require 'RMagick'
include Magick
img1 = ImageList.new("sf2.jpg")
img1[0] = img1.enhance().enhance()
img1[0] = img1.charcoal(0,1).contrast(true)
img1[0].alpha(ActivateAlphaChannel)
img1[0] = img1.fx("r", AlphaChannel)
img2 = Image.new(img1.columns, img1.rows,
GradientFill.new(0, 0, 200, 0, "#bbddff", "#f8c749"))
img3 = img2.composite(img1, NorthWestGravity, 0, 0, OverCompositeOp);
img3.write("sample468b.png")
exit
元画像(sf2.jpg)
出力画像(sample468b.png)
動作環境
ruby1.8.6-26/RMagick-2.3.0-ImageMagick-6.4.0-2-Q8
関連項目
ImageMagickでcharcoal処理した画像にグラデーションをかける (Convertコマンドでの同様の処理)
No comments:
Post a Comment