require 'RMagick'
include Magick
images = ImageList.new("sf.jpg")
images.alpha = ActivateAlphaChannel
images.new_image(images.columns, images.rows){
self.background_color = "none"
}
dr = Draw.new
dr.fill = "white"
dr.ellipse(images.columns/2, images.rows/2,
images.columns*0.8/2, images.rows*0.8/2,
0, 360)
dr.draw(images);
images.virtual_pixel_method = BackgroundVirtualPixelMethod
images.background_color = "none"
images[images.size-1] = images.blur_channel(0,10,AllChannels).
wave(images.columns/10, images.rows/10).
swirl(800).resize(images.columns, images.rows)
images.first.composite(images[images.size-1], 0, 0,
DstInCompositeOp).write("sample932a.png")
元画像(sf.jpg)
出力画像(sample932a.png)
動作環境
ruby1.8.6, rmagick2.7.1
関連項目
ImageMagickで画像を渦巻き模様で切り取る
No comments:
Post a Comment