From jlu at hep.anl.gov Sun Aug 1 02:55:46 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sat, 31 Jul 2010 19:55:46 -0500 (CDT) Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: Actually, I did in what I tried to run. What I posted was a verbatim copy from your e-mail. But I'm getting an invalid syntax exception at a different place, as follows: _________________________________________ import wx class PicWin(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, "Window. Title", size=(200,200), pos =(50,50), style = wx.DEFAULT_FRAME_STYLE) panel = wx.Panel(self, -1) bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() self.mainPic=wx.StaticBitmap(panel, -1, bmp) self.Show() app = wx.App(redirect=0) PicWin(None, -1) app.Mainloop0() ____________________________________ The error is marked (it doesn't show on the e-mail) on the "self" in the "self.mainPic" line. I've no idea what the problem is. 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 Fri, 30 Jul 2010, Alec Bennett wrote: > You didn't delete the periods that I put in to simulate indentations. > > > > On Fri, Jul 30, 2010 at 9:06 AM, donn wrote: > >> On 30/07/2010 17:48, Jack Uretsky wrote: >> >>> def__init__(self, parent, id): >>> ^ >>> SyntaxError: invalid syntax >>> >> I imagine the spacing in the email was not preserved, but even so, Python >> is giving you a little arrow "^" to go look at.... >> >> def, SPACE, dunder-init... etc. >> def __init... >> >> >> \d >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> > From adys.wh at gmail.com Sun Aug 1 03:31:00 2010 From: adys.wh at gmail.com (Jerome Leclanche) Date: Sun, 1 Aug 2010 02:31:00 +0100 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: [To the whole list this time, again, for good. Really sorry for the spam Daniel.] Semi-related brain dump. It's indeed unclear which issues Pillow is trying to solve, but PIL has indeed an extremely high amount of them. First of all, one that bugged me for ever now, is the extremely poor exception model. PIL arbitrarily catching SyntaxError, ValueError and TypeError makes debugging extremely hard. Having to raise SyntaxError (rather than a proper pil.BadFormat exception or something) is terrible. I can't count the times where this bit me. Second issue I have with PIL is its architecture. It's hard to globally register custom format plugins, for example. A global architecture redesign is something I'd love to discuss for hours, but it would break every possible bit of backwards compatibility to get something truly good out of it. I'm totally not putting the blame on PIL on this one, python project plugins are hard to write sanely in general. Although the "PIL" and "Image*" packages themselves do not respect python standards (should be from imaging import .., or something alike). I have many other minor issues with PIL (with drawing, cutting/pasting, so on), but nothing else worth forking on. But those two are extreme. On the wishlist as well is a more open development process. PIL is a very widely used library, yet its development is very obscure. There is no online version control or commit log, so on (or at least, not indicated anywhere). J. Leclanche / Adys From barthelemy at crans.org Sun Aug 1 09:25:20 2010 From: barthelemy at crans.org (=?ISO-8859-1?Q?S=E9bastien_Barth=E9lemy?=) Date: Sun, 1 Aug 2010 09:25:20 +0200 Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: On Sun, Aug 1, 2010 at 2:55 AM, Jack Uretsky wrote: > ? ? ? ?Actually, I did in what I tried to run. ?What I posted was a verbatim > copy from your e-mail. > But I'm getting an invalid syntax exception at a > different place, as follows: > _________________________________________ > import wx > > class PicWin(wx.Frame): > ? ? ? ?def __init__(self, parent, id): > ? ? ? ? ? ? ? ?wx.Frame.__init__(self, parent, id, "Window. Title", > size=(200,200), pos > =(50,50), style = wx.DEFAULT_FRAME_STYLE) > ? ? ? ? ? ? ? ?panel = wx.Panel(self, -1) > ? ? ? ? ? ? ? ?bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() the left parenthesis is not closed. From fredrik at pythonware.com Sun Aug 1 12:51:25 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 12:51:25 +0200 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: 2010/8/1 Jerome Leclanche : > Although the "PIL" and "Image*" packages themselves do not > respect python standards (should be from imaging import .., or > something alike). If you had been paying attention, you'd noticed that "python standards" change all the time, depend on what the latest minibosses think (suggestion: look up old versions of PEP 8 before you post stuff about how others ignore the "standards"). From fredrik at pythonware.com Sun Aug 1 13:04:48 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 13:04:48 +0200 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: 2010/7/31 Daniel Fetchinson : >> I have been wanting to tackle this for sometime, and finally got around to >> it tonight. I've created a "friendly" fork of PIL called "Pillow": >> http://pypi.python.org/pypi/Pillow/1.0 >> >> Some background: I've been doing Plone development for the past 5 years or >> so, and PIL has always "been an issue". I won't get into what the issues are >> now, but I assume folks know them. > > Well, I actually don't know what the "issues" are, but am very > interested in hearing them! Plone exists in the Zope universe, not the Python universe, which is an issue in itself. In this case, I think the actual "issue" is that Zope uses its own build system that's puts specific requirements on the distutils packaging; requirements that are not compatible with PIL's setup file. Instead of just sit down and contribute a patch like everyone else would have done, they've spent a couple of years ranting on their own mailing lists and occasionally sending me nastygrams (including writing reviews on PyPI telling people to stay away from the software because if it's not convenient to use with a package system you invented yourself, it's worthless for everyone). At least a packaging fork means that someone's over there is producing something more than invectives, but I'd still prefer a patch. From fredrik at pythonware.com Sun Aug 1 13:08:30 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 13:08:30 +0200 Subject: [Image-SIG] bug in docs for Image.rotate() In-Reply-To: <63801.1279820833@parc.com> References: <63801.1279820833@parc.com> Message-ID: 2010/7/22 Bill Janssen : > Hmmm, the docs say that Image.rotate() has a "filter" keyword arg, but > the code says that it's really "resample". ?Note that the docstring in > the code is wrong, too. ?This is 1.1.6 I'm looking at. Sounds like the good old "named positional arguments" vs "keyword arguments" issue. I'll take a look. From fredrik at pythonware.com Sun Aug 1 13:12:09 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 13:12:09 +0200 Subject: [Image-SIG] IOError("cannot identify image file") In-Reply-To: References: Message-ID: 2010/7/14 Steve McFarlin : > I can not seem to figure out why I am getting the cannot identify image file error. The image in question is a PNG. This PNG file can be loaded by PIL on another system. The PIL tests passed when installing. Is there something I there a common place to look too for why the image could not be identified. The most common cause of this problem is that you've ended up with multiple copies of the library, and your program isn't picking up the PIL version you just built. Try doing "import _imaging; print _imaging.__file__" in your program to see what version it picks up. > -------------------------------------------------------------------- > PIL 1.1.7 SETUP SUMMARY > -------------------------------------------------------------------- > version ? ? ? 1.1.7 > platform ? ? ?linux2 2.6.5 (r265:79063, Jul 13 2010, 18:43:16) > ? ? ? ? ? ? ?[GCC 4.3.2] > -------------------------------------------------------------------- > *** TKINTER support not available > --- JPEG support available > --- ZLIB (PNG/ZIP) support available > --- FREETYPE2 support available > *** LITTLECMS support not available > -------------------------------------------------------------------- > > -------------------------------------------------------------------- > PIL 1.1.7 TEST SUMMARY > -------------------------------------------------------------------- > Python modules loaded from ./PIL > Binary modules loaded from ./PIL > -------------------------------------------------------------------- > --- PIL CORE support ok > *** TKINTER support not installed > --- JPEG support ok > --- ZLIB (PNG/ZIP) support ok > --- FREETYPE2 support ok > *** LITTLECMS support not installed > -------------------------------------------------------------------- > Running selftest: > --- 57 tests passed. > > > Thanks, > Steve > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From fredrik at pythonware.com Sun Aug 1 13:14:24 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 13:14:24 +0200 Subject: [Image-SIG] PIL: TIFF images loaded as 16 bit signed integers In-Reply-To: References: Message-ID: 2010/7/6 Chris Mitchell : > I'm running into a problem where my image intensities are being loaded > as 16 bit signed integers. ?The code I'm using to open the tiff file > is: > > im = Image.open(file) > self.pixels = np.array([im.getdata()], np.uint16) > > the filetype is a 16bit TIFF, whose intensities load fine into ImageJ. > ?I load their intensities into a numpy 16bit array, and for the time > being I've fixed this problem with this code: > > np.where(self.pixels<0, -1*self.pixels+(32768+self.pixels),self.pixels) > > That basically takes any negative values and compensates for the > rollover. ?Does anyone have any idea why PIL is loading my TIFF files > as signed integers? Could be that something goes wrong on the way to numpy. What values do you get from PIL's own access methods (e.g. getpixel)? Also, what platform is this on? From fredrik at pythonware.com Sun Aug 1 13:46:12 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 13:46:12 +0200 Subject: [Image-SIG] bug in docs for Image.rotate() In-Reply-To: <67013.1279826347@parc.com> References: <63801.1279820833@parc.com> <67013.1279826347@parc.com> Message-ID: 2010/7/22 Bill Janssen : > Bill Janssen wrote: > >> Hmmm, the docs say that Image.rotate() has a "filter" keyword arg, but >> the code says that it's really "resample". ?Note that the docstring in >> the code is wrong, too. ?This is 1.1.6 I'm looking at. > > Also wrong in 1.1.7. ?And, in Image.rotate(), if you specify a > "resample" param and also "expand=True", the resample param is not > passed on to Image.transform(). The resample bug should be fixed in 1.1.7: http://hg.effbot.org/pil-117/changeset/db1b40ca85c4 From wrybread at gmail.com Sun Aug 1 04:21:42 2010 From: wrybread at gmail.com (Alec Bennett) Date: Sat, 31 Jul 2010 19:21:42 -0700 Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: Since Python uses indenting as part of its syntax, I used periods to symbolize indentation, since otherwise most email readers would scrub out my indents. Honestly, if you didn't pick up on that, your chances of successfully diving into using the wxPython gui framework are kind of slim. I'd recommend first working with some basic Python tutorials. In the meantime, I have a feeling the Pygame example that someone sent over will be a bit simpler. On Sat, Jul 31, 2010 at 5:55 PM, Jack Uretsky wrote: > Actually, I did in what I tried to run. What I posted was a > verbatim copy from your e-mail. But I'm getting an invalid syntax exception > at a different place, as follows: > _________________________________________ > import wx > > class PicWin(wx.Frame): > > def __init__(self, parent, id): > wx.Frame.__init__(self, parent, id, "Window. Title", > size=(200,200), pos > =(50,50), style = wx.DEFAULT_FRAME_STYLE) > panel = wx.Panel(self, -1) > bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() > > self.mainPic=wx.StaticBitmap(panel, -1, bmp) > self.Show() > > app = wx.App(redirect=0) > PicWin(None, -1) > app.Mainloop0() > ____________________________________ > The error is marked (it doesn't show on the e-mail) on the "self" > in the "self.mainPic" line. I've no idea what the problem is. > > 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 Fri, 30 Jul 2010, Alec Bennett wrote: > > You didn't delete the periods that I put in to simulate indentations. >> >> >> >> On Fri, Jul 30, 2010 at 9:06 AM, donn wrote: >> >> On 30/07/2010 17:48, Jack Uretsky wrote: >>> >>> def__init__(self, parent, id): >>>> ^ >>>> SyntaxError: invalid syntax >>>> >>>> I imagine the spacing in the email was not preserved, but even so, >>> Python >>> is giving you a little arrow "^" to go look at.... >>> >>> def, SPACE, dunder-init... etc. >>> def __init... >>> >>> >>> \d >>> >>> _______________________________________________ >>> 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 wrybread at gmail.com Sun Aug 1 04:25:52 2010 From: wrybread at gmail.com (Alec Bennett) Date: Sat, 31 Jul 2010 19:25:52 -0700 Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: Oh I get it, and looks like you're making progress. In the future, post the exact traceback (error report), instead of simply highlighting the line where the error occurred. Anyway, you currently have: bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() What I think you meant is: bmp = wx.Image("a_4.jpg", wx.BITMAP_TYPE_ANY).ConvertToBitmap() On Sat, Jul 31, 2010 at 7:21 PM, Alec Bennett wrote: > Since Python uses indenting as part of its syntax, I used periods to > symbolize indentation, since otherwise most email readers would scrub out my > indents. > > Honestly, if you didn't pick up on that, your chances of successfully > diving into using the wxPython gui framework are kind of slim. I'd recommend > first working with some basic Python tutorials. > > In the meantime, I have a feeling the Pygame example that someone sent over > will be a bit simpler. > > > > > On Sat, Jul 31, 2010 at 5:55 PM, Jack Uretsky wrote: > >> Actually, I did in what I tried to run. What I posted was a >> verbatim copy from your e-mail. But I'm getting an invalid syntax exception >> at a different place, as follows: >> _________________________________________ >> import wx >> >> class PicWin(wx.Frame): >> >> def __init__(self, parent, id): >> wx.Frame.__init__(self, parent, id, "Window. Title", >> size=(200,200), pos >> =(50,50), style = wx.DEFAULT_FRAME_STYLE) >> panel = wx.Panel(self, -1) >> bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() >> >> self.mainPic=wx.StaticBitmap(panel, -1, bmp) >> self.Show() >> >> app = wx.App(redirect=0) >> PicWin(None, -1) >> app.Mainloop0() >> ____________________________________ >> The error is marked (it doesn't show on the e-mail) on the "self" >> in the "self.mainPic" line. I've no idea what the problem is. >> >> 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 Fri, 30 Jul 2010, Alec Bennett wrote: >> >> You didn't delete the periods that I put in to simulate indentations. >>> >>> >>> >>> On Fri, Jul 30, 2010 at 9:06 AM, donn wrote: >>> >>> On 30/07/2010 17:48, Jack Uretsky wrote: >>>> >>>> def__init__(self, parent, id): >>>>> ^ >>>>> SyntaxError: invalid syntax >>>>> >>>>> I imagine the spacing in the email was not preserved, but even so, >>>> Python >>>> is giving you a little arrow "^" to go look at.... >>>> >>>> def, SPACE, dunder-init... etc. >>>> def __init... >>>> >>>> >>>> \d >>>> >>>> _______________________________________________ >>>> 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 seb.haase at gmail.com Sun Aug 1 20:10:37 2010 From: seb.haase at gmail.com (Sebastian Haase) Date: Sun, 1 Aug 2010 20:10:37 +0200 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: On Sun, Aug 1, 2010 at 3:31 AM, Jerome Leclanche wrote: > On the wishlist as well is a more open development process. PIL is a > very widely used library, yet its development is very obscure. There > is no online version control or commit log, so on (or at least, not > indicated anywhere). > Fredrik, would you mind commenting on this ? I remember having read that only paying "customers" (of some sort) would have "early access" to the svn version....? ( http://www.pythonware.com/products/pil/support.htm ) This seems quite uncommon for open source projects where patch submissions and bug reports from anyone are generally encouraged .... so you submit a patch, but you can only get the updated version back if you pay ...? Thjanks, My 2 cents, Sebastian Haase From aclark at aclark.net Sun Aug 1 20:21:42 2010 From: aclark at aclark.net (Alex Clark) Date: Sun, 01 Aug 2010 14:21:42 -0400 Subject: [Image-SIG] Pillow, the "friendly" PIL fork References: Message-ID: On 8/1/10 6:51 AM, in article AANLkTik-mkENWtpsMFPcYmd6eNYPb8Un+QwqZJ=Ugg+4 at mail.gmail.com, "Fredrik Lundh" wrote: > 2010/8/1 Jerome Leclanche : > >> Although the "PIL" and "Image*" packages themselves do not >> respect python standards (should be from imaging import .., or >> something alike). > > If you had been paying attention, you'd noticed that "python > standards" change all the time, depend on what the latest minibosses > think (suggestion: look up old versions of PEP 8 before you post stuff > about how others ignore the "standards"). This is good to know, thank you! (And, thank you Jerome and Daniel for your feedback). So if I understand you correctly, Fredrik, you are saying that you are adhering to what was once a standard and that you are skeptical about new standards (which is certainly reasonable). Regardless of standards, if I understand things correctly, some code supports: import Image While other code requires: from PIL import Image To work properly. So, we have a "human" problem. If everyone could agree on a single format and to update all their code we could move forward (also a logistical problem). Alex > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Alex Clark ? http://aclark.net Author ? Plone 3.3 Site Administration ? http://aclark.net/admin From aclark at aclark.net Sun Aug 1 20:38:21 2010 From: aclark at aclark.net (Alex Clark) Date: Sun, 01 Aug 2010 14:38:21 -0400 Subject: [Image-SIG] Pillow, the "friendly" PIL fork References: Message-ID: On 8/1/10 7:04 AM, in article AANLkTikcnVgGTjnWTiag0xNmKwdNU+QW2prNoETSv3mS at mail.gmail.com, "Fredrik Lundh" wrote: > 2010/7/31 Daniel Fetchinson : >>> I have been wanting to tackle this for sometime, and finally got around to >>> it tonight. I've created a "friendly" fork of PIL called "Pillow": >>> http://pypi.python.org/pypi/Pillow/1.0 >>> >>> Some background: I've been doing Plone development for the past 5 years or >>> so, and PIL has always "been an issue". I won't get into what the issues are >>> now, but I assume folks know them. >> >> Well, I actually don't know what the "issues" are, but am very >> interested in hearing them! > > Plone exists in the Zope universe, not the Python universe, which is > an issue in itself. We are working on that. Or at least I should say, I am working on that. I've pushed very hard for Plone to become "more Pythonic". And Zope should do the same IMVHO (though I'm not as involved in the Zope community). Things like making http://plone.org/products support "PyPI-like uploading" (which Tarek Ziad? helped us with) have taken us at least part of the way toward achieving that goal. > > In this case, I think the actual "issue" is that Zope uses its own > build system that's puts specific requirements on the distutils > packaging; Can you say what you are referring to here? I'm not familiar with it? or rather I should say I don't want to guess. Note: as of Zope 2.12, Zope 2 uses the egg package format. > requirements that are not compatible with PIL's setup file. OK, I'm trying to figure this out. As I understand it, the result of the incompatibility is that: import Image Fails in Zope 2 if PIL is installed because Zope 2 (OFS) has it's own Image module. > Instead of just sit down and contribute a patch like everyone else > would have done, they've spent a couple of years ranting on their own > mailing lists and occasionally sending me nastygrams (including > writing reviews on PyPI telling people to stay away from the software > because if it's not convenient to use with a package system you > invented yourself, it's worthless for everyone). Right, and that's what I'd like to straighten out once and for all if possible. It seems to me it's the Python community that should "save us". In other words, if everyone follows the Python standards (whether they are good/bad/wright/wrong/etc) we'd at least be able to move forward. > At least a packaging > fork means that someone's over there is producing something more than > invectives, but I'd still prefer a patch. Can you explain what that patch would look like? I'm interested in providing such a patch if possible. However, I'm under the impression that there is a fundamental disagreement preventing the inclusion of such a patch (i.e. If I submit a patch that breaks "import Image" you aren't going to apply it.) At the very least, it would be "nice" to get the story straight and if Plone (and anyone else interested) needs to move forward with a packaging fork we can do so in agreement and harmony (i.e. PIL can continue to support "import Imaging" while Pillow would require "from PIL import Imaging") and we would aim to include any new PIL feature adds in PIL to Pillow. Alex P.S. FWIW, I think it was Chris Withers (on the repoze-dev list) that suggested someone "pop in to image-sig" to take care of this. So thanks Chris Withers, too. > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Alex Clark ? http://aclark.net Author ? Plone 3.3 Site Administration ? http://aclark.net/admin From Chris.Barker at noaa.gov Sun Aug 1 21:04:05 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 01 Aug 2010 12:04:05 -0700 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: <4C55C525.9090809@noaa.gov> Alex Clark wrote: > OK, I'm trying to figure this out. As I understand it, the result of the > incompatibility is that: > > import Image > > Fails in Zope 2 if PIL is installed because Zope 2 (OFS) has it's own Image > module. For quite some time, PIL has been delivered as both a package and with a pth file, so you can use the old style: import Image or the newer: from PIL import Image. The PIL directory (package) has a lot of modules in it, so I really don't want them all importable at the top level. So I generally remove the .pth file, so that only the later works on my systems, with my code. I'd be a bit happier if "import Image" raised a deprecation warning, but I'm not sure how you'd do that. (I actually did help do that for the GDAL package, but that was set up differently - they actually had all their stuff dumped directly into site-packages). But it's not hard to have ZOPE remove the pth file if that's what you want. And when it comes down to it, there is no way to remove all possible name clashes --every package has to have a top-level name -- if ZOPE used a package called "PIL", you'd still have a clash. But python does allow the "import as" construction, so you can always patch your own systems by changing the name of a package. My tiny nit about "standards": Having a __version__ attribute is a very common convention, if not a standard -- it would be nice if PIL supported it -- and that's a trivial patch: in Image.py, add: __version__ = VERSION in __init__.py add: from Image import __version__ Another comment: If someone is doing a "friendly" fork -- it's really the least you can do to be very public about what the heck the "issues" are that you want to address that are not being addressed by the main version. >> At least a packaging >> fork means that someone's over there is producing something more than >> invectives, but I'd still prefer a patch. Is packaging the only "issues" this fork is for? -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 fredrik at pythonware.com Sun Aug 1 21:34:00 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 21:34:00 +0200 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: Message-ID: 2010/8/1 Alex Clark : > So if I understand you correctly, Fredrik, you are saying that you are > adhering to what was once a standard and that you are skeptical about new > standards (which is certainly reasonable). The great thing with standards is that there are so many to chose from :-) But seriously, I don't really care about the standards themselves; I do care a *lot* about compatibility and cost of upgrading, though. In my experience, people have better things to do with their time than to rewrite their code just to keep using the functionality they already have. > Regardless of standards, if I understand things correctly, some code > supports: > > ?import Image > > While other code requires: > > ?from PIL import Image > > To work properly. PIL's installed in the the PIL package so the "from PIL import" form always works. There are tons of books and code out there using the "import Image" form (PIL is old enough that packages didn't even exist when it was first released), so the installer also provides a PIL.pth file that causes Python's import machinery to add the directory to the path as well. I'm not very eager to break that for the current generation of the library, for Python 2.X. (It should also be noted that PIL actually predates Zope, so it's Zope that's doing namespace squatting here, not PIL :) > So, we have a "human" problem. If everyone could agree on a single format > and to update all their code we could move forward (also a logistical > problem). Sounds to me like the most practical way to solve this is to have Zope's installation framework tell PIL's setup script that it doesn't care about backwards compatibility via some kind of "altinstall" mechanism. I don't know enough about zc.buildout (?) to know how such a mechanism would look, but I'm open for suggestions. From fredrik at pythonware.com Sun Aug 1 21:46:17 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 1 Aug 2010 21:46:17 +0200 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: <4C55C525.9090809@noaa.gov> References: <4C55C525.9090809@noaa.gov> Message-ID: 2010/8/1 Christopher Barker : > I'd be a bit happier if "import Image" raised a deprecation warning, but I'm > not sure how you'd do that. (I actually did help do that for the GDAL > package, but that was set up differently - they actually had all their stuff > dumped directly into site-packages). Me neither, but having that as an installatoin option wouldn't be all bad. But I could start by going through the documentation on effbot.org and make sure it recommends "from PIL" more clearly (the current documentation uses both form). > But it's not hard to have ZOPE remove the pth file if that's what you want. > > And when it comes down to it, there is no way to remove all possible name > clashes --every package has to have a top-level name -- if ZOPE used a > package called "PIL", you'd still have a clash. Indeed, and as I mentioned earlier, PIL does in fact predate Zope, and grabbed the "Image*" prefix long before they released their first version :) (strangely enough, I don't remember this being much of a problem for the first decade or so. Could be that it's something with the latest crop of installation tools that messes things up, but I'm not following the developments over there that closely; last time I checked, most of the tools appeared to conflate setting up development environments with distributing software to client machines and/or pushing to production environments, and most of them also seem to ignore that the latter two are solved problems on many platforms...) > But python does allow the "import as" construction, so you can always patch > your own systems by changing the name of a package. > > My tiny nit about "standards": > > Having a __version__ attribute is a very common convention, if not a > standard -- it would be nice if PIL supported it -- and that's a trivial > patch: I was about to say "but doesn't 1.1.7 have that?" only to find that it doesn't. Just fixed this omission in trunk. From jlu at hep.anl.gov Sun Aug 1 22:16:15 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 1 Aug 2010 15:16:15 -0500 (CDT) Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: Hi - I think I understood your use of periods. Here's my most recent attempt, resulting in a "'module' object is not callable" error. The copy is made from a Terminal window on an Intel Mac running OS X Snow Leopard. 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, 31 Jul 2010, Alec Bennett wrote: > Since Python uses indenting as part of its syntax, I used periods to > symbolize indentation, since otherwise most email readers would scrub out my > indents. > > Honestly, if you didn't pick up on that, your chances of successfully diving > into using the wxPython gui framework are kind of slim. I'd recommend first > working with some basic Python tutorials. > > In the meantime, I have a feeling the Pygame example that someone sent over > will be a bit simpler. > > > > On Sat, Jul 31, 2010 at 5:55 PM, Jack Uretsky wrote: > >> Actually, I did in what I tried to run. What I posted was a >> verbatim copy from your e-mail. But I'm getting an invalid syntax exception >> at a different place, as follows: >> _________________________________________ >> import wx >> >> class PicWin(wx.Frame): >> >> def __init__(self, parent, id): >> wx.Frame.__init__(self, parent, id, "Window. Title", >> size=(200,200), pos >> =(50,50), style = wx.DEFAULT_FRAME_STYLE) >> panel = wx.Panel(self, -1) >> bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() >> >> self.mainPic=wx.StaticBitmap(panel, -1, bmp) >> self.Show() >> >> app = wx.App(redirect=0) >> PicWin(None, -1) >> app.Mainloop0() >> ____________________________________ >> The error is marked (it doesn't show on the e-mail) on the "self" >> in the "self.mainPic" line. I've no idea what the problem is. >> >> 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 Fri, 30 Jul 2010, Alec Bennett wrote: >> >> You didn't delete the periods that I put in to simulate indentations. >>> >>> >>> >>> On Fri, Jul 30, 2010 at 9:06 AM, donn wrote: >>> >>> On 30/07/2010 17:48, Jack Uretsky wrote: >>>> >>>> def__init__(self, parent, id): >>>>> ^ >>>>> SyntaxError: invalid syntax >>>>> >>>>> I imagine the spacing in the email was not preserved, but even so, >>>> Python >>>> is giving you a little arrow "^" to go look at.... >>>> >>>> def, SPACE, dunder-init... etc. >>>> def __init... >>>> >>>> >>>> \d >>>> >>>> _______________________________________________ >>>> Image-SIG maillist - Image-SIG at python.org >>>> http://mail.python.org/mailman/listinfo/image-sig >>>> >>>> >>> > From aclark at aclark.net Sun Aug 1 22:49:32 2010 From: aclark at aclark.net (Alex Clark) Date: Sun, 01 Aug 2010 16:49:32 -0400 Subject: [Image-SIG] Pillow, the "friendly" PIL fork References: <4C55C525.9090809@noaa.gov> Message-ID: On 8/1/10 3:04 PM, in article 4C55C525.9090809 at noaa.gov, "Christopher Barker" wrote: ? > > Is packaging the only "issues" this fork is for? Yes. In Plone-land we rely a great deal on packages on PyPI. Buildout is a tool (which my 'Plone site admin' book covers in great detail, FWIW) we use exclusively to build Plone CMS applications. Using Buildout to install packages is more or less the equivalent of running "easy_install SomePackage", only the result is an "instance" script with the packages specified in the buildout packages added to the sys.path. E.g.: #!/Users/aclark/Developer/python-buildout/python-2.4/bin/python2.4 import sys sys.path[0:0] = [ '/Users/aclark/Developer/eggs/Plone-3.3.5-py2.4.egg', '/Users/aclark/Developer/eggs/Pillow-1.1-py2.4-macosx-10.6-i386.egg', '/Users/aclark/Developer/eggs/plone.recipe.zope2instance-3.6-py2.4.egg', '/Users/aclark/Developer/eggs/zc.recipe.egg-1.2.2-py2.4.egg', '/Users/aclark/Developer/eggs/distribute-0.6.14-py2.4.egg', '/Users/aclark/Developer/python-buildout/python-2.4/lib/python2.4/site-packa ges', '/Users/aclark/Developer/eggs/Products.PloneTestCase-0.9.9-py2.4.egg', ? If I list PIL in Buildout, I get the latest on PyPI (or some version I specify) and it "breaks Zope" due to the issues we discussed. As such, various alternative re-packages have appeared: - http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz - http://dist.repoze.org/PIL-1.1.6.tar.gz - http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz Now, you can use Buildout to install PILwoTk quite easily simply by telling Buildout where to find it, e.g.: [buildout] find-links = http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz But it's not clear (to me at least) if the same is true of the re-packages that are not *renamed* e.g. http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz That is because Buildout's default index is PyPI and it will always find PIL there first (I think). So, I wanted a fork, because I wanted to take the latest re-packaging ( http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz) and "release" it to PyPI. Now I can specify the Pillow package in Buildout, and Buildout will find "the right one". (Here's a simple Plone buildout example: http://svn.aclark.net/svn/public/buildout/plone/trunk/buildout.cfg) Let me parse the rest of your and Fredrik's comments, and let them sink in a bit, and get back to you? (This is a very helpful dialogue I think, thank you all!) > > -Chris > > -- Alex Clark ? http://aclark.net Author ? Plone 3.3 Site Administration ? http://aclark.net/admin From chris.mit7 at gmail.com Mon Aug 2 00:11:12 2010 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Sun, 1 Aug 2010 18:11:12 -0400 Subject: [Image-SIG] PIL: TIFF images loaded as 16 bit signed integers In-Reply-To: References: Message-ID: My platform is windows 7 64bit, and when I do this: import Image im = Image.open(file) print im.getpixel((168,78)) #pixel intensity is 65535, gives -1 as value print im.getpixel((169,78)) #pixel intensity is 64453, gives -1083 as value. On Sun, Aug 1, 2010 at 7:14 AM, Fredrik Lundh wrote: > 2010/7/6 Chris Mitchell : >> I'm running into a problem where my image intensities are being loaded >> as 16 bit signed integers. ?The code I'm using to open the tiff file >> is: >> >> im = Image.open(file) >> self.pixels = np.array([im.getdata()], np.uint16) >> >> the filetype is a 16bit TIFF, whose intensities load fine into ImageJ. >> ?I load their intensities into a numpy 16bit array, and for the time >> being I've fixed this problem with this code: >> >> np.where(self.pixels<0, -1*self.pixels+(32768+self.pixels),self.pixels) >> >> That basically takes any negative values and compensates for the >> rollover. ?Does anyone have any idea why PIL is loading my TIFF files >> as signed integers? > > Could be that something goes wrong on the way to numpy. ?What values > do you get from PIL's own access methods (e.g. getpixel)? > > Also, what platform is this on? > > > From Chris.Barker at noaa.gov Mon Aug 2 03:34:03 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 01 Aug 2010 18:34:03 -0700 Subject: [Image-SIG] that's enough In-Reply-To: References: <4C52F87C.4000205@gmail.com> Message-ID: <4C56208B.4050400@noaa.gov> Jack Uretsky wrote: > I think I understood your use of periods. Here's my most recent > attempt, resulting in a "'module' object is not callable" error. read the error message carefully, and also read the notes to this list carefully -- I'm pretty someone already suggested a fix for this: >>> bmp = wx("a_4.jpg", wx.BITMAP_TYPE_ANY.ConvertToBitmap() that's trying to call the "wx' module, which, as the error says in not callable. I think you want: bmp = wx.Image("a_4.jpg", wx.BITMAP_TYPE_ANY).ConvertToBitmap() though it would be easier to do: bmp. wx.Bitmap("a_4.jpg") (untested) -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 Chris.Barker at noaa.gov Mon Aug 2 04:29:55 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 01 Aug 2010 19:29:55 -0700 Subject: [Image-SIG] Pillow, the "friendly" PIL fork In-Reply-To: References: <4C55C525.9090809@noaa.gov> Message-ID: <4C562DA3.8030508@noaa.gov> Alex Clark wrote: > On 8/1/10 3:04 PM, in article 4C55C525.9090809 at noaa.gov, "Christopher > Barker" wrote: > > ? >> Is packaging the only "issues" this fork is for? > > Yes. In Plone-land we rely a great deal on packages on PyPI. > Buildout is a > tool (which my 'Plone site admin' book covers in great detail, FWIW) we use > exclusively to build Plone CMS applications. couldn't you have "recipes" for buildout that does a little extra for certain packages -- like in this case, remove the PIL.pth file. Or maybe change the name of the Zope package named "Image", as Fredrik mentioned, PIL has been around a long time. But in any case, a fork seems like a lot of work for such a simple conflict! -Chris > Using Buildout to install packages is more or less the equivalent of running > "easy_install SomePackage", only the result is an "instance" script with the > packages specified in the buildout packages added to the sys.path. E.g.: > > > #!/Users/aclark/Developer/python-buildout/python-2.4/bin/python2.4 > > import sys > sys.path[0:0] = [ > '/Users/aclark/Developer/eggs/Plone-3.3.5-py2.4.egg', > '/Users/aclark/Developer/eggs/Pillow-1.1-py2.4-macosx-10.6-i386.egg', > '/Users/aclark/Developer/eggs/plone.recipe.zope2instance-3.6-py2.4.egg', > '/Users/aclark/Developer/eggs/zc.recipe.egg-1.2.2-py2.4.egg', > '/Users/aclark/Developer/eggs/distribute-0.6.14-py2.4.egg', > > '/Users/aclark/Developer/python-buildout/python-2.4/lib/python2.4/site-packa > ges', > '/Users/aclark/Developer/eggs/Products.PloneTestCase-0.9.9-py2.4.egg', > ? > > > If I list PIL in Buildout, I get the latest on PyPI (or some version I > specify) and it "breaks Zope" due to the issues we discussed. > > As such, various alternative re-packages have appeared: > > - http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz > - http://dist.repoze.org/PIL-1.1.6.tar.gz > - http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz > > Now, you can use Buildout to install PILwoTk quite easily simply by telling > Buildout where to find it, e.g.: > > [buildout] > find-links = http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz > > But it's not clear (to me at least) if the same is true of the re-packages > that are not *renamed* e.g. > http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz > > That is because Buildout's default index is PyPI and it will always find PIL > there first (I think). > > So, I wanted a fork, because I wanted to take the latest re-packaging ( > http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz) and "release" it to PyPI. > > Now I can specify the Pillow package in Buildout, and Buildout will find > "the right one". (Here's a simple Plone buildout example: > http://svn.aclark.net/svn/public/buildout/plone/trunk/buildout.cfg) > > Let me parse the rest of your and Fredrik's comments, and let them sink in a > bit, and get back to you? > > (This is a very helpful dialogue I think, thank you all!) > > >> -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 aclark at aclark.net Mon Aug 2 10:01:31 2010 From: aclark at aclark.net (Alex Clark) Date: Mon, 02 Aug 2010 04:01:31 -0400 Subject: [Image-SIG] Pillow, the "friendly" PIL fork References: <4C55C525.9090809@noaa.gov> <4C562DA3.8030508@noaa.gov> Message-ID: On 8/1/10 10:29 PM, in article 4C562DA3.8030508 at noaa.gov, "Christopher Barker" wrote: > Alex Clark wrote: >> On 8/1/10 3:04 PM, in article 4C55C525.9090809 at noaa.gov, "Christopher >> Barker" wrote: >> >> ? >>> Is packaging the only "issues" this fork is for? >> >> Yes. In Plone-land we rely a great deal on packages on PyPI. >> Buildout is a >> tool (which my 'Plone site admin' book covers in great detail, FWIW) we use >> exclusively to build Plone CMS applications. > > couldn't you have "recipes" for buildout that does a little extra for > certain packages -- like in this case, remove the PIL.pth file. Maybe. But that breaks the paradigm of "easy to add packages to your buildout". A recipe is a layer of abstraction that provides additional functionality. Installing PIL should be part of the existing functionality IMO. > > Or maybe change the name of the Zope package named "Image", as Fredrik > mentioned, PIL has been around a long time. Maybe. But I'm not quite sure how that would work. Zope 2 has also been around a long time? ~12 years I think? > > But in any case, a fork seems like a lot of work for such a simple conflict! If only it were a simple conflict. Like I said, this has been going on a long time. And like Fredrik said, the approach from the Zope/Plone community has not always been the most friendly. I'm trying to see if we can fix this once and for all, in one way or another. I'm still hopeful we can come up with a patch, but a fork that breaks backwards compatibility wouldn't be the worst thing in the world IMO. Alex > > -Chris > > > >> Using Buildout to install packages is more or less the equivalent of running >> "easy_install SomePackage", only the result is an "instance" script with the >> packages specified in the buildout packages added to the sys.path. E.g.: >> >> >> #!/Users/aclark/Developer/python-buildout/python-2.4/bin/python2.4 >> >> import sys >> sys.path[0:0] = [ >> '/Users/aclark/Developer/eggs/Plone-3.3.5-py2.4.egg', >> '/Users/aclark/Developer/eggs/Pillow-1.1-py2.4-macosx-10.6-i386.egg', >> '/Users/aclark/Developer/eggs/plone.recipe.zope2instance-3.6-py2.4.egg', >> '/Users/aclark/Developer/eggs/zc.recipe.egg-1.2.2-py2.4.egg', >> '/Users/aclark/Developer/eggs/distribute-0.6.14-py2.4.egg', >> >> '/Users/aclark/Developer/python-buildout/python-2.4/lib/python2.4/site-packa >> ges', >> '/Users/aclark/Developer/eggs/Products.PloneTestCase-0.9.9-py2.4.egg', >> ? >> >> >> If I list PIL in Buildout, I get the latest on PyPI (or some version I >> specify) and it "breaks Zope" due to the issues we discussed. >> >> As such, various alternative re-packages have appeared: >> >> - http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz >> - http://dist.repoze.org/PIL-1.1.6.tar.gz >> - http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz >> >> Now, you can use Buildout to install PILwoTk quite easily simply by telling >> Buildout where to find it, e.g.: >> >> [buildout] >> find-links = http://download.zope.org/distribution/PILwoTk-1.1.6.4.tar.gz >> >> But it's not clear (to me at least) if the same is true of the re-packages >> that are not *renamed* e.g. >> http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz >> >> That is because Buildout's default index is PyPI and it will always find PIL >> there first (I think). >> >> So, I wanted a fork, because I wanted to take the latest re-packaging ( >> http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz) and "release" it to PyPI. >> >> Now I can specify the Pillow package in Buildout, and Buildout will find >> "the right one". (Here's a simple Plone buildout example: >> http://svn.aclark.net/svn/public/buildout/plone/trunk/buildout.cfg) >> >> Let me parse the rest of your and Fredrik's comments, and let them sink in a >> bit, and get back to you? >> >> (This is a very helpful dialogue I think, thank you all!) >> >> >>> -Chris >>> >>> >> > -- Alex Clark ? http://aclark.net Author ? Plone 3.3 Site Administration ? http://aclark.net/admin From dhruv at nettrackers.net Mon Aug 2 15:38:58 2010 From: dhruv at nettrackers.net (Dhruv Majumdar) Date: Mon, 2 Aug 2010 19:08:58 +0530 Subject: [Image-SIG] PIL error with encoder Message-ID: Hi, Im new to Python and have been struggling with this error during tests: IOError: encoder zip not available I have python 2.7 with zlib, jpeg and freetype installed on the server. When building PIL it shows support for all three above. However i notice at ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) I get the abovementioned error. Please could someone help me ? Thanks! Dhruv -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Mon Aug 2 16:05:30 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 2 Aug 2010 16:05:30 +0200 Subject: [Image-SIG] PIL error with encoder In-Reply-To: References: Message-ID: 2010/8/2 Dhruv Majumdar : > Im new to Python and have been struggling with this error during tests: > > IOError: encoder zip not available > > I have python 2.7 with zlib, jpeg and freetype installed on the server. When > building PIL it shows support for all three above. However i notice at > ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) > > I get the abovementioned error. Make sure your Python script is actually picking up the version you built. To see which version it's using, add this to your script: import _imaging; print _imaging.__file__ From g.kloss at massey.ac.nz Tue Aug 3 03:08:05 2010 From: g.kloss at massey.ac.nz (Guy K. Kloss) Date: Tue, 3 Aug 2010 13:08:05 +1200 Subject: [Image-SIG] that's enough In-Reply-To: References: Message-ID: <201008031308.06769.g.kloss@massey.ac.nz> I'd *really* enjoy two things here: (A) Learn Python elsewhere, and keep the discussions on this list on topic, that is on the issues around image handling. (B) If you reply, cut all the crap out of the mail and keep only parts of past mails quoted that are required to understand your own post. In that respect, try to avoid top posting as well. A disgruntled list member, Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura P?taiao o M?hiohio me P?ngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9266 fax: +64 9 441-8181 G.Kloss at massey.ac.nz http://www.massey.ac.nz/~gkloss -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From dhruv at nettrackers.net Mon Aug 2 20:53:11 2010 From: dhruv at nettrackers.net (Dhruv Majumdar) Date: Tue, 3 Aug 2010 00:23:11 +0530 Subject: [Image-SIG] PIL error with encoder In-Reply-To: References: Message-ID: Hi Fredrik, >>> import _imaging; print _imaging.__file__ /usr/local/lib/python2.7/site-packages/PIL/_imaging.so Here's a dump of the complete error in case it helps; [root at acroplia-1 audioprocessing]# /usr/local/bin/python wav2png.py M1F1-Alaw-AFsp.wav processing file M1F1-Alaw-AFsp.wav: 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Traceback (most recent call last): File "wav2png.py", line 45, in create_wave_images(*args) File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", line 479, in create_wave_images waveform.save(output_filename_w) File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", line 391, in save self.image.save(filename) File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1439, in save save_handler(self, fp, filename) File "/usr/local/lib/python2.7/site-packages/PIL/PngImagePlugin.py", line 572, in _save ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 481, in _save e = Image._getencoder(im.mode, e, a, im.encoderconfig) File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 401, in _getencoder raise IOError("encoder %s not available" % encoder_name) IOError: encoder zip not available Thank you, Dhruv +1-510-931-6347 On 2 August 2010 19:35, Fredrik Lundh wrote: > 2010/8/2 Dhruv Majumdar : > > > Im new to Python and have been struggling with this error during tests: > > > > IOError: encoder zip not available > > > > I have python 2.7 with zlib, jpeg and freetype installed on the server. > When > > building PIL it shows support for all three above. However i notice at > > ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, > rawmode)]) > > > > I get the abovementioned error. > > Make sure your Python script is actually picking up the version you > built. To see which version it's using, add this to your script: > > import _imaging; print _imaging.__file__ > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.mit7 at gmail.com Tue Aug 3 04:16:25 2010 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Mon, 2 Aug 2010 22:16:25 -0400 Subject: [Image-SIG] PIL: TIFF images loaded as 16 bit signed integers In-Reply-To: References: Message-ID: You are right, when I look at the values obtained via getdata that are passed to numpy there is no problem. The issue is getting the pixel values with getpixel, which for certain size data sets is faster than using getdata. Basically if the dataset is less than a certain size, building my array via iterating with getpixel is faster than loading a 512x512 image into an array. Because my readout was using a small testarea, getpixel was being used and not getdata. On Sun, Aug 1, 2010 at 6:20 PM, Sebastian Haase wrote: > Chris, > > in you code: > np.where(self.pixels<0, ?...... > > how is this supposed to work, if self.pixels was defined as a > *unsigned* unit16 ndarray ... ? > (it would by definition not ever be pixels < 0 .... ) > > > - Sebastian Haase > > On Mon, Aug 2, 2010 at 12:11 AM, Chris Mitchell wrote: >> My platform is windows 7 64bit, and when I do this: >> >> import Image >> im = Image.open(file) >> print im.getpixel((168,78)) #pixel intensity is 65535, gives -1 as value >> print im.getpixel((169,78)) #pixel intensity is 64453, gives -1083 as value. >> >> >> On Sun, Aug 1, 2010 at 7:14 AM, Fredrik Lundh wrote: >>> 2010/7/6 Chris Mitchell : >>>> I'm running into a problem where my image intensities are being loaded >>>> as 16 bit signed integers. ?The code I'm using to open the tiff file >>>> is: >>>> >>>> im = Image.open(file) >>>> self.pixels = np.array([im.getdata()], np.uint16) >>>> >>>> the filetype is a 16bit TIFF, whose intensities load fine into ImageJ. >>>> ?I load their intensities into a numpy 16bit array, and for the time >>>> being I've fixed this problem with this code: >>>> >>>> np.where(self.pixels<0, -1*self.pixels+(32768+self.pixels),self.pixels) >>>> >>>> That basically takes any negative values and compensates for the >>>> rollover. ?Does anyone have any idea why PIL is loading my TIFF files >>>> as signed integers? >>> >>> Could be that something goes wrong on the way to numpy. ?What values >>> do you get from PIL's own access methods (e.g. getpixel)? >>> >>> Also, what platform is this on? >>> >>> >>> >> _______________________________________________ >> Image-SIG maillist ?- ?Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> > From olaf at dtrx.de Tue Aug 3 12:57:21 2010 From: olaf at dtrx.de (Olaf Dietrich) Date: Tue, 3 Aug 2010 12:57:21 +0200 Subject: [Image-SIG] ImageOps.fit(): cropping area wrong (too small by 1 px) (PIL 1.1.7) Message-ID: <20100803105721.GF10217@gracvn.ikra.med.uni-muenchen.de> Apparently, the cropping area is miscalculated in the ImageOps.fit() function in PIL 1.1.7: Calling fit() with bleed=0.0 should return an image without any removed border: # @param bleed Remove a border around the outside of the image (from all # four edges. The value is a decimal percentage (use 0.01 for one # percent). The default value is 0 (no border). However, the returned image after the internal call of crop, i.e. after the lines out = image.crop( (leftSide, topSide, leftSide + cropWidth, topSide + cropHeight) ) is in fact cropped: 1 column/row of pixels is removed at the right hand side and at the bottom, i.e. if we start with a 100?100 pixel image and call ImageOps.fit() without the bleed and centering parameters (or with bleed=0.0): print "before image.crop:", image.size out = image.crop( (leftSide, topSide, leftSide + cropWidth, topSide + cropHeight) ) print "after image.crop:", out.size this results in: | before image.crop: (100, 100) | after image.crop: (99, 99) If I assume that the convention in ImageOps.crop() is correct, i.e. left, top, right, bottom = _border(border) return image.crop( (left, top, image.size[0]-right, image.size[1]-bottom) ) then crop should be called with the arguments "0 0 size[0] size[1]" if NO cropping is intended. This means that EITHER already the definition of liveArea (in ImageOps.fit()) should be changed from: liveArea = ( bleedPixels[0], bleedPixels[1], image.size[0] - bleedPixels[0] - 1, image.size[1] - bleedPixels[1] - 1 ) to liveArea = ( bleedPixels[0], bleedPixels[1], image.size[0] - bleedPixels[0], image.size[1] - bleedPixels[1] ) OR the definition of liveSize should be change from liveSize = (liveArea[2] - liveArea[0], liveArea[3] - liveArea[1]) to liveSize = (liveArea[2] - liveArea[0] + 1, liveArea[3] - liveArea[1] + 1) OR cropWidth and cropHeight should be defined as cropHeight = liveSize[1] + 1 cropWidth = liveSize[0] + 1 This problem is independent of the one concerning the centering parameter that I described in my message from 30 July. Best regards Olaf From jlu at hep.anl.gov Wed Aug 4 01:48:43 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Tue, 3 Aug 2010 18:48:43 -0500 (CDT) Subject: [Image-SIG] that's enough In-Reply-To: <1279097096.9049.3.camel@mypride> References: <1279097096.9049.3.camel@mypride> Message-ID: Hi all- I tried Yuri's matplotlib approach, as follows: _______________________________ (I verified that the imports are giving me directories) >>> import Image >>> import numpy as np >>> import pylab as pyl >>> >>> if __name__ == "__main__": img_name = 'a_4.jpg' img = Image.open(img_name) a = np.asarray(img) p = a.copy().transpose((1, 0, 2)) pyl.imshow(p) pyl.show() ___________________________________ But when I hit F5, nothing happens (Mav OS X Smow Leopard) 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 Wed, 14 Jul 2010, Yury V. Zaytsev wrote: > ... or you can go for matplotlib and use its plot function to display > PIL images using the NumPy array interface (see my previous postings on > this list): > > import Image > import numpy as np > import pylab as pyl > > if __name__ == "__main__": > > img_name = 'ch43_roi.tiff' > img = Image.open(img_name) > > a = np.asarray(img) > p = a.copy().transpose((1, 0, 2)) > > pyl.imshow(p) > pyl.show() > > -- > Sincerely yours, > Yury V. Zaytsev > > On Sun, 2010-07-11 at 18:16 -0500, Jack Uretsky wrote: >> Hi- >> The following worked very well: >>>>> import Image >>>>> d = Image.open("a_1.jpg") >>>>> d.show() >>>>> >> >> Now, how do I turn >> it off before showing another image >> I'm on an Intel Mac, OS X Snow Leopard. >> Regards, >> Jack 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 >> >> >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig > From jlu at hep.anl.gov Wed Aug 4 02:04:37 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Tue, 3 Aug 2010 19:04:37 -0500 (CDT) Subject: [Image-SIG] that's enough (corrrection) In-Reply-To: References: <1279097096.9049.3.camel@mypride> Message-ID: "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 Tue, 3 Aug 2010, Jack Uretsky wrote: > Hi all- > I tried Yuri's matplotlib approach, as follows: > _______________________________ > (I verified that the imports are giving me directories) >>>> import Image >>>> import numpy as np >>>> import pylab as pyl >>>> >>>> if __name__ == "__main__": > > img_name = 'a_4.jpg' > img = Image.open(img_name) > > a = np.asarray(img) > p = a.copy().transpose((1, 0, 2)) > > pyl.imshow(p) > pyl.show() > ___________________________________ > But when I hit F5, I get an invalid syntax error, but nothing is marked on the IDLE script. > 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 Wed, 14 Jul 2010, Yury V. Zaytsev wrote: > >> ... or you can go for matplotlib and use its plot function to display >> PIL images using the NumPy array interface (see my previous postings on >> this list): >> >> import Image >> import numpy as np >> import pylab as pyl >> >> if __name__ == "__main__": >> >> img_name = 'ch43_roi.tiff' >> img = Image.open(img_name) >> >> a = np.asarray(img) >> p = a.copy().transpose((1, 0, 2)) >> >> pyl.imshow(p) >> pyl.show() >> >> -- >> Sincerely yours, >> Yury V. Zaytsev >> >> On Sun, 2010-07-11 at 18:16 -0500, Jack Uretsky wrote: >>> Hi- >>> The following worked very well: >>>>>> import Image >>>>>> d = Image.open("a_1.jpg") >>>>>> d.show() >>>>>> >>> >>> Now, how do I turn >>> it off before showing another image >>> I'm on an Intel Mac, OS X Snow Leopard. >>> Regards, >>> Jack 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 >>> >>> >>> >>> _______________________________________________ >>> Image-SIG maillist - Image-SIG at python.org >>> http://mail.python.org/mailman/listinfo/image-sig >> > From seb.haase at gmail.com Wed Aug 4 09:46:10 2010 From: seb.haase at gmail.com (Sebastian Haase) Date: Wed, 4 Aug 2010 09:46:10 +0200 Subject: [Image-SIG] that's enough In-Reply-To: References: <1279097096.9049.3.camel@mypride> Message-ID: this has become really now a very very long thread -- and the frustration thing is , I still don't get the title - why "that's enough"? what is enough ? ;-) - Sebastian Haase On Wed, Aug 4, 2010 at 1:48 AM, Jack Uretsky wrote: > Hi all- > ? ? ? ?I tried Yuri's matplotlib approach, as follows: > _______________________________ > ?(I verified that the imports are giving me directories) >>>> >>>> import Image >>>> import numpy as np >>>> import pylab as pyl >>>> >>>> if __name__ == "__main__": > > ? ? ? ?img_name = 'a_4.jpg' > ? ? ? ?img = Image.open(img_name) > > ? ?a = np.asarray(img) > ? ?p = a.copy().transpose((1, 0, 2)) > > ? ?pyl.imshow(p) > ? ?pyl.show() > ___________________________________ > ? ? ? ?But when I hit F5, nothing happens (Mav OS X Smow Leopard) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?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 Wed, 14 Jul 2010, Yury V. Zaytsev wrote: > >> ... or you can go for matplotlib and use its plot function to display >> PIL images using the NumPy array interface (see my previous postings on >> this list): >> >> import Image >> import numpy as np >> import pylab as pyl >> >> if __name__ == "__main__": >> >> ? img_name = 'ch43_roi.tiff' >> ? img = Image.open(img_name) >> >> ? a = np.asarray(img) >> ? p = a.copy().transpose((1, 0, 2)) >> >> ? pyl.imshow(p) >> ? pyl.show() >> >> -- >> Sincerely yours, >> Yury V. Zaytsev >> >> On Sun, 2010-07-11 at 18:16 -0500, Jack Uretsky wrote: >>> >>> Hi- >>> ? ? ? ?The following worked very well: >>>>>> >>>>>> import Image >>>>>> d = Image.open("a_1.jpg") >>>>>> d.show() >>>>>> >>> >>> ? ? ? ?Now, how do I turn >>> ?it off before showing another image >>> ? ? ? ?I'm on an Intel Mac, OS X Snow Leopard. >>> ? ? ? ? ? ? ? ? ? ? ? ?Regards, >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Jack 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 >>> >>> >>> >>> _______________________________________________ >>> 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 donn.ingle at gmail.com Wed Aug 4 10:23:16 2010 From: donn.ingle at gmail.com (donn) Date: Wed, 04 Aug 2010 10:23:16 +0200 Subject: [Image-SIG] that's enough In-Reply-To: References: <1279097096.9049.3.camel@mypride> Message-ID: <4C592374.7080502@gmail.com> On 04/08/2010 09:46, Sebastian Haase wrote: >I still don't get the title - why "that's enough"? > what is enough ? I don't know either, but it does form part of the words I say when I see another post to it. I usually add, "..already! Stop. Jeez." :D \d From olaf at dtrx.de Wed Aug 4 16:14:02 2010 From: olaf at dtrx.de (Olaf Dietrich) Date: Wed, 4 Aug 2010 16:14:02 +0200 Subject: [Image-SIG] ImageOps.fit(): centering parameter (PIL 1.1.7) In-Reply-To: <609_1280475781_4C528285_609_33177_1_20100730074247.GA4255@gracvn.ikra.med.uni-muenchen.de> Message-ID: <20100804141402.GG10217@gracvn.ikra.med.uni-muenchen.de> Olaf Dietrich (2010-07-30T09:42:47+0200): > Does the centering parameter of ImageOps.fit() really > work as intended (i.e. as described in the documentation)? Meanwhile, I've had a closer look at ImageOps.fit() and start to understand what's going on: # Returns a sized and cropped version of the image, cropped to the # requested aspect ratio and size. def fit(image, size, method=Image.NEAREST, bleed=0.0, centering=(0.5, 0.5)): 1) Cropping is always performed if the requested size ("size") has another aspect ratio than the original image.size. In particular, cropping is then performed even though the bleed-parameter might be zero (the default). 2) If cropping is performed because of differing aspect ratios, then it can be controlled by the centering-parameter. 3) If additional cropping is requested by setting the bleed-parameter to a value >0 (and <0.5), then this additional border is always removed symmetrically from the original image - this cannot be influenced by the centering parameter (this is what I originally expected the centering-parameter to do). I guess this behavior might be sensible as well, so I do not ask for any changes here. 4) (an independent observation:) There is a a wrong decrement by 1 when calculating the liveArea (or the liveSize). So, I suggest to improve the documentation and to correct the definition of liveArea, i.e., change # @param size The requested output size in pixels, given as a # (width, height) tuple. to e.g. # @param size The requested output size in pixels, given as a # (width, height) tuple. If the aspect ratio of size differs # from the original one, the image data is cropped appropriately. Change # @param centering Control the cropping position. Use (0.5, 0.5) for # center cropping (e.g. if cropping the width, take 50% off of the ... to e.g. # @param centering Control the cropping position. This parameter is # relevant only if a changed aspect ratio is requested by the chosen # size. Any additionally removed border pixels (if bleed is > 0) # are not influenced by the centering parameter, but are always # removed symmetrically from the image. Use (0.5, 0.5) for # center cropping (e.g. if cropping the width, take 50% off of the ... And finally correct: liveArea = ( bleedPixels[0], bleedPixels[1], image.size[0] - bleedPixels[0] - 1, image.size[1] - bleedPixels[1] - 1 ) to liveArea = ( bleedPixels[0], bleedPixels[1], image.size[0] - bleedPixels[0], image.size[1] - bleedPixels[1] ) Unfortunately, I was really looking for a function that does asymmetric cropping of any border pixels as well, so I will have to implement my own version of fit() ... Olaf From jlu at hep.anl.gov Wed Aug 4 17:01:29 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Wed, 4 Aug 2010 10:01:29 -0500 (CDT) Subject: [Image-SIG] that's enough In-Reply-To: References: <1279097096.9049.3.camel@mypride> Message-ID: Hi- The title was a bit of whimsy. I had enough of the picture I wanted; now, how do I turn it off. 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 Wed, 4 Aug 2010, Sebastian Haase wrote: > this has become really now a very very long thread > -- and the frustration thing is , > I still don't get the title - why "that's enough"? > what is enough ? > > ;-) > > - Sebastian Haase > > On Wed, Aug 4, 2010 at 1:48 AM, Jack Uretsky wrote: >> Hi all- >> ? ? ? ?I tried Yuri's matplotlib approach, as follows: >> _______________________________ >> ?(I verified that the imports are giving me directories) >>>>> >>>>> import Image >>>>> import numpy as np >>>>> import pylab as pyl >>>>> >>>>> if __name__ == "__main__": >> >> ? ? ? ?img_name = 'a_4.jpg' >> ? ? ? ?img = Image.open(img_name) >> >> ? ?a = np.asarray(img) >> ? ?p = a.copy().transpose((1, 0, 2)) >> >> ? ?pyl.imshow(p) >> ? ?pyl.show() >> ___________________________________ >> ? ? ? ?But when I hit F5, nothing happens (Mav OS X Smow Leopard) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?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 Wed, 14 Jul 2010, Yury V. Zaytsev wrote: >> >>> ... or you can go for matplotlib and use its plot function to display >>> PIL images using the NumPy array interface (see my previous postings on >>> this list): >>> >>> import Image >>> import numpy as np >>> import pylab as pyl >>> >>> if __name__ == "__main__": >>> >>> ? img_name = 'ch43_roi.tiff' >>> ? img = Image.open(img_name) >>> >>> ? a = np.asarray(img) >>> ? p = a.copy().transpose((1, 0, 2)) >>> >>> ? pyl.imshow(p) >>> ? pyl.show() >>> >>> -- >>> Sincerely yours, >>> Yury V. Zaytsev >>> >>> On Sun, 2010-07-11 at 18:16 -0500, Jack Uretsky wrote: >>>> >>>> Hi- >>>> ? ? ? ?The following worked very well: >>>>>>> >>>>>>> import Image >>>>>>> d = Image.open("a_1.jpg") >>>>>>> d.show() >>>>>>> >>>> >>>> ? ? ? ?Now, how do I turn >>>> ?it off before showing another image >>>> ? ? ? ?I'm on an Intel Mac, OS X Snow Leopard. >>>> ? ? ? ? ? ? ? ? ? ? ? ?Regards, >>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Jack 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 >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 Wed Aug 4 22:39:50 2010 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 4 Aug 2010 22:39:50 +0200 Subject: [Image-SIG] PIL error with encoder In-Reply-To: References: Message-ID: 2010/8/2 Dhruv Majumdar : >>>> import _imaging; print _imaging.__file__ > /usr/local/lib/python2.7/site-packages/PIL/_imaging.so So have you verified that this is identical to the one you built and tested? (e.g. by checking the size and modification time). > Here's a dump of the complete error in case it helps; > > [root at acroplia-1 audioprocessing]# /usr/local/bin/python wav2png.py > M1F1-Alaw-AFsp.wav > processing file M1F1-Alaw-AFsp.wav: > ??????? 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Traceback (most recent > call last): > ? File "wav2png.py", line 45, in > ??? create_wave_images(*args) > ? File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", > line 479, in create_wave_images > ??? waveform.save(output_filename_w) > ? File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", > line 391, in save > ??? self.image.save(filename) > ? File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1439, in > save > ??? save_handler(self, fp, filename) > ? File "/usr/local/lib/python2.7/site-packages/PIL/PngImagePlugin.py", line > 572, in _save > ??? ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, > rawmode)]) > ? File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 481, > in _save > ??? e = Image._getencoder(im.mode, e, a, im.encoderconfig) > ? File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 401, in > _getencoder > ??? raise IOError("encoder %s not available" % encoder_name) > IOError: encoder zip not available > > Thank you, > ? ? ? ?? Dhruv > +1-510-931-6347 > > > > On 2 August 2010 19:35, Fredrik Lundh wrote: >> >> 2010/8/2 Dhruv Majumdar : >> >> > Im new to Python and have been struggling with this error during tests: >> > >> > IOError: encoder zip not available >> > >> > I have python 2.7 with zlib, jpeg and freetype installed on the server. >> > When >> > building PIL it shows support for all three above. However i notice at >> > ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, >> > rawmode)]) >> > >> > I get the abovementioned error. >> >> Make sure your Python script is actually picking up the version you >> built. ?To see which version it's using, add this to your script: >> >> ? ? import _imaging; print _imaging.__file__ >> >> > > From dhruv at nettrackers.net Tue Aug 3 13:35:49 2010 From: dhruv at nettrackers.net (Dhruv Majumdar) Date: Tue, 3 Aug 2010 17:05:49 +0530 Subject: [Image-SIG] PIL error with encoder Message-ID: Hi, Im new to Python and have been struggling with this error during tests: IOError: encoder zip not available I have python 2.7 with zlib, jpeg and freetype installed on the server. When building PIL it shows support for all three above. However i notice at ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) I get the abovementioned error. Fredrik suggested checking if the correct version of the _imaging module was in use. >>> import _imaging; print _imaging.__file__ /usr/local/lib/python2.7/site-packages/PIL/_imaging.so suggests it is the correct one. Here's a dump of the complete error in case it helps; [root at acroplia-1 audioprocessing]# /usr/local/bin/python wav2png.py M1F1-Alaw-AFsp.wav processing file M1F1-Alaw-AFsp.wav: 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Traceback (most recent call last): File "wav2png.py", line 45, in create_wave_images(*args) File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", line 479, in create_wave_images waveform.save(output_filename_w) File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", line 391, in save self.image.save(filename) File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1439, in save save_handler(self, fp, filename) File "/usr/local/lib/python2.7/site-packages/PIL/PngImagePlugin.py", line 572, in _save ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 481, in _save e = Image._getencoder(im.mode, e, a, im.encoderconfig) File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 401, in _getencoder raise IOError("encoder %s not available" % encoder_name) IOError: encoder zip not available Please could someone help me ? Thanks! Dhruv -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhruv at nettrackers.net Tue Aug 3 13:52:19 2010 From: dhruv at nettrackers.net (Dhruv Majumdar) Date: Tue, 3 Aug 2010 17:22:19 +0530 Subject: [Image-SIG] PIL error with encoder In-Reply-To: References: Message-ID: Hi, Sorry about this , i re-downloaded PIL, and recompiled manually giving locations for libjpeg and zlib and things worked fine. Last time i was compiling, i had given the wrong location for zlib . Thank you, Dhruv On 3 August 2010 17:05, Dhruv Majumdar wrote: > Hi, > > > Im new to Python and have been struggling with this error during tests: > > IOError: encoder zip not available > > I have python 2.7 with zlib, jpeg and freetype installed on the server. > When building PIL it shows support for all three above. However i notice at > ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, rawmode)]) > > I get the abovementioned error. > > Fredrik suggested checking if the correct version of the _imaging module > was in use. > > > > >>> import _imaging; print _imaging.__file__ > /usr/local/lib/python2.7/site-packages/PIL/_imaging.so > > suggests it is the correct one. > > > Here's a dump of the complete error in case it helps; > > [root at acroplia-1 audioprocessing]# /usr/local/bin/python wav2png.py > M1F1-Alaw-AFsp.wav > processing file M1F1-Alaw-AFsp.wav: > 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Traceback (most recent > call last): > File "wav2png.py", line 45, in > create_wave_images(*args) > File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", > line 479, in create_wave_images > waveform.save(output_filename_w) > File "/root/a/freesound/freesound/utils/audioprocessing/processing.py", > line 391, in save > self.image.save(filename) > File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 1439, in > save > save_handler(self, fp, filename) > File "/usr/local/lib/python2.7/site-packages/PIL/PngImagePlugin.py", line > 572, in _save > > ImageFile._save(im, _idat(fp, chunk), [("zip", (0,0)+im.size, 0, > rawmode)]) > File "/usr/local/lib/python2.7/site-packages/PIL/ImageFile.py", line 481, > in _save > e = Image._getencoder(im.mode, e, a, im.encoderconfig) > File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 401, in > _getencoder > raise IOError("encoder %s not available" % encoder_name) > > IOError: encoder zip not available > > > Please could someone help me ? > > Thanks! > > Dhruv > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charmender at gmail.com Sun Aug 8 18:11:18 2010 From: charmender at gmail.com (Angus) Date: Mon, 9 Aug 2010 01:11:18 +0900 Subject: [Image-SIG] PIL anti-aliased scaling produces bad artifacts? Message-ID: Hi. Forgive me if this has been brought up before, but I'm stumped. To create anti-aliased edges of arbitrary shapes, I tried downscaling enlarged versions of those shapes with the ANTIALIAS mode. This works at first glance, but when zooming in, pixels with incorrect(?) brightness can be noticed. Please try the following example code to reproduce this problem: from PIL import Image, ImageDraw im = Image.new('RGB', (1500, 1000)) dr = ImageDraw.Draw(im) dr.polygon((0, 0, 1250, 0, 250, 1000, 0, 1000), fill=(255, 255, 255)) im = im.resize((15, 10), Image.ANTIALIAS) im.save('PIL_anti-aliasing_test.bmp') Zoom in far on the diagonal edge between the black and white areas of the resulting test image. Looking from left to right or top to bottom I expected the pixels to be increasingly dark. However, the order seems to be: ...white -> light gray -> dark gray -> black -> *very dark gray?!* -> black... Is this intentional or not? If intentional, is there another way to anti-alias edges with PIL (because I don't like these artifacts)? From erwin94 at gmx.net Sun Aug 8 21:06:44 2010 From: erwin94 at gmx.net (David) Date: Sun, 8 Aug 2010 21:06:44 +0200 Subject: [Image-SIG] PIL anti-aliased scaling produces bad artifacts? In-Reply-To: References: Message-ID: On Aug 8, 2010, at 6:11 PM, Angus wrote: > Hi. Forgive me if this has been brought up before, but I'm stumped. To > create anti-aliased edges of arbitrary shapes, I tried downscaling > enlarged versions of those shapes with the ANTIALIAS mode. This works > at first glance, but when zooming in, pixels with incorrect(?) > brightness can be noticed. Please try the following example code to > reproduce this problem: [...] > Zoom in far on the diagonal edge between the black and white areas of > the resulting test image. Looking from left to right or top to bottom > I expected the pixels to be increasingly dark. However, the order > seems to be: ...white -> light gray -> dark gray -> black -> *very > dark gray?!* -> black... What you are seeing sounds like ringing artifacts from the lanczos resampling of the ANTIALIAS mode (see http://en.wikipedia.org/wiki/Lanczos_resampling ). > Is this intentional or not? If intentional, is there another way to > anti-alias edges with PIL (because I don't like these artifacts)? You could try something like this: im = im._new(im.im.stretch((15,10), Image.BILINEAR)) This will try to do an anti-aliased resizing, but use a bilinear filter instead of the default lanczos filter. This will potentially have more aliasing artifacts, but should have no ringing at all. till then, David. From charmender at gmail.com Mon Aug 9 03:31:45 2010 From: charmender at gmail.com (Angus) Date: Mon, 9 Aug 2010 10:31:45 +0900 Subject: [Image-SIG] [SOLVED] PIL anti-aliased scaling produces bad artifacts? In-Reply-To: References: Message-ID: >> I expected the pixels to be increasingly dark. However, the order >> seems to be: ...white -> light gray -> dark gray -> black -> *very >> dark gray?!* -> black... > > What you are seeing sounds like ringing artifacts from the lanczos > resampling of the ANTIALIAS mode (see > http://en.wikipedia.org/wiki/Lanczos_resampling ). > >> Is this intentional or not? If intentional, is there another way to >> anti-alias edges with PIL (because I don't like these artifacts)? > > You could try something like this: > > im = im._new(im.im.stretch((15,10), Image.BILINEAR)) > > This will try to do an anti-aliased resizing, but use a bilinear filter > instead of the default lanczos filter. This will potentially have more > aliasing artifacts, but should have no ringing at all. > > till then, David. That works perfectly for me! Thanks a lot! Interesting explanation too. When I have some more free time I'll have to look deeper at the math behind these filters. From edward at unicornschool.org Mon Aug 9 03:54:58 2010 From: edward at unicornschool.org (Edward Cannon) Date: Sun, 8 Aug 2010 18:54:58 -0700 Subject: [Image-SIG] [SOLVED] PIL anti-aliased scaling produces bad artifacts? In-Reply-To: References: Message-ID: I have done this before and it works reasonably well. There is still some aliasing, but for most part it is perfectly acceptable. BILINEAR is the way to go. On Sun, Aug 8, 2010 at 6:31 PM, Angus wrote: >>> I expected the pixels to be increasingly dark. However, the order >>> seems to be: ...white -> light gray -> dark gray -> black -> *very >>> dark gray?!* -> black... >> >> What you are seeing sounds like ringing artifacts from the lanczos >> resampling of the ANTIALIAS mode (see >> http://en.wikipedia.org/wiki/Lanczos_resampling ). >> >>> Is this intentional or not? If intentional, is there another way to >>> anti-alias edges with PIL (because I don't like these artifacts)? >> >> You could try something like this: >> >> im = im._new(im.im.stretch((15,10), Image.BILINEAR)) >> >> This will try to do an anti-aliased resizing, but use a bilinear filter >> instead of the default lanczos filter. This will potentially have more >> aliasing artifacts, but should have no ringing at all. >> >> till then, David. > > That works perfectly for me! Thanks ?a lot! > > Interesting explanation too. When I have some more free time I'll have > to look deeper at the math behind these filters. > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From dblank at cs.brynmawr.edu Thu Aug 5 01:24:05 2010 From: dblank at cs.brynmawr.edu (Douglas S. Blank) Date: Wed, 4 Aug 2010 19:24:05 -0400 (EDT) Subject: [Image-SIG] Python 3 support Message-ID: <59991.76.98.34.255.1280964245.squirrel@cs.brynmawr.edu> Apologies if this is an oft-asked question, but I can't find an answer: What is the status of PIL for Python3? I see on http://www.pythonware.com/products/pil/index.htm: "A version of 1.1.7 for 3.X will be released later." That statement I guess means that PIL 1.1.7 is being ported to Python3. What is the expected time frame? Best guess? I haven't really followed the development of PIL, so I don't know if this is an open source project where people can help out, or it is solely dependent on Fredrik. The last comment from Fredrik was 17 months ago: On Thu Mar 19 09:31:32 CET 2009 Fredrik Lundh said: > The plan is to get 1.1.7 out of the door (early april) and then make a > version of that available for 3.x. There's also a preliminary port of 1.1.6 > available from a third party; see the mailing list archives for pointers. > > Cheers /F I couldn't find a link to this port. If anyone has any details on 1.1.7 or others for Python3, that would be great. Thanks! -Doug From massalinimartino at gmail.com Thu Aug 5 10:42:39 2010 From: massalinimartino at gmail.com (Martino Massalini) Date: Thu, 5 Aug 2010 10:42:39 +0200 Subject: [Image-SIG] Problem with psd and Alpha Message-ID: <29B87C47-3DB1-4C11-A880-85814C3455B3@gmail.com> Hi, i'm tryng to composite several psd coming from my render software. Each one is a psd with the same size of the others and an alpha channel. The problem is when i do im = Image.open("filepath") I alway get a "RGB" image instead of "RGBA" so i can't use the alpha channel as mask when i compose the image. Here some snippet: >>> im = Image.open("prova0000.psd") >>> im.mode 'RGB' >>> im.split() Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.5/site-packages/PIL/Image.py", line 1497, in split if self.im.bands == 1: AttributeError: 'NoneType' object has no attribute 'bands' >>> repr(im.im) 'None' >>> im.load() >>> repr(im.im) '' >>> im.split() (, , ) Thanks, Martino. From atyazdi at ucdavis.edu Tue Aug 10 01:29:03 2010 From: atyazdi at ucdavis.edu (Anahita Yazdi) Date: Mon, 9 Aug 2010 16:29:03 -0700 Subject: [Image-SIG] Image histogram In-Reply-To: References: Message-ID: Hi, I was just wondering how would I be able to get some extra help regarding editing an image's histogram using python's module? I have modified a histogram of an image however I dont know how to apply the new histogram to the image and basically reload the image based on its new modified histogram instead of its own histogram? In the other words how should I make changes on an image's histogram in a way that the image recognizes the new histogram and gets changed? I need to somehow introduce a LUT for the image and use ".point(table)" function to reload the image however I am not sure how to make the right LUT from a modified histogram! Thanks for the help in advance, Anahita -------------- next part -------------- An HTML attachment was scrubbed... URL: From edward at unicornschool.org Sat Aug 14 22:07:52 2010 From: edward at unicornschool.org (Edward Cannon) Date: Sat, 14 Aug 2010 13:07:52 -0700 Subject: [Image-SIG] Problem with psd and Alpha In-Reply-To: <29B87C47-3DB1-4C11-A880-85814C3455B3@gmail.com> References: <29B87C47-3DB1-4C11-A880-85814C3455B3@gmail.com> Message-ID: I seem to remember that there are two versions of the psd file format, a newer version and a version used with the numbered versions. Is your file a newer or older version? also, have you verified that the alpha channel is there by opening the file in another program (ie photoshop). On Thu, Aug 5, 2010 at 1:42 AM, Martino Massalini wrote: > Hi, i'm tryng to composite several psd coming from my render software. > Each one is a psd with ?the same size of the others and an alpha channel. > The problem is when i do > > im = Image.open("filepath") > > I alway get a "RGB" image instead of "RGBA" so i can't use the alpha channel > as mask when i compose the image. > > Here some snippet: > >>>> im = Image.open("prova0000.psd") >>>> im.mode > 'RGB' >>>> im.split() > Traceback (most recent call last): > ?File "", line 1, in > ?File "/Library/Python/2.5/site-packages/PIL/Image.py", line 1497, in split > ? ?if self.im.bands == 1: > AttributeError: 'NoneType' object has no attribute 'bands' >>>> repr(im.im) > 'None' >>>> im.load() > >>>> repr(im.im) > '' >>>> im.split() > (, mode=L size=146x90 at 0x42C828>, 0x42C940>) > > Thanks, > Martino. > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From joeoettinger at gmail.com Sun Aug 15 19:43:05 2010 From: joeoettinger at gmail.com (joe oettinger) Date: Sun, 15 Aug 2010 13:43:05 -0400 Subject: [Image-SIG] support for python 3 Message-ID: Over the past year, the lack of response by anyone to questions about PIL support of Python 3.x has been surprising. Surely the subject is of interest to some image-sig members. I?m guessing that the needed effort to extend that support must be very great, since other libraries such as Numpy haven?t been modified for Python 3.x either. Still, it would be nice for relative novices like me to have an idea if and when such support might be available. I feel a little guilty even bringing up the matter, having contributed very little to the open source effort. As a novice, I couldn't contribute much to such an effort (except perhaps correcting grammar and spelling in documents). Maybe this e-mail will stimulate discussion of the matter. Anyone have any thoughts? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Satya.Gundapaneni at zimmer.com Mon Aug 16 15:51:25 2010 From: Satya.Gundapaneni at zimmer.com (Satya Gundapaneni) Date: Mon, 16 Aug 2010 09:51:25 -0400 Subject: [Image-SIG] Opening TIFF and HPGL files using Python PIL getting IO Errors Message-ID: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> Hi, I am new to Python. I have a requirement to extract some portion of the image and save that portion. After some investigation in net I found out that Python and PIL has the capability to crop and the image and save that image to different file. But the problem I am facing is I am not able to open TIFF and HPGL files. When I try to open TIFF images I am getting "IOError: decoder group4 not available" While opening HPGL images I am getting "IOError: cannot identify image file" Will I be able to open TIFF and HPGL files in PIL or not? All my images are in either TIFF or HPGL formats. Appreciate your help. Regards, Satyanarayana Gundapaneni Zimmer Inc. 1800 W Center St. Warsaw, IN 46580 Mailto: satya.gundapaneni at zimmer.com Work - 574 267 6131 Xtn 12749 -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.kloss at massey.ac.nz Tue Aug 17 23:37:36 2010 From: g.kloss at massey.ac.nz (Guy K. Kloss) Date: Wed, 18 Aug 2010 09:37:36 +1200 Subject: [Image-SIG] support for python 3 In-Reply-To: References: Message-ID: <201008180937.36793.g.kloss@massey.ac.nz> On Mon, 16 Aug 2010 05:43:05 joe oettinger wrote: > I?m guessing that the needed effort to extend that support must be very > great, since other libraries such as Numpy haven?t been modified for > Python 3.x either. FYI: There is already a development release of NumPy with Py3k compatibility. So it looks like we'll be seeing it in the wild in the not too distant future as betas are already available: http://www.mail-archive.com/numpy-discussion at scipy.org/msg26524.html This release of NumPy supports Py 2.x as well as 3.x, so an approach like this works without a code base fragmentation/forking. HTH, Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura P?taiao o M?hiohio me P?ngarau Massey University, Albany (North Shore City, Auckland) 473 State Highway 17, Gate 1, Mailroom, Quad B Building voice: +64 9 414-0800 ext. 9266 fax: +64 9 441-8181 G.Kloss at massey.ac.nz http://www.massey.ac.nz/~gkloss -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From edward at unicornschool.org Tue Aug 17 23:55:35 2010 From: edward at unicornschool.org (Edward Cannon) Date: Tue, 17 Aug 2010 14:55:35 -0700 Subject: [Image-SIG] Opening TIFF and HPGL files using Python PIL getting IO Errors In-Reply-To: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> References: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> Message-ID: HPGL is a vector format used for old HP printers, PIL doesn't open vector art, so no help there, you need a separate converter to turn it into a raster format. look at http://www.pythonware.com/library/pil/handbook/format-tiff.htm for more information about loading tiff files in PIL. On Mon, Aug 16, 2010 at 6:51 AM, Satya Gundapaneni wrote: > Hi, > > > > I am new to Python. > > I have a requirement to extract some portion of the image and save that > portion. > > After some investigation in net I found out that Python and PIL has the > capability to crop and the image and save that image to different file. > > > > But the problem I am facing is? I am not able to open TIFF and HPGL files. > > > > When I try to open TIFF images I am getting? ?IOError: decoder group4 not > available? > > While opening HPGL images I am getting ?IOError: cannot identify image file? > > > > Will I be able to open TIFF and HPGL files in PIL or not? All my images are > in either TIFF or HPGL formats. > > > > Appreciate your help. > > > > > > Regards, > > Satyanarayana Gundapaneni > > Zimmer Inc. > > 1800 W? Center St. > > Warsaw, IN 46580 > Mailto: satya.gundapaneni at zimmer.com > > Work - 574 267 6131 Xtn 12749 > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From seb.haase at gmail.com Wed Aug 18 00:28:27 2010 From: seb.haase at gmail.com (Sebastian Haase) Date: Wed, 18 Aug 2010 00:28:27 +0200 Subject: [Image-SIG] Opening TIFF and HPGL files using Python PIL getting IO Errors In-Reply-To: References: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> Message-ID: Satya, maybe you can ask here: http://pypi.python.org/pypi/Chiplotle and let us all know what you got ... ;-) Good luck, Sebastian Haase On Tue, Aug 17, 2010 at 11:55 PM, Edward Cannon wrote: > HPGL is a vector format used for old HP printers, PIL doesn't open > vector art, so no help there, you need a separate converter to turn it > into a raster format. look at > http://www.pythonware.com/library/pil/handbook/format-tiff.htm for > more information about loading tiff files in PIL. > > On Mon, Aug 16, 2010 at 6:51 AM, Satya Gundapaneni > wrote: >> Hi, >> >> >> >> I am new to Python. >> >> I have a requirement to extract some portion of the image and save that >> portion. >> >> After some investigation in net I found out that Python and PIL has the >> capability to crop and the image and save that image to different file. >> >> >> >> But the problem I am facing is? I am not able to open TIFF and HPGL files. >> >> >> >> When I try to open TIFF images I am getting? ?IOError: decoder group4 not >> available? >> >> While opening HPGL images I am getting ?IOError: cannot identify image file? >> >> >> >> Will I be able to open TIFF and HPGL files in PIL or not? All my images are >> in either TIFF or HPGL formats. >> >> >> >> Appreciate your help. >> >> >> >> >> >> Regards, >> >> Satyanarayana Gundapaneni >> >> Zimmer Inc. >> >> 1800 W? Center St. >> >> Warsaw, IN 46580 >> Mailto: satya.gundapaneni at zimmer.com >> >> Work - 574 267 6131 Xtn 12749 >> >> _______________________________________________ >> 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 spe.stani.be at gmail.com Thu Aug 19 11:10:53 2010 From: spe.stani.be at gmail.com (Stani) Date: Thu, 19 Aug 2010 11:10:53 +0200 Subject: [Image-SIG] Opening TIFF and HPGL files using Python PIL getting IO Errors In-Reply-To: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> References: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> Message-ID: For group4 compressed tiff files you can preprocess them first with tiffcp to uncompressed tiff files which PIL can open. Tiffcp exists for all platforms (sudo apt-get install libtiff-tools on Ubuntu). On Mon, Aug 16, 2010 at 3:51 PM, Satya Gundapaneni wrote: > Hi, > > > > I am new to Python. > > I have a requirement to extract some portion of the image and save that > portion. > > After some investigation in net I found out that Python and PIL has the > capability to crop and the image and save that image to different file. > > > > But the problem I am facing is? I am not able to open TIFF and HPGL files. > > > > When I try to open TIFF images I am getting? ?IOError: decoder group4 not > available? > > While opening HPGL images I am getting ?IOError: cannot identify image file? > > > > Will I be able to open TIFF and HPGL files in PIL or not? All my images are > in either TIFF or HPGL formats. > > > > Appreciate your help. > > > > > > Regards, > > Satyanarayana Gundapaneni > > Zimmer Inc. > > 1800 W? Center St. > > Warsaw, IN 46580 > Mailto: satya.gundapaneni at zimmer.com > > Work - 574 267 6131 Xtn 12749 > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -- Phatch Photo Batch Processor - http://photobatch.stani.be SPE Python IDE - http://pythonide.stani.be From fetchinson at googlemail.com Tue Aug 17 18:06:26 2010 From: fetchinson at googlemail.com (Daniel Fetchinson) Date: Tue, 17 Aug 2010 18:06:26 +0200 Subject: [Image-SIG] support for python 3 In-Reply-To: References: Message-ID: > Over the past year, the lack of response by anyone to questions about PIL > support of Python 3.x has been surprising. Surely the subject is of interest > to some image-sig members. > > I?m guessing that the needed effort to extend that support must be very > great, since other libraries such as Numpy haven?t been modified for Python > 3.x either. > > Still, it would be nice for relative novices like me to have an idea if and > when such support might be available. > > I feel a little guilty even bringing up the matter, having contributed very > little to the open source effort. As a novice, I couldn't contribute much to > such an effort (except perhaps correcting grammar and spelling in > documents). > > Maybe this e-mail will stimulate discussion of the matter. Anyone have any > thoughts? Since you say your a novice maybe the following points are not completely useless: In the open source world sometimes deadlines can be set sometimes they can not. Some authors make commitments which they try to honor, sometimes they don't try to honor it and even other times they don't make any commitments. All of these options are perfectly legitimate since the authors are doing their entire work for free. In the case of PIL and python 3 support the case is that the authors prefer not to commit to any deadline or timeline. As I've said this is perfectly legitimate and there is nothing wrong with it. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown From provinsd at telusplanet.net Wed Aug 18 17:09:14 2010 From: provinsd at telusplanet.net (Dean Allen Provins, P. Geoph.) Date: Wed, 18 Aug 2010 09:09:14 -0600 Subject: [Image-SIG] Opening TIFF and HPGL files using Python PIL getting IO Errors In-Reply-To: References: <5CA1D3AF9FBC264281665CE55826848608DADEFE80@NAM-MSG.nam.zimmer.com> Message-ID: <20100818150914.GB4093@telusplanet.net> Satya: On Wed, Aug 18, 2010 at 12:28:27AM +0200, Sebastian Haase wrote: > Satya, > maybe you can ask here: > http://pypi.python.org/pypi/Chiplotle > and let us all know what you got ... ;-) > > Good luck, > Sebastian Haase I recommend "hp2xx" to read, display and convert to other formats, your HP-GL files. It does an excellent job, and I use it regularly. It will convert to several other vector and some raster formats. I use it to convert to Postscript (actually EPS). Go to "http://www.gnu.org/software/hp2xx/" to read about it, and to obtain a copy. If you are a Linux user, it may also be available for your distribution (it certainly is for Debian). Regards, Dean > On Tue, Aug 17, 2010 at 11:55 PM, Edward Cannon > wrote: > > HPGL is a vector format used for old HP printers, PIL doesn't open > > vector art, so no help there, you need a separate converter to turn it > > into a raster format. look at > > http://www.pythonware.com/library/pil/handbook/format-tiff.htm for > > more information about loading tiff files in PIL. > > > > On Mon, Aug 16, 2010 at 6:51 AM, Satya Gundapaneni > > wrote: > >> Hi, > >> > >> > >> > >> I am new to Python. > >> > >> I have a requirement to extract some portion of the image and save that > >> portion. > >> > >> After some investigation in net I found out that Python and PIL has the > >> capability to crop and the image and save that image to different file. > >> > >> > >> > >> But the problem I am facing is? I am not able to open TIFF and HPGL files. > >> > >> > >> > >> When I try to open TIFF images I am getting? ?IOError: decoder group4 not > >> available? > >> > >> While opening HPGL images I am getting ?IOError: cannot identify image file? > >> > >> > >> > >> Will I be able to open TIFF and HPGL files in PIL or not? All my images are > >> in either TIFF or HPGL formats. > >> > >> > >> > >> Appreciate your help. > >> > >> > >> > >> > >> > >> Regards, > >> > >> Satyanarayana Gundapaneni > >> > >> Zimmer Inc. > >> > >> 1800 W? Center St. > >> > >> Warsaw, IN 46580 > >> Mailto: satya.gundapaneni at zimmer.com > >> > >> Work - 574 267 6131 Xtn 12749 > >> > >> _______________________________________________ > >> 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 > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -- Dean Provins, P. Geoph. dprovins at alumni.ucalgary.ca KeyID at at pgpkeys.mit.edu:11371: 0x9643AE65 Fingerprint: 9B79 75FB 5C2B 22D0 6C8C 5A87 D579 9BE5 9643 AE65 From jlu at hep.anl.gov Sun Aug 22 22:25:04 2010 From: jlu at hep.anl.gov (Jack Uretsky) Date: Sun, 22 Aug 2010 15:25:04 -0500 (CDT) Subject: [Image-SIG] my solution (formerly "enough") Message-ID: Hi all- Following a suggestion of Yuri's. with assistance from the book "Beginning Game Development" by Will McGugan (Apress (registered) (Berkeley, CA 2007), here is my solution to the problem of switching images (you can substitute anything you have hadny for the images used for "back1" and "back2": ____________________________________________________ back1 = "a_1.jpg" back2 = "a_2.jpg" import pygame from pygame.locals import * from sys import exit import time pygame.init() screen = pygame.display.set_mode((640,480), 0, 32) pygame.display.set_caption("Hello, World!") back = pygame.image.load(back1).convert() pygame.event.pump() screen.blit(back, (0,0)) pygame.display.update() time.sleep(2) back = pygame.image.load(back2).convert() screen.blit(back, (0,0)) pygame.display.update() ______________________________________________ As you can see, the image can be updated, mulotiple times. My thanks to all who offered suggestions. 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 From l at lrowe.co.uk Mon Aug 23 17:12:41 2010 From: l at lrowe.co.uk (Laurence Rowe) Date: Mon, 23 Aug 2010 16:12:41 +0100 Subject: [Image-SIG] [Patch] PIL / setuptools compatibility Message-ID: Hi, Following the thread on Pillow and Zope / PIL compatibility, I think I've found a solution that I hope will be acceptable for PIL. Problem ======= It's not really a Zope / PIL issue, but rather an easy_install / PIL one which I think exposes a minor problem with PIL's setup.py which only shows up when installing with easy_install:: $ tmp/bin/easy_install http://effbot.org/downloads/Imaging-1.1.7.tar.gz ... Installed /data/devel/pil/tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg Processing dependencies for PIL==1.1.7 Finished processing dependencies for PIL==1.1.7 We're unable to ``import PIL``:: $ tmp/bin/python Python 2.6.4 (r264:75706, Jan 26 2010, 20:09:19) >>> import PIL Traceback (most recent call last): File "", line 1, in ImportError: No module named PIL >>> import Image >>> When the egg is created by easy_install the contents are not within a PIL subdirectory:: $ ls tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg ArgImagePlugin.py ImageEnhance.py PalmImagePlugin.pyc ArgImagePlugin.pyc ImageEnhance.pyc PcdImagePlugin.py BdfFontFile.py ImageFile.py PcdImagePlugin.pyc ... However, if we install without easy_install we get instead:: $ tar -zxf ~/Downloads/Imaging-1.1.7.tar.gz $ tmp/bin/python Imaging-1.1.7/setup.py install ... running install_lib creating /data/devel/pil/tmp/lib/python2.6/site-packages/PIL ... running install_egg_info Writing /data/devel/pil/tmp/lib/python2.6/site-packages/PIL/PIL-1.1.7-py2.6.egg-info creating /data/devel/pil/tmp/lib/python2.6/site-packages/PIL.pth And don't see a problem: $ tmp/bin/python Python 2.6.4 (r264:75706, Jan 26 2010, 20:09:19) >>> import PIL >>> import Image >>> Why does this happen? ===================== To enable ``import Image`` to work, PIL's setup.py installs `Image.py` and with the following options:: extra_path = "PIL", package_dir = {"": "PIL"}, packages = [""], As the `PIL` directory contains an `__init__.py`, ``from PIL import Image`` also works. This is a neat distutils hack, it just doesn't work for eggs. How can this be fixed? ====================== Instead of making a subdirectory importable by magic, we can use a trick to install PIL.pth:: package_data = {"PIL": ["../PIL.pth"]}, This means the PIL package can be installed normally:: ext_package = "PIL", packages = ["PIL"], Everything still ends up in the same place when you install with setup.py:: $ tmp/bin/python pil-setuptools-compat/setup.py install ... running build_py ... creating build/lib.macosx-10.6-i386-2.6/PIL ... copying PIL/../PIL.pth -> build/lib.macosx-10.6-i386-2.6/PIL/.. running build_ext ... running install_lib creating /data/devel/pil/tmp/lib/python2.6/site-packages/PIL ... copying build/lib.macosx-10.6-i386-2.6/PIL.pth -> /data/devel/pil/tmp/lib/python2.6/site-packages $ tmp/bin/python Python 2.6.4 (r264:75706, Jan 26 2010, 20:09:19) >>> import PIL >>> import Image >>> But now when we install with easy_install:: $ tmp/bin/easy_install pil-setuptools-compat/ ... Installed /data/devel/pil/tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg Processing dependencies for PIL==1.1.7 Finished processing dependencies for PIL==1.1.7 The egg gets created with a PIL package:: $ ls tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg EGG-INFO PIL PIL.pth And we can now import PIL:: $ tmp/bin/python Python 2.6.4 (r264:75706, Jan 26 2010, 20:09:19) >>> import PIL >>> import Image Traceback (most recent call last): File "", line 1, in ImportError: No module named Image >>> The ``import Image`` fails, because the PIL.pth is not directly in `site-packages`. This doesn't seem to be a concern for PIL users who install with easy_install / buildout :) To run the tests, I copied the test script and images to another folder for the imports to work correctly:: $ cd pil-setuptools-compat/ $ cp -R selftest.py Images ../tmp/ $ cd ../tmp/ $ bin/python selftest.py -------------------------------------------------------------------- PIL 1.1.7 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from /data/devel/pil/tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg/PIL Binary modules loaded from /data/devel/pil/tmp/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-i386.egg/PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok *** LITTLECMS support not installed -------------------------------------------------------------------- Running selftest: --- 57 tests passed. Code ==== Branch and test package at http://bitbucket.org/lrowe/pil-setuptools-compat Sorry this has got so long! I wanted to avoid misunderstandings. Laurence -------------- next part -------------- A non-text attachment was scrubbed... Name: pil-setuptools-compat.diff Type: application/octet-stream Size: 995 bytes Desc: not available URL: From joeoettinger at gmail.com Sun Aug 22 20:43:17 2010 From: joeoettinger at gmail.com (joe oettinger) Date: Sun, 22 Aug 2010 14:43:17 -0400 Subject: [Image-SIG] support for python 3 Message-ID: In reply to Daniel Fetchinson: Thanks Daniel. As you say, it's legitimate to not commit to a deadline or timeline and there's nothing wrong with that. I wasn't really asking for a deadline or timeline, just trying to get an idea how the process is going. Since PIL is an important Python library, having a general idea of how it's going would be helpful to those who are thinking about learning Python and trying to decide between Python 2.x and Python 3.x. I'll give you an example: My son is an engineer at TI. He writes programs in C, assembly(!) and Matlab, but he told me he was thinking about learning Python with his son Tim. The boy is 10, and it would be his first computer language. It would be simpler for Tim to learn Python 3 than to learn Python 2 and then switch. But I'm sure Tim would soon be interested in games and images ? la Pygames, hence PIL. I think it's wonderful what the authors of PIL have done and are doing. As I mentioned, I'm a novice (though I just wrote a Python program that uses a Tkinter GUI to access a dictionary whose keys are subjects and whose values are files). So my offer to help rings a little hollow, but it's sincere. Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From fetchinson at googlemail.com Thu Aug 26 16:25:42 2010 From: fetchinson at googlemail.com (Daniel Fetchinson) Date: Thu, 26 Aug 2010 16:25:42 +0200 Subject: [Image-SIG] support for python 3 In-Reply-To: References: Message-ID: > In reply to Daniel Fetchinson: > > Thanks Daniel. As you say, it's legitimate to not commit to a deadline or > timeline and there's nothing wrong with that. > > I wasn't really asking for a deadline or timeline, just trying to get an > idea how the process is going. Well, the status is this: python 3 support for PIL will sooner or later be done. I'm not fooling you, that's the exact status, many people tried to get more details but they all failed. Hence this is the exact knowledge that exists publicly. I'm also interested, probably even asked a similar question in the past, but came to the conclusion that it's impossible to get more details out of the developers. And I think there is nothing wrong with that. > Since PIL is an important Python library, having a general idea of how it's > going would be helpful to those who are thinking about learning Python and > trying to decide between Python 2.x and Python 3.x. Wait. If you are really asking about a decision between python 2 and python 3 then I can definitely give you my advice: without hesitation pick python 2. Reasons: (1) the difference between python 2 and 3 is not big (2) there are tons of example code out there written in python 2, see for example the activestate cookbook (3) there are tons of 3rd party libraries written in python 2, PIL being one example (4) python 2 will be supported for at least 10 years (if I'm not mistaken). > I'll give you an example: > > My son is an engineer at TI. He writes programs in C, assembly(!) and > Matlab, but he told me he was thinking about learning Python with his son > Tim. The boy is 10, and it would be his first computer language. It would be > simpler for Tim to learn Python 3 than to learn Python 2 and then switch. > But I'm sure Tim would soon be interested in games and images ? la Pygames, > hence PIL. I'd advise your grandson to dive into python 2 and not worry about python 3 for the moment. When python 3 becomes mainstream (a couple more years at least) he will be able to pick it up really fast because the jump from python 2 to 3 is not big at all. > I think it's wonderful what the authors of PIL have done and are doing. As > I mentioned, I'm a novice (though I just wrote a Python program that uses a > Tkinter GUI to access a dictionary whose keys are subjects and whose values > are files). So my offer to help rings a little hollow, but it's sincere. No worries, there is no problem with not contributing code or anything else. There is absolutely nothing wrong with simply using python and/or 3rd party libraries. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown From stephan0h at gmx.net Fri Aug 27 12:30:50 2010 From: stephan0h at gmx.net (stephan0h at gmx.net) Date: Fri, 27 Aug 2010 12:30:50 +0200 Subject: [Image-SIG] JPEG: colors less shiny? Message-ID: <4C7793DA.7080904@gmx.net> Hi List, I use PIL and Reportlab to procude PDFs containing images. When I convert the images to jpeg before adding them to the Pdf the colors seem to be less shiny (and the PDFs smaller - which is why i convert them). Any ideas? Thanks, Stephan From charlesc-pyimagesig at pyropus.ca Fri Aug 27 18:19:52 2010 From: charlesc-pyimagesig at pyropus.ca (Charles Cazabon) Date: Fri, 27 Aug 2010 10:19:52 -0600 Subject: [Image-SIG] PNG ICC profile buglet in PIL 1.1.7? Message-ID: <20100827161952.GA8958@pyropus.ca> Greetings, I recently upgraded a machine from PIL 1.1.5 to 1.1.7 and ran into a couple of buglets. One was the "'Nonetype' object has no attribute 'bands'" one with a fix found here: http://hg.effbot.org/pil-2009-raclette/changeset/fb7ce579f5f9 The other I've not found any references to in the list archives (or elsewhere): while saving an image in PNG format PIL threw an exception "compress() argument 1 must be string or read-only buffer, not None". I'm wondering if anyone else has run into this one, and whether this is a reasonable way to work around it: --- PngImagePlugin.py.orig 2010-08-27 10:17:11.570280539 -0600 +++ PngImagePlugin.py 2010-08-27 10:17:32.020279474 -0600 @@ -553,7 +553,7 @@ chunk(fp, cid, data) # ICC profile writing support -- 2008-06-06 Florian Hoech - if im.info.has_key("icc_profile"): + if im.info.get("icc_profile", None): # ICC profile # according to PNG spec, the iCCP chunk contains: # Profile name 1-79 bytes # (character string) Thanks, Charles -- ------------------------------------------------------------------ Charles Cazabon Software, consulting, and services available at http://pyropus.ca/ ------------------------------------------------------------------ From image-sig at online.de Sat Aug 28 17:30:31 2010 From: image-sig at online.de (Helge) Date: Sat, 28 Aug 2010 17:30:31 +0200 Subject: [Image-SIG] JPEG: colors less shiny? In-Reply-To: <4C7793DA.7080904@gmx.net> References: <4C7793DA.7080904@gmx.net> Message-ID: <4C792B97.9080508@online.de> Maybe the color channel subsampling. It should be possible to turn this off with the encoder option subsampling=0 or subsampling="4:4:4". I haven't tried it for myself. Best Regards, Helge From image-sig at online.de Sat Aug 28 20:07:05 2010 From: image-sig at online.de (Helge) Date: Sat, 28 Aug 2010 20:07:05 +0200 Subject: [Image-SIG] Paste with alpha not working correctly Message-ID: <4C795049.6090204@online.de> Hello Members, while playing around with PIL I went into a problem with alpha blending: > import Image > bg=Image.new("RGBA",(100,100),(255,0,0,0)) # background red, 100% transparent > bg.save("bg.png") # will be transparent > bg.save("bg.jpg") # will be red as alpha is removed > fg=Image.new("RGB",(100,100),"white") > fg.save("fg.png") > mask=Image.new("L",(100,100),0) > for x in range(100): > for y in range(100): > mask.putpixel((x,y),x*255/100) # gradient mask > mask.save("mask.png") > comp=bg.copy() # create copy (not required) > comp.paste(fg,(0,0),mask) # should blend from transparent to white > comp.save("comp.png") # but is tinted pink Of course usually I don't use colored bg (this is only for visualization here). The effect will be also visible if colored images are pasted into a black bg with mask and then the saved image is viewed on top of a white bg (pasted image will have a dark halo). Is this a library problem or am I doing something wrong? Best Regards, Helge From image-sig at online.de Sun Aug 29 19:42:00 2010 From: image-sig at online.de (Helge) Date: Sun, 29 Aug 2010 19:42:00 +0200 Subject: [Image-SIG] Paste with alpha not working correctly In-Reply-To: References: <4C795049.6090204@online.de> Message-ID: <4C7A9BE8.7020404@online.de> Hello Edward, hello list, Edward Cannon schrieb: > you are doing something "wrong." the paste command ignores the alpha > channel entirely, the only > way it will use it is if the image also used as a mask ie > comp.paste(fg, (0,0), fg) > which will do what you will expect, use fg's mask to do the blending. > adding a different mask > is like replacing the alpha in fg with the different mask. The way to > make a white blend to transparent > is to make a white image and then add the gradient as a mask. Sorry this does not solve my problem at all. I don't want to do a white blend to transparent but want to paste multiple images with mask on a transparent bg. Using code like this fg=fg.convert("RGBA") fg.putalpha(mask) bg.paste(fg,(0,0),fg) instead of using a separate mask in the paste call does not remove the tint from the bg but will apply the alpha twice (fg is less visible). > I am not > entirely sure if this will generalize > to your bigger problem, if you still have trouble post a sample picture or two. To clarify my intention: I want to make a collage of multiple images on a transparent bg with mask. So the blend should go from transparent to image for each image (and if already another image was pasted at the place this is taken into account). Result should be a png file with alpha that can be viewed on different background colors (or even images). The transparent parts should have no "tint" except the colors of my pasted images. I uploaded an example here: There are only two variants in the upper table that are correct: * the upper right corner of a collage on transparent "white" presented on a white bg * the lower left corner of a collage on transparent "black" presented on a black bg I was expecting in each table row all images appear identical (in all rows the same picture set is shown). Best Regards, Helge From adys.wh at gmail.com Sun Aug 29 19:53:34 2010 From: adys.wh at gmail.com (Jerome Leclanche) Date: Sun, 29 Aug 2010 18:53:34 +0100 Subject: [Image-SIG] Paste with alpha not working correctly In-Reply-To: <4C7A9BE8.7020404@online.de> References: <4C795049.6090204@online.de> <4C7A9BE8.7020404@online.de> Message-ID: Hi Helge I believe I've run into that issue before when creating composited images. I fixed it with the following hack in libImaging/Paste.c:135 @ paste_mask_RGBA Replaced the for loop with the following: for (y = 0; y < ysize; y++) { UINT8* out = (UINT8*) imOut->image[y+dy]+dx*pixelsize; UINT8* in = (UINT8*) imIn->image[y+sy]+sx*pixelsize; UINT8* mask = (UINT8*) imMask->image[y+sy]+sx*4+3; for (x = 0; x < xsize; x++) { for (i = 0; i < pixelsize; i++) { *mask = 255; // XXX Disable masking (transparency bug) // if (i == 3) {*out = 255; out++, in++;continue;} // XXX Disable masking (transparency bug) *out = BLEND(*mask, *out, *in, tmp1, tmp2); out++, in++; } mask += 4; } } } (You may want to swap the comments, I don't remember which line fixed it, it's been a while) J. Leclanche / Adys On Sun, Aug 29, 2010 at 6:42 PM, Helge wrote: > Hello Edward, hello list, > > Edward Cannon schrieb: >> >> you are doing something "wrong." the paste command ignores the alpha >> channel entirely, the only >> way it will use it is if the image also used as a mask ie >> ? comp.paste(fg, (0,0), fg) >> which will do what you will expect, use fg's mask to do the blending. >> adding a different mask >> is like replacing the alpha in fg with the different mask. The way to >> make a white blend to transparent >> is to make a white image and then add the gradient as a mask. > > Sorry this does not solve my problem at all. I don't want to do a white > blend to transparent but want to paste multiple images with mask on a > transparent bg. Using code like this > fg=fg.convert("RGBA") > fg.putalpha(mask) > bg.paste(fg,(0,0),fg) > instead of using a separate mask in the paste call does not remove the tint > from the bg but will apply the alpha twice (fg is less visible). > >> I am not >> entirely sure if this will generalize >> to your bigger problem, if you still have trouble post a sample picture or >> two. > > To clarify my intention: I want to make a collage of multiple images on a > transparent bg with mask. So the blend should go from transparent to image > for each image (and if already another image was pasted at the place this is > taken into account). Result should be a png file with alpha that can be > viewed on different background colors (or even images). The transparent > parts should have no "tint" except the colors of my pasted images. > > I uploaded an example here: > > There are only two variants in the upper table that are correct: > * the upper right corner of a collage on transparent "white" presented on a > white bg > * the lower left corner of a collage on transparent "black" presented on a > black bg > I was expecting in each table row all images appear identical (in all rows > the same picture set is shown). > > Best Regards, > Helge > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From image-sig at online.de Sun Aug 29 21:21:04 2010 From: image-sig at online.de (Helge) Date: Sun, 29 Aug 2010 21:21:04 +0200 Subject: [Image-SIG] Paste with alpha not working correctly In-Reply-To: References: <4C795049.6090204@online.de> <4C7A9BE8.7020404@online.de> Message-ID: <4C7AB320.4030602@online.de> Hello Jerome, Jerome Leclanche schrieb: > > I believe I've run into that issue before when creating composited > images. I fixed it with the following hack in libImaging/Paste.c:135 @ > paste_mask_RGBA > Replaced the for loop with the following: Glad to read that there is a solution. Sadly I have no possibility to compile the C part. Is there a workaround in python only? (Slowness is no problem.) Thanks and best Regards, Helge From adys.wh at gmail.com Sun Aug 29 21:40:24 2010 From: adys.wh at gmail.com (Jerome Leclanche) Date: Sun, 29 Aug 2010 20:40:24 +0100 Subject: [Image-SIG] Paste with alpha not working correctly In-Reply-To: <4C7AB320.4030602@online.de> References: <4C795049.6090204@online.de> <4C7A9BE8.7020404@online.de> <4C7AB320.4030602@online.de> Message-ID: Sorry Helge; unless you rewrite a pasting method in python (which is out of my league currently) there is no way around this. I'd still recommend compiling PIL; it's pretty easy since it has build scripts and so on. J. Leclanche / Adys On Sun, Aug 29, 2010 at 8:21 PM, Helge wrote: > Hello Jerome, > > Jerome Leclanche schrieb: >> >> I believe I've run into that issue before when creating composited >> images. I fixed it with the following hack in libImaging/Paste.c:135 @ >> paste_mask_RGBA >> Replaced the for loop with the following: > > Glad to read that there is a solution. > Sadly I have no possibility to compile the C part. Is there a workaround in > python only? (Slowness is no problem.) > > Thanks and best Regards, > ?Helge > From velasco at truman.edu Fri Aug 27 20:26:40 2010 From: velasco at truman.edu (Velasco, Eduardo) Date: Fri, 27 Aug 2010 13:26:40 -0500 Subject: [Image-SIG] PIL 1.1.7 for Python 2.7 Message-ID: Is there a download for PIL 1.1.7 for Python 2.7 (Windows)? Your page http://www.pythonware.com/products/pil/ only list downloads for Python 2.4, 2.5 and 2.6. Is it possible to use the download for 2.6 for 2.7 also? Thanks Eduardo Velasco -------------- next part -------------- An HTML attachment was scrubbed... URL: