Sha256: 5cf5dcda0b1f7dae21f56193f2f904276aec1ae89101c16288d94da566190aed

Contents?: true

Size: 445 Bytes

Versions: 38

Compression:

Stored size: 445 Bytes

Contents

#! /usr/local/bin/ruby -w
require 'RMagick'

# Demonstrate the Image#negate_channel method

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

begin

result = img.negate_channel(false, Magick::GreenChannel)

# 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('negate_channel.jpg')
exit

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rmagick-1.15.3 doc/ex/negate_channel.rb
rmagick-1.15.6 doc/ex/negate_channel.rb
rmagick-1.15.8 doc/ex/negate_channel.rb
rmagick-1.15.5 doc/ex/negate_channel.rb
rmagick-1.15.7 doc/ex/negate_channel.rb
rmagick-1.7.4 doc/ex/negate_channel.rb
rmagick-1.8.1 doc/ex/negate_channel.rb
rmagick-1.15.9 doc/ex/negate_channel.rb
rmagick-1.7.1 doc/ex/negate_channel.rb
rmagick-1.7.2 doc/ex/negate_channel.rb
rmagick-1.7.3 doc/ex/negate_channel.rb
rmagick-1.8.0 doc/ex/negate_channel.rb
rmagick-1.9.0 doc/ex/negate_channel.rb
rmagick-1.8.2 doc/ex/negate_channel.rb
rmagick-1.8.3 doc/ex/negate_channel.rb
rmagick-1.9.1 doc/ex/negate_channel.rb
rmagick-1.9.2 doc/ex/negate_channel.rb
rmagick-1.9.3 doc/ex/negate_channel.rb