Sha256: 235fc72b0ea94d3a9a7529fe006bc82b8205778c5a99754a16f0c0a5179a92bf

Contents?: true

Size: 690 Bytes

Versions: 25

Compression:

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

25 entries across 25 versions & 2 rubygems

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