(note This was a very old answer and described ruby-vips as of two major versions ago. I've updated it for the 2.0.16 gem, the current version in November 2019)
There is complete documentation here:
https://rubydoc.info/gems/ruby-vips
The Vips
section has a tutorial-style introduction:
https://rubydoc.info/gems/ruby-vips/Vips
For example:
require 'vips'
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]
mask = Vips::Image.new_from_array [
[-1, -1, -1],
[-1, 16, -1],
[-1, -1, -1]
], 8
im = im.conv mask, precision: :integer
im.write_to_file ARGV[1]
This opens an image in streaming mode, multiplies the middle band (green) by two, sharpens the image with an integer convolution, and writes the result back. You can run it like this:
./example.rb x.jpg y.ppm
There's a full "daltonize" example in the ruby-vips repo:
https://github.com/libvips/ruby-vips/blob/master/example/daltonize8.rb