Browse files

Set matte to false to speed up quantization

  • Loading branch information...
1 parent edc76aa commit 6ffec4adab7ad5799cbed9167d2a091e8afd1a9b rmagick committed Jul 31, 2007
Showing with 8 additions and 8 deletions.
  1. +2 −0 doc/ex/implode.rb
  2. +6 −8 doc/ex/matte_fill_to_border.rb
View
2 doc/ex/implode.rb
@@ -15,13 +15,15 @@
8.times {
frames << img.implode(implosion)
legend.annotate(frames, 0,0,10,20, sprintf("% 4.2f", implosion))
+ frames.matte = false
implosion -= 0.10
}
7.times {
implosion += 0.10
frames << img.implode(implosion)
legend.annotate(frames, 0,0,10,20, sprintf("% 4.2f", implosion))
+ frames.matte = false
}
frames.delay = 10
View
14 doc/ex/matte_fill_to_border.rb
@@ -1,16 +1,14 @@
#! /usr/local/bin/ruby -w
require 'RMagick'
-include Magick
-img = Image.new(200,200)
-img.compression = LZWCompression
+img = Magick::Image.new(200,200)
+img.compression = Magick::LZWCompression
-bg = Image.read('plasma:fractal') {
- self.size = '200x200'
- }
+bg = Magick::Image.read('plasma:fractal') { self.size = '200x200' }
+bg[0].matte = false
-gc = Draw.new
+gc = Magick::Draw.new
gc.stroke_width(2)
gc.stroke('black')
gc.fill('white')
@@ -35,7 +33,7 @@
# Composite the image over a nice bright background
# so that the transparent pixels will be obvious.
-img = bg[0].composite(img, CenterGravity, OverCompositeOp)
+img = bg[0].composite(img, Magick::CenterGravity, Magick::OverCompositeOp)
img.write('matte_fill_to_border_after.gif')
exit

0 comments on commit 6ffec4a

Please sign in to comment.