Sha256: 5cf3e465ce48c3fb4a02fbc44a5f2d8b75c356fd41d06e41b61a4545b5c1b03f

Contents?: true

Size: 745 Bytes

Versions: 9

Compression:

Stored size: 745 Bytes

Contents

#!/usr/bin/ruby

require 'vips'

# this makes vips keep a list of all active objects
# Vips::leak_set true

# disable the operation cache
# Vips::cache_set_max 0

# turn on debug logging
# Vips.set_debug true

if ARGV.length < 2
  raise "usage: #{$PROGRAM_NAME}: input-file output-file"
end

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

im *= [1, 2, 1]

# we want to be able to specify a scale for the convolution mask, so we have to
# make it ourselves
# if you are OK with scale=1, you can just pass the array directly to .conv()
mask = Vips::Image.new_from_array [[-1, -1, -1],
                                   [-1, 16, -1],
                                   [-1, -1, -1]], 8
im = im.conv mask

im.write_to_file ARGV[1]

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vips-8.11.3 example/example5.rb
vips-8.10.5 example/example5.rb
vips-8.9.1 example/example5.rb
ruby-vips-2.0.17 example/example5.rb
vips-8.8.4 example/example5.rb
vips-8.8.3 example/example5.rb
ruby-vips-2.0.16 example/example5.rb
vips-8.8.2 example/example5.rb
ruby-vips-2.0.15 example/example5.rb