Sha256: 999211b8fdaffa98556a2f23c916520ddc1d7a201b6bf2abe2df2b82fb552eae

Contents?: true

Size: 663 Bytes

Versions: 28

Compression:

Stored size: 663 Bytes

Contents

#! /usr/local/bin/ruby -w

require 'RMagick'

img = Magick::Image.read('images/Flower_Hat.jpg').first

legend = Magick::Draw.new
legend.stroke = 'transparent'
legend.fill = 'white'
legend.gravity = Magick::SouthGravity

frames = Magick::ImageList.new

implosion = 0.25
8.times {
    frames << img.implode(implosion)
    legend.annotate(frames, 0,0,10,20, sprintf("% 4.2f", implosion))
    implosion -= 0.10
    }

7.times {
    implosion += 0.10
    frames << img.implode(implosion)
    legend.annotate(frames, 0,0,10,20, sprintf("% 4.2f", implosion))
    }

frames.delay = 10
frames.iterations = 0
puts "Producing animation..."

frames.write("implode.gif")
exit

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rmagick-1.10.0 doc/ex/implode.rb
rmagick-1.10.1 doc/ex/implode.rb
rmagick-1.11.1 doc/ex/implode.rb
rmagick-1.12.0 doc/ex/implode.rb
rmagick-1.13.0 doc/ex/implode.rb
rmagick-1.11.0 doc/ex/implode.rb
rmagick-1.15.0 doc/ex/implode.rb
rmagick-1.14.1 doc/ex/implode.rb
rmagick-1.14.0 doc/ex/implode.rb
rmagick-1.15.1 doc/ex/implode.rb
rmagick-1.15.3 doc/ex/implode.rb
rmagick-1.15.2 doc/ex/implode.rb
rmagick-1.15.4 doc/ex/implode.rb
rmagick-1.15.6 doc/ex/implode.rb
rmagick-1.15.5 doc/ex/implode.rb
rmagick-1.15.7 doc/ex/implode.rb
rmagick-1.7.1 doc/ex/implode.rb
rmagick-1.7.2 doc/ex/implode.rb
rmagick-1.7.3 doc/ex/implode.rb
rmagick-1.7.4 doc/ex/implode.rb