Sha256: c5485e4579a04aae1c16c4330e3a24323fafe31da6720f6f5554b530ba6c1267

Contents?: true

Size: 615 Bytes

Versions: 12

Compression:

Stored size: 615 Bytes

Contents

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

require "RMagick"

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

# Make a watermark from the word "RMagick"
mark = Magick::Image.new(140, 40) {self.background_color = "none"}
gc = Magick::Draw.new
gc.annotate(mark, 0, 0, 0, -5, "RMagick") do
    gc.gravity = Magick::CenterGravity
    gc.pointsize = 32
    gc.font_family = "Times"
    gc.fill = "white"
    gc.stroke = "none"
end

mark = mark.wave(2.5, 70).rotate(-90)

# Composite the watermark in the lower right (southeast) corner.
img2 = img.watermark(mark, 0.25, 0, Magick::SouthEastGravity)
img2.write("watermark.jpg")

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rmagick-1.14.0 doc/ex/watermark.rb
rmagick-1.14.1 doc/ex/watermark.rb
rmagick-1.15.0 doc/ex/watermark.rb
rmagick-1.15.1 doc/ex/watermark.rb
rmagick-1.15.2 doc/ex/watermark.rb
rmagick-1.15.3 doc/ex/watermark.rb
rmagick-1.15.4 doc/ex/watermark.rb
rmagick-1.15.5 doc/ex/watermark.rb
rmagick-1.15.6 doc/ex/watermark.rb
rmagick-1.15.7 doc/ex/watermark.rb
rmagick-1.15.8 doc/ex/watermark.rb
rmagick-1.15.9 doc/ex/watermark.rb