[Image-SIG] Need 12 or 16 bits/pixel images

Roger Burnham rburnham@cri-inc.com
Thu, 27 May 1999 10:58:48 -800


Hi,

I've an application presented to me that needs the dynamic range of 12-16 
bits/pixel images.  We have a digital camera interfaced to Python, that can 
return such images (currently, I scale the data to 8 bits).

I would like to stick with a standard format so that the user can view/manipulate 
the images with other programs as well.  BMP is obviously out (I think!).  I know 
TIF can do it, as I have an example 16 bit image collected with the same camera 
using a third party program.

PIL opens this image successfully.  The image has a rawmode of L;16B, but the 
decoder seems to just take the upper byte and give me a 0-255 grayscale image.

Now I know I'll have to scale to 8 bits to display (on win95, using ImageWin), 
but I need the raw 16 bit data for computations, and I need to be able to save 16 
bit images as well.  I'd prefer not to resort to floating point images, as this 
application will be very memory intensive (up to 16 input images to the algo, and 
up to 4 output images).

Can I do this with a variant of the TIF plugin?  Any other advice anyone cares to 
offer on how to tackle this?

Much appreciated,

Roger Burnham   
Cambridge Research & Instrumentation   
rburnham@cri-inc.com   
http://www.cri-inc.com/   
http://starship.python.net/crew/roger/   
PGP Key: http://www.nai.com/default_pgp.asp   
PGP Fingerprint: 5372 729A 9557 5F36 177F  084A 6C64 BE27 0BC4 CF2D