Sha256: 67eb9c3c96d26048fca132f386580ef71d63cbae765bd353490a81793c4375ed

Contents?: true

Size: 691 Bytes

Versions: 67

Compression:

Stored size: 691 Bytes

Contents

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

# Demonstrate the ImageList#quantize method

require 'RMagick'

snapshots = Magick::ImageList.new "images/Ballerina.jpg","images/Gold_Statue.jpg","images/Shorts.jpg"

# Quantize all 3 images to a single set of 16 colors in the RGB colorspace
$stdout.sync=true
printf "Quantizing... Please be patient, this may take a couple of seconds... "
quant = snapshots.quantize 16
puts "Done."

# Now we create the "before" and "after" images.
# Arrange the original images side-by-side into a
# single image.
old = snapshots.append false
old.write('quantize-m_before.jpg')

# Repeat for the quantized images.
new = quant.append false
new.write('quantize-m_after.jpg')

exit

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/quantize-m.rb
rmagick-2.13.3 doc/ex/quantize-m.rb
rmagick-2.13.3.rc1 doc/ex/quantize-m.rb
rmagick-2.13.2 doc/ex/quantize-m.rb
rdp-rmagick-0.0.0 doc/ex/quantize-m.rb
rmagick-2.13.1 doc/ex/quantize-m.rb
rmagick-2.12.2 doc/ex/quantize-m.rb
rmagick-2.12.1 doc/ex/quantize-m.rb
rmagick-2.12.0 doc/ex/quantize-m.rb
rmagick-2.11.1 doc/ex/quantize-m.rb
rmagick-2.10.0 doc/ex/quantize-m.rb
rmagick-2.11.0 doc/ex/quantize-m.rb
rmagick-1.10.0 doc/ex/quantize-m.rb
rmagick-1.10.1 doc/ex/quantize-m.rb
rmagick-1.13.0 doc/ex/quantize-m.rb
rmagick-1.12.0 doc/ex/quantize-m.rb
rmagick-1.11.1 doc/ex/quantize-m.rb
rmagick-1.11.0 doc/ex/quantize-m.rb
rmagick-1.15.0 doc/ex/quantize-m.rb
rmagick-1.14.1 doc/ex/quantize-m.rb