Sha256: 0bc60f737fc14fec35657b4f78604fc5ebb3292035bcdc79b68030dbe9d047e7

Contents?: true

Size: 467 Bytes

Versions: 12

Compression:

Stored size: 467 Bytes

Contents

#!/usr/bin/ruby

require "vips"

im = Vips::Image.new_from_file ARGV[0], access: :sequential

left_text = Vips::Image.text "left corner", dpi: 300
left = left_text.embed 50, 50, im.width, 150

right_text = Vips::Image.text "right corner", dpi: 300
right = right_text.embed im.width - right_text.width - 50, 50, im.width, 150

footer = (left | right).ifthenelse(0, [255, 0, 0], blend: true)

im = im.insert footer, 0, im.height, expand: true

im.write_to_file ARGV[1]

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-vips-2.2.1/example/annotate.rb
ruby-vips-2.2.2 example/annotate.rb
ruby-vips-2.2.1 example/annotate.rb
vips-8.15.1 example/annotate.rb
ruby-vips-2.2.0 example/annotate.rb
vips-8.12.2 example/annotate.rb
vips-8.12.1 example/annotate.rb
ruby-vips-2.1.4 example/annotate.rb
ruby-vips-2.1.3 example/annotate.rb
ruby-vips-2.1.2 example/annotate.rb
ruby-vips-2.1.1 example/annotate.rb
ruby-vips-2.1.0 example/annotate.rb