require 'RMagick'
include Magick
img1 = ImageList.new("sf.jpg")
# 明度を70%に
img2 = img1.modulate(0.7, 1.0, 1.0)
img2.write("sample453a.jpg")
# 彩度を150%に
img3 = img1.modulate(1.0, 1.5, 1.0)
img3.write("sample453b.jpg")
# 色相を10%に
img3 = img1.modulate(1.0, 1.0, 0.1)
img3.write("sample453c.jpg")
exit
元画像(sf.jpg)
出力画像(sample452a.jpg)

出力画像(sample453b.jpg)

出力画像(sample453c.jpg)

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