Sha256: 5d24f31032539de1bded9355b30f02912769a4176e8594ea149f0bd44b25e5c5

Contents?: true

Size: 590 Bytes

Versions: 20

Compression:

Stored size: 590 Bytes

Contents

require 'RMagick'

# Create a transparent image to tile over the background image.
wm = Magick::Image.read("xc:none") { self.size = "100x50" }.first

# Draw "RMagick" in semi-transparent text on the transparent image.
gc = Magick::Draw.new
gc.fill '#ffffff7f'
gc.font_weight Magick::BoldWeight
gc.font_size 18
gc.rotate 15
gc.gravity Magick::CenterGravity
gc.text 0, 0, "RMagick"
gc.draw wm

# Read the background image.
img = Magick::Image.read("images/Flower_Hat.jpg").first

# Composite the tile image over the background image.
img.composite_tiled! wm
img.write "composite_tiled.jpg"


Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rmagick-2.13.4 doc/ex/composite_tiled.rb
rmagick-2.13.3 doc/ex/composite_tiled.rb
rmagick-2.13.3.rc1 doc/ex/composite_tiled.rb
rmagick-2.13.2 doc/ex/composite_tiled.rb
rdp-rmagick-0.0.0 doc/ex/composite_tiled.rb
rmagick-2.13.1 doc/ex/composite_tiled.rb
rmagick-2.12.2 doc/ex/composite_tiled.rb
rmagick-2.12.1 doc/ex/composite_tiled.rb
rmagick-2.12.0 doc/ex/composite_tiled.rb
rmagick-2.11.1 doc/ex/composite_tiled.rb
rmagick-2.10.0 doc/ex/composite_tiled.rb
rmagick-2.11.0 doc/ex/composite_tiled.rb
rmagick-2.6.0 doc/ex/composite_tiled.rb
rmagick-2.7.0 doc/ex/composite_tiled.rb
rmagick-2.7.1 doc/ex/composite_tiled.rb
rmagick-2.7.2 doc/ex/composite_tiled.rb
rmagick-2.8.0 doc/ex/composite_tiled.rb
rmagick-2.9.0 doc/ex/composite_tiled.rb
rmagick-2.9.1 doc/ex/composite_tiled.rb
rmagick-2.9.2 doc/ex/composite_tiled.rb