libvips 8.6 is done! Though it’s a bit late. This post summarizes what’s new – check the ChangeLog if you need more details.

New operators

There are five new operators. The largest is vips_composite2(): this will composite a pair of transparent images together using PDF-style blending modes. For example, given the standard libtiff and libpng demo images:

PNG and TIFF demo images

Running:

$ vips composite2 cramps.png png_demo1.png x.png over

Gives:

Composite of PNG and TIFF demo images

over is probably the most useful, but composite2 supports all the PDF blend modes.

composite2 joins a pair of images, but you can join a whole array of images using an array of blend modes in a single operation with composite. Options let you control the compositing space and premultiplication handling.

vips_fill_nearest() replaces every zero pixel in an image with the nearest non-zero pixel. For example:

Fill nearest image

The zero pixels on the left have all been replaced. It’s reasonably quick (about a second for that example on this old laptop) and doesn’t need that much memory. It’s handy for things like cell counting, where you want to assign cell pixels to the nearest nucleus.

vips_find_trim() searches an image in from the edges and returns the bounding box of the non-background pixels. It’s useful for automatically trimming away the edges from scanned images.

vips_gravity() places an image within a larger canvas, positioning the image according to a compass direction. It’s just vips_embed() with a convenient interface.

vips_thumbnail_image() lets you thumbnail any image source. It can be useful if you need to do something to an image before making a thumbnail.

New features

There are a few new options for existing operations.

Image format improvements

As usual, the image load and save operations have had a large number of improvements:

Changes

There have been a few changes to existing features.

Fixes and small improvements

Finally there are a range of smaller improvements:

Plus many even smaller bug fixes and improvements. As usual, the ChangeLog has more details, if you’re interested.