2017.09.16 19:50 "[Tiff] TIFF tile size limit", by Bob Friesenhahn

2017.09.17 15:29 "Re: [Tiff] TIFF tile size limit", by Kemp Watson

"Tile sizes are already allowed to be larger than the image dimensions by the TIFF specification since they can spill over the right and bottom of the image. A one pixel image could be in a 1kx1k "tile²."

Ugh. That¹s the root of the issue, for sure.

Yes, the compression is not really the issue (LZW will compress whitespace to almost nothing), it¹s the allocation of the raw rasters/tiles for the decompressed data.

I just went back and re-read the Tiled Image specification. You are completely correct, there is no formal restriction on tile size vs image size, although there¹s a lot of ³not recommended² verbage. Personally, I¹d be inclined to limit the tile size to the image size (technically, to the 16-pixel boundary just above the image size, or perhaps to the next larger power-of-two size to provide 'quadrants'). That would break the compatibility with the TIFF spec, though. Would that be a problem in practice? Adobe¹s not really keeping the spec up to date with modern needs anyway, and BigTIFF is not a spec either. The reality is that libtiff is diverging from the TIFF 6.0 specification.

W. Kemp Watson

kemp@objectivepathology.com

Objective Pathology Services Limited

8250 Lawson Road
Milton, Ontario
Canada L9T 5C6

www.objectivepathology.com
tel. +1 (416) 970-7284

On 2017-09-17, 11:04 AM, "Bob Friesenhahn" <bfriesen@simple.dallas.tx.us> wrote:

>On Sun, 17 Sep 2017, Kemp Watson wrote:
>

>> I know that we use very large bigtiffs, sometimes terabytes in size, but >> currently we allocate only 512-pixel tiles. I could see that going to 4K

>> maximum in the near future, very practically.

>>

>> But, would limiting the tile size to be up to but not more than the full >> image dimensions not essentially guarantee that a tiled implementation

>> would not use more memory than a full rasterized image (barring pointers >> and small stuff)?

>

>Tile sizes are already allowed to be larger than the image dimensions >by the TIFF specification since they can spill over the right and >bottom of the image. A one pixel image could be in a 1kx1k "tile".

>

>> I may well be missing some critical detail here - what in those sample >> files is the root cause of the large allocations?

>

>That is a good question. Some compressors are capable of remarkable >compression ratios and so the files can claim large pixel dimensions >although the file is very small. In some cases it is not easy to know >what a decoder can produce from a very small input.

>

>Even Rouault tells me that one of the compressors is theoretically >capable of storing a 100000x100000 image in a few hundred bytes.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/