Sha256: 1789ff9029c598b1f4bdf5e98f1aaf33bd94b61688c5968e66d1bd15db92d751

Contents?: true

Size: 642 Bytes

Versions: 13

Compression:

Stored size: 642 Bytes

Contents

#!/usr/bin/env ruby -w

require 'rmagick'

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

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

result = imgs.montage do
  self.tile = '2x2'
  self.background_color = 'black'
  self.stroke = 'transparent'
  self.fill = 'white'
  self.pointsize =9
  self.geometry = Magick::Geometry.new(img.columns/2, img.rows/2, 5, 5)
end

result.write('channel.jpg')

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
rmagick-windows-2.16.5 doc/ex/channel.rb
rmagick-windows-2.16.4 doc/ex/channel.rb
rmagick-windows-2.16.3 doc/ex/channel.rb
rmagick-windows-2.16.2 doc/ex/channel.rb
rmagick-windows-2.16.1 doc/ex/channel.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/rmagick-2.16.0/doc/ex/channel.rb
rmagick-2.16.0 doc/ex/channel.rb
rmagick-2.15.4 doc/ex/channel.rb
rmagick-2.15.3 doc/ex/channel.rb
rmagick-2.15.2 doc/ex/channel.rb
rmagick-2.15.1 doc/ex/channel.rb
rmagick-2.15.0 doc/ex/channel.rb
rmagick-2.14.0 doc/ex/channel.rb