Sha256: e4dbd5330b29873f6091a907e09e9e45fd8ab1159fe06a042fb224c5067e0696

Contents?: true

Size: 530 Bytes

Versions: 6

Compression:

Stored size: 530 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 = 10_000
# animation.animate
animation.write('cycle_colormap.gif')
exit

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/cycle_colormap.rb
rmagick-4.1.0.rc1 doc/ex/cycle_colormap.rb
rmagick-4.0.0 doc/ex/cycle_colormap.rb
rmagick-3.2.0 doc/ex/cycle_colormap.rb
rmagick-3.1.0 doc/ex/cycle_colormap.rb
rmagick-3.0.0 doc/ex/cycle_colormap.rb