Sha256: 79a60793026224e3919fcec68013d619423f2a87f769e5d2037ee0d31e47a9be

Contents?: true

Size: 486 Bytes

Versions: 25

Compression:

Stored size: 486 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

25 entries across 25 versions & 2 rubygems

Version Path
vips-8.6.3.2 example/annotate.rb
vips-8.7.0.1 example/annotate.rb
ruby-vips-2.0.13 example/annotate.rb
vips-8.6.3.1 example/annotate.rb
vips-8.6.3 example/annotate.rb
ruby-vips-2.0.12 example/annotate.rb
ruby-vips-2.0.11 example/annotate.rb
ruby-vips-2.0.10 example/annotate.rb
ruby-vips-2.0.9 example/annotate.rb
ruby-vips-2.0.8 example/annotate.rb
ruby-vips-2.0.7 example/annotate.rb
ruby-vips-2.0.6 example/annotate.rb
ruby-vips-2.0.5 example/annotate.rb
ruby-vips-2.0.4 example/annotate.rb
ruby-vips-2.0.3 example/annotate.rb
ruby-vips-2.0.2 example/annotate.rb
ruby-vips-2.0.1 example/annotate.rb
ruby-vips-2.0.0 example/annotate.rb
ruby-vips-1.0.6 example/annotate.rb
ruby-vips-1.0.5 example/annotate.rb