Sha256: 824e674b191a251d00c6ac10bc6b7b9d451eb044ccbfc6ceacb18b83f515943e

Contents?: true

Size: 604 Bytes

Versions: 38

Compression:

Stored size: 604 Bytes

Contents

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

require 'RMagick'
include Magick

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

imgs << img
imgs << img.channel(RedChannel)
imgs.cur_image['Label'] = 'RedChannel'
imgs <<  img.channel(GreenChannel)
imgs.cur_image['Label'] = 'GreenChannel'
imgs << img.channel(BlueChannel)
imgs.cur_image['Label'] = 'BlueChannel'

result = imgs.montage {
    self.tile = "2x2"
    self.background_color = 'black'
    self.stroke = 'transparent'
    self.fill = 'white'
    self.geometry = Geometry.new(img.columns/2, img.rows/2, 5, 5)
    }

result.write('channel.jpg')

Version data entries

38 entries across 38 versions & 1 rubygems

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