From efotinis at yahoo.com Sun Nov 1 08:02:19 2009 From: efotinis at yahoo.com (Elias Fotinis) Date: Sun, 1 Nov 2009 09:02:19 +0200 Subject: [Image-SIG] 64bit windows OS In-Reply-To: <4AE58EFB.7070404@busino.ch> References: <4AE58EFB.7070404@busino.ch> Message-ID: <03EEDAAE94D246B299D830C6D1AAB1EA@efcore> From: "Raphael Walker" > the _imaging.pyd has dependencies to zlib.dll. i checked your _imaging.pyd > from your install package and there is no dependency to zlib.dll. There shouldn't be a dll dependancy. You have to build zlib as a static library (zlib.lib). I've used the makefile in zlib's win32 directory to create a zlib.lib (make sure you're in the main zlib directory, not in \win32): nmake /f win32\makefile.msc zlib.lib You can omit the "zlib.lib" part in the above command if you want all targets (dll, minigzip, etc.) to be built, but we don't need them for PIL. Try that and see if it works. And remember I've uploaded a prebuilt x64 PIL 1.1.6 binary for Python 2.6 in case you need it in a hurry :) http://www.mediafire.com/?20h3zeimnke From fredrik at pythonware.com Mon Nov 2 15:18:28 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 2 Nov 2009 15:18:28 +0100 Subject: [Image-SIG] tiff with 16bit/channel In-Reply-To: <4AE97CE9.8070104@duet.it> References: <4AE97CE9.8070104@duet.it> Message-ID: <368a5cd50911020618n223df7a5k99ed579c73b105b1@mail.gmail.com> To keep us from guessing, please post a short code snippet that illustrates the problem, plus the full traceback. On Thu, Oct 29, 2009 at 12:30 PM, Fabio Marcone wrote: > Hi! > this is my first post here. I'm using PIL to create a thumbnail (jpeg) for > an image tiff with 16 bits per channel but I got an "illegal conversion" > error. > > Is there a way to solve it? > > if not, is there a way to modify pil to transform from 16 to bit image > before load it in memory? > someone can suggests me where I have to apply changes in source code? > > thanks in advance, > Fabio Marcone > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From nuffnough at gmail.com Mon Nov 2 21:16:36 2009 From: nuffnough at gmail.com (nuffnough) Date: Tue, 3 Nov 2009 07:16:36 +1100 Subject: [Image-SIG] Does PIL handle Canon CR2 format for 5dII and 7d? Message-ID: <159c16bf0911021216o22e881bbicbc813c9dae88271@mail.gmail.com> And is there a published release date for a version that will work with Python 3.x? I From fredrik at pythonware.com Mon Nov 2 21:58:54 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 2 Nov 2009 21:58:54 +0100 Subject: [Image-SIG] ANN: PIL 1.1.7 release candidate 1 (November 1, 2009) Message-ID: <368a5cd50911021258j531014b8j35aac8424b3ac25d@mail.gmail.com> Ok, this thing has been sitting in the repo for way too long; let's get it out there before I come up with more things to tweak & tune. PIL 1.1.7 release candidate for Python 2.X is now available. This release contains tons of bug fixes, and numerous new features, including color management support (based on Kevin Cazabon's pyCMS package), support for reading interlaced PNG files (from Conrado Porto Lopes Gouv?a) and improved PNG compression (from Alexey Borzenkov), improved support for 64-bit platforms, and lots of other tweaks and fixes. For more details, see: http://hg.effbot.org/pil-2009-raclette/src/pil-117c1-20091101/CHANGES To get your hands on this release candidate, grab a source archive from: http://hg.effbot.org/pil-2009-raclette/downloads/ or Windows binaries for Python 2.5 and 2.6 from: http://effbot.org/downloads/#pil (source archives will appear on effbot.org/downloads as well, later this week). This release has been built and tested on a variety of platforms, but I'm still interested in feedback from Mac OS X and non-Linux Unix flavours. Hopefully, this will be the only release candidate, and will be promoted (with a few trivial fixes that's already sitting in the repository) to final status next week. From cgohlke at uci.edu Tue Nov 3 01:35:53 2009 From: cgohlke at uci.edu (Christoph Gohlke) Date: Mon, 02 Nov 2009 16:35:53 -0800 Subject: [Image-SIG] PIL-1.1.7c1.win-amd64-py2.6 Message-ID: <4AEF7AE9.6060703@uci.edu> Hi, there is a 64-bit Visual Studio 2008 build of PIL 1.1.7c1 for Python 2.6 available on my homepage. It built without problems and passed the selftest. http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil Christoph From nils.de.reus at ivm.vu.nl Wed Nov 4 14:16:46 2009 From: nils.de.reus at ivm.vu.nl (Nils Olaf de Reus) Date: Wed, 4 Nov 2009 14:16:46 +0100 Subject: [Image-SIG] PIL 1.1.6 ImageFile.Parser destroys data for PngImagePlugin Message-ID: <1257340606.6418.28.camel@DELL0712> I am experiencing inconvenience from the behaviour of ImageFile.py in PIL 1.1.6 when attempting to read in a PNG image. The method I see documented to retreive an image through ImageFile is by invoking close() on the ImageFile.Parser, like this. >>> import ImageFile >>> import urllib >>> >>> f = urllib.urlopen('') >>> >>> p = ImageFile.Parser() >>> >>> while True: ... s = f.read(1024) ... if not s: ... break ... p.feed(s) ... >>> im = p.close() The way ImageFile.Parser works, it creates an ImageFile._ParserFile to act as a file, and calls Image.open() on that. So far so good, and this results in a valid png image object.. for a very brief moment, because in the 'finally' section immediately after, it calls close() on that ImageFile._ParserFile. The definition of close() in ImageFile._ParserFile is as follows: def close(self): self.data = self.offset = None But PngImagePlugin does not copy data on opening - it just keeps a reference to the source. So this just now destroyed the data on the object that PngImagePlugin is still referring to as the location of its IDAT chunks.. not a bright move, because we have now created a condition where from the point of view of the PngImagePlugin, self.fp is an ImageFile._ParserFile instance, and self.fp.data is None. Which means that as soon as we try to do anything with that image, PngImagePlugin is going to be firing read() instructions at its self.fp, which in turn blindly trusts that its self.data supports __getitem__().. and predictably, there is our Traceback: >>> im.convert('RGB') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 653, in convert self.load() File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 189, in load s = read(self.decodermaxblock) File "/usr/lib/python2.5/site-packages/PIL/PngImagePlugin.py", line 365, in load_read return self.fp.read(bytes) File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 300, in read data = self.data[pos:pos+bytes] TypeError: 'NoneType' object is unsubscriptable I am currently working around the issue by creating my own ImageFile._ParserFile object that avoids having its data None'd. >>> import ImageFile >>> import urllib >>> >>> f = urllib.urlopen('') >>> >>> p = ImageFile.Parser() >>> >>> while True: ... s = f.read(1024) ... if not s: ... break ... p.feed(s) ... >>> virtualfile = ImageFile._ParserFile(p.data) >>> im = Image.open(virtualfile) >>> p.close() >>> im.convert('RGB') This works great -just need to keep the virtualfile around until I'm really done with it- but obviously I am not happy having to use what is supposed to be an internal from ImageFile. >From where I stand, the sensible thing would be to eliminate these two lines from ImageFile.Parser.close(): finally: fp.close() # explicitly close the virtual file ..except that because of the comment, I must assume that there is a reason to be doing this. Could someone please shed light on why it is necessary to explicitly close fp there? Kind regards, Nils Olaf de Reus From fredrik at pythonware.com Wed Nov 4 16:43:56 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 4 Nov 2009 16:43:56 +0100 Subject: [Image-SIG] PIL 1.1.6 ImageFile.Parser destroys data for PngImagePlugin In-Reply-To: <1257340606.6418.28.camel@DELL0712> References: <1257340606.6418.28.camel@DELL0712> Message-ID: <368a5cd50911040743n13b12904i215c6a6753f7c4c8@mail.gmail.com> Thanks for the detailed analysis. The fix in 1.1.7 is slightly different from the one you propose: http://hg.effbot.org/pil-2009-raclette/changeset/fe4688f15fed/ Not sure why the code considers it important to close the file at that point; I'll take another look at a look at the code and the history of that file when I find the time. On Wed, Nov 4, 2009 at 2:16 PM, Nils Olaf de Reus wrote: > I am experiencing inconvenience from the behaviour of ImageFile.py in > PIL 1.1.6 when attempting to read in a PNG image. > > The method I see documented to retreive an image through ImageFile is by > invoking close() on the ImageFile.Parser, like this. > >>>> import ImageFile >>>> import urllib >>>> >>>> f = urllib.urlopen('') >>>> >>>> p = ImageFile.Parser() >>>> >>>> while True: > ... ? ? s = f.read(1024) > ... ? ? if not s: > ... ? ? ? ? break > ... ? ? p.feed(s) > ... >>>> im = p.close() > > The way ImageFile.Parser works, it creates an ImageFile._ParserFile to > act as a file, and calls Image.open() on that. So far so good, and this > results in a valid png image object.. for a very brief moment, because > in the 'finally' section immediately after, it calls close() on that > ImageFile._ParserFile. > > The definition of close() in ImageFile._ParserFile is as follows: > > ? ?def close(self): > ? ? ? ?self.data = self.offset = None > > But PngImagePlugin does not copy data on opening - it just keeps a > reference to the source. So this just now destroyed the data on the > object that PngImagePlugin is still referring to as the location of its > IDAT chunks.. not a bright move, because we have now created a condition > where from the point of view of the PngImagePlugin, self.fp is an > ImageFile._ParserFile instance, and self.fp.data is None. > > Which means that as soon as we try to do anything with that image, > PngImagePlugin is going to be firing read() instructions at its self.fp, > which in turn blindly trusts that its self.data supports __getitem__().. > and predictably, there is our Traceback: > >>>> im.convert('RGB') > Traceback (most recent call last): > ?File "", line 1, in > ?File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 653, in > convert > ? ?self.load() > ?File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 189, in > load > ? ?s = read(self.decodermaxblock) > ?File "/usr/lib/python2.5/site-packages/PIL/PngImagePlugin.py", line > 365, in load_read > ? ?return self.fp.read(bytes) > ?File "/usr/lib/python2.5/site-packages/PIL/ImageFile.py", line 300, in > read > ? ?data = self.data[pos:pos+bytes] > TypeError: 'NoneType' object is unsubscriptable > > > I am currently working around the issue by creating my own > ImageFile._ParserFile object that avoids having its data None'd. > >>>> import ImageFile >>>> import urllib >>>> >>>> f = urllib.urlopen('') >>>> >>>> p = ImageFile.Parser() >>>> >>>> while True: > ... ? ? s = f.read(1024) > ... ? ? if not s: > ... ? ? ? ? break > ... ? ? p.feed(s) > ... >>>> virtualfile = ImageFile._ParserFile(p.data) >>>> im = Image.open(virtualfile) >>>> p.close() >>>> im.convert('RGB') > > > > This works great -just need to keep the virtualfile around until I'm > really done with it- but obviously I am not happy having to use what is > supposed to be an internal from ImageFile. > > >From where I stand, the sensible thing would be to eliminate these two > lines from ImageFile.Parser.close(): > > ? ? ? ? ? ?finally: > ? ? ? ? ? ? ? ?fp.close() # explicitly close the virtual file > > ..except that because of the comment, I must assume that there is a > reason to be doing this. Could someone please shed light on why it is > necessary to explicitly close fp there? > > Kind regards, > ?Nils Olaf de Reus > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From zachar.desiatnik at intel.com Wed Nov 4 21:13:52 2009 From: zachar.desiatnik at intel.com (Desiatnik, Zachar) Date: Wed, 4 Nov 2009 22:13:52 +0200 Subject: [Image-SIG] Does PIL support PPM files with 32-bit MaxColor value? Message-ID: Hi, I'm new PIL user. I wanted utilize it in the PPM image comparison. I found the PIL usable for our needs and wanted to distribute it for our needs. I have the PPM image with 0xFFFF Maxval (maximum color value). The object of the Image class loaded my PPM without any complain. But after I saved it back on the dick I was surprised that the Maxval of saved image was of 256 (0xFF) value. I started to debug the load procedure and found that PpmImageFile._open from PpmImagePlugin method just ignores the Maxval parameter. Q: Do I have some alternative to load and process the PPM image with 32-bit Maxval? Thank you in advance. Zachar --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mperriard at nds.com Thu Nov 5 10:36:38 2009 From: mperriard at nds.com (Perriard, Morten) Date: Thu, 5 Nov 2009 10:36:38 +0100 Subject: [Image-SIG] PIL fails to load BMP version 4 Message-ID: http://www.fileformat.info/format/bmp/egff.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlu at hep.anl.gov Sun Nov 8 00:21:42 2009 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 7 Nov 2009 17:21:42 -0600 (CST) Subject: [Image-SIG] installing PIL on Snow Leopard; Xcode problem Message-ID: Hi- I'm trying to install the PIL using Imaging-1.1.6. following the first of the suggestions at "Passing Curiosity": http://passingcuriosity.com/2009/installing-pil-on-mac-os-x-leopard/ . I'm running Snow Leopard on an Intel machine (MacBook2.1). Two questions (to start with): 1. What is my Xcode problem? When I run >python2.6 setup.py build I get: running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk Please check your Xcode installation 2. this is followed by the line gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - In what file do I find this line so I can make the recommended correction? Thanks for any help I can get. Jack L. U. "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From ghankiewicz at rastertech.es Mon Nov 9 17:24:05 2009 From: ghankiewicz at rastertech.es (Grzegorz Adam Hankiewicz) Date: Mon, 09 Nov 2009 17:24:05 +0100 Subject: [Image-SIG] Speeding up an image transformation in C Message-ID: <4AF84225.1010305@rastertech.es> Hello. I have a small python algorithm similar to a floodfill that works slow in python. Is there any documentation on how I could write a C extension to speed it up? Are there any dev headers I can compile against to handle an Image from C? From s.ulbrich at googlemail.com Tue Nov 10 18:26:00 2009 From: s.ulbrich at googlemail.com (Stefan Ulbrich) Date: Tue, 10 Nov 2009 18:26:00 +0100 Subject: [Image-SIG] Python 2.5 on mac Message-ID: <1B975FB7-1D1B-461B-91D4-E9D3D0D3679A@gmail.com> Hello, I'd like to install PIL 1.1.7 on Mac Os X but the installer fails to find python 2.5 - which is installed as python -V states: Python 2.5.1 So I decided to install Macpython 2.6 and python -V returns Python 2.6.4 however, I still cannot install PIL. Any suggestions how to solve this issue? Best regards, Stefan From irena.efremenko at weizmann.ac.il Wed Nov 11 13:32:41 2009 From: irena.efremenko at weizmann.ac.il (Irena Efremenko) Date: Wed, 11 Nov 2009 14:32:41 +0200 Subject: [Image-SIG] PIL installation error Message-ID: <587F79CD-17D6-4B9B-89F3-2CDA05583323@weizmann.ac.il> Hi, I get the following error messages trying to install PIL: Imaging-1.1.6->70% sudo python setup.py install running install running build running build_py running build_ext building '_imagingtk' extension creating build/temp.linux-x86_64-2.4 creating build/temp.linux-x86_64-2.4/Tk gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 - Wall -D_FORTIFY_SOURCE=2 -g -fPIC -IlibImaging -I/usr/include -I/usr/ local/include -I/usr/include/python2.4 -c _imagingtk.c -o build/ temp.linux-x86_64-2.4/_imagingtk.o _imagingtk.c:20:16: error: tk.h: No such file or directory _imagingtk.c:23: error: expected ')' before '*' token _imagingtk.c:31: error: expected specifier-qualifier-list before 'Tcl_Interp' _imagingtk.c: In function '_tkinit': _imagingtk.c:37: error: 'Tcl_Interp' undeclared (first use in this function) _imagingtk.c:37: error: (Each undeclared identifier is reported only once _imagingtk.c:37: error: for each function it appears in.) _imagingtk.c:37: error: 'interp' undeclared (first use in this function) _imagingtk.c:45: error: expected expression before ')' token _imagingtk.c:51: error: 'TkappObject' has no member named 'interp' _imagingtk.c:55: warning: implicit declaration of function 'TkImaging_Init' error: command 'gcc' failed with exit status 1 I have Python 2.4 installed. Please, help. Thanks, ****** Dr. Irena Efremenko Department of Organic Chemistry Weizmann Institute of Science 76100 Rehovot, Israel Phone: +972 8 9343680 FAX: +972 8 9344142 Email: irena.efremenko at weizmann.ac.il ****** From fredrik at pythonware.com Wed Nov 11 19:13:36 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 11 Nov 2009 19:13:36 +0100 Subject: [Image-SIG] PIL installation error In-Reply-To: <587F79CD-17D6-4B9B-89F3-2CDA05583323@weizmann.ac.il> References: <587F79CD-17D6-4B9B-89F3-2CDA05583323@weizmann.ac.il> Message-ID: <368a5cd50911111013v677333ffqeaae85f22ce0ff7b@mail.gmail.com> Your Python installation includes Tkinter but your Tcl/Tk installation is incomplete; you either have to install the relevant Tcl/Tk development packages, or tweak setup.py to disable Tkinter support. On Wed, Nov 11, 2009 at 1:32 PM, Irena Efremenko wrote: > Hi, > I get the following error messages trying to install PIL: > > Imaging-1.1.6->70% ?sudo python setup.py install > running install > running build > running build_py > running build_ext > building '_imagingtk' extension > creating build/temp.linux-x86_64-2.4 > creating build/temp.linux-x86_64-2.4/Tk > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall > -D_FORTIFY_SOURCE=2 -g -fPIC -IlibImaging -I/usr/include > -I/usr/local/include -I/usr/include/python2.4 -c _imagingtk.c -o > build/temp.linux-x86_64-2.4/_imagingtk.o > _imagingtk.c:20:16: error: tk.h: No such file or directory > _imagingtk.c:23: error: expected ')' before '*' token > _imagingtk.c:31: error: expected specifier-qualifier-list before > 'Tcl_Interp' > _imagingtk.c: In function '_tkinit': > _imagingtk.c:37: error: 'Tcl_Interp' undeclared (first use in this function) > _imagingtk.c:37: error: (Each undeclared identifier is reported only once > _imagingtk.c:37: error: for each function it appears in.) > _imagingtk.c:37: error: 'interp' undeclared (first use in this function) > _imagingtk.c:45: error: expected expression before ')' token > _imagingtk.c:51: error: 'TkappObject' has no member named 'interp' > _imagingtk.c:55: warning: implicit declaration of function 'TkImaging_Init' > error: command 'gcc' failed with exit status 1 > > I have Python 2.4 installed. > Please, help. Thanks, > > ****** > Dr. Irena Efremenko > Department of Organic Chemistry > Weizmann Institute of Science > 76100 Rehovot, Israel > Phone: +972 8 9343680 > FAX: ? +972 8 9344142 > Email: irena.efremenko at weizmann.ac.il > ****** > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From tim at timhatch.com Wed Nov 11 19:17:22 2009 From: tim at timhatch.com (Tim Hatch) Date: Wed, 11 Nov 2009 10:17:22 -0800 Subject: [Image-SIG] PIL installation error In-Reply-To: <587F79CD-17D6-4B9B-89F3-2CDA05583323@weizmann.ac.il> References: <587F79CD-17D6-4B9B-89F3-2CDA05583323@weizmann.ac.il> Message-ID: <4AFAFFB2.8000606@timhatch.com> > I get the following error messages trying to install PIL: > ... > _imagingtk.c:20:16: error: tk.h: No such file or directory Looks like you have _tkinter available but it can't find your tk.h. Assuming you have the tcl headers, adjust TCL_ROOT in setup.py appropriately. Tim From ivangermes at gmail.com Thu Nov 12 13:59:24 2009 From: ivangermes at gmail.com (Ivan Elchin) Date: Thu, 12 Nov 2009 15:59:24 +0300 Subject: [Image-SIG] resizing an image with alphachannel: dirty edges Message-ID: I have a problem, when i resizing an image with alphachannel. Source image: http://dl.dropbox.com/u/932658/sega.png Result image has dirty edges: http://dl.dropbox.com/u/932658/rez.png Sample code code from Django Photologue): ==================================== import Image im = Image.open("sega.png") cur_width, cur_height = im.size new_width, new_height = (200, 200) if not new_width == 0 and not new_height == 0: ratio = min(float(new_width)/cur_width, float(new_height)/cur_height) else: if new_width == 0: ratio = float(new_height)/cur_height else: ratio = float(new_width)/cur_width new_dimensions = (int(round(cur_width*ratio)), int(round(cur_height*ratio))) new_im = im.resize(new_dimensions, Image.ANTIALIAS) new_im.save('rez.png') ==================================== From nils.de.reus at ivm.vu.nl Thu Nov 12 14:54:18 2009 From: nils.de.reus at ivm.vu.nl (Nils Olaf de Reus) Date: Thu, 12 Nov 2009 14:54:18 +0100 Subject: [Image-SIG] Speeding up an image transformation in C In-Reply-To: References: Message-ID: <1258034058.11707.32.camel@DELL0712> On Mon, 9 Nov 2009 17:24:05 +0100, Grzegorz Adam Hankiewicz wrote: > Hello. > > I have a small python algorithm similar to a floodfill that works slow > in python. Is there any documentation on how I could write a C extension > to speed it up? Are there any dev headers I can compile against to > handle an Image from C? I would recommend in this case that you use cython. It allows you to create a C implementation of your algorithm with a python front end, and compile it into an extension which you can then import into regular python code. If you use a numpy array to represent your image, it should work exceptionally well. There is a cython tutorial for using C code with python aimed specifically at numpy. It can be found here: http://wiki.cython.org/tutorials ==================================================== Drs. Nils Olaf de Reus Department of Spatial Analysis and Decision Support Institute for Environmental Studies, VU Amsterdam De Boelelaan 1087, 1081HV The Netherlands Website: http://www.ivm.vu.nl Email: nils.de.reus at ivm.vu.nl ==================================================== From paul.de.velder at gmail.com Thu Nov 12 11:33:16 2009 From: paul.de.velder at gmail.com (Paul) Date: Thu, 12 Nov 2009 11:33:16 +0100 Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 Message-ID: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> Hi Fredrik, I'm using PIL to do some quick image manipulation and I'm very happy with it. I would like to use the chroma subsampling that is present in PIL 1.1.7, but I'm restricted to use Python 2.4... Could you point me out where I can find a Windows binary of PIL 1.1.7 for Python 2.4? Thanks! Best regards, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From pratap.zapada at c-sam.com Fri Nov 13 14:56:43 2009 From: pratap.zapada at c-sam.com (Pratap Zapada) Date: Fri, 13 Nov 2009 19:26:43 +0530 Subject: [Image-SIG] Image1 is Sub-Set of Image2 (Pythone) Message-ID: <000001ca6469$24fc0400$6901a8c0@popnet.co.in> Dear Sir, Let us consider that we have two images say Image1 & Image2. Can you please, Guide me to write code in Pythone to verify that Image1 is sub-set of Image2 or not. Regards, Pratap Zapada -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Fri Nov 13 15:40:02 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 13 Nov 2009 15:40:02 +0100 Subject: [Image-SIG] Image1 is Sub-Set of Image2 (Pythone) In-Reply-To: <000001ca6469$24fc0400$6901a8c0@popnet.co.in> References: <000001ca6469$24fc0400$6901a8c0@popnet.co.in> Message-ID: <368a5cd50911130640n6fb4f663h319bd03703c86b7b@mail.gmail.com> On Fri, Nov 13, 2009 at 2:56 PM, Pratap Zapada wrote: > Let us consider that we have two images say Image1 & Image2. > > Can you please, Guide me to write code in Pythone to verify that Image1 is > sub-set of Image2 or not. How do you define subset? From fredrik at pythonware.com Fri Nov 13 21:06:19 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 13 Nov 2009 21:06:19 +0100 Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> Message-ID: <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> The release candidate is only built for 2.5 and 2.6. I'll build more versions when I cut the final release (sunday, unless something weird happens). (the library supports 1.5.2 through 2.6, with support for 3.x coming up later; not sure I'll provide binaries for all the old versions, though :) On Thu, Nov 12, 2009 at 11:33 AM, Paul wrote: > Hi Fredrik, > > I'm using PIL to do some quick image manipulation and I'm very happy with > it. > I would like to use the chroma subsampling that is present in PIL 1.1.7, but > I'm restricted to use Python 2.4... Could you point me out where I can find > a Windows binary of PIL 1.1.7 for Python 2.4? > > Thanks! > > Best regards, > > Paul > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From jlu at hep.anl.gov Fri Nov 13 21:59:15 2009 From: jlu at hep.anl.gov (Jack Uretsky) Date: Fri, 13 Nov 2009 14:59:15 -0600 (CST) Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> Message-ID: Hi- Perhaps you can answer, at least, the second question. In what file do I find the gcc? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 1. What is my Xcode problem? When I run >python2.6 setup.py build I get: running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk Please check your Xcode installation 2. this is followed by the line gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - In what file do I find this line so I can make the recommended correction? "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley From fredrik at pythonware.com Fri Nov 13 22:19:21 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 13 Nov 2009 22:19:21 +0100 Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> Message-ID: <368a5cd50911131319q51882623la9ca0c40e7405445@mail.gmail.com> I'm not using Mac myself, so I don't know exactly what you need to install to build Python extensions, but there are plenty of Mac hackers here that might be able to point you in the right direction. You could also ping the nice folks over at the pythonmac-sig mailing list. On Fri, Nov 13, 2009 at 9:59 PM, Jack Uretsky wrote: > Hi- > ? ? ? ?Perhaps you can answer, at least, the second question. ?In what file > do I find the gcc? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > 1. What is my Xcode problem? ?When I run >python2.6 setup.py build > ?I get: running build > running build_py > running build_ext > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: > /Developer/SDKs/MacOSX10.4u.sdk > Please check your Xcode installation > > 2. this is followed by the line > > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - > > In what file do I find this line so I can make the recommended correction? > > > > > > "Trust me. ?I have a lot of experience at this." > ? ? ? ? ? ? ? ?General Custer's unremembered message to his men, > ? ? ? ? ? ? ? ?just before leading them into the Little Big Horn Valley > > > > > From janssen at parc.com Fri Nov 13 23:28:47 2009 From: janssen at parc.com (Bill Janssen) Date: Fri, 13 Nov 2009 14:28:47 PST Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> Message-ID: <23152.1258151327@parc.com> Need more details. What version of OS X, what version of Python, what version of Xcode? Bill Jack Uretsky wrote: > Hi- > Perhaps you can answer, at least, the second question. In > what file do I find the gcc? > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > 1. What is my Xcode problem? When I run >python2.6 setup.py build > I get: running build > running build_py > running build_ext > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: > /Developer/SDKs/MacOSX10.4u.sdk > Please check your Xcode installation > > 2. this is followed by the line > > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - > > In what file do I find this line so I can make the recommended correction? > > > > > > "Trust me. I have a lot of experience at this." > General Custer's unremembered message to his men, > just before leading them into the Little Big Horn Valley > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From cgohlke at uci.edu Sat Nov 14 01:36:40 2009 From: cgohlke at uci.edu (Christoph Gohlke) Date: Fri, 13 Nov 2009 16:36:40 -0800 Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 Message-ID: <4AFDFB98.7000209@uci.edu> There's a Windows binary of PIL 1.1.7c1 for Python 2.4 build with VS2003 at Christoph From jlu at hep.anl.gov Sat Nov 14 20:07:57 2009 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 14 Nov 2009 13:07:57 -0600 (CST) Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: <23152.1258151327@parc.com> References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> <23152.1258151327@parc.com> Message-ID: Hi- Xcode - 3.2 (bundled with Mac OS upgrade software) Python 2.6 Mac OS X 10.6.1 (Snow Leopard) "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Fri, 13 Nov 2009, Bill Janssen wrote: > Need more details. What version of OS X, what version of Python, what > version of Xcode? > > Bill > > Jack Uretsky wrote: > >> Hi- >> Perhaps you can answer, at least, the second question. In >> what file do I find the gcc? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> 1. What is my Xcode problem? When I run >python2.6 setup.py build >> I get: running build >> running build_py >> running build_ext >> --- using frameworks at /System/Library/Frameworks >> building '_imaging' extension >> Compiling with an SDK that doesn't seem to exist: >> /Developer/SDKs/MacOSX10.4u.sdk >> Please check your Xcode installation >> >> 2. this is followed by the line >> >> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk >> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - >> >> In what file do I find this line so I can make the recommended correction? >> >> >> >> >> >> "Trust me. I have a lot of experience at this." >> General Custer's unremembered message to his men, >> just before leading them into the Little Big Horn Valley >> >> >> >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig > From janssen at parc.com Sat Nov 14 20:20:42 2009 From: janssen at parc.com (Bill Janssen) Date: Sat, 14 Nov 2009 11:20:42 PST Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> <23152.1258151327@parc.com> Message-ID: <29140.1258226442@parc.com> OK, and is that Python 2.6 the one that comes with Snow Leopard? That should pin it down. The question here is, why is your system trying to use the 10.4 SDK, instead of the 10.6 SDK? The only thing I can think of is that you are using a non-Apple-supplied Python, which was built against the 10.4 SDK, so it's trying to use that to build PIL, too. Bill Jack Uretsky wrote: > Hi- > Xcode - 3.2 (bundled with Mac OS upgrade software) > Python 2.6 > Mac OS X 10.6.1 (Snow Leopard) > > "Trust me. I have a lot of experience at this." > General Custer's unremembered message to his men, > just before leading them into the Little Big Horn Valley > > > > > On Fri, 13 Nov 2009, Bill Janssen wrote: > > > Need more details. What version of OS X, what version of Python, what > > version of Xcode? > > > > Bill > > > > Jack Uretsky wrote: > > > >> Hi- > >> Perhaps you can answer, at least, the second question. In > >> what file do I find the gcc? > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > >> 1. What is my Xcode problem? When I run >python2.6 setup.py build > >> I get: running build > >> running build_py > >> running build_ext > >> --- using frameworks at /System/Library/Frameworks > >> building '_imaging' extension > >> Compiling with an SDK that doesn't seem to exist: > >> /Developer/SDKs/MacOSX10.4u.sdk > >> Please check your Xcode installation > >> > >> 2. this is followed by the line > >> > >> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > >> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - > >> > >> In what file do I find this line so I can make the recommended correction? > >> > >> > >> > >> > >> > >> "Trust me. I have a lot of experience at this." > >> General Custer's unremembered message to his men, > >> just before leading them into the Little Big Horn Valley > >> > >> > >> > >> > >> _______________________________________________ > >> Image-SIG maillist - Image-SIG at python.org > >> http://mail.python.org/mailman/listinfo/image-sig > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From jlu at hep.anl.gov Sun Nov 15 03:24:30 2009 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 14 Nov 2009 20:24:30 -0600 (CST) Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: <29140.1258226442@parc.com> References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> <23152.1258151327@parc.com> <29140.1258226442@parc.com> Message-ID: Thanks. I'n not seeing why that helps. I did Finder-File-Find-SDK and got 156 items. Im not sure what to do next Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Sat, 14 Nov 2009, Bill Janssen wrote: > OK, and is that Python 2.6 the one that comes with Snow Leopard? > > That should pin it down. The question here is, why is your system > trying to use the 10.4 SDK, instead of the 10.6 SDK? The only thing I > can think of is that you are using a non-Apple-supplied Python, which > was built against the 10.4 SDK, so it's trying to use that to build PIL, > too. > > Bill > > > Jack Uretsky wrote: > >> Hi- >> Xcode - 3.2 (bundled with Mac OS upgrade software) >> Python 2.6 >> Mac OS X 10.6.1 (Snow Leopard) >> >> "Trust me. I have a lot of experience at this." >> General Custer's unremembered message to his men, >> just before leading them into the Little Big Horn Valley >> >> >> >> >> On Fri, 13 Nov 2009, Bill Janssen wrote: >> >>> Need more details. What version of OS X, what version of Python, what >>> version of Xcode? >>> >>> Bill >>> >>> Jack Uretsky wrote: >>> >>>> Hi- >>>> Perhaps you can answer, at least, the second question. In >>>> what file do I find the gcc? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>> 1. What is my Xcode problem? When I run >python2.6 setup.py build >>>> I get: running build >>>> running build_py >>>> running build_ext >>>> --- using frameworks at /System/Library/Frameworks >>>> building '_imaging' extension >>>> Compiling with an SDK that doesn't seem to exist: >>>> /Developer/SDKs/MacOSX10.4u.sdk >>>> Please check your Xcode installation >>>> >>>> 2. this is followed by the line >>>> >>>> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk >>>> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - >>>> >>>> In what file do I find this line so I can make the recommended correction? >>>> >>>> >>>> >>>> >>>> >>>> "Trust me. I have a lot of experience at this." >>>> General Custer's unremembered message to his men, >>>> just before leading them into the Little Big Horn Valley >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Image-SIG maillist - Image-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/image-sig >>> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig > From janssen at parc.com Sun Nov 15 19:44:11 2009 From: janssen at parc.com (Bill Janssen) Date: Sun, 15 Nov 2009 10:44:11 PST Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> <23152.1258151327@parc.com> <29140.1258226442@parc.com> Message-ID: <33202.1258310651@parc.com> So, did you download and install a different Python than came with your Mac? Bill Jack Uretsky wrote: > Thanks. I'n not seeing why that helps. I did Finder-File-Find-SDK > and got 156 items. Im not sure what to do next > Regards, > Jack > > "Trust me. I have a lot of experience at this." > General Custer's unremembered message to his men, > just before leading them into the Little Big Horn Valley > > > > > On Sat, 14 Nov 2009, Bill Janssen wrote: > > > OK, and is that Python 2.6 the one that comes with Snow Leopard? > > > > That should pin it down. The question here is, why is your system > > trying to use the 10.4 SDK, instead of the 10.6 SDK? The only thing I > > can think of is that you are using a non-Apple-supplied Python, which > > was built against the 10.4 SDK, so it's trying to use that to build PIL, > > too. > > > > Bill > > > > > > Jack Uretsky wrote: > > > >> Hi- > >> Xcode - 3.2 (bundled with Mac OS upgrade software) > >> Python 2.6 > >> Mac OS X 10.6.1 (Snow Leopard) > >> > >> "Trust me. I have a lot of experience at this." > >> General Custer's unremembered message to his men, > >> just before leading them into the Little Big Horn Valley > >> > >> > >> > >> > >> On Fri, 13 Nov 2009, Bill Janssen wrote: > >> > >>> Need more details. What version of OS X, what version of Python, what > >>> version of Xcode? > >>> > >>> Bill > >>> > >>> Jack Uretsky wrote: > >>> > >>>> Hi- > >>>> Perhaps you can answer, at least, the second question. In > >>>> what file do I find the gcc? > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > >>>> 1. What is my Xcode problem? When I run >python2.6 setup.py build > >>>> I get: running build > >>>> running build_py > >>>> running build_ext > >>>> --- using frameworks at /System/Library/Frameworks > >>>> building '_imaging' extension > >>>> Compiling with an SDK that doesn't seem to exist: > >>>> /Developer/SDKs/MacOSX10.4u.sdk > >>>> Please check your Xcode installation > >>>> > >>>> 2. this is followed by the line > >>>> > >>>> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > >>>> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - > >>>> > >>>> In what file do I find this line so I can make the recommended correction? > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> "Trust me. I have a lot of experience at this." > >>>> General Custer's unremembered message to his men, > >>>> just before leading them into the Little Big Horn Valley > >>>> > >>>> > >>>> > >>>> > >>>> _______________________________________________ > >>>> Image-SIG maillist - Image-SIG at python.org > >>>> http://mail.python.org/mailman/listinfo/image-sig > >>> > >> _______________________________________________ > >> Image-SIG maillist - Image-SIG at python.org > >> http://mail.python.org/mailman/listinfo/image-sig > > From fredrik at pythonware.com Sun Nov 15 21:16:18 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 15 Nov 2009 21:16:18 +0100 Subject: [Image-SIG] ANN: PIL 1.1.7 release candidate 1 (November 1, 2009) In-Reply-To: <368a5cd50911021258j531014b8j35aac8424b3ac25d@mail.gmail.com> References: <368a5cd50911021258j531014b8j35aac8424b3ac25d@mail.gmail.com> Message-ID: <368a5cd50911151216h6e68269dy49b2fea417358ab7@mail.gmail.com> Ok, I just tagged and posted tarballs and binaries for 1.1.7 final, which is basically c1 with very some minor tweaks. Everything is available from: http://effbot.org/downloads/#pil which includes a distutils source archives, Windows binaries for 2.4 and newer, and a subversion vendor drop for use with svn:externals. In addition, there's an old-school tarball available as: http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz and Mercurial users can find a "stable fork" for the development tree at http://hg.effbot.org/pil-117 (which also has downloads available). A formal announcement will follow later this week. Enjoy! /F On Mon, Nov 2, 2009 at 9:58 PM, Fredrik Lundh wrote: > Ok, this thing has been sitting in the repo for way too long; let's > get it out there before I come up with more things to tweak & tune. > > PIL 1.1.7 release candidate for Python 2.X is now available. ?This > release contains tons of bug fixes, and numerous new features, > including color management support (based on Kevin Cazabon's pyCMS > package), support for reading interlaced PNG files (from Conrado Porto > Lopes Gouv?a) and improved PNG compression (from Alexey Borzenkov), > improved support for 64-bit platforms, and lots of other tweaks and > fixes. ?For more details, see: > > ? ?http://hg.effbot.org/pil-2009-raclette/src/pil-117c1-20091101/CHANGES > > To get your hands on this release candidate, grab a source archive from: > > ? ?http://hg.effbot.org/pil-2009-raclette/downloads/ > > or Windows binaries for Python 2.5 and 2.6 from: > > ? http://effbot.org/downloads/#pil > > (source archives will appear on effbot.org/downloads as well, later this week). > > This release has been built and tested on a variety of platforms, but > I'm still interested in feedback from Mac OS X and non-Linux Unix > flavours. ?Hopefully, this will be the only release candidate, and > will be promoted (with a few trivial fixes that's already sitting in > the repository) to final status next week. > > > From jlu at hep.anl.gov Mon Nov 16 05:52:56 2009 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 15 Nov 2009 22:52:56 -0600 (CST) Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 In-Reply-To: <33202.1258310651@parc.com> References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> <23152.1258151327@parc.com> <29140.1258226442@parc.com> <33202.1258310651@parc.com> Message-ID: Yes and no. In addition to the version that came with Snow Leopard, I downloaded version 3.1.1 Regards, Jack "Trust me. I have a lot of experience at this." General Custer's unremembered message to his men, just before leading them into the Little Big Horn Valley On Sun, 15 Nov 2009, Bill Janssen wrote: > So, did you download and install a different Python than came with your > Mac? > > Bill > > > Jack Uretsky wrote: > >> Thanks. I'n not seeing why that helps. I did Finder-File-Find-SDK >> and got 156 items. Im not sure what to do next >> Regards, >> Jack >> >> "Trust me. I have a lot of experience at this." >> General Custer's unremembered message to his men, >> just before leading them into the Little Big Horn Valley >> >> >> >> >> On Sat, 14 Nov 2009, Bill Janssen wrote: >> >>> OK, and is that Python 2.6 the one that comes with Snow Leopard? >>> >>> That should pin it down. The question here is, why is your system >>> trying to use the 10.4 SDK, instead of the 10.6 SDK? The only thing I >>> can think of is that you are using a non-Apple-supplied Python, which >>> was built against the 10.4 SDK, so it's trying to use that to build PIL, >>> too. >>> >>> Bill >>> >>> >>> Jack Uretsky wrote: >>> >>>> Hi- >>>> Xcode - 3.2 (bundled with Mac OS upgrade software) >>>> Python 2.6 >>>> Mac OS X 10.6.1 (Snow Leopard) >>>> >>>> "Trust me. I have a lot of experience at this." >>>> General Custer's unremembered message to his men, >>>> just before leading them into the Little Big Horn Valley >>>> >>>> >>>> >>>> >>>> On Fri, 13 Nov 2009, Bill Janssen wrote: >>>> >>>>> Need more details. What version of OS X, what version of Python, what >>>>> version of Xcode? >>>>> >>>>> Bill >>>>> >>>>> Jack Uretsky wrote: >>>>> >>>>>> Hi- >>>>>> Perhaps you can answer, at least, the second question. In >>>>>> what file do I find the gcc? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>> 1. What is my Xcode problem? When I run >python2.6 setup.py build >>>>>> I get: running build >>>>>> running build_py >>>>>> running build_ext >>>>>> --- using frameworks at /System/Library/Frameworks >>>>>> building '_imaging' extension >>>>>> Compiling with an SDK that doesn't seem to exist: >>>>>> /Developer/SDKs/MacOSX10.4u.sdk >>>>>> Please check your Xcode installation >>>>>> >>>>>> 2. this is followed by the line >>>>>> >>>>>> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk >>>>>> -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - >>>>>> >>>>>> In what file do I find this line so I can make the recommended correction? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> "Trust me. I have a lot of experience at this." >>>>>> General Custer's unremembered message to his men, >>>>>> just before leading them into the Little Big Horn Valley >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Image-SIG maillist - Image-SIG at python.org >>>>>> http://mail.python.org/mailman/listinfo/image-sig >>>>> >>>> _______________________________________________ >>>> Image-SIG maillist - Image-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/image-sig >>> > From fredrik at pythonware.com Mon Nov 16 16:20:33 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 16 Nov 2009 16:20:33 +0100 Subject: [Image-SIG] Speeding up an image transformation in C In-Reply-To: <4AF84225.1010305@rastertech.es> References: <4AF84225.1010305@rastertech.es> Message-ID: <368a5cd50911160720k90d6ec3qd941c37a62bbf3b3@mail.gmail.com> There's a brief note here: http://effbot.org/zone/pil-extending.htm You can simplify the dependencies by simply copying the Imaging definition to your own code -- the "im.id" attribute used in that article is guaranteed to give you a pointer to that structure (that is, if the structure ever changes, PIL will provide a different mechanism to access the internal image descriptor). Another approach is to use tostring/fromstring in a wrapper, and write a C extension that works on a byte string or buffer object. On Mon, Nov 9, 2009 at 5:24 PM, Grzegorz Adam Hankiewicz wrote: > Hello. > > I have a small python algorithm similar to a floodfill that works slow in > python. Is there any documentation on how I could write a C extension to > speed it up? Are there any dev headers I can compile against to handle an > Image from C? > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From rowen at uw.edu Mon Nov 16 23:34:02 2009 From: rowen at uw.edu (Russell E. Owen) Date: Mon, 16 Nov 2009 14:34:02 -0800 Subject: [Image-SIG] PIL 1.1.7 binary for python 2.4 References: <1c878f6c0911120233g56f055dbu1dc268487d06e53e@mail.gmail.com> <368a5cd50911131206g2cdd976cvce5dd63b4f236cd4@mail.gmail.com> Message-ID: In article , Jack Uretsky wrote: > Hi- > Perhaps you can answer, at least, the second question. In what > file do I find the gcc? > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > 1. What is my Xcode problem? When I run >python2.6 setup.py build > I get: running build > running build_py > running build_ext > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: > /Developer/SDKs/MacOSX10.4u.sdk > Please check your Xcode installation > > 2. this is followed by the line > > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ - > > In what file do I find this line so I can make the recommended correction? I think all you need to do is run the XCode installer again, and this time be sure to install the 10.4 SDK (which is not installed by default). Then try the build again. -- Russell From dineshbvadhia at hotmail.com Wed Nov 18 15:41:37 2009 From: dineshbvadhia at hotmail.com (Dinesh B Vadhia) Date: Wed, 18 Nov 2009 06:41:37 -0800 Subject: [Image-SIG] Simple image display question Message-ID: My Python program generates urls to images on the web (flickr in this case) eg. http://farm3.static.flickr.com/2054/2303499779_9d3de1e838_m.jpg http://farm3.static.flickr.com/2149/2328692615_5b285f6556_m.jpg http://farm3.static.flickr.com/2225/2506707027_b7b8d9782a_m.jpg http://farm1.static.flickr.com/33/70092693_157e05bcd5_m.jpg http://farm1.static.flickr.com/137/390105952_ed7febc823_m.jpg http://farm1.static.flickr.com/60/211356465_eff94c2d59_m.jpg http://farm1.static.flickr.com/11/13072294_0f2369024c_m.jpg http://farm1.static.flickr.com/96/264201591_47b5d22bf4_m.jpg http://farm1.static.flickr.com/145/425383366_a794d9e850_m.jpg For testing purposes, I want to display the images in 3x3 thumbnail on an empty web page. How can I do this quickly? Dinesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Fri Nov 20 13:09:22 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 20 Nov 2009 13:09:22 +0100 Subject: [Image-SIG] Simple image display question In-Reply-To: References: Message-ID: <368a5cd50911200409t459bea52s55b59e5d076e5b82@mail.gmail.com> Generate a HTML file with IMG tags? Any HTML tutorial should teach you how to do that, and you don't really need more than the "print" statement to generate the file in Python. I'm pretty sure flickr can provide you with URL:s for the thumbnail versions they've already created (you're using their API, right?), but if you need to do local processing, use Image.open(urllib.urlopen(...)) to get a PIL image object, do what you need to do to the image, and save it to a local file. Then generate a HTML file that points to the local files instead of the flickr URL:s. On Wed, Nov 18, 2009 at 3:41 PM, Dinesh B Vadhia wrote: > My Python program generates urls to images on the web (flickr in this case) > eg. > > http://farm3.static.flickr.com/2054/2303499779_9d3de1e838_m.jpg > http://farm3.static.flickr.com/2149/2328692615_5b285f6556_m.jpg > http://farm3.static.flickr.com/2225/2506707027_b7b8d9782a_m.jpg > http://farm1.static.flickr.com/33/70092693_157e05bcd5_m.jpg > http://farm1.static.flickr.com/137/390105952_ed7febc823_m.jpg > http://farm1.static.flickr.com/60/211356465_eff94c2d59_m.jpg > http://farm1.static.flickr.com/11/13072294_0f2369024c_m.jpg > http://farm1.static.flickr.com/96/264201591_47b5d22bf4_m.jpg > http://farm1.static.flickr.com/145/425383366_a794d9e850_m.jpg > For testing purposes, I want to display the images in 3x3 thumbnail on an > empty web page.? How can I do this quickly? > > Dinesh > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From snaury at gmail.com Fri Nov 20 14:17:15 2009 From: snaury at gmail.com (Alexey Borzenkov) Date: Fri, 20 Nov 2009 16:17:15 +0300 Subject: [Image-SIG] resizing an image with alphachannel: dirty edges In-Reply-To: References: Message-ID: On Thu, Nov 12, 2009 at 3:59 PM, Ivan Elchin wrote: > I have a problem, when i resizing an image with alphachannel. You can try converting your image to RGBa (premultiplied alpha), resizing it, then converting back to RGBA. The problem here is that there are dirty pixels with 0 alpha, and they get interpolated like everything else. On my PIL this works: from PIL import Image im = Image.open("sega.png") im = im.convert("RGBa") cur_width, cur_height = im.size new_width, new_height = (200, 200) if not new_width == 0 and not new_height == 0: ratio = min(float(new_width)/cur_width, float(new_height)/cur_height) else: if new_width == 0: ratio = float(new_height)/cur_height else: ratio = float(new_width)/cur_width new_dimensions = (int(round(cur_width*ratio)), int(round(cur_height*ratio))) new_im = im.resize(new_dimensions, Image.ANTIALIAS) new_im = new_im.convert("RGBA") new_im.save('rez.png') Though my PIL has many modifications, I'm not sure if RGBA->RGBa->RGBA is implemented in vanilla 1.1.6. (after checking) Ah, yes, it's not. Though you can try recompiling PIL with this patch: http://git.kitsu.ru/patched/pil.git?a=commitdiff;h=b8f1c572430b06b5d4294fb2bf29327275120554 From snaury at gmail.com Fri Nov 20 14:33:29 2009 From: snaury at gmail.com (Alexey Borzenkov) Date: Fri, 20 Nov 2009 16:33:29 +0300 Subject: [Image-SIG] PIL 1.1.6 ImageFile.Parser destroys data for PngImagePlugin In-Reply-To: <368a5cd50911040743n13b12904i215c6a6753f7c4c8@mail.gmail.com> References: <1257340606.6418.28.camel@DELL0712> <368a5cd50911040743n13b12904i215c6a6753f7c4c8@mail.gmail.com> Message-ID: Hi Fredrik, On Wed, Nov 4, 2009 at 6:43 PM, Fredrik Lundh wrote: > Thanks for the detailed analysis. ?The fix in 1.1.7 is slightly > different from the one you propose: > > ? ?http://hg.effbot.org/pil-2009-raclette/changeset/fe4688f15fed/ > > Not sure why the code considers it important to close the file at that > point; I'll take another look at a look at the code and the history of > that file when I find the time. I looked at your changeset, and wonder why do you call image.load() in finally? If Image.open fails, then self.image.load will also fail, masking the original exception with attribute error. I don't remember what I posted back then, but my patch was a little different: http://git.kitsu.ru/patched/pil.git?a=commitdiff;h=943d371a903bf2af8ebc6b3be908bcdd6f8d0964 From ivanlan9 at gmail.com Fri Nov 20 18:34:22 2009 From: ivanlan9 at gmail.com (Ivan Van Laningham) Date: Fri, 20 Nov 2009 10:34:22 -0700 Subject: [Image-SIG] XPM Message-ID: Hi All-- I ran across Tom Heathcotes patches for PIL 1.1.6 to handle XPM files correctly. Is there a version of PIL available that includes the fixes? I've got several hundred XPMs I'd like to convert to PNGs. Thanks! Metta, Ivan -- Ivan Van Laningham God N Locomotive Works http://www.pauahtun.org/ http://www.python.org/workshops/1998-11/proceedings/papers/laningham/laningham.html Army Signal Corps: Cu Chi, Class of '70 Author: Teach Yourself Python in 24 Hours From Chris.Barker at noaa.gov Fri Nov 20 18:33:31 2009 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 20 Nov 2009 09:33:31 -0800 Subject: [Image-SIG] easy-install on Windows Message-ID: <4B06D2EB.3050008@noaa.gov> Hi folks, I just tried: easy_install PIL on Windows with Python 2.6 I got PIL 1.1.7, which is nice, but it got installed a bit oddly. I couldn't do: from PIL import Image What it did is put everything into a directory that got added to the easy_install.pth file. The result is similar to the old style PIL dir, with a PIL.pth file, except that you can't do "import PIL" anymore, as the egg dir has a big 'ol long name. I'm a big fan of namespaces, so I really don't want all that stuff in the root namespace. In fact, I've been removing the PIL.pth file (probably only as a matter of principle, but it forces us to use the import style I prefer). I think the that the PIL directory should be put in the egg dir with easy-install, but however it's done: import PIL should work. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From adys.wh at gmail.com Sat Nov 21 10:00:11 2009 From: adys.wh at gmail.com (Jerome Leclanche) Date: Sat, 21 Nov 2009 10:00:11 +0100 Subject: [Image-SIG] Using a DXT1 decoder Message-ID: <41eceb530911210100s62710b95l12d288eb5d5ad29a@mail.gmail.com> Hello! I'm writing a decoder for the FTEX format (obscure one used by old games from Particle Systems). I followed the steps described here: http://www.pythonware.com/library/pil/handbook/decoder.htm The decoder works great for uncompressed (.ftu) FTEX files. However, the textures inside the image can be dxt1 compressed (.ftc). I was wondering if there was a PIL DXT1 decoder available somewhere, and if not, how to actually write one - the help page only explains how to use raw/bit decoders. Cheers J. Leclanche / Adys From d.l.goldsmith at gmail.com Fri Nov 20 21:45:39 2009 From: d.l.goldsmith at gmail.com (David Goldsmith) Date: Fri, 20 Nov 2009 12:45:39 -0800 Subject: [Image-SIG] Trouble using pilfile utility Message-ID: <45d1ab480911201245l42cea652v2d8ae7add7ef51d4@mail.gmail.com> In Windows, i.e., from a DOS prompt, I get, e.g.: C:\Users\Fermat>pilfile Fractals 'pilfile' is not recognized as an internal or external command, operable program or batch file. Do I need to add ...Python\Lib\site-packages\PIL\Scripts to my PATH? (If so, it'd be nice if: a. http://www.pythonware.com/library/pil/handbook/pilfile.htm stated this, and b. the installer did this automatically.) Thanks! DG -------------- next part -------------- An HTML attachment was scrubbed... URL: From sierra_mtnview at sbcglobal.net Sun Nov 22 19:34:11 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Sun, 22 Nov 2009 10:34:11 -0800 Subject: [Image-SIG] Reading and Manipulating a WinTV Capture Card Message-ID: <4B098423.8050306@sbcglobal.net> I would like to read a capture card (Subject) that is connected to a b/w camera and produces 640x480 frames. I'm certainly not familiar with the methodology and has some basic understanding how images can be written and read from a PC monitor. On the surface of it, capture card, it would seem that on only needs to read each frame into an array of appropriate size, and process the frames as necessary. The card is made by Hauppauge, but they say they know of no facility to read their card. I know a fellow who is doing it with C++, but my interest is in Python. He may have to use ActiveX or some other MS tool. Is there some way? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From fredrik at pythonware.com Sun Nov 22 19:43:05 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 22 Nov 2009 19:43:05 +0100 Subject: [Image-SIG] Reading and Manipulating a WinTV Capture Card In-Reply-To: <4B098423.8050306@sbcglobal.net> References: <4B098423.8050306@sbcglobal.net> Message-ID: <368a5cd50911221043i741d073av52f3c90966f78e8e@mail.gmail.com> Here's a DirectShow interface that might work with your card: http://videocapture.sourceforge.net/ On Sun, Nov 22, 2009 at 7:34 PM, Wayne Watson wrote: > I would like to read a capture card (Subject) that is connected to a b/w > camera and produces 640x480 frames. I'm certainly not familiar with the > methodology and has some basic understanding how images can be written and > read from a PC monitor. On the surface of it, capture card, it would seem > that on only needs to read each frame into an array of appropriate size, and > process the frames as necessary. > > The card is made by Hauppauge, but they say they know of no facility to read > their card. I know a fellow who is doing it with C++, but my interest is in > Python. He may have to use ActiveX or some other MS tool. ?Is there some > way? > > -- > ? ? ? ? ?Wayne Watson (Watson Adventures, Prop., Nevada City, CA) > > ? ? ? ? ? ?(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) > ? ? ? ? ? ? Obz Site: ?39? 15' 7" N, 121? 2' 32" W, 2700 feet > ? ? ? ? ? ? ? ? ? ?350 350 350 350 350 350 350 350 350 350 > ? ? ? ? ? ? ? ? ? ?Make the number famous. See 350.org > ? ? ? ? ? The major event has passed, but keep the number alive. > > ? ? ? ? ? ? ? ? ? Web Page: > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From sierra_mtnview at sbcglobal.net Wed Nov 25 02:59:09 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Tue, 24 Nov 2009 17:59:09 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped Message-ID: <4B0C8F6D.6020409@sbcglobal.net> A few hours ago someone posted some sample Python code somewhere in several of the python lists pictures. I looked at it and thought that looks pretty interesting. Now I can't find it. Does anyone know of that post? Typical I use Image-SIG, Pmw-Toolkit Python Tutor, Tkinter, VisPython lists but I don't see it. My interest is that I would like to step through a video file of b/w images, 640x480, and stop along the way to make histograms to determine noise characteristics of the camera that took the video. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From sierra_mtnview at sbcglobal.net Wed Nov 25 16:44:48 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Wed, 25 Nov 2009 07:44:48 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> Message-ID: <4B0D50F0.7090409@sbcglobal.net> I thought I'd try executing your code under Win Python, but it objected to indentation, tabs. I tried substituting 4 blanks for them, but that didn't work out. Suggestions? David Kirtley wrote: > http://www.cs.panam.edu/~dkirtley/video/ > > Should not need too much modification for what you want to do. > > David Kirtley > > On Tue, Nov 24, 2009 at 7:59 PM, Wayne Watson > wrote: > >> A few hours ago someone posted some sample Python code somewhere in several >> of the python lists pictures. I looked at it and thought that looks pretty >> interesting. Now I can't find it. Does anyone know of that post? Typical I >> use Image-SIG, Pmw-Toolkit Python Tutor, Tkinter, VisPython lists but I >> don't see it. >> >> My interest is that I would like to step through a video file of b/w images, >> 640x480, and stop along the way to make histograms to determine noise >> characteristics of the camera that took the video. >> >> -- >> Wayne Watson (Watson Adventures, Prop., Nevada City, CA) >> >> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) >> Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet >> 350 350 350 350 350 350 350 350 350 350 >> Make the number famous. See 350.org >> The major event has passed, but keep the number alive. >> >> Web Page: >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> >> > > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From sierra_mtnview at sbcglobal.net Wed Nov 25 17:21:50 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Wed, 25 Nov 2009 08:21:50 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> Message-ID: <4B0D599E.2010104@sbcglobal.net> David, I have many video files, but only want to process them one at a time. The format is unique, but simple. Basically, 640x480 b/w bmp images one right after the other. The program should read one image, then allow the user to produce a histogram of the image displayed. Now he moves to the next one of interest, and does the same. I started down this path some months ago, but got side tracked. I did make some progress, so I think I'll review that, and just see if I can finish it off. I would think it really isn't a complicated program. In fact, I would think such a common need, without the histograms, that it should be available as a possible example of how to read simple video files. I'll stick to Win Python. I've used C and Linux before, but don't see a need to go back to it here. David Kirtley wrote: > Well, I really had intended it to be a guide and unless you have the > gnuplot python stuff also, it would not run directly. > > What exactly are you trying to do? From what I understood, you have a > bunch of image files and want to do histograms for each of them. > (Unless you are trying to do them from video which is problematic. I > personally saved the video I was working as a set of individual image > files. Getting them from a video stream is a lot harder and has many > difficulties- many man-made because of licensing and patents on video > compression. I have not done it directly and would not want to mess > with it. It is really nasty.) > > Also, that code is pretty old (I think 2.2 or maybe even older Python) > the new glob stuff > files = glob.glob(os.path.join('','*.out')) > will make it easy to get a list of the files in the directory. > > So the basic strategy would be : > > Get the list of files to process with the glob -- Who chooses these names? ;) > > (Not perfect code, just rough idea.....) > > for file in file_list: > image = Image.open(file) > histogram = Image.chops.histogram -- don't remember where the > histogram stuff is off the top of my head > make the comparison > save the results > > > > If you are going to be doing some in depth analysis of the data, you > prob will want to use Numpy and deal with them as arrays. > > On Wed, Nov 25, 2009 at 9:44 AM, Wayne Watson > wrote: > >> I thought I'd try executing your code under Win Python, but it objected to >> indentation, tabs. I tried substituting 4 blanks for them, but that didn't >> work out. Suggestions? >> >> David Kirtley wrote: >> >>> http://www.cs.panam.edu/~dkirtley/video/ >>> >>> Should not need too much modification for what you want to do. >>> >>> David Kirtley >>> >>> On Tue, Nov 24, 2009 at 7:59 PM, Wayne Watson >>> wrote: >>> >>> >>>> A few hours ago someone posted some sample Python code somewhere in >>>> several >>>> of the python lists pictures. I looked at it and thought that looks >>>> pretty >>>> interesting. Now I can't find it. Does anyone know of that post? Typical >>>> I >>>> use Image-SIG, Pmw-Toolkit Python Tutor, Tkinter, VisPython lists but I >>>> don't see it. >>>> >>>> My interest is that I would like to step through a video file of b/w >>>> images, >>>> 640x480, and stop along the way to make histograms to determine noise >>>> characteristics of the camera that took the video. >>>> >>>> -- >>>> Wayne Watson (Watson Adventures, Prop., Nevada City, CA) >>>> >>>> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) >>>> Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet >>>> 350 350 350 350 350 350 350 350 350 350 >>>> Make the number famous. See 350.org >>>> The major event has passed, but keep the number alive. >>>> >>>> Web Page: >>>> >>>> _______________________________________________ >>>> Image-SIG maillist - Image-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/image-sig >>>> >>>> >>>> >>> >> -- >> Wayne Watson (Watson Adventures, Prop., Nevada City, CA) >> >> (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) >> Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet >> 350 350 350 350 350 350 350 350 350 350 >> Make the number famous. See 350.org >> The major event has passed, but keep the number alive. >> >> Web Page: >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> >> > > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From Chris.Barker at noaa.gov Wed Nov 25 18:19:12 2009 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 25 Nov 2009 09:19:12 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0D599E.2010104@sbcglobal.net> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> Message-ID: <4B0D6710.3020707@noaa.gov> Wayne Watson wrote: > David, I have many video files, but only want to process them one at a > time. The format is unique, but simple. Basically, 640x480 b/w bmp > images one right after the other. In here: http://www.pythonware.com/library/pil/handbook/introduction.htm Under "image sequences" there is enough info to tell you want to do if PIL understands your format. What happens when you point PIL at the file? Does it find the first image? does it find more than one? If not, then you may need to break them apart yourself before feeding them to PIL. Also if it's as simple as a binary dump of a standard data type, then you could probably use numpy's "fromfile" to read the data in, you could then covert to a PIL image for the histogram, or just use numpy's histogram functions to compute it. You may want to post a (small) sample file here, and others can take a look if you're still confused. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From sierra_mtnview at sbcglobal.net Wed Nov 25 20:52:51 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Wed, 25 Nov 2009 11:52:51 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0D6710.3020707@noaa.gov> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> Message-ID: <4B0D8B13.9010707@sbcglobal.net> I didn't know I could post, attach I guess, here. I'll do that later. There is one puzzling format difficulty I have with the file that requires some attention. I hope to have that cleared up in the next hour or two. Actually, there's a twist in the format that should be mentioned. The first image (frame) is 640x480, and I'm pretty sure one byte per pixel. However, every other image (frame) after that is 128 pixels square. An auxiliary text file provides where, x and y pixel position, the small image should be pasted to form a complete image with the 640x480 frame. However, if one can get as far as simply displaying the first frame and then the following smaller frames, I think that would be quite sufficient for starters. Yes, I've made some "touchdowns" before on the link you provided earlier this year. I do need to fiddle with PIL again to get some semblance of an idea how to use. Christopher Barker wrote: > Wayne Watson wrote: >> David, I have many video files, but only want to process them one at >> a time. The format is unique, but simple. Basically, 640x480 b/w bmp >> images one right after the other. > > In here: > > http://www.pythonware.com/library/pil/handbook/introduction.htm > > Under "image sequences" there is enough info to tell you want to do if > PIL understands your format. > > > What happens when you point PIL at the file? Does it find the first > image? does it find more than one? If not, then you may need to break > them apart yourself before feeding them to PIL. > > > Also if it's as simple as a binary dump of a standard data type, then > you could probably use numpy's "fromfile" to read the data in, you > could then covert to a PIL image for the histogram, or just use > numpy's histogram functions to compute it. > > You may want to post a (small) sample file here, and others can take a > look if you're still confused. > > -Chris > > > > > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From Chris.Barker at noaa.gov Wed Nov 25 22:57:04 2009 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 25 Nov 2009 13:57:04 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0D8B13.9010707@sbcglobal.net> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> Message-ID: <4B0DA830.3060306@noaa.gov> Wayne Watson wrote: > I didn't know I could post, attach I guess, here. I'll do that later. as long as it's a small file -- it can be much easier to help > There is one puzzling format difficulty I have with the file that > requires some attention. I hope to have that cleared up in the next hour > or two. Actually, there's a twist in the format that should be > mentioned. The first image (frame) is 640x480, and I'm pretty sure one > byte per pixel. However, every other image (frame) after that is 128 > pixels square. An auxiliary text file provides where, x and y pixel > position, the small image should be pasted to form a complete image with > the 640x480 frame. Maybe it's because I"m more familiar with numpy than PIL, but this is how I'd do that (untested, of course...): import numpy as np infile = file('filename') img = np.fromfile(infile, count=640*480, dtype=np.uint8) for i in range(num_images): do_something small_image = np.fromfile(infile, count=128*128, dtype=np.uint8) img[x:x+128, y:y+128] = small_image .... NOTE: np.histogram2d might do what you want for the histogram I'm sure you can do somethign similar directly with PIL. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From janssen at parc.com Thu Nov 26 03:05:24 2009 From: janssen at parc.com (Bill Janssen) Date: Wed, 25 Nov 2009 18:05:24 PST Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0D8B13.9010707@sbcglobal.net> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> Message-ID: <91172.1259201124@parc.com> Another good option is pyglet. I use it for converting video to streams of PIL images. Here's the code for turning a pyglet image into a PIL image: def pyglet_to_pil_image (pyglet_image): image = pyglet_image.get_image_data() format = image.format if format != 'RGB': # Only save in RGB or RGBA formats. format = 'RGBA' pitch = -(image.width * len(format)) # Note: Don't try and use frombuffer(..); different versions of # PIL will orient the image differently. pil_image = Image.fromstring( format, (image.width, image.height), image.get_data(format, pitch)) # need to flip the image to accommodate Pyglet's transform space pil_image = pil_image.transpose(Image.FLIP_TOP_BOTTOM) return pil_image This code is part of extensions/video.py, part of the UpLib source code at http://uplib.parc.com/. Bill From fredrik at pythonware.com Thu Nov 26 09:37:04 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 26 Nov 2009 09:37:04 +0100 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <91172.1259201124@parc.com> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> <91172.1259201124@parc.com> Message-ID: <368a5cd50911260037v7a64ecc2m9093bcf581454fc2@mail.gmail.com> On Thu, Nov 26, 2009 at 3:05 AM, Bill Janssen wrote: > ? ? ? ?# Note: Don't try and use frombuffer(..); different versions of > ? ? ? ?# PIL will orient the image differently. > ? ? ? ?pil_image = Image.fromstring( > ? ? ? ? ? ?format, (image.width, image.height), image.get_data(format, pitch)) frombuffer interprets the default decoder settings differently from fromstring; this is being fixed long-term, but as mentioned in the documentation, you can do it portably by spelling out the decoder arguments: im = Image.frombuffer(mode, size, data, "raw", mode, 0, 1) (1.1.7 will also warn you if you call it without the last four arguments). From sierra_mtnview at sbcglobal.net Thu Nov 26 15:44:52 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Thu, 26 Nov 2009 06:44:52 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0DA830.3060306@noaa.gov> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> <4B0DA830.3060306@noaa.gov> Message-ID: <4B0E9464.1020607@sbcglobal.net> Thanks. Unfortunately, the fellow that can answer my question left early yesterday, so I won't know exactly the file's structure until Monday. Christopher Barker wrote: > Wayne Watson wrote: >> I didn't know I could post, attach I guess, here. I'll do that later. > > as long as it's a small file -- it can be much easier to help > >> There is one puzzling format difficulty I have with the file that >> requires some attention. I hope to have that cleared up in the next >> hour or two. Actually, there's a twist in the format that should be >> mentioned. The first image (frame) is 640x480, and I'm pretty sure >> one byte per pixel. However, every other image (frame) after that is >> 128 pixels square. An auxiliary text file provides where, x and y >> pixel position, the small image should be pasted to form a complete >> image with the 640x480 frame. > > Maybe it's because I"m more familiar with numpy than PIL, but this is > how I'd do that (untested, of course...): > > import numpy as np > > infile = file('filename') > > img = np.fromfile(infile, count=640*480, dtype=np.uint8) > > > for i in range(num_images): > do_something > small_image = np.fromfile(infile, count=128*128, dtype=np.uint8) > img[x:x+128, y:y+128] = small_image > .... > > NOTE: np.histogram2d might do what you want for the histogram > > > I'm sure you can do somethign similar directly with PIL. > > -Chris > > > > > > > > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From sierra_mtnview at sbcglobal.net Thu Nov 26 15:45:30 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Thu, 26 Nov 2009 06:45:30 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <91172.1259201124@parc.com> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> <91172.1259201124@parc.com> Message-ID: <4B0E948A.8090404@sbcglobal.net> Thanks. I'll try to follow up on this soon. Bill Janssen wrote: > Another good option is pyglet. I use it for converting video to streams > of PIL images. > > Here's the code for turning a pyglet image into a PIL image: > > def pyglet_to_pil_image (pyglet_image): > image = pyglet_image.get_image_data() > format = image.format > if format != 'RGB': > # Only save in RGB or RGBA formats. > format = 'RGBA' > pitch = -(image.width * len(format)) > > # Note: Don't try and use frombuffer(..); different versions of > # PIL will orient the image differently. > pil_image = Image.fromstring( > format, (image.width, image.height), image.get_data(format, pitch)) > # need to flip the image to accommodate Pyglet's transform space > pil_image = pil_image.transpose(Image.FLIP_TOP_BOTTOM) > return pil_image > > This code is part of extensions/video.py, part of the UpLib source code > at http://uplib.parc.com/. > > Bill > > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet 350 350 350 350 350 350 350 350 350 350 Make the number famous. See 350.org The major event has passed, but keep the number alive. Web Page: From msoulier at digitaltorque.ca Thu Nov 26 15:57:35 2009 From: msoulier at digitaltorque.ca (Michael P. Soulier) Date: Thu, 26 Nov 2009 09:57:35 -0500 Subject: [Image-SIG] had to hack setup.py to find tk.h Message-ID: <20091126145734.GK95848@kanga.digitaltorque.ca> Hi, I'm on an Ubuntu system and I had to add this to setup.py to get PIL to build with the Tk extension. add_directory(include_dirs, "/usr/include/tk") as tk.h is not in /usr/include Cheers, Mike -- Michael P. Soulier "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction." --Albert Einstein -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From fredrik at pythonware.com Thu Nov 26 17:50:25 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 26 Nov 2009 17:50:25 +0100 Subject: [Image-SIG] had to hack setup.py to find tk.h In-Reply-To: <20091126145734.GK95848@kanga.digitaltorque.ca> References: <20091126145734.GK95848@kanga.digitaltorque.ca> Message-ID: <368a5cd50911260850h7664b73dsb4224b0de7f7a19f@mail.gmail.com> Which versions of PIL and Ubuntu? (I'm pretty sure I built this successfully on 9.10.) On Thu, Nov 26, 2009 at 3:57 PM, Michael P. Soulier wrote: > Hi, > > I'm on an Ubuntu system and I had to add this to setup.py to get PIL to > build with the Tk extension. > > ?add_directory(include_dirs, "/usr/include/tk") > > as tk.h is not in /usr/include > > Cheers, > Mike > -- > Michael P. Soulier > "Any intelligent fool can make things bigger and more complex... It > takes a touch of genius - and a lot of courage to move in the opposite > direction." --Albert Einstein > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From mark.wendell at gmail.com Fri Nov 27 18:50:17 2009 From: mark.wendell at gmail.com (Mark Wendell) Date: Fri, 27 Nov 2009 10:50:17 -0700 Subject: [Image-SIG] Inverse of QUAD transform? Message-ID: The docs say that the QUAD image transform takes a quadrilateral defined by an 8-tuple, and transforms it to a rectangle of the provided 'size'. I need the inverse of that: I need to take a rectangular region, and warp it to an arbitrary quad. Is there a way to do that? thanks Mark -- -- Mark Wendell From ian at excess.org Sat Nov 28 14:44:08 2009 From: ian at excess.org (Ian Ward) Date: Sat, 28 Nov 2009 08:44:08 -0500 Subject: [Image-SIG] Problem with optimize flag and GIF encoder Message-ID: <4B112928.9080009@excess.org> Hello, I am running python 2.5 and PIL 1.1.6 on Debian Lenny, and I've found that using the optimize flag when creating GIF files can create invalid images. An example: >>> im = Image.new('RGB', (20,44)) >>> im.save('test.gif', optimize=True) >>> im2 = Image.open('test.gif') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1917, in open raise IOError("cannot identify image file") IOError: cannot identify image file >>> I came across this problem using django-filebrowser, which has optimize=True as a default for creating thumbnails of all image formats. Ian (sorry if this message gets posted twice, I'm resending 20h after my first attempt) From fredrik at pythonware.com Mon Nov 30 00:06:14 2009 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 29 Nov 2009 15:06:14 -0800 Subject: [Image-SIG] Problem with optimize flag and GIF encoder In-Reply-To: <4B112928.9080009@excess.org> References: <4B112928.9080009@excess.org> Message-ID: <368a5cd50911291506h52fe519ckdfbb9a449a913797@mail.gmail.com> Hmm. PIL doesn't officially support "optimize" for GIF files: http://effbot.org/imagingbook/format-gif.htm so maybe this is some partially implemented feature that's been hiding in there for ages. I'm not sure GIF is such a great format for thumbnails anyway; maybe the toolkit should be tweaked to render any 8-bit thumbnail as PNG instead? On Sat, Nov 28, 2009 at 5:44 AM, Ian Ward wrote: > Hello, > > I am running python 2.5 and PIL 1.1.6 on Debian Lenny, and I've found > that using the optimize flag when creating GIF files can create invalid > images. ?An example: > >>>> im = Image.new('RGB', (20,44)) >>>> im.save('test.gif', optimize=True) >>>> im2 = Image.open('test.gif') > Traceback (most recent call last): > ?File "", line 1, in > ?File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1917, in open > ? ?raise IOError("cannot identify image file") > IOError: cannot identify image file >>>> > > I came across this problem using django-filebrowser, which has > optimize=True as a default for creating thumbnails of all image formats. > > Ian > > (sorry if this message gets posted twice, I'm resending 20h after my > first attempt) > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From ian at excess.org Mon Nov 30 02:26:40 2009 From: ian at excess.org (Ian Ward) Date: Sun, 29 Nov 2009 20:26:40 -0500 Subject: [Image-SIG] Problem with optimize flag and GIF encoder In-Reply-To: <368a5cd50911291506h52fe519ckdfbb9a449a913797@mail.gmail.com> References: <4B112928.9080009@excess.org> <368a5cd50911291506h52fe519ckdfbb9a449a913797@mail.gmail.com> Message-ID: <4B131F50.4000103@excess.org> It is listed under 1.2a3/1.2b1 here: http://effbot.org/zone/pil-changes-113.htm But you're right, I might suggest they generate png thumbnails instead. Ian Fredrik Lundh wrote: > Hmm. PIL doesn't officially support "optimize" for GIF files: > > http://effbot.org/imagingbook/format-gif.htm > > so maybe this is some partially implemented feature that's been hiding > in there for ages. I'm not sure GIF is such a great format for > thumbnails anyway; maybe the toolkit should be tweaked to render any > 8-bit thumbnail as PNG instead? > > > > On Sat, Nov 28, 2009 at 5:44 AM, Ian Ward wrote: >> Hello, >> >> I am running python 2.5 and PIL 1.1.6 on Debian Lenny, and I've found >> that using the optimize flag when creating GIF files can create invalid >> images. An example: >> >>>>> im = Image.new('RGB', (20,44)) >>>>> im.save('test.gif', optimize=True) >>>>> im2 = Image.open('test.gif') >> Traceback (most recent call last): >> File "", line 1, in >> File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1917, in open >> raise IOError("cannot identify image file") >> IOError: cannot identify image file >> I came across this problem using django-filebrowser, which has >> optimize=True as a default for creating thumbnails of all image formats.. >> >> Ian >> >> (sorry if this message gets posted twice, I'm resending 20h after my >> first attempt) >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> From image-sig at richardshea.fastmail.fm Mon Nov 30 10:17:50 2009 From: image-sig at richardshea.fastmail.fm (image-sig at richardshea.fastmail.fm) Date: Mon, 30 Nov 2009 22:17:50 +1300 Subject: [Image-SIG] What's wrong with this TIF ... IOError("cannot identify image file") Message-ID: <1259572670.23148.1347619311@webmail.messagingengine.com> Hi - I have a TIF which when I am try to read it with PIL I get 'IOError("cannot identify image file")'. In it's original form PIL can read it. I then use ImageMagick to change it's colour managment from RGB to CMYK (script A at bottom of email shows the windows BAT files used). At that stage PIL won't read the output. The output of TIFFDUMP applied to that image (ZENDGraphOutput-Step1.TIF) is shown below. However I read in an earlier post (http://mail.python.org/pipermail/image-sig/2008-November/005263.html) that some TIF headers are needed by PIL which are sometimes lost by intermediate process so I used ImageMagick and TIFFSET to put them back in place (script B at bottom of email). Unfortunately even after that PIL won't read it. The output of TIFFDUMP applied to that image (ZENDGraphOutput-Step2.TIF) is also shown below. Is there anyone out there who can see why PIL is choking on this TIF ? I would be grateful for any advice. TIFFDUMP OUTPUT FOR THE FIRST FILE ================================== C:\20091130>C:\bin\installed\GnuWin32\bin\tiffdump.exe "C:\20091130\OutputImages\ZENDGraphOutput-Step1.TIF" C:\20091130\OutputImages\ZENDGraphOutput-Step1.TIF: Magic: 0x4949 Version: 0x2a Directory 0: offset 374842 (0x5b83a) next 0 (0) ImageWidth (256) SHORT (3) 1<1600> ImageLength (257) SHORT (3) 1<981> BitsPerSample (258) SHORT (3) 5<8 8 8 8 8> Compression (259) SHORT (3) 1<5> Photometric (262) SHORT (3) 1<5> FillOrder (266) SHORT (3) 1<1> DocumentName (269) ASCII (2) 84 StripOffsets (273) LONG (4) 981<8 327 646 965 1284 1603 1922 2241 2560 2879 3198 3517 3836 4155 4474 4793 5112 5431 5750 6069 6388 6707 7026 7345 ...> Orientation (274) SHORT (3) 1<1> SamplesPerPixel (277) SHORT (3) 1<5> RowsPerStrip (278) SHORT (3) 1<1> StripByteCounts (279) LONG (4) 981<319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 319 ...> XResolution (282) RATIONAL (5) 1<96> YResolution (283) RATIONAL (5) 1<96> PlanarConfig (284) SHORT (3) 1<1> ResolutionUnit (296) SHORT (3) 1<2> Software (305) ASCII (2) 58 InkSet (332) SHORT (3) 1<1> ExtraSamples (338) SHORT (3) 1<2> TIFFDUMP OUTPUT FOR THE SECOND FILE =================================== C:\20091130>C:\bin\installed\GnuWin32\bin\tiffdump.exe "C:\20091130\OutputImages\ZENDGraphOutput-Step2.TIF" C:\20091130\OutputImages\ZENDGraphOutput-Step2.TIF: Magic: 0x4949 Version: 0x2a Directory 0: offset 309338 (0x4b85a) next 0 (0) ImageWidth (256) SHORT (3) 1<1600> ImageLength (257) SHORT (3) 1<981> BitsPerSample (258) SHORT (3) 4<16 16 16 16> Compression (259) SHORT (3) 1<5> Photometric (262) SHORT (3) 1<5> FillOrder (266) SHORT (3) 1<1> DocumentName (269) ASCII (2) 84 StripOffsets (273) LONG (4) 981<8 191 374 557 740 923 1106 1289 1472 1655 1838 2021 2204 2387 2570 2753 2936 3119 3302 3485 3668 3851 4034 4217 ...> Orientation (274) SHORT (3) 1<1> SamplesPerPixel (277) SHORT (3) 1<4> RowsPerStrip (278) SHORT (3) 1<1> StripByteCounts (279) LONG (4) 981<183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 183 ...> XResolution (282) RATIONAL (5) 1<96> YResolution (283) RATIONAL (5) 1<96> PlanarConfig (284) SHORT (3) 1<1> ResolutionUnit (296) SHORT (3) 1<2> Software (305) ASCII (2) 7 InkSet (332) SHORT (3) 1<1> SCRIPT A ======== @echo off set ICCCOLPROFDIR=C:\Adobe_ICC_Profiles_bundler set IMGINPUTDIR=C:\20091130 set IMGOUTPUTDIR=C:\20091130\OutputImages set CONVERTEXE=C:\ImageMagick\convert.exe @echo off REM Convert the TIFF Produced directly from the ZendGraph output set INPUTFILE=ZENDGraphOutput.TIFF set OUTPUTFILE=ZENDGraphOutput-Step1.TIF @echo on %CONVERTEXE% %IMGINPUTDIR%\%INPUTFILE% +profile icc -profile %ICCCOLPROFDIR%\RGBProfiles\AdobeRGB1998.icc -profile %ICCCOLPROFDIR%\CMYKProfiles\USWebCoatedSWOP.icc -strip %IMGOUTPUTDIR%\%OUTPUTFILE% @echo off SCRIPT B ======== @echo off set CONVERTEXE=C:\ImageMagick\convert.exe set IMGDIR=C:\20091130\OutputImages set TIFFSETEXE=C:\bin\installed\GnuWin32\bin\tiffset.exe @echo off REM Convert the TIFF Produced directly from the ZendGraph output set INPUTFILE=ZENDGraphOutput-Step1.TIF set INTERMEDIATEFILE=ZENDGraphOutput-Step2.TIF @echo on %CONVERTEXE% %IMGDIR%\%INPUTFILE% -flatten +matte %IMGDIR%\%INTERMEDIATEFILE% @echo off %TIFFSETEXE% -s 305 Banana %IMGDIR%\%INTERMEDIATEFILE% %TIFFSETEXE% -s 296 2 %IMGDIR%\%INTERMEDIATEFILE% %TIFFSETEXE% -s 282 96 %IMGDIR%\%INTERMEDIATEFILE% %TIFFSETEXE% -s 283 96 %IMGDIR%\%INTERMEDIATEFILE% @echo off From lists+Image_SIG at hoech.org Mon Nov 30 14:14:19 2009 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Mon, 30 Nov 2009 14:14:19 +0100 Subject: [Image-SIG] What's wrong with this TIF ... IOError("cannot identify image file") In-Reply-To: <1259572670.23148.1347619311@webmail.messagingengine.com> References: <1259572670.23148.1347619311@webmail.messagingengine.com> Message-ID: <4B13C52B.1050104@hoech.org> Hi, it has nothing to do with missing TIFF headers. > TIFFDUMP OUTPUT FOR THE SECOND FILE > =================================== > BitsPerSample (258) SHORT (3) 4<16 16 16 16> PIL can't process 16-bit/channel images. You can use -depth 8 option in your ImageMagick commandline to force 8-bit/channel output (as the original image is also 8-bit, I assume you use the Q16 version of ImageMagick which always converts to 16-bit for supported fileformats on output if you don't tell it otherwise). Regards, Florian H?ch From sierra_mtnview at sbcglobal.net Mon Nov 30 19:51:14 2009 From: sierra_mtnview at sbcglobal.net (Wayne Watson) Date: Mon, 30 Nov 2009 10:51:14 -0800 Subject: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped In-Reply-To: <4B0E948A.8090404@sbcglobal.net> References: <4B0C8F6D.6020409@sbcglobal.net> <22b0f40d0911242110i43dc56fdle619284b7434e51b@mail.gmail.com> <4B0D50F0.7090409@sbcglobal.net> <22b0f40d0911250804l2dd17af4j8530c70b851e983b@mail.gmail.com> <4B0D599E.2010104@sbcglobal.net> <4B0D6710.3020707@noaa.gov> <4B0D8B13.9010707@sbcglobal.net> <91172.1259201124@parc.com> <4B0E948A.8090404@sbcglobal.net> Message-ID: <4B141422.4040507@sbcglobal.net> I now have a detailed description of the file, but the smallest file I can find is 1.7M. I don't think I can go lower. It probably contains 90 128x128 frames plus the 640x480. I suppose if there's some tool in Win, I could just cut it at some place to shorten it. Tomorrow I'm going out of town, but should be on the web mail. I'll have my laptop, and many of these files are on it, so I might be able to do some work on this. Wayne Watson wrote: > Thanks. I'll try to follow up on this soon. > > Bill Janssen wrote: >> Another good option is pyglet. I use it for converting video to streams >> of PIL images. >> >> Here's the code for turning a pyglet image into a PIL image: >> >> def pyglet_to_pil_image (pyglet_image): >> image = pyglet_image.get_image_data() >> format = image.format >> if format != 'RGB': >> # Only save in RGB or RGBA formats. >> format = 'RGBA' >> pitch = -(image.width * len(format)) >> >> # Note: Don't try and use frombuffer(..); different versions of >> # PIL will orient the image differently. >> pil_image = Image.fromstring( >> format, (image.width, image.height), >> image.get_data(format, pitch)) >> # need to flip the image to accommodate Pyglet's transform space >> pil_image = pil_image.transpose(Image.FLIP_TOP_BOTTOM) >> return pil_image >> >> This code is part of extensions/video.py, part of the UpLib source code >> at http://uplib.parc.com/. >> >> Bill >> >> > -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39? 15' 7" N, 121? 2' 32" W, 2700 feet The popular press and many authorities believe the number of pedifiles that prowl the web is 50,00. There are no figures that support this. The number of children below 18 years of age kidnapped by strangers is 1 in 600,00, or 115 per year. -- The Science of Fear by D. Gardner Web Page: From ivangermes at gmail.com Fri Nov 27 15:59:23 2009 From: ivangermes at gmail.com (Ivan Elchin) Date: Fri, 27 Nov 2009 17:59:23 +0300 Subject: [Image-SIG] resizing an image with alphachannel: dirty edges In-Reply-To: References: Message-ID: Thank you! It's works fine! 2009/11/20 Alexey Borzenkov > On Thu, Nov 12, 2009 at 3:59 PM, Ivan Elchin wrote: > > I have a problem, when i resizing an image with alphachannel. > > You can try converting your image to RGBa (premultiplied alpha), > resizing it, then converting back to RGBA. The problem here is that > there are dirty pixels with 0 alpha, and they get interpolated like > everything else. On my PIL this works: > > from PIL import Image > > im = Image.open("sega.png") > im = im.convert("RGBa") > > cur_width, cur_height = im.size > new_width, new_height = (200, 200) > > if not new_width == 0 and not new_height == 0: > ratio = min(float(new_width)/cur_width, > float(new_height)/cur_height) > else: > if new_width == 0: > ratio = float(new_height)/cur_height > else: > ratio = float(new_width)/cur_width > > > new_dimensions = (int(round(cur_width*ratio)), > int(round(cur_height*ratio))) > > new_im = im.resize(new_dimensions, Image.ANTIALIAS) > new_im = new_im.convert("RGBA") > > new_im.save('rez.png') > > Though my PIL has many modifications, I'm not sure if RGBA->RGBa->RGBA > is implemented in vanilla 1.1.6. (after checking) Ah, yes, it's not. > Though you can try recompiling PIL with this patch: > > http://git.kitsu.ru/patched/pil.git?a=commitdiff;h=b8f1c572430b06b5d4294fb2bf29327275120554 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ian at excess.org Fri Nov 27 17:34:04 2009 From: ian at excess.org (Ian Ward) Date: Fri, 27 Nov 2009 11:34:04 -0500 Subject: [Image-SIG] Problem with optimize flag and GIF encoder Message-ID: <4B0FFF7C.6000906@excess.org> Hello, I am running python 2.5 and PIL 1.1.6 on Debian Lenny, and I've found that using the optimize flag when creating GIF files can create invalid images. An example: >>> im = Image.new('RGB', (20,44)) >>> im.save('test.gif', optimize=True) >>> im2 = Image.open('test.gif') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1917, in open raise IOError("cannot identify image file") IOError: cannot identify image file >>> I came across this problem using django-filebrowser, which has optimize=True as a default for creating thumbnails of all image formats. Ian From cannon.el at gmail.com Fri Nov 27 20:48:18 2009 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Fri, 27 Nov 2009 11:48:18 -0800 Subject: [Image-SIG] Fwd: Inverse of QUAD transform? In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Laura & Edward Cannon Date: Fri, Nov 27, 2009 at 11:48 AM Subject: Re: [Image-SIG] Inverse of QUAD transform? To: Mark Wendell there is a (undocumented) perspective method that might do what you want. as I recall http://mail.python.org/pipermail/image-sig/2005-February/003198.html is the documentation. There is not an anti-quad however. On Fri, Nov 27, 2009 at 9:50 AM, Mark Wendell wrote: > The docs say that the QUAD image transform takes a quadrilateral > defined by an 8-tuple, and transforms it to a rectangle of the > provided 'size'. > > I need the inverse of that: I need to take a rectangular region, and > warp it to an arbitrary quad. Is there a way to do that? > > thanks > Mark > -- > -- > Mark Wendell > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig >