From hquan at purdue.edu Wed Nov 2 04:36:47 2011 From: hquan at purdue.edu (hquan at purdue.edu) Date: Tue, 1 Nov 2011 20:36:47 -0700 Subject: [Image-SIG] patch request Message-ID: <2D215AD71F1540A394C8637273095B26@NapPC> Hi, This may be a duplicated because I can't find previous email in archive. I guess I found a bug in _image.c. CObject is already deprecated and Capsules should be used. It seems in Python 3.2.2 CObject is removed. The attachment is the diff file for this. Hope this is helpful. In case attachment is filtered out, I attach the diff file at the end. Thanks, Heran =============== diff -r cd403356263f _imaging.c --- a/_imaging.c Tue Jun 28 11:51:48 2011 +0200 +++ b/_imaging.c Sun Oct 30 00:14:28 2011 -0700 @@ -3083,7 +3083,7 @@ if (strcmp(name, "id") == 0) return PyLong_FromLong((long) self->image); if (strcmp(name, "ptr") == 0) - return PyCObject_FromVoidPtrAndDesc(self->image, IMAGING_MAGIC, NULL); + return PyCapsule_New(self->image, IMAGING_MAGIC, NULL); return PyObject_GenericGetAttr((PyObject*) self, nameobj); } =============== From anu.mathew.varghese1786 at gmail.com Wed Nov 2 08:05:58 2011 From: anu.mathew.varghese1786 at gmail.com (Anu Varghese) Date: Wed, 2 Nov 2011 12:35:58 +0530 Subject: [Image-SIG] Written a patch for PIL for windows Message-ID: Hi Floks, I have written a patch of PIL for windows. Currently Ghostscript processing support is for linux. Please have a look on the attached patch. Regards, Anu Mathew Varghese 9960597882 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EpsImagePlugin.py Type: text/x-python Size: 9758 bytes Desc: not available URL: From andrewsautter at gmail.com Wed Nov 2 18:57:54 2011 From: andrewsautter at gmail.com (Andrew Sautter) Date: Wed, 2 Nov 2011 13:57:54 -0400 Subject: [Image-SIG] PIL for python 2.7 Message-ID: I have a 64-bit version of python 2.7.2 installed on my computer but it does not have a graphics library, when I try to install PIL it says that I do not have python 2.7 in the registry, how do it fix this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From virtue at rocketmonkeys.com Wed Nov 2 19:42:43 2011 From: virtue at rocketmonkeys.com (James) Date: Wed, 2 Nov 2011 14:42:43 -0400 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? In-Reply-To: References: Message-ID: AFAIK, ImageDraw is a raster-based library, not object or vector based. So I don't think any objects are kept around, and changes simply happen to a buffer. I could be wrong. That's not to say there aren't other performance issues to watch out for. But I don't imagine that simply drawing a ton of shapes will overload memory in ImageDraw like it would in a lib that saves object information. -James From edward at unicornschool.org Wed Nov 2 21:35:18 2011 From: edward at unicornschool.org (Edward Cannon) Date: Wed, 2 Nov 2011 13:35:18 -0700 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? In-Reply-To: References: Message-ID: I have written code that draws maybe 10K objects (circles) on a single canvas. No real performance issues there at all, at least not in regards to memory. The bottleneck in my program was another part of the code, not drawing the shapes so I can't be positive that it is not slow to draw, but it didn't seem so to me. On Wed, Nov 2, 2011 at 11:42 AM, James wrote: > AFAIK, ImageDraw is a raster-based library, not object or vector > based. ?So I don't think any objects are kept around, and changes > simply happen to a buffer. ?I could be wrong. > > That's not to say there aren't other performance issues to watch out > for. ?But I don't imagine that simply drawing a ton of shapes will > overload memory in ImageDraw like it would in a lib that saves object > information. > > -James > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From Chris.Barker at noaa.gov Wed Nov 2 22:48:12 2011 From: Chris.Barker at noaa.gov (Chris.Barker) Date: Wed, 02 Nov 2011 14:48:12 -0700 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? In-Reply-To: References: Message-ID: <4EB1BA9C.5090202@noaa.gov> On 10/26/11 2:49 PM, Jeff Brantley wrote: > I am working on code to draw tens or hundreds of thousands of squares > and connecting lines using the tkinter canvas, and it is incredibly slow > because, as I understand it, the canvas keeps the individual shape > objects around in memory and tests for the current visible bounding box > to touch them, and redraws them. That may or not be why it's slow... > I am wondering whether PIL's ImageDraw module behaves in this manner, or > whether it instead just paints the shapes onto a raw pixel buffer, > effectively "staining" the pixels, rather than holding onto thousands of > identical objects. you are right -- PIL just does the drawing, and is not any kind of object canvas. >I assume that this would be much faster if it is the > case. perhaps, and perhaps not. Keeping the objects around per-se isn't necessarily a slow process. But certainly PIL's drawing is simpler. I've found PIL drawing to be pretty slow, but for your use case, it may well be fine. For higher quality, you may want to look into Agg-draw: http://effbot.org/zone/pythondoc-aggdraw.htm I don't know if it's been rolled into PIL or not. Do you need a GUI of some sort? or are you just drawing an image to save to a file or something? -Chris > Thanks for your help, > Jeff > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- 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 mit at mitayai.org Wed Nov 2 20:12:28 2011 From: mit at mitayai.org (Mitayai) Date: Wed, 2 Nov 2011 15:12:28 -0400 Subject: [Image-SIG] PIL for python 2.7 In-Reply-To: References: Message-ID: Can you repost to the list with details about your system's operating system and whatever relevant details you know about your python installation and, most importantly, how you were trying to install PIL when it failed (and maybe the error messages)? If this is a UNIX-type machine (like a mac, linux, freebsd, etc) the following may help you gather some info: root at xxx:/var/log/varnish# uname -a Linux xxx 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux root at cxxx:/var/log/varnish# which python /usr/local/bin/python root at xxx:/var/log/varnish# python -V Python 2.6.5 or, just on the off-chance this works for you... have you tried "easy_install"? it worked on my brand-new Mac out-of-the-box... mitmac:~ mitayai$ sudo easy_install PIL Password: Searching for PIL Best match: PIL 1.1.7 Processing PIL-1.1.7-py2.7-macosx-10.7-intel.egg [etc] On Wed, Nov 2, 2011 at 1:57 PM, Andrew Sautter wrote: > I have a 64-bit version of python 2.7.2 installed on my computer but it > does not have a graphics library, when I try to install PIL it says that I > do not have python 2.7 in the registry, how do it fix this? > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -- Mit Rowe Stagename, Inc. http://www.stagename.com mit at stagename.com Office: +1-866-326-3098xt102 Mobile: +1-416-219-2512 Fax: +1-416-533-3480 1 Atlantic Avenue, Suite 107 / Toronto, ON M6K 3E7 / Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsbmsu at gmail.com Wed Nov 2 22:17:18 2011 From: jsbmsu at gmail.com (Jeff Brantley) Date: Wed, 2 Nov 2011 17:17:18 -0400 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? In-Reply-To: References: Message-ID: Thank you both for the feedback. In the meantime, I made some major changes to my drawing algorithm that resulted in about a 20X reduction in width and probably a similar factor reduction in the number of line objects drawn. Now the tk canvas performance problems are virtually gone, so it seems I can continue prototyping with it. But it is nice to know in future if the drawing size scales up again by an order of magnitude, that ImageDraw may be the answer. Thanks again, Jeff On Wed, Nov 2, 2011 at 4:35 PM, Edward Cannon wrote: > I have written code that draws maybe 10K objects (circles) on a single > canvas. No real performance issues there at all, at least not in > regards to memory. The bottleneck in my program was another part of > the code, not drawing the shapes so I can't be positive that it is not > slow to draw, but it didn't seem so to me. > > On Wed, Nov 2, 2011 at 11:42 AM, James wrote: > > AFAIK, ImageDraw is a raster-based library, not object or vector > > based. So I don't think any objects are kept around, and changes > > simply happen to a buffer. I could be wrong. > > > > That's not to say there aren't other performance issues to watch out > > for. But I don't imagine that simply drawing a ton of shapes will > > overload memory in ImageDraw like it would in a lib that saves object > > information. > > > > -James > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlie.clark at clark-consulting.eu Thu Nov 3 10:06:08 2011 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Thu, 03 Nov 2011 10:06:08 +0100 Subject: [Image-SIG] PIL for python 2.7 In-Reply-To: References: Message-ID: Am 02.11.2011, 18:57 Uhr, schrieb Andrew Sautter : > I have a 64-bit version of python 2.7.2 installed on my computer but it > does not have a graphics library, when I try to install PIL it says that > I > do not have python 2.7 in the registry, how do it fix this? Hi Andrew, it sounds like you need the 64-bit Windows binaries. Microsoft makes life difficult by not providing a compiler with their operating system. Fortunately, Chris Gohlke maintains a large library of Windows binaries of Python packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/ Look for "amd64" Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From Chris.Barker at noaa.gov Thu Nov 3 17:50:38 2011 From: Chris.Barker at noaa.gov (Chris.Barker) Date: Thu, 03 Nov 2011 09:50:38 -0700 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? In-Reply-To: References: Message-ID: <4EB2C65E.7050504@noaa.gov> On 11/2/11 2:17 PM, Jeff Brantley wrote: > Thank you both for the feedback. In the meantime, I made some major > changes to my drawing algorithm that resulted in about a 20X reduction > in width and probably a similar factor reduction in the number of line > objects drawn. Now the tk canvas performance problems are virtually > gone, so it seems I can continue prototyping with it. Are you using TK for a GUI here? or just for drawing? If GUI, I'd stick with it (or choose another GUI toolkit, wx drawing is pretty fast, or even openGL if you need to quickly re-draw the same stuff at different scales or views. If you're not making a GUI app and just need drawing, I'd go with a drawing API -- PIL, or maybe Kiva or Cairo or something. -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 anu.varghese1786 at gmail.com Mon Nov 7 08:18:00 2011 From: anu.varghese1786 at gmail.com (Anu Varghese) Date: Mon, 7 Nov 2011 12:48:00 +0530 Subject: [Image-SIG] I have written a patch for ghostscript(postscript converion for windows) In-Reply-To: References: Message-ID: Hi, Currently Python PIL in linux supports postscript conversion using ghostscript. EpsImageplugin is written for linux ghostscript. I have modified EpsImagePlugin for PIL which supports postscript conversion using ghostscript in windows. Regards, Anu Mathew Varghese -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EpsImagePlugin.py Type: text/x-python Size: 9758 bytes Desc: not available URL: From tiit at sympatico.ca Tue Nov 8 19:41:15 2011 From: tiit at sympatico.ca (Etienne Desautels) Date: Tue, 8 Nov 2011 13:41:15 -0500 Subject: [Image-SIG] New feature added - need code review Message-ID: Hi, I added an option to specify/keep quantization tables when saving to JPEG. My motivation was that the libjpeg default quantization are far from ideal in many scenarios. When specifying custom quantization tables it's possible to get better results for the same file size. Another motivation is to save the image with the same compression (quantization tables + subsampling) as the original, loosing less quality as possible. I added a few things to facilitate that. For example you can pass "keep" to the quality arg to keep the same compression quality (it will keep the same quantization table and subsampling). I also added some default quantization tables corresponding to some Photoshop default. So you can pass "web_high" to the quality arg and the image will be save with the same quantization tables and subsambling of what Photoshop will have used for this settings. It's easy to add more presets like that. Unfortunately I'm far from a C expert. My last and only experience is 10 years away and it was just a little bit more then an Hello world. So, I'll be really glad if someone with more knowledge could review my code. I tested the code on converting a big batch (~4000) of TIFF to JPEG in to 2 different resolutions and qualities. It works pretty well and my code didn't look to leak any memory. A few notes: - I'm validating tables data in both C and Python. Not sure it's needed and, if not, what's the best way to do it? - Really not sure about all the pointer stuff. - Really not sure about DECREF and Error. Feel free to comment on anything (ex.: if you think to pass "keep" as value to quality arg is bad, etc.). Here's the code: https://bitbucket.org/etienned/pil-2009-raclette Regards From jules at projectfourwinds.com Fri Nov 11 18:38:57 2011 From: jules at projectfourwinds.com (Julian Davis) Date: Fri, 11 Nov 2011 17:38:57 +0000 Subject: [Image-SIG] Installing PIL 1.1.7 for Python 2.7 for Windows 7 Message-ID: I have just downloaded and run the 1.1.7 PIL installed but it says I have no versions of Python 2.7 showing in the registry. However I do have Python installed in c:\program files\python27, and the registry contains [HKEY_LOCAL_MACHINE\SOFTWARE\Python] [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore] [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7] [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help] [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help\Main Python Documentation] @="C:\\Program Files\\Python27\\Doc\\python272.chm" [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath] @="C:\\Program Files\\Python27\\" [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup] @="Python 2.7" [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Modules] [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath] @="C:\\Program Files\\Python27\\Lib;C:\\Program Files\\Python27\\DLLs;C:\\Program Files\\Python27\\Lib\\lib-tk" Suggestions please. Thanks Jules -------------- next part -------------- An HTML attachment was scrubbed... URL: From jules at projectfourwinds.com Fri Nov 11 19:29:05 2011 From: jules at projectfourwinds.com (Julian Davis) Date: Fri, 11 Nov 2011 18:29:05 +0000 Subject: [Image-SIG] Installing PIL 1.1.7 for Python 2.7 for Windows 7 In-Reply-To: References: Message-ID: Figured out the first problem. I had installed the 64 bit version of Python 2.7, now installed Python2.7.2 32 bit. Installed now recognises the presence of Python 2.7 but it crashes during the installation process. Another request for suggestions? Thanks Jules On 11 November 2011 17:38, Julian Davis wrote: > I have just downloaded and run the 1.1.7 PIL installed but it says I have > no versions of Python 2.7 showing in the registry. > > However I do have Python installed in c:\program files\python27, and the > registry contains > > [HKEY_LOCAL_MACHINE\SOFTWARE\Python] > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore] > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7] > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help] > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help\Main Python > Documentation] > @="C:\\Program Files\\Python27\\Doc\\python272.chm" > > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath] > @="C:\\Program Files\\Python27\\" > > > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup] > @="Python 2.7" > > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Modules] > > [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath] > @="C:\\Program Files\\Python27\\Lib;C:\\Program > Files\\Python27\\DLLs;C:\\Program Files\\Python27\\Lib\\lib-tk" > > Suggestions please. > > Thanks > > Jules > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jules at projectfourwinds.com Fri Nov 11 19:33:21 2011 From: jules at projectfourwinds.com (Julian Davis) Date: Fri, 11 Nov 2011 18:33:21 +0000 Subject: [Image-SIG] Installing PIL 1.1.7 for Python 2.7 for Windows 7 In-Reply-To: References: Message-ID: Fixed that problem too. To complete the install without a crash I right clicked on the installation exe and selected Troubleshoot Compatibility. It then told me it need to run it in XP compatibility mode which then ran fine. Thanks Jules On 11 November 2011 18:29, Julian Davis wrote: > Figured out the first problem. I had installed the 64 bit version of > Python 2.7, now installed Python2.7.2 32 bit. > > Installed now recognises the presence of Python 2.7 but it crashes during > the installation process. > > Another request for suggestions? > > Thanks > > Jules > > > On 11 November 2011 17:38, Julian Davis wrote: > >> I have just downloaded and run the 1.1.7 PIL installed but it says I have >> no versions of Python 2.7 showing in the registry. >> >> However I do have Python installed in c:\program files\python27, and the >> registry contains >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python] >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore] >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7] >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help] >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Help\Main Python >> Documentation] >> @="C:\\Program Files\\Python27\\Doc\\python272.chm" >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath] >> @="C:\\Program Files\\Python27\\" >> >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup] >> @="Python 2.7" >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\Modules] >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath] >> @="C:\\Program Files\\Python27\\Lib;C:\\Program >> Files\\Python27\\DLLs;C:\\Program Files\\Python27\\Lib\\lib-tk" >> >> Suggestions please. >> >> Thanks >> >> Jules >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brenden.brown at gmail.com Wed Nov 16 03:12:19 2011 From: brenden.brown at gmail.com (Brenden Brown) Date: Tue, 15 Nov 2011 18:12:19 -0800 Subject: [Image-SIG] Installing PIL Message-ID: Hi all, I'm trying to install PIL, and get an error "Python version 2.7 required, which was not found in the registry". What registry values do I need? I'm running Windows 7 SP1 Steps: 1) Install Python 2.7 from http://www.python.org/download/releases/2.7.2/, Windows x86 MSI Installer (2.7.2) with the following information in the installer: Author: Secret Labs AB (PythonWare) Author_email: info at pythonware.com Description: Python Imaging Library Name: PIL Url: http://www.pythonware.com/products/pil Version: 1.1.7 2) Run PIL executable from http://effbot.org/downloads/#imaging or http://www.pythonware.com/products/pil/, the 2.7 version I've verified the registry information contains what is added in the script at http://effbot.org/zone/python-register.htm: In HKLM\Software\Python\PythonCore\2.7 there is InstallPath="C:\Python27" and PythonPath="C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk" I've verified that Python 2.7 is installed to those locations. I've been learning Python starting last week, and this is the first time I've tried to install a module. I would appreciate any help in troubleshooting this error. Thanks, Brenden -------------- next part -------------- An HTML attachment was scrubbed... URL: From haineault at gmail.com Wed Nov 16 14:58:48 2011 From: haineault at gmail.com (Maxime Haineault) Date: Wed, 16 Nov 2011 08:58:48 -0500 Subject: [Image-SIG] Important bug on some 64bits distributions Message-ID: Hello, I've been dealing with an annoying bug in PIL for almost a year, so I decided to report it since it seem pretty easy to fix and I can't understand why it hasn't been addressed yet. First a little background on how it occurs. My system is running 64bit Ubuntu Desktop and the bug occurred on 10.10, 11.04 and 11.11. I use PIL in my Django projects and I use pip & virtualenv to install my python packages. On a new system installation I invariably get the same result. PIL gets compiled normally, but the package using it all breaks. A little digging shows that at compile time PIL states that Jpeg support is not available even if it is installed on the system. After a lot of trial and errors and searching in forums I found a workaround that works every time: $: sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ $: sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ $: sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ I guess I don't have much explaining to do on what's going wrong at compile time or why this problem doesn't occur on 32bits systems. Regards, -- Maxime Haineault Consultant Web / Associ? ? Motion M?dia http://motion-m.ca max at motion-m.ca (450) 747-0862 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmorris at arete.com Wed Nov 16 22:03:45 2011 From: cmorris at arete.com (Morris, Chris) Date: Wed, 16 Nov 2011 21:03:45 +0000 Subject: [Image-SIG] PIL bug Message-ID: <5265F0AE8B35AC40B6684BB2AEC4065C0E53FB3F@LA-MB1.corp.arete.com> The following code: from PIL import Image im = Image.open("img.bmp") im.show() brings up the default Windows 7 Image Viewer. The image viewer does not display the image requested, but instead displays "windows photo viewer can't open this picture because either the picture is deleted, or it's in a location that isn't available". This site: http://www.velocityreviews.com/forums/t707158-python-pil-and-vista-windows-7-show-not-working.html has an explanation for this behavior. What actually happens is that the Windows code relies on the fact that the default image viewer on Windows XP was able to work at blocking mode - this means that the command will wait until the image window will be closed. Because of that behaviour, they constructed a command line which deletes a file right after the image has been shown. Windows Vista doesn't work the same way, it immediately returns once the command has been executed, so what happens now is that the temporary file gets immediately deleted by the command line, and the image viewer doesn't have enough time to load the image before it is being deleted. Here is a quick workaround: Edit C:\Python26\lib\site-packages\PIL\ImageShow.py, and around line 99, replace with the following line: return "start /wait %s && PING 127.0.0.1 -n 5 > NUL && del /f %s" % (file, file) I would like to report this behavior as a bug. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhilash.pin2 at gmail.com Fri Nov 18 09:34:43 2011 From: abhilash.pin2 at gmail.com (=?UTF-8?B?YcOfbOC5gM6vbM6xc2zguYA=?=) Date: Fri, 18 Nov 2011 14:04:43 +0530 Subject: [Image-SIG] need pyrthon help for dpx image Message-ID: Hello, I need to check the width and height of a dpx image through python, hope PIL doesn't support dpx format. Can I get any other module or piece of code that can help me to get at least this much requirement as of now. It ll be a great help. Regards, Abhilash -- a?l??l?sl? From erlinger at mozarteum.at Fri Nov 18 18:18:36 2011 From: erlinger at mozarteum.at (Josef Erlinger) Date: Fri, 18 Nov 2011 18:18:36 +0100 Subject: [Image-SIG] conversion from .tif to .jpeg Message-ID: <4EC6936C.5080506@mozarteum.at> Hi there, I tried to convert .tif to .jpeg format, it works for most of the files but in some cases (at least one) I got this error message Error Message at opening: cannot identify image file In the folder where the corrupt .tif lies are 19 more .tif files which were made at the same time with the same tool all the other works except the special one. I am pleased for any help. Python: 2.6 PIL: 1.1.7 IDE: Eclipse Indigo Thanks in advance Joey -- -- DI Josef Erlinger IT-Systems Integrator, Software Engineer Internationale Stiftung Mozarteum Salzburg Schwarzstr. 26 5020 Salzburg, Austria T +43 (0) 662 889 40 65 F +43 (0) 662 889 40 68 E erlinger at mozarteum.at www.mozarteum.at Newsletter Stiftung Mozarteum Facebook Stiftung Mozarteum ZVR: 438729131, UID: ATU33977907 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aclark at aclark.net Mon Nov 28 15:13:20 2011 From: aclark at aclark.net (Alex Clark) Date: Mon, 28 Nov 2011 09:13:20 -0500 Subject: [Image-SIG] Important bug on some 64bits distributions In-Reply-To: References: Message-ID: On 11/16/11 8:58 AM, Maxime Haineault wrote: > Hello, > > I've been dealing with an annoying bug in PIL for almost a year, so I > decided to report it since it seem > pretty easy to fix and I can't understand why it hasn't been addressed yet. Please report it here: - https://bitbucket.org/effbot/pil-2009-raclette/issues/new > > First a little background on how it occurs. My system is running 64bit > Ubuntu Desktop and the bug occurred > on 10.10, 11.04 and 11.11. I use PIL in my Django projects and I use pip > & virtualenv to install my python packages. > > On a new system installation I invariably get the same result. PIL gets > compiled normally, but the package using it > all breaks. A little digging shows that at compile time PIL states that > Jpeg support is not available even if it is installed > on the system. > > After a lot of trial and errors and searching in forums I found a > workaround that works every time: > > $: sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ > $: sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ > $: sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ > > I guess I don't have much explaining to do on what's going wrong at > compile time or why this problem doesn't occur on > 32bits systems. You can try Pillow (PIL fork), it may be fixed there already: - http://pypi.python.org/pypi/Pillow/1.7.5 Alex > > Regards, > > -- > > Maxime Haineault > Consultant Web / Associ? > > ? Motion M?dia > http://motion-m.ca > max at motion-m.ca > (450) 747-0862 > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- Alex Clark ? http://aclark.net From aclark at aclark.net Mon Nov 28 15:18:11 2011 From: aclark at aclark.net (Alex Clark) Date: Mon, 28 Nov 2011 09:18:11 -0500 Subject: [Image-SIG] Installing PIL In-Reply-To: References: Message-ID: On 11/15/11 9:12 PM, Brenden Brown wrote: > Hi all, > > I'm trying to install PIL, and get an error "Python version 2.7 > required, which was not found in the registry". What registry values do > I need? > > I'm running Windows 7 SP1 > > Steps: > 1) Install Python 2.7 from > http://www.python.org/download/releases/2.7.2/, Windows x86 MSI > Installer (2.7.2) with the following information in the installer: > > Author: Secret Labs AB (PythonWare) > Author_email: info at pythonware.com > Description: Python Imaging Library > Name: PIL > Url: http://www.pythonware.com/products/pil > Version: 1.1.7 > > 2) Run PIL executable from http://effbot.org/downloads/#imaging or > http://www.pythonware.com/products/pil/, the 2.7 version > > I've verified the registry information contains what is added in the > script at http://effbot.org/zone/python-register.htm: > In HKLM\Software\Python\PythonCore\2.7 there is > InstallPath="C:\Python27" and > PythonPath="C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk" > > I've verified that Python 2.7 is installed to those locations. Can you try: http://pypi.python.org/packages/2.7/P/Pillow/Pillow-1.7.5-py2.7-win32.egg#md5=eaad5079b449e0024173faf1ff510372 And let me know if it works? > > I've been learning Python starting last week, and this is the first time > I've tried to install a module. I would appreciate any help in > troubleshooting this error. > > Thanks, > Brenden > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- Alex Clark ? http://pythonpackages.com From aclark at aclark.net Mon Nov 28 15:23:52 2011 From: aclark at aclark.net (Alex Clark) Date: Mon, 28 Nov 2011 09:23:52 -0500 Subject: [Image-SIG] PIL bug In-Reply-To: <5265F0AE8B35AC40B6684BB2AEC4065C0E53FB3F@LA-MB1.corp.arete.com> References: <5265F0AE8B35AC40B6684BB2AEC4065C0E53FB3F@LA-MB1.corp.arete.com> Message-ID: On 11/16/11 4:03 PM, Morris, Chris wrote: > The following code: > > from PIL import Image > > im = Image.open("img.bmp") > > im.show() > > brings up the default Windows 7 Image Viewer. The image viewer does not > display the image requested, but instead displays ?windows photo viewer > can't open this picture because either the picture is deleted, or it's > in a location that isn't available?. > > This site: > http://www.velocityreviews.com/forums/t707158-python-pil-and-vista-windows-7-show-not-working.html > has an explanation for this behavior. > > /What actually happens is that the Windows code relies on the fact that > the default image viewer on Windows XP was able to work at blocking mode > - this means that the command will wait until the image window will be > closed. Because of that behaviour, they constructed a command line which > deletes a file right after the image has been shown.// > > Windows Vista doesn't work the same way, it immediately returns once the > command has been executed, so what happens now is that the temporary > file gets immediately deleted by the command line, and the image viewer > doesn't have enough time to load the image before it is being deleted. > > Here is a quick workaround: > > Edit C:\Python26\lib\site-packages\PIL\ImageShow.py, and around line 99, > replace with the following line: > > return "start /wait %s && PING 127.0.0.1 -n 5 > NUL && del /f %s" % > (file, file)/ > > // > > // > > // > > I would like to report this behavior as a bug. Please open a ticket: - https://bitbucket.org/effbot/pil-2009-raclette/issues/new Alex > > -Chris > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- Alex Clark ? http://pythonpackages.com From cannon.el at gmail.com Thu Nov 24 19:33:29 2011 From: cannon.el at gmail.com (Edward Cannon) Date: Thu, 24 Nov 2011 10:33:29 -0800 Subject: [Image-SIG] conversion from .tif to .jpeg In-Reply-To: <4EC6936C.5080506@mozarteum.at> References: <4EC6936C.5080506@mozarteum.at> Message-ID: <08B4DDAC-2501-486E-B607-E4F260BF8F31@gmail.com> It probably means that the file is corrupt. Try opening the file with another program. On Nov 18, 2011, at 9:18 AM, Josef Erlinger wrote: > Hi there, > I tried to convert .tif to .jpeg format, it works for most of the files but in some cases (at least one) I got this error message > Error Message at opening: cannot identify image file > In the folder where the corrupt .tif lies are 19 more .tif files which were made at the same time with the same tool > all the other works except the special one. > I am pleased for any help. > > Python: 2.6 > PIL: 1.1.7 > IDE: Eclipse Indigo > > Thanks in advance > > Joey > -- > -- > DI Josef Erlinger > IT-Systems Integrator, Software Engineer > > Internationale Stiftung Mozarteum Salzburg > Schwarzstr. 26 > 5020 Salzburg, Austria > T +43 (0) 662 889 40 65 > F +43 (0) 662 889 40 68 > E erlinger at mozarteum.at > www.mozarteum.at > > Newsletter Stiftung Mozarteum > Facebook Stiftung Mozarteum > ZVR: 438729131, UID: ATU33977907 > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From vugluskr at vugluskr.org.ua Fri Nov 25 23:26:37 2011 From: vugluskr at vugluskr.org.ua (=?UTF-8?B?0JHQvtCz0YPQvSDQlNC80LjRgtGA0LjQuQ==?=) Date: Sat, 26 Nov 2011 00:26:37 +0200 Subject: [Image-SIG] Creating animated GIFs. Message-ID: <4ED0161D.2020208@vugluskr.org.ua> Hello, People. Is there a easy way to create animated GIF file from series of separated images or by modify existing animated GIF image? Only thing I have found is script images2gif.py by Almar Klein (June 2009). And some discussion about patent limitation on GIF support. Is there some technical problem to add support of animation feature inside PIL? PS Sorry for my English. -- ????? ??????? aka vugluskr From igor.e.novikov at gmail.com Tue Nov 29 01:27:22 2011 From: igor.e.novikov at gmail.com (Igor Novikov) Date: Tue, 29 Nov 2011 02:27:22 +0200 Subject: [Image-SIG] conversion from .tif to .jpeg In-Reply-To: <08B4DDAC-2501-486E-B607-E4F260BF8F31@gmail.com> References: <4EC6936C.5080506@mozarteum.at> <08B4DDAC-2501-486E-B607-E4F260BF8F31@gmail.com> Message-ID: I think that the problem cause is a CMYKA images (i.e. CMYK images with alpha channel). PIL doesn't support such image type because internal image representation is limited by four channels. And only TIFF format provides such image type. It would be interesting to know whether the PIL developers are planning to resolve this issue. It would be resolving at least as a workaround loading such images as a tuple of CMYK image and alpha channel as a separate grayscale image. This issue is highly important for our project. -- Regards, Igor Novikov sK1 Project http://sk1project.org On Thu, Nov 24, 2011 at 8:33 PM, Edward Cannon wrote: > It probably means that the file is corrupt. Try opening the file with > another program. > > > > On Nov 18, 2011, at 9:18 AM, Josef Erlinger wrote: > > Hi there, > I tried to convert .tif to .jpeg format, it works for most of the files > but in some cases (at least one) I got this error message > Error Message at opening: cannot identify image file > In the folder where the corrupt .tif lies are 19 more .tif files which > were made at the same time with the same tool > all the other works except the special one. > I am pleased for any help. > > Python: 2.6 > PIL: 1.1.7 > IDE: Eclipse Indigo > > Thanks in advance > > Joey > -- > -- > > DI Josef Erlinger > IT-Systems Integrator, Software Engineer > > Internationale Stiftung Mozarteum Salzburg > Schwarzstr. 26 > 5020 Salzburg, Austria > T +43 (0) 662 889 40 65 > F +43 (0) 662 889 40 68 > E erlinger at mozarteum.at > www.mozarteum.at > > Newsletter Stiftung Mozarteum > Facebook Stiftung Mozarteum > ZVR: 438729131, UID: ATU33977907 > > _______________________________________________ > 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: