Re: Tiff Image Reader/writer

2005-06-16 Thread James Carroll
I did a test with wxPython 2.6.1 on Windows. I created a G4 TIFF image that was 4400 x 3599 big, and the following code took under a half second. import wx import time def readImage(filename): img = wx.Image(filename) w = img.GetWidth() h = img.GetHeight() value = img.GetGreen(w

Re: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Robert Kern wrote: > 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 And for comparison:

Re: Tiff Image Reader/writer

2005-06-15 Thread James Carroll
What do you mean by decode the pixels? If there's some image processing that needs to be done, or if you want to view, brighten, or print or something, then there are ways of doing it that will be as fast as can be. If stepping through the pixels to do your own math is what you want, then maybe

Re: Tiff Image Reader/writer

2005-06-15 Thread Robert Kern
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Robert Kern > wrote: > >>PyPK wrote: >> >>>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

Re: Tiff Image Reader/writer

2005-06-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Robert Kern wrote: > PyPK wrote: >> 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 = Im

Re: Tiff Image Reader/writer

2005-06-14 Thread Fredrik Lundh
"PyPK" <[EMAIL PROTECTED]> wrote: > I get a decoder error when i do a get pixel on the Image > > >>> im.getpixel((12,34)) > > Traceback (most recent call last): > File "", line 1, in ? > File "Image.py", line 858, in getpixel > self.load() > File "/usr/local/lib/python2.4/site-packages/P

Re: Tiff Image Reader/writer

2005-06-14 Thread James Carroll
Hmm... that's unfortunate. What platform are you on? If Windows, then I believe that PIL is statically linked against LibTIFF and that particular libtiff wasn't compiled with certain options (CCITT formats or something.) (in 1999 that was true, I found a post from Fred here: http://mail.python.o

Re: Tiff Image Reader/writer

2005-06-14 Thread PyPK
I get a decoder error when i do a get pixel on the Image >>> im.getpixel((12,34)) Traceback (most recent call last): File "", 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._

Re: Tiff Image Reader/writer

2005-06-13 Thread Fredrik Lundh
"PyPK" wrote: > nothing fancy. I just want to be able to read a tiff image, get pixel > values, write back to a tiff file. so why doesn't PIL or ImageMagick work for you? here's a minimal PIL version: from PIL import Image im = Image.open("myfile.tiff") value = im.getpixel((12, 34)

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
When i try this i get this error: import Image >>> im = Image.open('image.tif') >>> im.getpixel((10,19)) Traceback (most recent call last): File "", 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, i

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
PyPK wrote: > 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,

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tiff Image Reader/writer

2005-06-13 Thread Robert Kern
PyPK wrote: > nothing fancy. I just want to be able to read a tiff image, get pixel > values, write back to a tiff file. [An aside: please quote the message you are replying to.] Why doesn't the PIL satisfy this need? Or are you just collecting a list of packages with this capability? -- Rober

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
nothing fancy. I just want to be able to read a tiff image, get pixel values, write back to a tiff file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tiff Image Reader/writer

2005-06-13 Thread James Carroll
What sort of things do you want to do with the TIFFs? How heavy-weight or light-weight are you interested in? For heavy-weight there are: - wxPython will do a bunch of tiff reading, and some image processing http://www.wxpython.org - GDAL >(quoting Khalid Zuberi:) >GDAL supports GeoTIFF and inc

Re: Tiff Image Reader/writer

2005-06-13 Thread PyPK
Is there any package out there which handles Tiff Images other than PIL or ImageMagic . -- http://mail.python.org/mailman/listinfo/python-list

Re: Tiff Image Reader/writer

2005-06-13 Thread Dan Sommers
On 13 Jun 2005 07:55:04 -0700, "PyPK" <[EMAIL PROTECTED]> wrote: > Hi I am looking for a simple tiff Image reader/writer in python.Can > anyone point me to the right one. I don't know what your definition of "simple" is, but check out the Python Imaging Library (PIL) at effbot.org. Regards, Dan