AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2011

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2011.06.05 12:38 "Questions on TIFF LZW compression", by Thomas Richter
2011.06.05 12:47 "Questions on TIFF LZW compression", by Thomas Richter
2011.06.06 16:17 "Re: Questions on TIFF LZW compression", by Olivier Paquet
2011.06.06 16:55 "Re: Questions on TIFF LZW compression", by Bob Friesenhahn
2011.06.07 16:45 "Re: Questions on TIFF LZW compression", by Thomas Richter
2011.06.07 17:06 "Re: Questions on TIFF LZW compression", by Bob Friesenhahn

2011.06.06 16:55 "Re: Questions on TIFF LZW compression", by Bob Friesenhahn

On Sun, 5 Jun 2011, Thomas Richter wrote:
>
> First, how does LZW compression work for images that are not 8 bits/pixel?
> As far as I read the specs, the input to the LZW compression is the
> "raw" TIFF stripe buffer, but this leaves a couple of corner
> cases open. I see that this type of compression works for any bit depth
> that divides eight, or is a multiple of eight, but what
> happens for 10 bits per pixel images? Is LZW really applied to the
> bit-packed(!) input, or is the LZW algorithm applied to 16 bit
> data, where 10 bits are packed (left-justified? right-justified?) into a
> 16 bit word? In the former case, LZW will very unlikely give
> much compression performance, of course.

While I am not an expert at TIFF compression issues, I suspect that 
you are correct that the predictor has little value (and may cause 
harm) at depths other than 8 (and perhaps 16) bits since the 
compressor works on an octet stream.  The value of the predictor 
depends on the nature of the image.  When Adobe produced a preliminary 
application note about Photoshop CS2's added support for 16 and 24 bit 
floats, they also defined new types of predictors which work better 
for that sort of data.

TIFF is not PNG.  PNG has a huge number of filter mechanisms, but TIFF 
is more of a "working format" so it focuses less on achieving the 
absolute smallest file size.  The ability of TIFF to directly store 10 
bit data is already an accomplishment compared with other formats 
which would be forced to promote to 16-bit and then use compression to 
make the result smaller.

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