0

I'm using MS Deep Zoom Composer to generate tiled image sets for megapixel sized images.

Right now I'm preparing a densely detailed black and white linedrawing. The lack of gamma correction during resizing is very apparent; while zooming the tiles appear to become brighter on higher zoom levels. This makes the boundaries between tiles quite apparent during the loading stage.

While it does not in any way hurt usability it is a bit unsightly. I am wondering if there are any alternatives to Deep Zoom Composer that do gamma correct resizing?

Spiny Norman
  • 63
  • 1
  • 4

3 Answers3

1

pamscale1 of the netpbm suite is quite well known not to screw up scaled images as you describe. It uses gamma correction instead of ill-concieved "high-quality filters" and other magic used to paper over incorrect scaling algorithms.

Of course you will need some scripting - it's not a direct replacement.

Simon Thum
  • 576
  • 4
  • 15
1

We maintain a list of DZI creation tools here:

http://openseadragon.github.io/examples/creating-zooming-images/

I don't know if any of them do gamma correction, but some of them might not have that issue to begin with. Also, many of them come with source, so you can add the gamma correction in yourself if need be.

iangilman
  • 2,144
  • 1
  • 13
  • 16
1

The vips deepzoom creator can do this.

You make a deepzoom pyramid like this:

vips dzsave somefile.tif pyr_name

and it'll read somefile.tif and write pyr_name.dzi and pyr_name_files, a folder containing the tiles. You can use a .zip extension to the pyramid name and it'll directly write an uncompressed zip file containing the whole pyramid --- this is a lot faster on Windows. There's a blog post with some more examples and explanation.

To make it shrink gamma corrected, you need to move your image to a linear colourspace for saving. The simplest is probably scRGB, that is, sRGB with linear light. You can do this with:

vips colourspace somefile.tif x.tif scrgb

and it'll write x.tif, an scRGB float tiff.

You can run the two operations in a single command by using .dz as the output file suffix. This will send the output of the colourspace transform to the deepzoom writer for saving. The deepzoom writer will use .jpg to save each tile, the jpeg writer knows that jpeg files can only be RGB, so it'll automatically turn the scRGB tiles back into plain sRGB for saving.

Put that all together and you need:

vips colourspace somefile.tif mypyr.dz scrgb

And that should build a pyramid with a linear-light shrink.

You can pass options to the deepzoom saver in square brackets after the filename, for example:

vips colourspace somefile.tif mypyr.dz[container=zip] scrgb

The blog post has the details.

update: the Windows binary is here, to save you hunting. Unzip somewhere, and vips.exe is in the /bin folder.

jcupitt
  • 10,213
  • 2
  • 23
  • 39