Sha256: fad5d9e94cd946d6d81f24bd2224a896edbed45ff54e4db8a87ce521a6d87a7b

Contents?: true

Size: 404 Bytes

Versions: 38

Compression:

Stored size: 404 Bytes

Contents

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

require 'RMagick'
include Magick

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

begin

result = img.bilevel_channel(2*MaxRGB/3, RedChannel)

# Substitute the standard "Not Implemented" image
rescue NotImplementedError
    result = Magick::Image.read("images/notimplemented.gif").first
    result.resize!(img.columns, img.rows)
end

result.write('bilevel_channel.jpg')
exit

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rmagick-1.10.0 doc/ex/bilevel_channel.rb
rmagick-1.10.1 doc/ex/bilevel_channel.rb
rmagick-1.12.0 doc/ex/bilevel_channel.rb
rmagick-1.13.0 doc/ex/bilevel_channel.rb
rmagick-1.11.0 doc/ex/bilevel_channel.rb
rmagick-1.11.1 doc/ex/bilevel_channel.rb
rmagick-1.15.1 doc/ex/bilevel_channel.rb
rmagick-1.14.0 doc/ex/bilevel_channel.rb
rmagick-1.14.1 doc/ex/bilevel_channel.rb
rmagick-1.15.0 doc/ex/bilevel_channel.rb
rmagick-1.15.10 doc/ex/bilevel_channel.rb
rmagick-1.15.14 doc/ex/bilevel_channel.rb
rmagick-1.15.11 doc/ex/bilevel_channel.rb
rmagick-1.15.12 doc/ex/bilevel_channel.rb
rmagick-1.15.13 doc/ex/bilevel_channel.rb
rmagick-1.15.15 doc/ex/bilevel_channel.rb
rmagick-1.15.2 doc/ex/bilevel_channel.rb
rmagick-1.15.16 doc/ex/bilevel_channel.rb
rmagick-1.15.17 doc/ex/bilevel_channel.rb
rmagick-1.15.3 doc/ex/bilevel_channel.rb