ruby-vips8

Ruby binding for the vips8 API. This is still not quite done.

The older vips7-based ruby-vips gem might be more robust.

This binding is based on the gobject-introspection gem. Try gir_ffi-vips for one based on gir_ffi.

To try it out

Make sure you have vips-8.2 or later installed and that Vips-8.0.typelib is on your GI_TYPELIB_PATH. Then install with:

$ rake install

And take a look in examples/. There is full rdoc documentation, take a look there too.

Example

im = Vips::Image.new_from_file filename

# put im at position (100, 100) in a 3000 x 3000 pixel image, 
# make the other pixels in the image by mirroring im up / down / 
# left / right, see
# http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/libvips-conversion.html#vips-embed
im = im.embed 100, 100, 3000, 3000, :extend => :mirror
im.write_to_file output_filename

# multiply the green (middle) band by 2, leave the other two alone
im *= [1, 2, 1]

# make an image from an array constant, convolve with it
mask = Vips::Image.new_from_array [
    [-1, -1, -1],
    [-1, 16, -1],
    [-1, -1, -1]], 8
im = im.conv mask

What's wrong with ruby-vips?

There's an existing Ruby binding for vips here. It was written by a Ruby expert, it works well, it includes a test-suite, and has pretty full documentation. Why do another?

ruby-vips is based on the old vips7 API. There's now vips8, which adds several very useful new features:

There are some more minor pluses as well:

This binding adds some extra useful features over the old ruby-vips binding.