P
PyPK
Hi I am looking for a simple tiff Image reader/writer in python.Can
anyone point me to the right one.
anyone point me to the right one.
Hi I am looking for a simple tiff Image reader/writer in python.Can
anyone point me to the right one.
(quoting Khalid Zuberi
GDAL supports GeoTIFF and includes python bindings:
http://www.remotesensing.org/gdal/
PyPK said:nothing fancy. I just want to be able to read a tiff image, get pixel
values, write back to a tiff file.
PyPK said:One reason why I don't want to use PIL is it seems very slow for tiff
images of very large sizes(2400x4800). So I am looking for a better
tool than does the right job faster.
PyPK said:nothing fancy. I just want to be able to read a tiff image, get pixel
values, write back to a tiff file.
PyPK said:I get a decoder error when i do a get pixel on the Image
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "Image.py", line 858, in getpixel
self.load()
File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line
180, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "Image.py", line 328, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder group4 not available
Robert Kern said:PyPK said:One reason why I don't want to use PIL is it seems very slow for tiff
images of very large sizes(2400x4800). So I am looking for a better
tool than does the right job faster.
This isn't fast enough?
In [8]: %time img2 = Image.open('foo.tiff')
CPU times: user 0.00 s, sys: 0.01 s, total: 0.01 s
Wall time: 0.03
In [9]: img2.size
Out[9]: (2400, 4800)
Marc said:Robert Kern said:PyPK said:One reason why I don't want to use PIL is it seems very slow for tiff
images of very large sizes(2400x4800). So I am looking for a better
tool than does the right job faster.
This isn't fast enough?
In [8]: %time img2 = Image.open('foo.tiff')
CPU times: user 0.00 s, sys: 0.01 s, total: 0.01 s
Wall time: 0.03
In [9]: img2.size
Out[9]: (2400, 4800)
It's fast enough to open the file and read the meta-data. The OP wants to
decode the actual pixels.
Robert Kern said:PyPK said:One reason why I don't want to use PIL is it seems very slow for tiff
images of very large sizes(2400x4800). So I am looking for a better
tool than does the right job faster.
This isn't fast enough?
In [8]: %time img2 = Image.open('foo.tiff')
CPU times: user 0.00 s, sys: 0.01 s, total: 0.01 s
Wall time: 0.03
In [9]: img2.size
Out[9]: (2400, 4800)
It's fast enough to open the file and read the meta-data. The OP wants to
decode the actual pixels.
Ciao,
Marc 'BlackJack' Rintsch
Robert said:Marc 'BlackJack' Rintsch wrote:It's fast enough to open the file and read the meta-data. The OP wants to
decode the actual pixels.
Okay.
In [12]: %time d = img.getdata()
CPU times: user 0.31 s, sys: 1.43 s, total: 1.73 s
Wall time: 6.19
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.