require 'RMagick'
include Magick
img1 = ImageList.new("tree1.jpg")
img1 = img1.threshold(QuantumRange*0.5)
img2 = img1.crop(0, 0, img1.columns/2, img1.rows)
img1 = img1.negate()
img3 = img1.composite(img2, NorthWestGravity, 0, 0, OverCompositeOp);
img3.write("sample469a.png")
exit
元画像(tree1.jpg)

出力画像(sample469a.png)

動作環境
ruby1.8.6-26/RMagick-2.3.0-ImageMagick-6.4.0-2-Q8
関連項目
RMagickをWindowsで使用するための設定
No comments:
Post a Comment