Sha256: c092a9ea78d59dd5171d60af1fcb05c43a50f8756eadfc094bc5a6cb79833b3d
Contents?: true
Size: 588 Bytes
Versions: 19
Compression:
Stored size: 588 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
19 entries across 19 versions & 3 rubygems