[Image-SIG] Reading 16bit image

Klamer Schutte Schutte@fel.tno.nl
Sat, 17 Aug 2002 11:23:13 +0200


Aureli,

All over the PIL source there seem to be hooks for 16 bit TIFF support.
I hacked the code a while ago to have it working to my needs (reading
16 bit usigned int tiffs) and it sort of worked (arithmetic not defined
on 16 bits, so casting to 32 bit / float needed).

If you really are interested I will dust it off and package it so
you can use it as well.

Klamer

Aureli Soria Frisch wrote:
> 
> >how can I use the "raw decoder" to read a binary 16 bit image?
> >I tried doing this:
> >
> >>>  import Image
> >>>  data = open('binary_file').read()   #string buffer with data
> >>>  size = (256 256)                        #this is really its size
> >>>  mode = 'F;16'
> >>>  image = Image.fromstrin(mode,size,data,"raw")
> >
> >Python tells me this mode (F;16) does not exist. So, wich mode must I use for
> >16 bit images?
> >Could somebody help me?
> 
> I submitted a while ago a question related to the possibility of
> opening TIF files with 16 bit depth that remained with no answer...
> 
> It would be interesting to know how to work with 16 bit files in PIL
> in general (it does not seem to be possible with the open source
> version of PIL)...
> 
> Thanks,
> Aureli
> --
> #################################
> Aureli Soria Frisch
> Fraunhofer IPK
> Dept. Pattern Recognition
> 
> post: Pascalstr. 8-9, 10587 Berlin, Germany
> e-mail: aureli@ipk.fhg.de
> fon: +49 30 39006-143
> fax: +49 30 3917517
> web: http://vision.fhg.de/~aureli/web-aureli_en.html
> #################################
> 
> _______________________________________________
> Image-SIG maillist  -  Image-SIG@python.org
> http://mail.python.org/mailman/listinfo/image-sig