AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 1999

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

1999.10.04 18:22 "How adobe write TIFF format?", by Mauricio Cunha Escarpinati
1999.10.05 00:02 "Re: How adobe write TIFF format?", by Daniel Mccoy

1999.10.05 00:02 "Re: How adobe write TIFF format?", by Daniel Mccoy

I would assume that they multiplied the 12-bit number by 16
(or shifted it up four bits depending on how you look at it)
to rescale 0-4095 into the range 0-65520.
Then, if they were smart, they added the top four bits of the original
value (original / 256) back into the new value, making the range 0-65535.  
(ie.   sixteen = (twelve << 4) + (twelve >> 8)  assuming all are unsigned)

Either way, you should just be able to divide by 16, 
(or shift the number down four bits) to get it back to the range 0-4095.  
(twelve = sixteen >> 4)

Dan McCoy      Pixar    mccoy@pixar.com

From: Mauricio <escarpin@sel.eesc.sc.usp.br>
>Hello,
>I'm working with TIFF format and I have a problem: my scanner uses 12
>bits to digitalize the image. I'm using the Adobe to write the image and
>I realized that the writed image has 16 bits (value from 0 to 65535). My
>doubt is: how my value (that must is between 0 and 4095) is converted to
>range 0  65535? I know that Adobe write the least significant byte first
>and, after, the most significant byte, but I don't know which part of
>the byte I have to discard. Can anyone help me?
>Thanks.
>    Mauricio