AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1999.09.24 12:24 "Tiff 12 bits/pixels!!!", by Mauricio
1999.09.24 22:45 "Re: Tiff 12 bits/pixels!!!", by Niles Ritter
1999.09.27 03:24 "Re: Tiff 12 bits/pixels!!!", by Niles Ritter
1999.09.24 23:13 "Re: Tiff 12 bits/pixels!!!", by Eric Shapiro

1999.09.24 23:13 "Re: Tiff 12 bits/pixels!!!", by Eric Shapiro

To implement this transformation (12-bit image into data matrix) I must know HOW Adobe software saves this TIFF format, I mean I need to know the structure used by Adobe on saving the TIFF format when using 12-bit grayscale images.

There are two common ways to save 12-bit grayscale images. One way is to use exactly 12 bits for each pixel. The second way is to use 16 bits per pixel and pad the low-order bits with either zeros or ones.

Using 16-bits instead of 12 has a lot of advantages: It works with PhotoShop, it is much easier to deal with whole bytes in your software, etc, etc. Only a few packages handle 12 bpp TIFF images as far as I can tell.

I can't remember off the top of my head if those applications that support 12bpp tiffs upport both Intel and Motorola swapping. If I remember right, most software assume Intel formatting of 12bpp images. This gets a little tricky on a big-endian (Motorola, etc) machine - you have to swap nibbles instead of short integers every time you read/write a scanline.

-Eric

-------------------------------------------------
 Eric Shapiro                shapiro@relium.com
 Relium Corp.                    www.relium.com
-------------------------------------------------