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
September 2002

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

2002.09.18 17:53 "Reading 16bits from a gray scale image", by Steven Luke
2002.09.18 18:49 "Re: Reading 16bits from a gray scale image", by Steven Luke
2002.09.18 19:05 "Re: Reading 16bits from a gray scale image", by Chris Hanson
2002.09.19 00:20 "Re: Reading 16bits from a gray scale image", by Marti Maria

2002.09.19 00:20 "Re: Reading 16bits from a gray scale image", by Marti Maria

> I am displaying the image in 8bits so the final number 
> needs to be only 8bits, that is why I shifted the pixels 
> the opposite direction at the end.  I am not sure if I am 
> doing this step correct either.  I was thinking of dividing 
> by 257 but am unsure of the rounding process and think 
> that this is probably just as good because it is easier.

The correct method would be to divide by 257 and then round:

    r = floor(c / 257.0 + 0.5)

However this is painfull slow. If you don't care about memory, 
you could use a table of 64K for speeding up... other options 
would be to use fixed point.

Anyway, for most usages a simple >> 8 is enough.

Regards,
Marti.