Skip to content

What's_New_in_7.30

John Cupitt edited this page Mar 29, 2017 · 1 revision

title: What's New in 7.30 permalink: /What's_New_in_7.30/

This page summarises the changes for version 7.30. We have a detailed VIPS ChangeLog and nip2 ChangeLog, but as headlines:

Improved sequential mode : vips-7.28 introduced sequential mode, a new file IO mode where pixels could be streamed directly from compressed input files to compressed output files without any separate decompression stage. This has seen several useful improvements, see below.

Save as DeepZoom : libvips can now save images in DeepZoom format. This (should be) the fastest and most memory-efficient DeepZoom writer around, I think. See below. Many thanks to Alexander Koshman for this feature.

Zombie pipelines : libvips has a new feature to save memory --- at the end of every calculation it puts pipelines into a "zombie" state. Zombie pipelines are dead, but yet still living. This feature gives a large reduction in memory use in languages with lazy garbage-collection, like Ruby.

Much better Ruby support : ruby-vips, the main Ruby binding for libvips, is much better. There's also carrierwave-vips, a plugin for the popular carrierwave Ruby web framework image upload system, which uses libvips as the image processing engine. We have two related repositories of benchmarks: vips-benchmarks, which times ruby-vips against other Ruby image processing systems, and carrierwave-vips-benchmarks which shows how carrierwave speeds up with a vips backend. Stanislaw Pankevich has worked very hard on all this.

Better threading support : You can now pass images between threads and use results calculated in one to help another. Previously you needed to be rather careful if you wanted to use libvips from many threads.

More nip2 menu items : nip2 now has menu items to calculate skew and kurtosis, two useful properties of distributions. The menu items for finding and applying colour calibrations from images of Macbeth charts are much faster and support a new workflow where images are linearised by their embedded ICC profiles.

nip2 Definition Browser : This is handy if you do any programming in nip2. See below.

Plus the usual minor speed-ups, portability improvements, enhancements and bug fixes. What's New in 7.28 is still there if you're interested.

Save as Deep Zoom

libvips now has a DeepZoom writer. This is based on the code from the tiff pyramid writer: it scans the input image once and writes all layers of the pyramid at the same time. It also uses a set of worker threads to write separate tiles in parallel, producing a further speedup.

Use it like this:

$ vips dzsave huge.tif my_dz_dir

will create a directory called my_dz_dir and build a set of directories in there containing the tiles.

The default is 256 x 256 pixel tiles, with 1 pixel overlap, and each tile in JPEG format. A set of flags let you change overlap and tile size:

$ vips dzsave
usage:
   dzsave in dirname
where:
   in           - Image to save, input VipsImage
   dirname      - Directory name to save to, input gchararray
optional arguments:
   suffix       - Filename suffix for tiles, input gchararray
   overlap      - Tile overlap in pixels, input gint
   tile-width   - Tile width in pixels, input gint
   tile-height  - Tile height in pixels, input gint
operation flags: sequential nocache
dzsave: too few arguments

For example:

$ vips dzsave huge.tif my_dz_dir --overlap=16 --tile-width=768 --tile-height=768 --suffix=.png[compression=9]

Will create 768 x 768 tiles, 16 pixel overlaps, with each tile written in PNG format with maximum compression.

Improvements to sequential mode

libvips-7.28 introduced sequential mode, a new file IO mode where pixels could be streamed directly from compressed input files to compressed output files without any separate decompression stage.

This has been improved in several ways. First, it's now available in vips7 via a new "rs" open mode:

IMAGE *im = im_open (filename, "rs");

Opens a file for sequential read.

Secondly, it's now turned on automatically for vips8 command-line operations when possible. For example:

$ vips copy huge1.tif huge2.tif

will copy the tiff image without having a separate decompression stage. This can give a huge speed up.

Finally, sequential mode is able to skip ahead if necessary. For example:

$ vips extract_area huge.tif tiny.jpg 0 100 100 100

(cut a 100x100 pixel area out of a tif image 100 pixels down from the top of the file) will now run in sequential mode. It will read the first 100 scan lines and throw them away, then read the next 100 and save a square of pixels to tiny.jpg, and then stop. It will not need to read the whole of huge.tif.

nip2 improvements

If you click View / Definition Browser in nip2's programming window, you'll see this new thing appear on the right:

center|300px

It shows all definitions in this scope, with their help text. You can type into the search box at the top and it'll show just definitions with that text in their name or help.

As you type in the main text area, it'll search left from the cursor and show all matches for that identifier. In other words, as you type, it shows all possible completions and their documentation.

center|300px

Clone this wiki locally