From fredrik at pythonware.com Thu Oct 2 19:47:28 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 02 Oct 2008 19:47:28 +0200 Subject: [Image-SIG] No "transparency" key in info for transparent PNG In-Reply-To: <199b51b30809281630o1abf9b56ubef76dd4c3a9720c@mail.gmail.com> References: <199b51b30809281630o1abf9b56ubef76dd4c3a9720c@mail.gmail.com> Message-ID: Szymon Kosok wrote: > I have transparent PNG (when I open it in Photoshop it's transparent) > and when I try to open it with PIL there is no "transparency" key in > info. I've tried another transparent PNG (famfamfam icon) and no luck > with that too. What can cause that problem? Mode is "RGBA". the transparency key is used to mark a given color index as transparent for 8-bit (mode "P") images. an RGBA image has a transparency value for each pixel (that's what the "A" in the mode name stands for). From michael.odonnell at uam.es Fri Oct 3 00:26:05 2008 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Fri, 3 Oct 2008 00:26:05 +0200 Subject: [Image-SIG] PIL and Python 2.6 Message-ID: <47e491110810021526la9bc525oa7867fb3950b8d0a@mail.gmail.com> Hi All, Anyone know if PIL will be updated to work with Python 2.6 now that it is fully released? If no update pending, is there a way to use the libraries installed under 2.5 with 2.6? (I am keen to use Python 2.6 but my software needs PIL) Mick From micko at wagsoft.com Fri Oct 3 00:28:29 2008 From: micko at wagsoft.com (Michael O'Donnell) Date: Fri, 3 Oct 2008 00:28:29 +0200 Subject: [Image-SIG] PIL and Python 2.6 Message-ID: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> Hi All, Anyone know if PIL will be updated to work with Python 2.6 now that it is fully released? If no update pending, is there a way to use the libraries installed under 2.5 with 2.6? (I am keen to use Python 2.6 but my software needs PIL) Mick From d_l_goldsmith at yahoo.com Sat Oct 4 08:40:30 2008 From: d_l_goldsmith at yahoo.com (David Goldsmith) Date: Fri, 3 Oct 2008 23:40:30 -0700 (PDT) Subject: [Image-SIG] How to create a new RGB image from an mxnx3 numpy array Message-ID: <977391.3577.qm@web52103.mail.re2.yahoo.com> Hi! I've been over and over the handbook, tried everything I could think of, and still can't figure it out: how the heck does one get an m x n x 3 numpy array interpreted as an RGB image? I tried fromarray, both with the whole array, and trying to merge the three images resulting from fromarray-ing the three m x n sub-arrays, creating the image first and then using putdata in various ways, etc., etc. Please help. Thanks. DG PS: Also, more discussion of the Palette concept in the handbook would be nice (e.g., what's its relation, if any, to the concept of colormaps, as used, e.g., in matlab and matplotlib). Thanks again. From ned at nedbatchelder.com Sat Oct 4 16:59:32 2008 From: ned at nedbatchelder.com (Ned Batchelder) Date: Sat, 04 Oct 2008 10:59:32 -0400 Subject: [Image-SIG] How to create a new RGB image from an mxnx3 numpy array In-Reply-To: <977391.3577.qm@web52103.mail.re2.yahoo.com> References: <977391.3577.qm@web52103.mail.re2.yahoo.com> Message-ID: <48E784D4.4020800@nedbatchelder.com> I use code like this: pixels = numpy.zeros((200, 300, 3), dtype=numpy.uint8) //.. write data into the pixels array .. im = Image.fromarray(pixels) --Ned. http://nedbatchelder.com David Goldsmith wrote: > Hi! I've been over and over the handbook, tried everything I could think of, and still can't figure it out: how the heck does one get an m x n x 3 numpy array interpreted as an RGB image? I tried fromarray, both with the whole array, and trying to merge the three images resulting from fromarray-ing the three m x n sub-arrays, creating the image first and then using putdata in various ways, etc., etc. Please help. Thanks. > > DG > > PS: Also, more discussion of the Palette concept in the handbook would be nice (e.g., what's its relation, if any, to the concept of colormaps, as used, e.g., in matlab and matplotlib). Thanks again. > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > > -- Ned Batchelder, http://nedbatchelder.com From d_l_goldsmith at yahoo.com Sat Oct 4 18:40:19 2008 From: d_l_goldsmith at yahoo.com (David Goldsmith) Date: Sat, 4 Oct 2008 09:40:19 -0700 (PDT) Subject: [Image-SIG] How to create a new RGB image from an mxnx3 numpy array In-Reply-To: <48E784D4.4020800@nedbatchelder.com> Message-ID: <851995.52002.qm@web52109.mail.re2.yahoo.com> Awesome, thanks Ned! FTR (in case it helps others): Ned's "solution" was, formally, among the first things (if not the first thing) I tried, but...for my RGB table, I was using a colormap salvaged from some previous work in matlab using the scipy sub-package scipy.io.mio. All that data was in floating point in the interval [0,1], which I knew, but by the time I guessed that I probably needed to convert it to [0,255], I think I must've made some other change somewhere else and/or neglected to simultaneously enforce that the m x n x 3 array be numpy.uint8 so that, between those other two problems, the solution to my problem was being "masked". :-( Anyway, thanks again! DG --- On Sat, 10/4/08, Ned Batchelder wrote: > From: Ned Batchelder > Subject: Re: [Image-SIG] How to create a new RGB image from an mxnx3 numpy array > To: d_l_goldsmith at yahoo.com > Cc: image-sig at python.org > Date: Saturday, October 4, 2008, 7:59 AM > I use code like this: > > pixels = numpy.zeros((200, 300, 3), dtype=numpy.uint8) > //.. write data into the pixels array .. > im = Image.fromarray(pixels) > > --Ned. > http://nedbatchelder.com > > David Goldsmith wrote: > > Hi! I've been over and over the handbook, tried > everything I could think of, and still can't figure it > out: how the heck does one get an m x n x 3 numpy array > interpreted as an RGB image? I tried fromarray, both with > the whole array, and trying to merge the three images > resulting from fromarray-ing the three m x n sub-arrays, > creating the image first and then using putdata in various > ways, etc., etc. Please help. Thanks. > > > > DG > > > > PS: Also, more discussion of the Palette concept in > the handbook would be nice (e.g., what's its relation, > if any, to the concept of colormaps, as used, e.g., in > matlab and matplotlib). Thanks again. > > > > > > > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > > > > > > > > -- > Ned Batchelder, http://nedbatchelder.com From fredrik at pythonware.com Sun Oct 5 17:31:45 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 05 Oct 2008 17:31:45 +0200 Subject: [Image-SIG] PIL and Python 2.6 In-Reply-To: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> References: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> Message-ID: Michael O'Donnell wrote: > Anyone know if PIL will be updated to work with Python 2.6 > now that it is fully released? > > If no update pending, is there a way to use the libraries installed > under 2.5 with 2.6? > > (I am keen to use Python 2.6 but my software needs PIL) afaik, PIL 1.1.6 works just fine under 2.6. there's a 2.6 build for windows available from: http://effbot.org/downloads/#pil From mail at karsten.name Sun Oct 5 22:54:17 2008 From: mail at karsten.name (Karsten Hiddemann) Date: Sun, 05 Oct 2008 22:54:17 +0200 Subject: [Image-SIG] PIL and Python 2.6 In-Reply-To: References: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> Message-ID: <48E92979.3050002@karsten.name> Fredrik Lundh schrieb: > afaik, PIL 1.1.6 works just fine under 2.6. there's a 2.6 build for > windows available from: I remember somebody saying 'If 2.6 doesn't require fixes, there will most likely be a "patch catchup" round in august/september, and an official 1.1.7 release after that.' I'm eagerly awaiting said things. :) Cheers, Karsten From fredrik at pythonware.com Mon Oct 6 20:42:26 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 06 Oct 2008 20:42:26 +0200 Subject: [Image-SIG] PIL and Python 2.6 In-Reply-To: <48E92979.3050002@karsten.name> References: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> <48E92979.3050002@karsten.name> Message-ID: Karsten Hiddemann wrote: >> afaik, PIL 1.1.6 works just fine under 2.6. there's a 2.6 build for >> windows available from: > > I remember somebody saying 'If 2.6 doesn't require fixes, there will > most likely be a "patch catchup" round in august/september, and an > official 1.1.7 release after that.' I'm eagerly awaiting said things. :) yep, I seem to remember that too... however, I got somewhat distracted by a job offer I couldn't refuse, in a country I haven't lived in before, so things are a bit busy right now. (but in the meantime, maybe we could set up a google moderator series or a slinkset forum to collect and prioritize patches and other fixes that would be nice to have in an 1.1.7 maintenance release. what would the list prefer?) From borgus at gmx.de Tue Oct 7 11:17:41 2008 From: borgus at gmx.de (Sebastian Wernicke) Date: Tue, 07 Oct 2008 11:17:41 +0200 Subject: [Image-SIG] support for more image-formats? iff? Message-ID: <48EB2935.60200@gmx.de> Hi guys! This is my very first mail in this list, just wanna say 'hello' and ask a question... I'm mainly a 3d artist and not a programmer...i just write my own small tools to make my work easyer...:o) Question 1: I'm searching for iff support, would be very nice for me to be able to open it with the pil-modules... is this format planned to be supported? IFF a maya file format with RGBA and a Z Channel (8 or 16Bit) Question 2: Is there a way to display 16 Bit/per Channel Pictures (such as Tiff)? Hope that are not to stupid questions for you.... Best regards, Sebastian From jcupitt at gmail.com Tue Oct 7 12:00:04 2008 From: jcupitt at gmail.com (jcupitt at gmail.com) Date: Tue, 7 Oct 2008 11:00:04 +0100 Subject: [Image-SIG] Yet another image processing library In-Reply-To: <522c6460707300858q33bbdadehb8fb355c7cd617c3@mail.gmail.com> References: <522c6460707300858q33bbdadehb8fb355c7cd617c3@mail.gmail.com> Message-ID: <522c6460810070300g61c445e5xae544daba11fed99@mail.gmail.com> 2007/7/30 : > I help maintain an image processing library called VIPS. We've just > released a new stable version and one of the new features is a Python > binding. > > http://www.vips.ecs.soton.ac.uk I hope no one minds this announcement. We've just released a new stable version of vips, 7.16.2, that improves the Python binding quite a bit. Good things about vips: * fast, since it's written in C and has good SMP support * low memory use, especially for large images and complex processing, since it is demand-driven and keeps source images on disc where possible * many pixel formats, from 8 to 128-bit pixels, and any number of image bands * >300 image processing operations available in Python * LGPL license Bad things about vips: * no Python binding for Windows (though it ought to be easy to build) * this new version is not yet available in all linuxes so you might need to compile from source * the Python binding is generated automatically from a C++ binding and isn't very Pythonesque More detail and benchmarks here: http://www.vips.ecs.soton.ac.uk/index.php?title=Python New stuff in this version: * The varargs parts of the C++ API are now wrapped in Python, so you can do things like building masks from lists: mask = VMask.VIMask (3, 3, 2, 0, [-1, -1, -1, -1, 16, -1, -1, -1, -1]) To make a 3x3 integer convolution mask, with scale == 2. * The VImage class now has .tobuffer(), .frombuffer() and .tostring() and .fromstring(), so you can efficiently move images between PIL and VIPS. There are also a couple of utility functions to convert VIPS headers to PIL headers and back. There's some sample code in SVN: http://vips.svn.sourceforge.net/viewvc/vips/vips7/branches/vips-7.16/python/test/pilvips.py?view=markup Although it won't copy over image metadata, like EXIF and ICC profiles, sadly. John From d_l_goldsmith at yahoo.com Wed Oct 8 02:48:58 2008 From: d_l_goldsmith at yahoo.com (David Goldsmith) Date: Tue, 7 Oct 2008 17:48:58 -0700 (PDT) Subject: [Image-SIG] Yet another image processing library In-Reply-To: <522c6460810070300g61c445e5xae544daba11fed99@mail.gmail.com> Message-ID: <553219.92670.qm@web52103.mail.re2.yahoo.com> How "PIL-like" is your Python API? DG --- On Tue, 10/7/08, jcupitt at gmail.com wrote: > From: jcupitt at gmail.com > Subject: Re: [Image-SIG] Yet another image processing library > To: image-sig at python.org > Date: Tuesday, October 7, 2008, 3:00 AM > 2007/7/30 : > > I help maintain an image processing library called > VIPS. We've just > > released a new stable version and one of the new > features is a Python > > binding. > > > > http://www.vips.ecs.soton.ac.uk > > I hope no one minds this announcement. We've just > released a new > stable version of vips, 7.16.2, that improves the Python > binding quite > a bit. > > Good things about vips: > > * fast, since it's written in C and has good SMP > support > * low memory use, especially for large images and complex > processing, > since it is demand-driven and keeps source images on disc > where > possible > * many pixel formats, from 8 to 128-bit pixels, and any > number of image bands > * >300 image processing operations available in Python > * LGPL license > > Bad things about vips: > > * no Python binding for Windows (though it ought to be easy > to build) > * this new version is not yet available in all linuxes so > you might > need to compile from source > * the Python binding is generated automatically from a C++ > binding and > isn't very Pythonesque > > More detail and benchmarks here: > > http://www.vips.ecs.soton.ac.uk/index.php?title=Python > > New stuff in this version: > > * The varargs parts of the C++ API are now wrapped in > Python, so you > can do things like building masks from lists: > > mask = VMask.VIMask (3, 3, 2, 0, > [-1, -1, -1, > -1, 16, -1, > -1, -1, -1]) > > To make a 3x3 integer convolution mask, with scale == 2. > > * The VImage class now has .tobuffer(), .frombuffer() and > .tostring() > and .fromstring(), so you can efficiently move images > between PIL and > VIPS. There are also a couple of utility functions to > convert VIPS > headers to PIL headers and back. There's some sample > code in SVN: > > http://vips.svn.sourceforge.net/viewvc/vips/vips7/branches/vips-7.16/python/test/pilvips.py?view=markup > > Although it won't copy over image metadata, like EXIF > and ICC profiles, sadly. > > John > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From jcupitt at gmail.com Wed Oct 8 10:33:41 2008 From: jcupitt at gmail.com (jcupitt at gmail.com) Date: Wed, 8 Oct 2008 09:33:41 +0100 Subject: [Image-SIG] Yet another image processing library In-Reply-To: <553219.92670.qm@web52103.mail.re2.yahoo.com> References: <522c6460810070300g61c445e5xae544daba11fed99@mail.gmail.com> <553219.92670.qm@web52103.mail.re2.yahoo.com> Message-ID: <522c6460810080133x1378b368h9e9e88ec298c6ed1@mail.gmail.com> 2008/10/8 David Goldsmith : > How "PIL-like" is your Python API? The 'Python' page on our website has some sample code comparing PIL and vips: http://www.vips.ecs.soton.ac.uk/index.php?title=Python#Speed_and_memory_use So it's broadly similar. I suppose someone could write a wrapper class that makes vips look more like PIL, but I don't think 100% compatibility is possible, since vips has (almost) no destructive operations. I think the big differences are: * vips should be quicker, especially if you have more than one CPU core or you're working on large images, though it does depend on what operations you use and what image format you work in * vips can process larger images and needs less memory * vips is more flexible in the range of image formats available: vips images are width, height, bands, format and that's it, there's no RGB mode or greyscale mode or alpha channel or anything like that * vips can handle metadata like ICC profiles and EXIF data * vips has a larger range of operations available (I think) * vips is almost all C/C++, so it's harder to extend or modify from Python * vips has (almost) no destructive operations: unlike PIL, you can't modify images, you can only make new images (most demand-driven image processing systems are like this, it makes caching and parallelism much easier) * PIL has a more 'natural' Python interface * vips has a GUI you can use to experiment with (nip2), though it's rather an odd one John From szymon at mwg.pl Wed Oct 8 16:29:30 2008 From: szymon at mwg.pl (Szymon Kosok) Date: Wed, 8 Oct 2008 16:29:30 +0200 Subject: [Image-SIG] Transparent paste - another problem Message-ID: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> Hi, I have another problem with PIL and transparent images. I have such code: foo = Image.open("bar.png") for p in w: baz = Image.open(p.element.binary.path) foo.paste(baz, (p.x, p.y), baz) And the problem is... every baz (some of them are semi-transparent) is transparent over every previous element. Maybe I'll show what I want, and what I got: http://i36.tinypic.com/2efjlaw.png - this is what I want, http://i38.tinypic.com/11glf6t.png - and this what I get. Any hints? Best regards, Szymon From lists+Image_SIG at hoech.org Wed Oct 8 17:09:41 2008 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Wed, 08 Oct 2008 17:09:41 +0200 Subject: [Image-SIG] Transparent paste - another problem In-Reply-To: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> References: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> Message-ID: <48ECCD35.60608@hoech.org> Hi, without seeing the original foo and at least some of the baz images, it's hard to tell how to achieve what you're looking for. I'd assume you want some sort of "adaptive multiplication", where only transparent parts are "multiplied over" the existing image and fully opaque parts "knock out" everything under it. Regards, Florian Szymon Kosok schrieb: > Hi, > > I have another problem with PIL and transparent images. I have such code: > > foo = Image.open("bar.png") > > for p in w: > > baz = Image.open(p.element.binary.path) > > foo.paste(baz, (p.x, p.y), baz) > > And the problem is... every baz (some of them are semi-transparent) is > transparent over every previous element. > > Maybe I'll show what I want, and what I got: > > http://i36.tinypic.com/2efjlaw.png - this is what I want, > http://i38.tinypic.com/11glf6t.png - and this what I get. > > Any hints? > > Best regards, > Szymon > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From szymon at mwg.pl Wed Oct 8 17:25:55 2008 From: szymon at mwg.pl (Szymon Kosok) Date: Wed, 8 Oct 2008 17:25:55 +0200 Subject: [Image-SIG] Transparent paste - another problem In-Reply-To: <48ECCD35.60608@hoech.org> References: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> <48ECCD35.60608@hoech.org> Message-ID: <199b51b30810080825m42d8e0c5vbb2152861d081874@mail.gmail.com> Hi, Ok. So here is some baz: http://i.wonderlife.pl/cache/ubranie-83-620.png http://i.wonderlife.pl/cache/ubranie-84-620.png And this is foo: http://i.wonderlife.pl/img/ciala/mc.png Regards, Szymon 2008/10/8 Florian H?ch : > Hi, > > without seeing the original foo and at least some of the baz images, it's > hard to tell how to achieve what you're looking for. I'd assume you want > some sort of "adaptive multiplication", where only transparent parts are > "multiplied over" the existing image and fully opaque parts "knock out" > everything under it. > > Regards, > > Florian > > Szymon Kosok schrieb: >> >> Hi, >> >> I have another problem with PIL and transparent images. I have such code: >> >> foo = Image.open("bar.png") >> >> for p in w: >> >> baz = Image.open(p.element.binary.path) >> >> foo.paste(baz, (p.x, p.y), baz) >> >> And the problem is... every baz (some of them are semi-transparent) is >> transparent over every previous element. >> >> Maybe I'll show what I want, and what I got: >> >> http://i36.tinypic.com/2efjlaw.png - this is what I want, >> http://i38.tinypic.com/11glf6t.png - and this what I get. >> >> Any hints? >> >> Best regards, >> Szymon >> _______________________________________________ >> 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 d_l_goldsmith at yahoo.com Wed Oct 8 18:59:34 2008 From: d_l_goldsmith at yahoo.com (David Goldsmith) Date: Wed, 8 Oct 2008 09:59:34 -0700 (PDT) Subject: [Image-SIG] Yet another image processing library In-Reply-To: <522c6460810080133x1378b368h9e9e88ec298c6ed1@mail.gmail.com> Message-ID: <371620.970.qm@web52109.mail.re2.yahoo.com> Thanks, John, very helpful. (FTR: in my case, it was a rhetorical question because, into the foreseeable future, I'm Windows-bound, but it was a helpful synopsis and hopefully others will fill find it so also. Thanks again!) DG --- On Wed, 10/8/08, jcupitt at gmail.com wrote: > From: jcupitt at gmail.com > Subject: Re: [Image-SIG] Yet another image processing library > To: d_l_goldsmith at yahoo.com > Cc: image-sig at python.org > Date: Wednesday, October 8, 2008, 1:33 AM > 2008/10/8 David Goldsmith : > > How "PIL-like" is your Python API? > > The 'Python' page on our website has some sample > code comparing PIL and vips: > > http://www.vips.ecs.soton.ac.uk/index.php?title=Python#Speed_and_memory_use > > So it's broadly similar. I suppose someone could write > a wrapper class > that makes vips look more like PIL, but I don't think > 100% > compatibility is possible, since vips has (almost) no > destructive > operations. > > I think the big differences are: > > * vips should be quicker, especially if you have more than > one CPU > core or you're working on large images, though it does > depend on what > operations you use and what image format you work in > * vips can process larger images and needs less memory > * vips is more flexible in the range of image formats > available: vips > images are width, height, bands, format and that's it, > there's no RGB > mode or greyscale mode or alpha channel or anything like > that > * vips can handle metadata like ICC profiles and EXIF data > * vips has a larger range of operations available (I think) > * vips is almost all C/C++, so it's harder to extend or > modify from Python > * vips has (almost) no destructive operations: unlike PIL, > you can't > modify images, you can only make new images (most > demand-driven image > processing systems are like this, it makes caching and > parallelism > much easier) > * PIL has a more 'natural' Python interface > * vips has a GUI you can use to experiment with (nip2), > though it's > rather an odd one > > John From Chris.Barker at noaa.gov Wed Oct 8 21:28:40 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 08 Oct 2008 12:28:40 -0700 Subject: [Image-SIG] Yet another image processing library In-Reply-To: <371620.970.qm@web52109.mail.re2.yahoo.com> References: <371620.970.qm@web52109.mail.re2.yahoo.com> Message-ID: <48ED09E8.7050307@noaa.gov> David Goldsmith wrote: > in my case, it was a rhetorical > question because, into the foreseeable future, I'm Windows-bound, Is it not available for Windows? from the website, it looks like it is (apart from utf-8 filename issues) Can it efficiently consume and/or produce numpy arrays? That would be very handy for "destructive" operations. numpy can use the buffer interface, but it would be even better to support the new nd-array buffer interface: http://www.python.org/dev/peps/pep-3118/ -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 jcupitt at gmail.com Wed Oct 8 21:54:18 2008 From: jcupitt at gmail.com (jcupitt at gmail.com) Date: Wed, 8 Oct 2008 20:54:18 +0100 Subject: [Image-SIG] Yet another image processing library In-Reply-To: <48ED09E8.7050307@noaa.gov> References: <371620.970.qm@web52109.mail.re2.yahoo.com> <48ED09E8.7050307@noaa.gov> Message-ID: <522c6460810081254t698c07c5y8993553b4ceb54c3@mail.gmail.com> 2008/10/8 Christopher Barker : > Is it not available for Windows? from the website, it looks like it is > (apart from utf-8 filename issues) The windows binary on the website does not include the Python binding. It ought to build for windows (it builds a DLL for libvips with no problems, for example), I just haven't done it. > Can it efficiently consume and/or produce numpy arrays? That would be very > handy for "destructive" operations. > > numpy can use the buffer interface, but it would be even better to support > the new nd-array buffer interface: vips has .tobuffer() and .frombuffer(), so I guess it should work with numpy, but I've not tried. John From lists+Image_SIG at hoech.org Fri Oct 10 10:55:27 2008 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Fri, 10 Oct 2008 10:55:27 +0200 Subject: [Image-SIG] Transparent paste - another problem In-Reply-To: <199b51b30810080825m42d8e0c5vbb2152861d081874@mail.gmail.com> References: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> <48ECCD35.60608@hoech.org> <199b51b30810080825m42d8e0c5vbb2152861d081874@mail.gmail.com> Message-ID: <48EF187F.9050603@hoech.org> Ok, I think I got it. The alpha channel needs to be updated during and inserted after the paste operations. from PIL import Image, ImageChops foo = Image.open("bar.png") alpha = foo.split()[-1] for p in w: baz = Image.open(p.element.binary.path) foo.paste(baz, (p.x, p.y), baz) alpha = ImageChops.add(alpha, baz.split()[-1]) foo.putalpha(alpha) Regards, Florian Szymon Kosok schrieb: > Hi, > > Ok. So here is some baz: > > http://i.wonderlife.pl/cache/ubranie-83-620.png > http://i.wonderlife.pl/cache/ubranie-84-620.png > > And this is foo: > > http://i.wonderlife.pl/img/ciala/mc.png > > Regards, > Szymon > > 2008/10/8 Florian H?ch : >> Hi, >> >> without seeing the original foo and at least some of the baz images, it's >> hard to tell how to achieve what you're looking for. I'd assume you want >> some sort of "adaptive multiplication", where only transparent parts are >> "multiplied over" the existing image and fully opaque parts "knock out" >> everything under it. >> >> Regards, >> >> Florian >> >> Szymon Kosok schrieb: >>> Hi, >>> >>> I have another problem with PIL and transparent images. I have such code: >>> >>> foo = Image.open("bar.png") >>> >>> for p in w: >>> >>> baz = Image.open(p.element.binary.path) >>> >>> foo.paste(baz, (p.x, p.y), baz) >>> >>> And the problem is... every baz (some of them are semi-transparent) is >>> transparent over every previous element. >>> >>> Maybe I'll show what I want, and what I got: >>> >>> http://i36.tinypic.com/2efjlaw.png - this is what I want, >>> http://i38.tinypic.com/11glf6t.png - and this what I get. >>> >>> Any hints? >>> >>> Best regards, >>> Szymon >>> _______________________________________________ >>> 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 szymon at mwg.pl Fri Oct 10 11:10:24 2008 From: szymon at mwg.pl (Szymon Kosok) Date: Fri, 10 Oct 2008 11:10:24 +0200 Subject: [Image-SIG] Transparent paste - another problem In-Reply-To: <48EF187F.9050603@hoech.org> References: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> <48ECCD35.60608@hoech.org> <199b51b30810080825m42d8e0c5vbb2152861d081874@mail.gmail.com> <48EF187F.9050603@hoech.org> Message-ID: <199b51b30810100210h48a2a433kfed2b55c4530d002@mail.gmail.com> Hello, You are my hero, Florian. :) That works! :) Thanks. Best regards, Szymon 2008/10/10 Florian H?ch : > Ok, I think I got it. The alpha channel needs to be updated during and > inserted after the paste operations. > > from PIL import Image, ImageChops > > foo = Image.open("bar.png") > alpha = foo.split()[-1] > > for p in w: > baz = Image.open(p.element.binary.path) > foo.paste(baz, (p.x, p.y), baz) > alpha = ImageChops.add(alpha, baz.split()[-1]) > > foo.putalpha(alpha) > > Regards, > > Florian > > Szymon Kosok schrieb: >> >> Hi, >> >> Ok. So here is some baz: >> >> http://i.wonderlife.pl/cache/ubranie-83-620.png >> http://i.wonderlife.pl/cache/ubranie-84-620.png >> >> And this is foo: >> >> http://i.wonderlife.pl/img/ciala/mc.png >> >> Regards, >> Szymon >> >> 2008/10/8 Florian H?ch : >>> >>> Hi, >>> >>> without seeing the original foo and at least some of the baz images, it's >>> hard to tell how to achieve what you're looking for. I'd assume you want >>> some sort of "adaptive multiplication", where only transparent parts are >>> "multiplied over" the existing image and fully opaque parts "knock out" >>> everything under it. >>> >>> Regards, >>> >>> Florian >>> >>> Szymon Kosok schrieb: >>>> >>>> Hi, >>>> >>>> I have another problem with PIL and transparent images. I have such >>>> code: >>>> >>>> foo = Image.open("bar.png") >>>> >>>> for p in w: >>>> >>>> baz = Image.open(p.element.binary.path) >>>> >>>> foo.paste(baz, (p.x, p.y), baz) >>>> >>>> And the problem is... every baz (some of them are semi-transparent) is >>>> transparent over every previous element. >>>> >>>> Maybe I'll show what I want, and what I got: >>>> >>>> http://i36.tinypic.com/2efjlaw.png - this is what I want, >>>> http://i38.tinypic.com/11glf6t.png - and this what I get. >>>> >>>> Any hints? >>>> >>>> Best regards, >>>> Szymon >>>> _______________________________________________ >>>> 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 > From lists+Image_SIG at hoech.org Fri Oct 10 11:21:26 2008 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Fri, 10 Oct 2008 11:21:26 +0200 Subject: [Image-SIG] Transparent paste - another problem In-Reply-To: <199b51b30810100210h48a2a433kfed2b55c4530d002@mail.gmail.com> References: <199b51b30810080729t514f2380x5492bd0a7757e2ad@mail.gmail.com> <48ECCD35.60608@hoech.org> <199b51b30810080825m42d8e0c5vbb2152861d081874@mail.gmail.com> <48EF187F.9050603@hoech.org> <199b51b30810100210h48a2a433kfed2b55c4530d002@mail.gmail.com> Message-ID: <48EF1E96.9050407@hoech.org> :) Another quick update. Use ImageChops.lighter instead of ImageChops.add (same arguments). That way the mask quality should not wear down when adding an alpha channel that is partially the same as the existing one. Regards, Florian Szymon Kosok schrieb: > Hello, > > You are my hero, Florian. :) That works! :) Thanks. > > Best regards, > Szymon > > 2008/10/10 Florian H?ch : >> Ok, I think I got it. The alpha channel needs to be updated during and >> inserted after the paste operations. >> >> from PIL import Image, ImageChops >> >> foo = Image.open("bar.png") >> alpha = foo.split()[-1] >> >> for p in w: >> baz = Image.open(p.element.binary.path) >> foo.paste(baz, (p.x, p.y), baz) >> alpha = ImageChops.add(alpha, baz.split()[-1]) >> >> foo.putalpha(alpha) >> >> Regards, >> >> Florian >> >> Szymon Kosok schrieb: >>> Hi, >>> >>> Ok. So here is some baz: >>> >>> http://i.wonderlife.pl/cache/ubranie-83-620.png >>> http://i.wonderlife.pl/cache/ubranie-84-620.png >>> >>> And this is foo: >>> >>> http://i.wonderlife.pl/img/ciala/mc.png >>> >>> Regards, >>> Szymon >>> >>> 2008/10/8 Florian H?ch : >>>> Hi, >>>> >>>> without seeing the original foo and at least some of the baz images, it's >>>> hard to tell how to achieve what you're looking for. I'd assume you want >>>> some sort of "adaptive multiplication", where only transparent parts are >>>> "multiplied over" the existing image and fully opaque parts "knock out" >>>> everything under it. >>>> >>>> Regards, >>>> >>>> Florian >>>> >>>> Szymon Kosok schrieb: >>>>> Hi, >>>>> >>>>> I have another problem with PIL and transparent images. I have such >>>>> code: >>>>> >>>>> foo = Image.open("bar.png") >>>>> >>>>> for p in w: >>>>> >>>>> baz = Image.open(p.element.binary.path) >>>>> >>>>> foo.paste(baz, (p.x, p.y), baz) >>>>> >>>>> And the problem is... every baz (some of them are semi-transparent) is >>>>> transparent over every previous element. >>>>> >>>>> Maybe I'll show what I want, and what I got: >>>>> >>>>> http://i36.tinypic.com/2efjlaw.png - this is what I want, >>>>> http://i38.tinypic.com/11glf6t.png - and this what I get. >>>>> >>>>> Any hints? >>>>> >>>>> Best regards, >>>>> Szymon >>>>> _______________________________________________ >>>>> 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 >> > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From mail at karsten.name Fri Oct 10 13:26:26 2008 From: mail at karsten.name (Karsten Hiddemann) Date: Fri, 10 Oct 2008 13:26:26 +0200 Subject: [Image-SIG] PIL and Python 2.6 In-Reply-To: References: <47e491110810021528v15631751mafb50a3a4784bffe@mail.gmail.com> <48E92979.3050002@karsten.name> Message-ID: <48EF3BE2.3070901@karsten.name> Fredrik Lundh schrieb: > (but in the meantime, maybe we could set up a google moderator series or > a slinkset forum to collect and prioritize patches and other fixes that > would be nice to have in an 1.1.7 maintenance release. what would the > list prefer?) No comment from the list, so I assume that it has just the same problem like I do: Absolutely no experience with either one. I guess you can just set up what you prefer most from those two. Cheers, Karsten From btkuhn at email.unc.edu Tue Oct 14 01:44:32 2008 From: btkuhn at email.unc.edu (btkuhn at email.unc.edu) Date: Mon, 13 Oct 2008 19:44:32 -0400 Subject: [Image-SIG] Image Support Message-ID: <20081013194432.hj0f9xkzcwgk0c4k@webmail4.isis.unc.edu> Hello, I hope this is the correct support address; apologies if it is not. I am completely new to programming and am going through a tutorial using python, and the examples I am working with require PIL and ImageTk. I have downloaded and installed these applications but when I try to run a program using the image module, I get the error message "ImportError: No module named Image". I can't find the module in the installed directory, but I installed the program according to directions on your website. From looking on your website, it looks like this is a fairly common problem, but I didn't see instructions for how to "fix" it. Could you please help me out if you are able? Thanks very much, Ben From jwt at onjapan.net Tue Oct 14 02:01:35 2008 From: jwt at onjapan.net (Jim Tittsler) Date: Tue, 14 Oct 2008 13:01:35 +1300 Subject: [Image-SIG] Image Support In-Reply-To: <20081013194432.hj0f9xkzcwgk0c4k@webmail4.isis.unc.edu> References: <20081013194432.hj0f9xkzcwgk0c4k@webmail4.isis.unc.edu> Message-ID: <959A0FEE-F937-40E6-9380-A36ED30D3871@onjapan.net> On Oct 14, 2008, at 12:44, btkuhn at email.unc.edu wrote: > I hope this is the correct support address; apologies if it is not. > I am completely new to programming and am going through a tutorial > using python, and the examples I am working with require PIL and > ImageTk. I have downloaded and installed these applications but when > I try to run a program using the image module, I get the error > message "ImportError: No module named Image". I can't find the > module in the installed directory, but I installed the program > according to directions on your website. Do you have more than one version of Python installed on your system? (Could you have installed PIL in one version of Python, but your system is using a different version when you "try to run a program"?) Did the test step (python selftest.py) during the installation process succeed? From Chris.Barker at noaa.gov Tue Oct 14 03:43:36 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 13 Oct 2008 18:43:36 -0700 Subject: [Image-SIG] Image Support In-Reply-To: <20081013194432.hj0f9xkzcwgk0c4k@webmail4.isis.unc.edu> References: <20081013194432.hj0f9xkzcwgk0c4k@webmail4.isis.unc.edu> Message-ID: <48F3F948.7070604@noaa.gov> btkuhn at email.unc.edu wrote: > I hope this is the correct support address; apologies if it is not. yes, this is the right list. > I get the error message "ImportError: No > module named Image". somehow it didn't get installed correctly. You'll need to tell us what platform you are on, how you installed python, and how you installed PIL. and as another poster said -- this could be caused by having two versions of python in your system -- one you installed PIL into, and the one you are using. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception From btkuhn at email.unc.edu Tue Oct 14 19:35:18 2008 From: btkuhn at email.unc.edu (btkuhn at email.unc.edu) Date: Tue, 14 Oct 2008 13:35:18 -0400 Subject: [Image-SIG] Image Support Message-ID: <20081014133518.5z2v1wgv4kcw408o@webmail4.isis.unc.edu> Hello, I sent a few emails yesterday requesting support help because I was unable to use the "Image.py" module on my machine with python 2.5. When SIG was installed, all modules were automatically saved in the folder C:\Python25\Lib\site-packages\PIL\ . This is the directory for the only version of Python on my machine. After trying to get the module to work for some time, I found that if I copy the module into the folder C:\Python25, the module is accessed properly and works correctly. I'm not sure why this is because with other downloaded modules I have they are imported correctly as long as saved in any folder within C:\Python25. Is there any way around saving every single file in the SIG package directly in the C:\Python25 folder, which will make it extremely cluttered? Sorry if this is a basic question; I'm new to programming. Thanks, Ben From mck at tuxwerk.de Thu Oct 16 09:24:43 2008 From: mck at tuxwerk.de (Marek Kralewski) Date: Thu, 16 Oct 2008 09:24:43 +0200 Subject: [Image-SIG] EPS and resolution Message-ID: <1224141883.6011.18.camel@localhost.localdomain> Hi, I am writing a script to convert EPS to PNG images. I need to set the resolution (and geometry accordingly), since the rendered images are to small. The resolution and geometry must be given as switches to the gs command. Is there a way to overload the Ghostcript function in the EpsImagePlugin.py file or to overload the plugin? The question hopefully seems trivial to a python programmer.. Thank you, Marek From egraham at cens.ucla.edu Fri Oct 17 17:29:35 2008 From: egraham at cens.ucla.edu (Eric Graham) Date: Fri, 17 Oct 2008 08:29:35 -0700 Subject: [Image-SIG] Analyzing hemispheric photos? Message-ID: Hello, I received this request via the R-Ecology mailing list and thought I'd post the question here. Apparently Windows Vista 64-bit does not support Gap Light Analyzer, which takes canopy hemispherical photos, thresholds them, and then gives values such as % canopy openness, LAI, etc. Has anyone used PIL to analyze hemispheric photos? If so, would you have some code lying around to help out this person? This is all assuming that Python + PIL work under Windows Vista 64, which I know nothing about... Thanks a lot! Eric From cannon.el at gmail.com Fri Oct 17 20:54:47 2008 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Fri, 17 Oct 2008 11:54:47 -0700 Subject: [Image-SIG] Analyzing hemispheric photos? In-Reply-To: References: Message-ID: Python+PIL works great under vista, I use it all the time. Images can be thresholded, and the ImageStat module might have some things that you could use. On Fri, Oct 17, 2008 at 8:29 AM, Eric Graham wrote: > Hello, > > I received this request via the R-Ecology mailing list and thought I'd post > the question here. Apparently Windows Vista 64-bit does not support Gap > Light Analyzer, which takes canopy hemispherical photos, thresholds them, > and then gives values such as % canopy openness, LAI, etc. Has anyone used > PIL to analyze hemispheric photos? If so, would you have some code lying > around to help out this person? This is all assuming that Python + PIL work > under Windows Vista 64, which I know nothing about... Thanks a lot! > > Eric > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From dpmellis at gmail.com Sun Oct 19 23:02:30 2008 From: dpmellis at gmail.com (Daniel Mellis) Date: Sun, 19 Oct 2008 16:02:30 -0500 Subject: [Image-SIG] Help Installing PIL 1.1.6 Message-ID: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> Hello, I am running OS X 10.4.11 and python 2.5.2 and when I run "python setup.py install" I get the following error message: --- using frameworks at /System/Library/Frameworks building '_imaging' extension Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/ MacOSX10.4u.sdk Please check your Xcode installation gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ -DWORDS_BIGENDIAN -I/ usr/local/include/freetype2 -IlibImaging -I/Library/Frameworks/ Python.framework/Versions/2.5/include -I/usr/local/include -I/Library/ Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _imaging.c -o build/temp.macosx-10.3-ppc-2.5/_imaging.o unable to execute gcc: No such file or directory error: command 'gcc' failed with exit status 1 I'm not very familiar with the unix aspects of OS X, so some hand holding would be greatly appreciated. Thanks! Daniel From Chris.Barker at noaa.gov Mon Oct 20 01:31:38 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Sun, 19 Oct 2008 16:31:38 -0700 Subject: [Image-SIG] Help Installing PIL 1.1.6 In-Reply-To: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> References: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> Message-ID: <48FBC35A.1060108@noaa.gov> Daniel Mellis wrote: > Hello, > > I am running OS X 10.4.11 and python 2.5.2 and when I run "python > setup.py install" I get the following error message: Use the package you fin here: http://pythonmac.org/packages/py25-fat/index.html Otherwise, you'll need to find and compile all the dependencies as Universal binaries, which is a pain. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception From rowen at u.washington.edu Mon Oct 20 21:25:00 2008 From: rowen at u.washington.edu (Russell E. Owen) Date: Mon, 20 Oct 2008 12:25:00 -0700 Subject: [Image-SIG] Help Installing PIL 1.1.6 References: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> Message-ID: In article <2F43092B-9C2C-4865-9AF3-5B25094124D1 at gmail.com>, Daniel Mellis wrote: > Hello, > > I am running OS X 10.4.11 and python 2.5.2 and when I run "python > setup.py install" I get the following error message: > > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/ > MacOSX10.4u.sdk > Please check your Xcode installation > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - > fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd - > fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ -DWORDS_BIGENDIAN -I/ > usr/local/include/freetype2 -IlibImaging -I/Library/Frameworks/ > Python.framework/Versions/2.5/include -I/usr/local/include -I/Library/ > Frameworks/Python.framework/Versions/2.5/include/python2.5 -c > _imaging.c -o build/temp.macosx-10.3-ppc-2.5/_imaging.o > unable to execute gcc: No such file or directory > error: command 'gcc' failed with exit status 1 > > I'm not very familiar with the unix aspects of OS X, so some hand > holding would be greatly appreciated. Thanks! I agree with Chris. But to comment on your specific question: it looks to me as if you don't have Apple's developer's tools (a.k.a. XCode) installed -- it can't seem to find the C compiler (gcc). To build PIL from source you have to have the developer's tools installed. Then you'd have to build various unix libraries from source. It's a lot easier to use the existing binary if you can. -- Russell From msarahan at gmail.com Mon Oct 20 05:15:51 2008 From: msarahan at gmail.com (Mike Sarahan) Date: Sun, 19 Oct 2008 23:15:51 -0400 Subject: [Image-SIG] Help Installing PIL 1.1.6 In-Reply-To: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> References: <2F43092B-9C2C-4865-9AF3-5B25094124D1@gmail.com> Message-ID: <8275939c0810192015l5876e80awc653f259c3b6f79c@mail.gmail.com> Hi Daniel, It would be wise to also install Xcode, if you haven't already. This is includes gcc and the other things mentioned in debug output that you posted. It should be included on your OSX DVD. As an alternative, you can download it from versiontracker or otherwise: http://www.versiontracker.com/dyn/moreinfo/macosx/21437 Here's another potentially helpful links: http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/ Google will also work wonders in your quest for Apple/GCC zen. -Mike On Sun, Oct 19, 2008 at 5:02 PM, Daniel Mellis wrote: > Hello, > > I am running OS X 10.4.11 and python 2.5.2 and when I run "python setup.py > install" I get the following error message: > > --- using frameworks at /System/Library/Frameworks > building '_imaging' extension > Compiling with an SDK that doesn't seem to exist: > /Developer/SDKs/MacOSX10.4u.sdk > Please check your Xcode installation > gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd > -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBZ -DWORDS_BIGENDIAN > -I/usr/local/include/freetype2 -IlibImaging > -I/Library/Frameworks/Python.framework/Versions/2.5/include > -I/usr/local/include > -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c > _imaging.c -o build/temp.macosx-10.3-ppc-2.5/_imaging.o > unable to execute gcc: No such file or directory > error: command 'gcc' failed with exit status 1 > > I'm not very familiar with the unix aspects of OS X, so some hand holding > would be greatly appreciated. Thanks! > > Daniel > _______________________________________________ > 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 ryanlists at gmail.com Tue Oct 21 18:41:15 2008 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 21 Oct 2008 11:41:15 -0500 Subject: [Image-SIG] installation problems Message-ID: I am having trouble getting PIL 1.1.6 installed in windows. The installer shows a cmd window for a split second and dies without giving me any information. I messed around with the script about registering Python. Python is registered, but the script doesn't think so because the keys don't match exactly (trialing backslashes and so on or a different order for the elements of PythonPath). I tried installing from the source tarball but I get this message: error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py. Trying to pass the -c mingw32 flag leads to the following: C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install -c mingw32 usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'mingw32' C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install "-c mingw32" usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -m not recognized C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py -c mingw32 install usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -c not recognized C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py "-c mingw32" install usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -c not recognized How do I either get the exe to run or get the install from source to work with mingw32? Thanks, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From smullen at uclick.com Tue Oct 21 20:22:25 2008 From: smullen at uclick.com (Samuel Mullen) Date: Tue, 21 Oct 2008 13:22:25 -0500 Subject: [Image-SIG] Resizing Tif's to smaller gifs adds pixels Message-ID: <4c7eeb0e0810211122he0950d4mf24486e5ed6b0283@mail.gmail.com> I'm not entirely sure how this group works: if there is a page I'm supposed to follow up on or if I should expect an email in reply. Anyway, here's my question. I'm very new to Python and PIL, I know how to do this stuff in perl and ImageMagick, but I'm having issues with Python and PIL. I need to scale a TIFF image from 1925x588 px to a GIF of 600xnnn px. I've tried the following code, but it leads to a lot of extra odd colored pixels being inserted into the resulting image. img = "tmp/tmsho20080901.tif" im = Image.open("tmp/tmsho20080901.tif") w, h = im.size im.thumbnail((600, h * 600 / w), Image.ANTIALIAS) newimg = im.resize((600, int(h * (600.0 / w))), Image.ANTIALIAS) newimg.save("tmsho20080901.gif") Using ImageMagick's convert I would do this... convert -colors 256 -resize 600 -colorspace RGB -black-threshold 100 -contrast -intent Perceptual tmp/tmsho20080901.tif tmsho20080901.gif I think it may have something to do with the palette or the number of colors alotted for the resulting image, but I'm really not a graphics guy. Any help on this would be appreciated. Samuel Mullen -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanlists at gmail.com Tue Oct 21 21:26:32 2008 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 21 Oct 2008 14:26:32 -0500 Subject: [Image-SIG] problems with PIL 1.1.6 installation Message-ID: I am having trouble getting PIL 1.1.6 installed in windows. The installer shows a cmd window for a split second and dies without giving me any information. I messed around with the script about registering Python. Python is registered, but the script doesn't think so because the keys don't match exactly (trialing backslashes and so on or a different order for the elements of PythonPath). I tried installing from the source tarball but I get this message: error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py. Trying to pass the -c mingw32 flag leads to the following: C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install -c mingw32 usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'mingw32' C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install "-c mingw32" usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -m not recognized C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py -c mingw32 install usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -c not recognized C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py "-c mingw32" install usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: option -c not recognized How do I either get the exe to run or get the install from source to work with mingw32? Thanks, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists+Image_SIG at hoech.org Wed Oct 22 15:28:35 2008 From: lists+Image_SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Wed, 22 Oct 2008 15:28:35 +0200 Subject: [Image-SIG] problems with PIL 1.1.6 installation In-Reply-To: References: Message-ID: <48FF2A83.5030003@hoech.org> Hello, the cmd window is curious. The installer should be a GUI application. Maybe the exe is broken. Did you try re-downloading? Regards, Florian Ryan Krauss schrieb: > I am having trouble getting PIL 1.1.6 installed in windows. The > installer shows a cmd window for a split second and dies without giving > me any information. I messed around with the script about registering > Python. Python is registered, but the script doesn't think so because > the keys don't match exactly (trialing backslashes and so on or a > different order for the elements of PythonPath). > > I tried installing from the source tarball but I get this message: > > error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate compatible > binaries. > Visual Studio 2003 was not found on this system. If you have Cygwin > installed, > you can try compiling with MingW32, by passing "-c mingw32" to setup.py. > > > Trying to pass the -c mingw32 flag leads to the following: > > C:\ryan\DOWNLO~1\Imaging-1.1. > 6>python setup.py install -c mingw32 > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: invalid command 'mingw32' > > C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install "-c mingw32" > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: option -m not recognized > > C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py -c mingw32 install > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: option -c not recognized > > C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py "-c mingw32" install > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: option -c not recognized > > > How do I either get the exe to run or get the install from source to > work with mingw32? > > Thanks, > > Ryan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From G.Kloss at massey.ac.nz Thu Oct 23 06:43:12 2008 From: G.Kloss at massey.ac.nz (Guy K. Kloss) Date: Thu, 23 Oct 2008 17:43:12 +1300 Subject: [Image-SIG] Resizing Tif's to smaller gifs adds pixels In-Reply-To: <4c7eeb0e0810211122he0950d4mf24486e5ed6b0283@mail.gmail.com> References: <4c7eeb0e0810211122he0950d4mf24486e5ed6b0283@mail.gmail.com> Message-ID: <200810231743.13075.G.Kloss@massey.ac.nz> On Wed, 22 Oct 2008 7:22:25 am Samuel Mullen wrote: > I think it may have something to do with the palette or the number of > colors alotted for the resulting image, but I'm really not a graphics guy. GIF is an image format than can handle only an indexed colour pallet of 256 colours. So if you image used 8 bit per channel (true colour) you will experience some quality loss, and the image will look more grainy. Some software packages are quite good in optimising the pallet and use some dithering algorithms that make the effects stand out less. Ever thought of using PNG instead of GIF? It very often works just as well, and PNG is a much more capable format. HTH, Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura P?taiao o M?hiohio me P?ngarau Room 2.63, Quad Block A Building Massey University, Auckland, Albany Private Bag 102 904, North Shore Mail Centre voice: +64 9 414-0800 ext. 9585 ? fax: +64 9 441-8181 eMail: G.Kloss at massey.ac.nz ?http://www.massey.ac.nz/~gkloss/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. URL: From cannon.el at gmail.com Thu Oct 23 07:58:07 2008 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Wed, 22 Oct 2008 22:58:07 -0700 Subject: [Image-SIG] antialiased lines and polygons Message-ID: A quick question, is their a way to get an antialiased line or polygon in PIL? I draw my shapes just fine, but the edges are jagged. Some packages I know can antialias to reduce the appearance of pixelization, is PIL one of those? Edward From karsten.hiddemann at mathematik.uni-dortmund.de Thu Oct 23 10:35:29 2008 From: karsten.hiddemann at mathematik.uni-dortmund.de (Karsten Hiddemann) Date: Thu, 23 Oct 2008 10:35:29 +0200 Subject: [Image-SIG] antialiased lines and polygons In-Reply-To: References: Message-ID: <49003751.80200@mathematik.uni-dortmund.de> Laura & Edward Cannon schrieb: > Some packages I know can antialias to reduce the appearance > of pixelization, is PIL one of those? I haven't looked into how much PIL supports this, but maybe you want to use aggdraw? From the product page: The aggdraw module implements the basic WCK 2D Drawing Interface on top of the AGG library [1]. This library provides high-quality drawing, with anti-aliasing and alpha compositing, while being fully compatible with the WCK renderer. [1]: http://www.antigrain.com/ Cheers, Karsten From yoda at isr.ist.utl.pt Fri Oct 24 13:14:00 2008 From: yoda at isr.ist.utl.pt (Rodrigo Ventura) Date: Fri, 24 Oct 2008 12:14:00 +0100 Subject: [Image-SIG] PIL does not compile on python 2.6 in MacOSX Leopard Message-ID: <82D90597-5C03-4F81-90CF-0B69A0DF5FDE@isr.ist.utl.pt> I've compiled PIL just fine, with all optional support (used macports for the missing packages), with the python shipped with Leopard (2.5.1), but after installing the official MacPython distro, the PIL does not compile any more. First of all, I get warning after almost all gcc calls during compilation that I did't get before. Sample example: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk - fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 - DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/ Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/ include/freetype2 -IlibImaging -I/opt/local/include -I/Library/ Frameworks/Python.framework/Versions/2.6/include -I/usr/include -I/ Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c libImaging/RawDecode.c -o build/temp.macosx-10.3-i386-2.6/libImaging/ RawDecode.o In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/pyport.h:235, from /Library/Frameworks/Python.framework/Versions/ 2.6/include/python2.6/Python.h:58, from libImaging/ImPlatform.h:10, from libImaging/Imaging.h:14, from libImaging/RawDecode.c:17: /usr/include/architecture/ppc/math.h:675: warning: conflicting types for built-in function 'scalb' And then it fails with: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - bundle -undefined dynamic_lookup build/temp.macosx-10.3-i386-2.6/ _imagingtk.o build/temp.macosx-10.3-i386-2.6/Tk/tkImaging.o -L/opt/ local/lib -L/usr/local/lib -L/Library/Frameworks/Python.framework/ Versions/2.6/lib -L/usr/lib -o build/lib.macosx-10.3-i386-2.6/ _imagingtk.so -framework Tcl -framework Tk ld: in /opt/local/lib/libz.1.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/gO/gOEfKG2kElSEfJYMJH7ijU++ +TI/-Tmp-//ccpZdO98.out (No such file or directory) error: command 'gcc' failed with exit status 1 Is there a fix for this? Cheers, Rodrigo Ventura Institute for Systems and Robotics (www.isr.ist.utl.pt) Instituto Superior T?cnico Lisbon, Portugal From Chris.Barker at noaa.gov Fri Oct 24 18:41:01 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 24 Oct 2008 09:41:01 -0700 Subject: [Image-SIG] [Pythonmac-SIG] python 2.6 on mac seems to break compatibility In-Reply-To: References: <58519D6E-2A11-41CF-93E3-C0DBE888C62A@isr.ist.utl.pt> Message-ID: <4901FA9D.1030100@noaa.gov> Mark Bestley wrote: > I can see several choices yup -- it's easy to do all or nothing with macport or fink, though I do see folks using macports to satisfy the dependencies for some python extensions -- I wonder how? > If 1 works good - 2 or 3 would take more time 4) Use the pre-built Universal Framework libs available from: http://www.kyngchaos.com/wiki/doku.php?id=software:frameworks I think UnixImageIO and FreeType will get you everything you need. These are dynamic libs that are built so that they can be used as OS-X Frameworks, and have a structure so that they fit in well with traditional unix builds. you need to do a bit of path manipulation to get the PIL build to find them, but they work fine. The downside is that your PIL will then be dependent on them -- which is not a problem unless you want to distribute your PIL build. I think it would be a good idea to establish these Frameworks as a "standard" way to support these libs with MacPython extensions, but I didn't get much interest when I proposed it, and I haven't had the time to push it myself. I edited PIL's setup.py to support using these Frameworks a while back. I haven't got it tested enough to submit a patch to PIL, but I've enclosed what I did with this message. -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 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: setup.py URL: From tomek at tmreality.com Wed Oct 29 16:31:18 2008 From: tomek at tmreality.com (=?utf-8?B?VG9tYXN6IFppZWxpxYRza2k=?=) Date: Wed, 29 Oct 2008 16:31:18 +0100 Subject: [Image-SIG] PIL license question Message-ID: Hello! I'm using PIL in my Python-based web server app. PIL license: http://www.pythonware.com/products/pil/license.htm says, that copyright notice should appear in all PIL copies, and that both that copyright notice and the permission notice should appear in supporting documentation. The copyright notice is: "The Python Imaging Library is Copyright (c) 1997-2006 by Secret Labs AB Copyright (c) 1995-2006 by Fredrik Lundh" Now, I took a look at source files and most of them have slightely different copyright notice, some examples are: "Copyright (c) 1996-2003 by Fredrik Lundh" only "Copyright (c) 2004 by Bob Ippolito. Copyright (c) 2004 by Secret Labs. Copyright (c) 2004 by Fredrik Lundh. " etc It's probably ok as this is from original source package, so if authors put it like that then they know what they're doing, - but maybe I should put that notice from license text to every source file to be in full compliance? Also, I noticed that apt-getted PIL package on Ubuntu doesn't include PIL license text (at least I couldn't find it). Should I put one somewhere around? Currently it's probably not that important, but in case I have customer for the software, I'd like to not violate any license. Best regards, Tomasz Zieli?ski From cannon.el at gmail.com Wed Oct 22 17:12:44 2008 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Wed, 22 Oct 2008 08:12:44 -0700 Subject: [Image-SIG] Resizing Tif's to smaller gifs adds pixels In-Reply-To: <4c7eeb0e0810211122he0950d4mf24486e5ed6b0283@mail.gmail.com> References: <4c7eeb0e0810211122he0950d4mf24486e5ed6b0283@mail.gmail.com> Message-ID: Your problem is that you resized the image twice. Use either the thumbnail method or the resize method, not both. (personally I would use resize) edward 2008/10/21 Samuel Mullen > I'm not entirely sure how this group works: if there is a page I'm supposed > to follow up on or if I should expect an email in reply. Anyway, here's my > question. > > I'm very new to Python and PIL, I know how to do this stuff in perl and > ImageMagick, but I'm having issues with Python and PIL. > > I need to scale a TIFF image from 1925x588 px to a GIF of 600xnnn px. > > I've tried the following code, but it leads to a lot of extra odd colored > pixels being inserted into the resulting image. > > img = "tmp/tmsho20080901.tif" > im = Image.open("tmp/tmsho20080901.tif") > w, h = im.size > > im.thumbnail((600, h * 600 / w), Image.ANTIALIAS) > > newimg = im.resize((600, int(h * (600.0 / w))), Image.ANTIALIAS) > newimg.save("tmsho20080901.gif") > > Using ImageMagick's convert I would do this... > > convert -colors 256 -resize 600 -colorspace RGB -black-threshold 100 > -contrast -intent Perceptual tmp/tmsho20080901.tif tmsho20080901.gif > > I think it may have something to do with the palette or the number of > colors alotted for the resulting image, but I'm really not a graphics guy. > > Any help on this would be appreciated. > > Samuel Mullen > > _______________________________________________ > 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 ryanlists at gmail.com Wed Oct 22 21:15:15 2008 From: ryanlists at gmail.com (Ryan Krauss) Date: Wed, 22 Oct 2008 14:15:15 -0500 Subject: [Image-SIG] problems with PIL 1.1.6 installation In-Reply-To: <48FF2A83.5030003@hoech.org> References: <48FF2A83.5030003@hoech.org> Message-ID: I tried re-downloading the exe and using the tarball. On Wed, Oct 22, 2008 at 8:28 AM, Florian H?ch > wrote: > Hello, > > the cmd window is curious. The installer should be a GUI application. Maybe > the exe is broken. Did you try re-downloading? > > Regards, > > Florian > > Ryan Krauss schrieb: > >> I am having trouble getting PIL 1.1.6 installed in windows. The installer >> shows a cmd window for a split second and dies without giving me any >> information. I messed around with the script about registering Python. >> Python is registered, but the script doesn't think so because the keys >> don't match exactly (trialing backslashes and so on or a different order for >> the elements of PythonPath). >> >> I tried installing from the source tarball but I get this message: >> >> error: Python was built with Visual Studio 2003; >> extensions must be built with a compiler than can generate compatible >> binaries. >> Visual Studio 2003 was not found on this system. If you have Cygwin >> installed, >> you can try compiling with MingW32, by passing "-c mingw32" to setup.py. >> >> >> Trying to pass the -c mingw32 flag leads to the following: >> >> C:\ryan\DOWNLO~1\Imaging-1.1. >> 6>python setup.py install -c mingw32 >> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] >> or: setup.py --help [cmd1 cmd2 ...] >> or: setup.py --help-commands >> or: setup.py cmd --help >> >> error: invalid command 'mingw32' >> >> C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py install "-c mingw32" >> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] >> or: setup.py --help [cmd1 cmd2 ...] >> or: setup.py --help-commands >> or: setup.py cmd --help >> >> error: option -m not recognized >> >> C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py -c mingw32 install >> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] >> or: setup.py --help [cmd1 cmd2 ...] >> or: setup.py --help-commands >> or: setup.py cmd --help >> >> error: option -c not recognized >> >> C:\ryan\DOWNLO~1\Imaging-1.1.6>python setup.py "-c mingw32" install >> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] >> or: setup.py --help [cmd1 cmd2 ...] >> or: setup.py --help-commands >> or: setup.py cmd --help >> >> error: option -c not recognized >> >> >> How do I either get the exe to run or get the install from source to work >> with mingw32? >> >> Thanks, >> >> Ryan >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spe.stani.be at gmail.com Wed Oct 29 22:54:54 2008 From: spe.stani.be at gmail.com (Stani) Date: Wed, 29 Oct 2008 22:54:54 +0100 Subject: [Image-SIG] pil sightings In-Reply-To: References: Message-ID: <1225317294.15533.32.camel@blue> Today was the official launch of the coin and I finally had some time to blog about it: http://pythonide.blogspot.com/2008/10/how-to-make-money-with-free-software.html Have a nice day, Stani Op vrijdag 12-09-2008 om 17:51 uur [tijdzone +0200], schreef Fredrik Lundh: > this definitely made my day: > > http://vanrees.org/weblog/archive/2008/09/12/python-calculated-coin > > excellent work, stani. and congrats for winning! > > (just wish I could figure out how to order one from here ;-) > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From noboru.uchida.777 at gmail.com Thu Oct 30 11:49:23 2008 From: noboru.uchida.777 at gmail.com (Noboru Uchida) Date: Thu, 30 Oct 2008 19:49:23 +0900 Subject: [Image-SIG] Bug in ImageWin (display.c) Message-ID: <49099133.6010803@gmail.com> Excuse my poor English. Problem: Dib.draw() fails occasionally and raises Overflow Error. Reason: In display.c, Window Handles(HWND) and Device Contexts(HDC) are both declared as "int". HWND/HDC arguments are parsed by PyArg_ParseTuple(), using format "i". "i" converts Python integer to plain C integer, but when the value is greater than 0x7fffffff, it seems to fail in Overflow Error. The problem is, HWND/HDC *can* take such values. I think unsigned integer and Format "I" would fix this problem.