AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2003.12.26 16:00 "[Tiff] [ANNOUNCE]: Libtiff 3.6.1 released", by Andrey Kiselev
[...]
2004.01.14 17:26 "Re: [Tiff] COLORMAP and byte padding", by Andy Cave
2004.01.14 16:43 "Re: [Tiff] COLORMAP and byte padding", by Joris
2004.01.14 17:36 "Re: [Tiff] COLORMAP and byte padding", by Joris
[...]

2004.01.14 17:36 "Re: [Tiff] COLORMAP and byte padding", by Joris

I really wouldn't do that.

0 to 256 -> 0,
257 to 513 -> 2,

Philip Crews wrote:

> Using integer division, the only 16-bit pixel value that will > result in white (255) is 0xffff, and 0x0100 will incorrectly be black

You misunderstood. I should have thought about / with integer operands being an integer divide in C (right?). In ObjectPascal, it's a floating divide. I actually meant to denote the floating division, and rounding afterwards. That should make more sense.

Also, I tend to look at it from the theoretical point of view. If 0 maps to 0, and 65535 maps to 255, then the mapping formulae quite simply is /65535*255. Plus rounding, of course.

Joris