simple image processing in python
Randall Hopper
aa8vb at yahoo.com
Wed Oct 11 11:42:46 EDT 2000
Kevin Cazabon:
|You can easily get the sizes of the files with PIL, without loading the
|entire image.
...
|PIL doesn't actually load the data until you perform an operation that
|requires that it is loaded... so just getting the size is very quick, even
|with a 400MB image file.
Can you read the pixels from a big image with PIL (say, line-by-line), or
are you limited to listing header info.
------------------------------------------------------------------------------
>>> im = Image.open( "penn_mrlc.tif" )
>>> im.size
(24758, 13716) <---------------------
>>> im.info
{'compression': 'raw'}
>>> len( im.tile )
13716
>>> im.thumbnail( (128,128) )
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "/home/rhh/software/python-1.5.2/lib/python1.5/site-packages/PIL/Image.py", line 723, in thumbnail
self.load(1)
File "/home/rhh/bin/../software/python/lib/python1.5/site-packages/PIL/ImageFile.py", line 134, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "/home/rhh/software/python-1.5.2/lib/python1.5/site-packages/PIL/Image.py", line 225, in _getdecoder
return apply(decoder, (mode,) + args + extra)
ValueError: unknown raw mode
------------------------------------------------------------------------------
--
Randall Hopper
aa8vb at yahoo.com
More information about the Python-list
mailing list