Sha256: fd26fbf49993c811f7f25ea646bb5674b0f974a57099243e822681e073c9c26d

Contents?: true

Size: 692 Bytes

Versions: 13

Compression:

Stored size: 692 Bytes

Contents

#!/usr/bin/env 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 do
  frames << img.implode(implosion)
  legend.annotate(frames, 0,0,10,20, sprintf('% 4.2f', implosion))
  frames.matte = false
  implosion -= 0.10
end

7.times do
  implosion += 0.10
  frames << img.implode(implosion)
  legend.annotate(frames, 0,0,10,20, sprintf('% 4.2f', implosion))
  frames.matte = false
end

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

frames.write('implode.gif')
exit

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
rmagick-windows-2.16.5 doc/ex/implode.rb
rmagick-windows-2.16.4 doc/ex/implode.rb
rmagick-windows-2.16.3 doc/ex/implode.rb
rmagick-windows-2.16.2 doc/ex/implode.rb
rmagick-windows-2.16.1 doc/ex/implode.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/implode.rb
rmagick-2.16.0 doc/ex/implode.rb
rmagick-2.15.4 doc/ex/implode.rb
rmagick-2.15.3 doc/ex/implode.rb
rmagick-2.15.2 doc/ex/implode.rb
rmagick-2.15.1 doc/ex/implode.rb
rmagick-2.15.0 doc/ex/implode.rb
rmagick-2.14.0 doc/ex/implode.rb