Sha256: 4f5ebac78d5bdf8c2730389bd15d7544e78f4221ab12a12017db0aa3c5725067
Contents?: true
Size: 723 Bytes
Versions: 29
Compression:
Stored size: 723 Bytes
Contents
#! /usr/local/bin/ruby -w require 'RMagick' img = Magick::Image.new(200,200) img.compression = Magick::LZWCompression bg = Magick::Image.read('plasma:fractal') { self.size = '200x200' } bg[0].matte = false gc = Magick::Draw.new gc.stroke_width(2) gc.stroke('black') gc.fill('white') gc.roundrectangle(0, 0, 199, 199, 8, 8) gc.fill('yellow') gc.stroke('red') gc.circle(100, 100, 100, 25) gc.draw(img) img.write('matte_floodfill_before.gif') img.fuzz = 100 img = img.matte_floodfill(100, 100) # Composite the image over a nice bright background # so that the transparent pixels will be obvious. img = bg[0].composite(img, Magick::CenterGravity, Magick::OverCompositeOp) img.write('matte_floodfill_after.gif') exit
Version data entries
29 entries across 29 versions & 2 rubygems