[PYTHON IMAGE-SIG] Reading, displaying, and manipulating sun-rasters

Seth A. Coe sac@lems.brown.edu
Mon, 17 Jun 1996 09:45:09 -0400


Fredrik Lundh writes:
 > 
 > > My group is trying to load in a raster file to manipulate it as an object
 > > in a canvas.
 > 
 > Seems as you've stumbled upon two problems with PIL at the same time:
 > 
 > 1. Interlaced GIFs are not properly read, as I noticed myself
 >    a few days ago (found a "NYI" comment in the sources :-(.
 >    This is why the image looks so strange.  I'll fix this for
 >    the next release.
 > 
 > 2. A (possible) problem with the type of Sun raster files you're
 >    using.  To help me track down this problem, could you mail me the
 >    output from pilfile.py?
 > 
 > 	$ python pilfile.py -i <rasfile>
 > 
 >    And yes, what happens if you try to do "show" on that image.
 > 
 > 	Image.open(file).show()
 > 
 >    If that fails, does this work?
 > 
 > 	Image.open(file).convert("RGB").show()
 > 
 > Anyway, a quick workaround is to use PPM instead of GIF as the
 > intermediate format (or determine how to switch off interlacing in
 > ImageMagick).
 > 
 > Regards	/F
 > 

Thanks for your help, using ppm as an intermediate instead of gif
seems to be working just fine. Here is the output of pilfile.py when I
try to shoe a sun image. Hope it helps you out some.

sac@lems61 251 > python -i pilfile.py ~/raphael/rabbit.ras 
/home/sac/raphael/rabbit.ras: SUN 128x128 L
>>> Image.open(file).show()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/Image.py", line 241, in show
    file = self._dump()
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/Image.py", line 105, in _dump
    self.load()
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/ImageFile.py", line 120, in load
    d = _getdecoder(d, self, e, a)
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/ImageFile.py", line 47, in _getdecoder
    raise IOError, "decoder %s not available" % d
IOError: decoder sun_rle not available
>>> Image.open(file).convert("RGB").show()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/Image.py", line 130, in convert
    self.load()
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/ImageFile.py", line 120, in load
    d = _getdecoder(d, self, e, a)
  File "/lems/vision/tools/Python/1.3/lib/python/Imaging/ImageFile.py", line 47, in _getdecoder
    raise IOError, "decoder %s not available" % d
IOError: decoder sun_rle not available

=================
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
=================