require 'RMagick'
include Magick
images = ImageList.new("sf2.jpg")
images.virtual_pixel_method = TileVirtualPixelMethod
images.distort(ScaleRotateTranslateDistortion,
[0.25, 10]).write("sample1088a.png")
exit
上記では画像サイズを1/4(=0.25)に縮小して、10度傾けています。
元画像(sf2.jpg)

出力画像(sample1088a.png)

動作環境
ruby1.8.6, rmagick2.9.0
関連項目
RMagickで画像を台形変形させる (distortメソッドを使用して台形変形)
ImageMagickで画像を縮小してタイル配置にして回転させる (convertコマンドによる同様の処理)
No comments:
Post a Comment