[Image-SIG] fromstring image question

joperry at purdue.edu joperry at purdue.edu
Wed Oct 3 00:07:47 CEST 2007


Hi everyone,

I am having difficulty using the Image.fromstring(args) command.  My data is
little endian 16 bit unsigned int.  When I try to use the correct decoder "F;16"
idle fails.  Here is an example:

img2=Image.fromstring("L",(512,512), buffed, "raw", "F;16")

Traceback (most recent call last):
File "<pyshell#26>", line 1, in <module>
img2=Image.fromstring("L",(512,512), buffed, "raw", "F;16")
File "C:\Python25\lib\site-packages\PIL\Image.py", line 1744, in fromstring
im.fromstring(data, decoder_name, args)
File "C:\Python25\lib\site-packages\PIL\Image.py", line 570, in fromstring
d = _getdecoder(self.mode, decoder_name, args)
File "C:\Python25\lib\site-packages\PIL\Image.py", line 373, in _getdecoder
return apply(decoder, (mode,) + args + extra)
ValueError: unknown raw mode

For a more accurate following of the problem I am using this forum for help too.
http://www.thescripts.com/forum/thread716616.html

Thanks for any advice in advance,
John Perry





More information about the Image-SIG mailing list