AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2002.01.16 11:07 "How to interpret 16-bit GrayScale image?", by Bad Badtz
[...]
2002.01.21 23:26 "Re: How to interpret 16-bit GrayScale image?", by Martí Maria
2002.01.21 19:57 "Re: How to interpret 16-bit GrayScale image?", by Daniel McCoy
2002.01.23 04:18 "Re: How to interpret 16-bit GrayScale image?", by Kevin D. Quitt
2002.01.24 05:07 "Re: How to interpret 16-bit GrayScale image?", by Kevin D. Quitt
[...]

2002.01.23 04:18 "Re: How to interpret 16-bit GrayScale image?", by Kevin D. Quitt

      a8_by257 = (unsigned char) (double) (i / 257. + .5);

You can save yourself a whole lot of time by doing:

a8_by257 = (unsigned char)((i + 128) / 257);