Sha256: 3fc653ba5d63f0db47dd9fdd336d73b65eea5972c54ecb8b563fbb9886c47a10

Contents?: true

Size: 429 Bytes

Versions: 19

Compression:

Stored size: 429 Bytes

Contents

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

# Demonstrate the Image#colorize method by converting
# a full-color image to "sepia-tone"

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

# Convert the color image to monochrome
mono = img.quantize(256, Magick::GRAYColorspace)

# Colorize with a 30% blend of a brownish-orange color
colorized = mono.colorize(0.30, 0.30, 0.30, '#cc9933')

colorized.write('colorize.jpg')
exit

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/colorize.rb
rmagick-4.1.0.rc1 doc/ex/colorize.rb
rmagick-4.0.0 doc/ex/colorize.rb
rmagick-3.2.0 doc/ex/colorize.rb
rmagick-3.1.0 doc/ex/colorize.rb
rmagick-3.0.0 doc/ex/colorize.rb
rmagick-windows-2.16.5 doc/ex/colorize.rb
rmagick-windows-2.16.4 doc/ex/colorize.rb
rmagick-windows-2.16.3 doc/ex/colorize.rb
rmagick-windows-2.16.2 doc/ex/colorize.rb
rmagick-windows-2.16.1 doc/ex/colorize.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/colorize.rb
rmagick-2.16.0 doc/ex/colorize.rb
rmagick-2.15.4 doc/ex/colorize.rb
rmagick-2.15.3 doc/ex/colorize.rb
rmagick-2.15.2 doc/ex/colorize.rb
rmagick-2.15.1 doc/ex/colorize.rb
rmagick-2.15.0 doc/ex/colorize.rb
rmagick-2.14.0 doc/ex/colorize.rb