require 'RMagick'
include Magick
images1 = ImageList.new("sf.jpg")
images1.alpha = ActivateAlphaChannel
img2 = Image.new(images1.columns, images1.rows){
self.background_color = "none"
}
idr = Draw.new
idr.fill = "white"
idr.ellipse(images1.columns/2,images1.rows/2,
images1.columns/2,images1.rows/2,0,360)
idr.draw(img2);
img3 = images1.composite(img2, 0, 0, DstInCompositeOp);
img3.write("sample718a.png")
exit
元画像(sf.jpg)
出力画像(sample718a.png)

関連項目
RMagickで画像の指定した点から円形のバンド状に明るさを変える
No comments:
Post a Comment