Sha256: c85273562a5e88cb494bfbbcc9cf3f57b2bb4d586a758ad621a3242b72d0a933

Contents?: true

Size: 526 Bytes

Versions: 13

Compression:

Stored size: 526 Bytes

Contents

#!/usr/bin/env ruby -w
require 'rmagick'

# Demonstrate the Image#cycle_colormap method

balloons = Magick::Image.read('images/Hot_Air_Balloons.jpg').first
balloons = balloons.quantize(256, Magick::RGBColorspace)

jump = balloons.colors / 10

animation = Magick::ImageList.new
animation[0] = balloons

5.times { animation << animation.cycle_colormap(jump) }
4.times { animation << animation.cycle_colormap(-jump) }

animation.delay=20
animation.iterations = 10000
#animation.animate
animation.write('cycle_colormap.gif')
exit

Version data entries

13 entries across 13 versions & 3 rubygems

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