2008.11.18 02:14 "[Tiff] Creating a tiled tiff from scratch (essentially)", by Beck, Tucker A

2008.11.18 09:28 "Re: [Tiff] Creating a tiled tiff from scratch (essentially)", by John

Hi,

2008/11/18 Beck, Tucker A <Tucker.Beck@pnl.gov>:

When I create the tiff file, I would like to set up each directory when I create the file. I do not want to store any image data in them at creation, I just want them to be ready for writing data when it needs to be done.

I have a slightly similar problem: one of the output formats for my image processing system is tiled, pyramidal, jpeg tiff.

The best solution I found was to write the file in two stages. I make a pass over the full resolution image and generate all the layers of the pyramid as separate tiled jpeg tiff files. I then create the final output image, copy the pyramid layers in one by one, attach any extra data (ICC profiles etc.) then finally delete the temporary files.

It seems fast enough, and it works with any version of libtiff. The is an extra jpeg decompress / recompress when you copy the tiled images which it would be nice to avoid, but I've not managed to work that one out.

LGPL source here, if you're curious:

  http://vips.svn.sourceforge.net/viewvc/vips/vips7/trunk/libsrc/format/im_vips2tiff.c?view=markup

John