From nicolas.limare at cmla.ens-cachan.fr Wed Mar 2 08:01:43 2011 From: nicolas.limare at cmla.ens-cachan.fr (Nicolas Limare) Date: Wed, 2 Mar 2011 16:01:43 +0900 Subject: [Image-SIG] bug in nearest-neighbour resize Message-ID: <20110302070143.GJ5341@nashi.hw.39mm.net> Hi all, I think there is a bug in the nearest neighbour resizing filter: when resizing an image with an integer ratio, the original pixels are not all expanded by this ratio. For example: >>> from PIL import Image >>> Image.VERSION '1.1.7' >>> im = Image.open("input.png") >>> for x in range(0, 6): ... im.getpixel((x, 0)) ... (255, 0, 0) (0, 255, 0) (0, 0, 255) (255, 0, 0) (0, 255, 0) (0, 0, 255) The first column of my input image is RGBRGB... >>> zim = im.resize((im.size[0] * 3, im.size[0] * 3), Image.NEAREST) >>> for x in range(0, 18): ... zim.getpixel((x, 0)) ... (255, 0, 0) (255, 0, 0) (255, 0, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 0, 255) (0, 0, 255) (255, 0, 0) (255, 0, 0) (255, 0, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 0, 255) (0, 0, 255) Note that the first pixel is repeated 3 times, the second 4 times, then 2, 3, 4, amd 2 times. I would expect each pixel to be repeated 3 times, and I think that is what "nearest neighbour" means. I could track the bug down to libImaging/Geometry.c, function ImagingScaleAffine(), lines 672-697. there must be something wrong in these two loops, probably related to the integer rounding, but I wasn't able to figure out the exact meaning of all the variables. -- Nicolas LIMARE - CMLA - ENS Cachan http://www.cmla.ens-cachan.fr/~limare/ IPOL - image processing on line http://www.ipol.im/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From nicolas at limare.net Wed Mar 2 07:56:45 2011 From: nicolas at limare.net (Nicolas Limare) Date: Wed, 2 Mar 2011 15:56:45 +0900 Subject: [Image-SIG] bug in nearest pixel resize Message-ID: <20110302065645.GI5341@nashi.hw.39mm.net> Hi all, I think there is a bug in the nearest neighbour resizing filter: when resizing an images with an integer ratio, the original pixels are not all expanded by this ratio. For example: >>> from PIL import Image >>> Image.VERSION '1.1.7' >>> im = Image.open("input.png") >>> for x in range(0, 6): ... im.getpixel((x, 0)) ... (255, 0, 0) (0, 255, 0) (0, 0, 255) (255, 0, 0) (0, 255, 0) (0, 0, 255) The first column of my input image is RGBRGB... >>> zim = im.resize((im.size[0] * 3, im.size[0] * 3), Image.NEAREST) >>> for x in range(0, 18): ... zim.getpixel((x, 0)) ... (255, 0, 0) (255, 0, 0) (255, 0, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 0, 255) (0, 0, 255) (255, 0, 0) (255, 0, 0) (255, 0, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 255, 0) (0, 0, 255) (0, 0, 255) Note that the first pixel is repeated 3 times, the second 4 times, then 2, 3, 4, amd 2 times. I would expect each pixel to be repeated 3 times, and I think that is what "nearest neighbour" means. I could track the bug down to libImaging/Geometry.c, function ImagingScaleAffine(), lines 672-697. there must be something wrong in these two loops, probably related to the integer rounding, but I wasn't able to figure out the exact meaning of all the variables. -- Nicolas LIMARE - CMLA - ENS Cachan http://www.cmla.ens-cachan.fr/~limare/ IPOL - image processing on line http://www.ipol.im/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From edward at unicornschool.org Thu Mar 3 03:26:32 2011 From: edward at unicornschool.org (Edward Cannon) Date: Wed, 2 Mar 2011 18:26:32 -0800 Subject: [Image-SIG] Creating images with layers editable by Photoshop? In-Reply-To: References: Message-ID: one thing you might consider is creating seperate images for each of the layers named something like im-01, im-02, etc. then import them into photoshop. On Mon, Feb 28, 2011 at 2:52 AM, Alec Bennett wrote: > I'm trying to create a collage of a few images, and have the images appear > as different layers in Photoshop. > > Is such a thing possible with the PIL? > > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From moroses at gmail.com Mon Mar 7 14:18:01 2011 From: moroses at gmail.com (Mor Roses) Date: Mon, 7 Mar 2011 15:18:01 +0200 Subject: [Image-SIG] Hebrew support?? Message-ID: is there Hebrew support in ImageDraw?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodrigoqluz at gmail.com Tue Mar 8 16:47:17 2011 From: rodrigoqluz at gmail.com (Rodrigo Queluz) Date: Tue, 8 Mar 2011 12:47:17 -0300 Subject: [Image-SIG] Trouble with Python Path Message-ID: Hello, I'm having a problem with the instalation of *Python Imaging Library 1.1.7 for Python 2.6* (Windows only). He don't recognize where Python is installed in my computer. It's not installed in C:/ as usual, but in D:/ Hope hear from you soon!! best regards, rodrigo ----------------------------------------------- Rodrigo Celestino Queluz Cell Phone: +55 19 9228 7842 Skype: rodrigo.queluz 4? Turma Inform?tica Biom?dica (Biomedic Informatic) USP - Ribeir?o Preto (University of Sao Paulo) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Barker at noaa.gov Tue Mar 8 21:30:34 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 08 Mar 2011 12:30:34 -0800 Subject: [Image-SIG] Trouble with Python Path In-Reply-To: References: Message-ID: <4D7691EA.6010102@noaa.gov> On 3/8/11 7:47 AM, Rodrigo Queluz wrote: > I'm having a problem with the installation of *Python Imaging Library > 1.1.7 for Python 2.6* > (Windows only). > > He don't recognize where Python is installed in my computer. It's not > installed in C:/ as usual, but in D:/ The installer should be looking in the registry to see where Python is. If that isn't working, the easiest thing to do is to let it put it in C:, then move it by hand to where you want it. It should get put in site_packages If you don't have write permissions to C:, I'm a a loss -- but there may be a way to extract the contents of the installer and install it by hand. -Chris > Hope hear from you soon!! > > best regards, > rodrigo > ----------------------------------------------- > Rodrigo Celestino Queluz > > Cell Phone: +55 19 9228 7842 > Skype: rodrigo.queluz > > 4? Turma Inform?tica Biom?dica (Biomedic Informatic) > USP - Ribeir?o Preto (University of Sao Paulo) > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov From w.wolfgang at qmul.ac.uk Wed Mar 9 18:06:06 2011 From: w.wolfgang at qmul.ac.uk (Werner Wolfgang) Date: Wed, 09 Mar 2011 17:06:06 +0000 Subject: [Image-SIG] PIL 1.1.7 for Python 2.7 installation problem Message-ID: <20110309170606.sqx0yx6eg0oc4kwk@webmail.qmul.ac.uk> Hello, I have Python 2.7.1. I would like to instal PIL 1.1.7 for Python 2.7. During the setup the blue background of PIL1.1.7 becomes translucent white and the computer freezes. What is the problem? Thank you, Werner Wolfgang Queen Mary University Institute of Biological and Chemical Sciences Fogg Building room 4.03 Mile End Road E1 4NS London From yury at shurup.com Fri Mar 11 00:00:15 2011 From: yury at shurup.com (Yury V. Zaytsev) Date: Fri, 11 Mar 2011 00:00:15 +0100 Subject: [Image-SIG] PIL 1.1.7 for Python 2.7 installation problem In-Reply-To: <20110309170606.sqx0yx6eg0oc4kwk@webmail.qmul.ac.uk> References: <20110309170606.sqx0yx6eg0oc4kwk@webmail.qmul.ac.uk> Message-ID: <1299798015.7061.1.camel@mypride> On Wed, 2011-03-09 at 17:06 +0000, Werner Wolfgang wrote: > What is the problem? This problem doesn't seem to be related to PIL in any way. Check out system logs, try chkdsk, disable antivirus / backup software etc. That is do the normal round of general Windows troubleshooting. -- Sincerely yours, Yury V. Zaytsev From erwan.loaec at cgin.fr Thu Mar 17 11:49:35 2011 From: erwan.loaec at cgin.fr (=?ISO-8859-1?Q?Erwan_Loa=EBc?=) Date: Thu, 17 Mar 2011 11:49:35 +0100 Subject: [Image-SIG] PIL 1.1.7, windows compilation: problem to save image file Message-ID: <4D81E73F.6090402@cgin.fr> Hello, I've successfully compiled PIL under windows XP 32 bits. When I try to save a JPEG or TIFF file, I obtain the following trace: Traceback (most recent call last): File "D:\testpy\testPIL.py", line 9, in im.save(r"D:\testpy\mytest.jpg") File "C:\Python25\lib\site-packages\PIL\Image.py", line 1439, in save save_handler(self, fp, filename) File "C:\Python25\lib\site-packages\PIL\JpegImagePlugin.py", line 471, in _s ave ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) File "C:\Python25\lib\site-packages\PIL\ImageFile.py", line 499, in _save s = e.encode_to_file(fh, bufsize) IOError: [Errno 0] Error The problem is the "write(fh, buf, status)" in encode.c which always return "-1". When I create a new handle directly in encode.c example: fh = open( "mytest.jpg", _O_WRONLY | _O_CREAT | _O_BINARY ); The write() works perfectly. So I think the problem should be related to the file descriptor... So, is anyone know the solution for windows ? Note: under linux, everything works perfectly. It really seems to be a "windows" issue. Thanks, -- Erwan From erwan.loaec at cgin.fr Thu Mar 17 12:13:13 2011 From: erwan.loaec at cgin.fr (=?ISO-8859-1?Q?Erwan_Loa=EBc?=) Date: Thu, 17 Mar 2011 12:13:13 +0100 Subject: [Image-SIG] PIL 1.1.7, windows compilation: problem to save image file In-Reply-To: <008c01cbe493$0a641e10$1f2c5a30$@com> References: <4D81E73F.6090402@cgin.fr> <008c01cbe493$0a641e10$1f2c5a30$@com> Message-ID: <4D81ECC9.3010202@cgin.fr> Yes I've try with and without r"XXX" syntax, with absolute, and relative path, etc... I've forgotten to tell you I'm using ActiveState Python 2.5.1.1 -- Erwan Rob Cole wrote: > I have little clue, except: I've had problems using that r"asdf" syntax. Did > you try omitting the 'r' and doubling up on the backslashes? > > PS - I've been programming in Python now for a total of about a week - so > take with salt... > > Rob > > > -----Original Message----- > From: image-sig-bounces+sec=robcole.com at python.org > [mailto:image-sig-bounces+sec=robcole.com at python.org] On Behalf Of Erwan > Loa?c > Sent: Thursday, March 17, 2011 3:50 AM > To: image-sig at python.org > Subject: [Image-SIG] PIL 1.1.7, windows compilation: problem to save image > file > > Hello, > > I've successfully compiled PIL under windows XP 32 bits. > > When I try to save a JPEG or TIFF file, I obtain the following trace: > > Traceback (most recent call last): > File "D:\testpy\testPIL.py", line 9, in > im.save(r"D:\testpy\mytest.jpg") > File "C:\Python25\lib\site-packages\PIL\Image.py", line 1439, in save > save_handler(self, fp, filename) > File "C:\Python25\lib\site-packages\PIL\JpegImagePlugin.py", line > 471, in _s > ave > ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) > File "C:\Python25\lib\site-packages\PIL\ImageFile.py", line 499, in > _save > s = e.encode_to_file(fh, bufsize) > IOError: [Errno 0] Error > > > The problem is the "write(fh, buf, status)" in encode.c which always > return "-1". When I create a new handle directly in encode.c > > example: > fh = open( "mytest.jpg", _O_WRONLY | _O_CREAT | _O_BINARY ); > > The write() works perfectly. So I think the problem should be related to > the file descriptor... > > So, is anyone know the solution for windows ? > > > Note: under linux, everything works perfectly. It really seems to be a > "windows" issue. > > > Thanks, > From erwan.loaec at cgin.fr Thu Mar 17 15:22:17 2011 From: erwan.loaec at cgin.fr (=?ISO-8859-1?Q?Erwan_Loa=EBc?=) Date: Thu, 17 Mar 2011 15:22:17 +0100 Subject: [Image-SIG] PIL 1.1.7, windows compilation: problem to save image file In-Reply-To: <4D81ECC9.3010202@cgin.fr> References: <4D81E73F.6090402@cgin.fr> <008c01cbe493$0a641e10$1f2c5a30$@com> <4D81ECC9.3010202@cgin.fr> Message-ID: <4D821919.60507@cgin.fr> I answer to myself... I'm using mingw to compile PIL. By default, gcc used msvcrt.dll library, and the write() function is call through this lib while python.exe creates the handle through msvcr71.dll. That's why when I've recreated the handle, both open() and write() call the same lib (msvcrt.dll), and everything worked. To solve it, I've change the specs file of gcc by replacing -lmsvcrt with -lmsvcr71 in the libgcc section, and change write() to _write() in encode.c. I hope this could be helpful... -- Erwan Erwan Loa?c wrote: > Yes I've try with and without r"XXX" syntax, with absolute, and relative > path, etc... > > I've forgotten to tell you I'm using ActiveState Python 2.5.1.1 > > -- > Erwan > > > Rob Cole wrote: >> I have little clue, except: I've had problems using that r"asdf" >> syntax. Did >> you try omitting the 'r' and doubling up on the backslashes? >> >> PS - I've been programming in Python now for a total of about a week - so >> take with salt... >> >> Rob >> >> >> -----Original Message----- >> From: image-sig-bounces+sec=robcole.com at python.org >> [mailto:image-sig-bounces+sec=robcole.com at python.org] On Behalf Of Erwan >> Loa?c >> Sent: Thursday, March 17, 2011 3:50 AM >> To: image-sig at python.org >> Subject: [Image-SIG] PIL 1.1.7, windows compilation: problem to save >> image >> file >> >> Hello, >> >> I've successfully compiled PIL under windows XP 32 bits. >> >> When I try to save a JPEG or TIFF file, I obtain the following trace: >> >> Traceback (most recent call last): >> File "D:\testpy\testPIL.py", line 9, in >> im.save(r"D:\testpy\mytest.jpg") >> File "C:\Python25\lib\site-packages\PIL\Image.py", line 1439, in save >> save_handler(self, fp, filename) >> File "C:\Python25\lib\site-packages\PIL\JpegImagePlugin.py", line >> 471, in _s >> ave >> ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) >> File "C:\Python25\lib\site-packages\PIL\ImageFile.py", line 499, in >> _save >> s = e.encode_to_file(fh, bufsize) >> IOError: [Errno 0] Error >> >> >> The problem is the "write(fh, buf, status)" in encode.c which always >> return "-1". When I create a new handle directly in encode.c >> >> example: >> fh = open( "mytest.jpg", _O_WRONLY | _O_CREAT | _O_BINARY ); >> >> The write() works perfectly. So I think the problem should be related >> to the file descriptor... >> >> So, is anyone know the solution for windows ? >> >> >> Note: under linux, everything works perfectly. It really seems to be a >> "windows" issue. >> >> >> Thanks, >> > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From rob at robcole.com Fri Mar 11 09:04:37 2011 From: rob at robcole.com (Rob Cole) Date: Fri, 11 Mar 2011 00:04:37 -0800 Subject: [Image-SIG] Bug in PIL? Message-ID: <000001cbdfc2$f80c5b80$e8251280$@com> The vast majority of my images open fine, but some fail with a "image file is truncated" error. The built-in wxPython Image object handles them fine, as do my other jpeg viewers and editors, so I assume it's a bug in PIL. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jehiah at gmail.com Tue Mar 15 14:30:42 2011 From: jehiah at gmail.com (Jehiah Czebotar) Date: Tue, 15 Mar 2011 09:30:42 -0400 Subject: [Image-SIG] update pypi to PIL 1.1.7 Message-ID: the PIL homepage has a download for version 1.1.7, but pypi does not have that version. Can anyone on this list update that? http://www.pythonware.com/products/pil/ http://pypi.python.org/pypi/PIL -- Jehiah From richie.dunk at gmail.com Thu Mar 17 11:14:37 2011 From: richie.dunk at gmail.com (Richie Dunk) Date: Thu, 17 Mar 2011 10:14:37 +0000 Subject: [Image-SIG] AGGdraw rotate? Message-ID: Hi, I'm drawing a custom graph using aggdraw, and I need add some rotated text. I can't find a simple way to do it, so I think I need to create a sort of sub-canvas, rotate it with PIL, then paste it into the image. Does this sound right? Can anyone point me in the direction of how I might do this, particulalrly making the background of the sub-image transparent. Sorry if that's a bit waffle-y, I am I newbie with this whole image processing stuff. Cheers, Richie -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwidion at mpc.com.br Mon Mar 21 13:04:08 2011 From: gwidion at mpc.com.br (Joao S. O. Bueno) Date: Mon, 21 Mar 2011 09:04:08 -0300 Subject: [Image-SIG] Bug in PIL? In-Reply-To: <000001cbdfc2$f80c5b80$e8251280$@com> References: <000001cbdfc2$f80c5b80$e8251280$@com> Message-ID: On Fri, Mar 11, 2011 at 5:04 AM, Rob Cole wrote: > The vast majority of my images open fine, but some fail with a ?image file > is truncated? error. > > > > The built-in wxPython Image object handles them fine, as do my other jpeg > viewers and editors, so I assume it?s a bug in PIL. Hi Rob, without making some of your faulting images available so other people can check what is different with them - i.e. whether the images are at fault, or if it is indeed PIL), nobody will be able to help you. Please consider uploading 3 or 4 of those images to a public place and notifying the list. Regards, js -><- > > > ? > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From gwidion at mpc.com.br Mon Mar 21 13:43:04 2011 From: gwidion at mpc.com.br (Joao S. O. Bueno) Date: Mon, 21 Mar 2011 09:43:04 -0300 Subject: [Image-SIG] Fwd: Bug in PIL? In-Reply-To: References: <000001cbdfc2$f80c5b80$e8251280$@com> <00f101cbe7c1$4de4b650$e9ae22f0$@com> Message-ID: On Mon, Mar 21, 2011 at 9:12 AM, Rob Cole wrote: > HI js, > > Thank you for being concerned. > > How do I get back to the original thread to post again? (I'm brand new to this...) > > This issue has been resolved, but I don?t know how to communicate it... Just do "reply to all" instead of just "reply" to this e-mail If you can't do that for some reason, just repeat the subject - "Bug in PIL?" and include the address ? on the list of recipients - it will be nice if you include information on what was the problem and how you did fix it. Also, please verify your e-mail "from:" address - I tried emailing you on the "rob(at) robcole.com" listed address and it failed - is that address working? If not, update your email application settings so that the "from" address display a valid address. ? js ?-><- > > Thanks > Rob > > -------------------------- Mail Delivery Subsystem to me show details 9:37 AM (4 minutes ago) Delivery to the following recipient failed permanently: rob at robcole.com Technical details of permanent failure: I tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 Sending address not accepted due to spam filter (state 13). From rob at robcole.com Mon Mar 21 13:50:55 2011 From: rob at robcole.com (Rob Cole) Date: Mon, 21 Mar 2011 05:50:55 -0700 Subject: [Image-SIG] Fwd: Bug in PIL? In-Reply-To: References: <000001cbdfc2$f80c5b80$e8251280$@com> <00f101cbe7c1$4de4b650$e9ae22f0$@com> Message-ID: <000901cbe7c6$9f0002b0$dd000810$@com> My jpegs were bad: missing last byte sometimes (looked like a bad block...) PIL was less forgiving than some, but once I got the root problem solved, its working fabulously! Thanks all. Rob -----Original Message----- From: image-sig-bounces+sec=robcole.com at python.org [mailto:image-sig-bounces+sec=robcole.com at python.org] On Behalf Of Joao S. O. Bueno Sent: Monday, March 21, 2011 5:43 AM To: Rob Cole; image-sig at python.org Subject: [Image-SIG] Fwd: Bug in PIL? On Mon, Mar 21, 2011 at 9:12 AM, Rob Cole wrote: > HI js, > > Thank you for being concerned. > > How do I get back to the original thread to post again? (I'm brand new to this...) > > This issue has been resolved, but I don?t know how to communicate it... Just do "reply to all" instead of just "reply" to this e-mail If you can't do that for some reason, just repeat the subject - "Bug in PIL?" and include the address ? on the list of recipients - it will be nice if you include information on what was the problem and how you did fix it. Also, please verify your e-mail "from:" address - I tried emailing you on the "rob(at) robcole.com" listed address and it failed - is that address working? If not, update your email application settings so that the "from" address display a valid address. ? js ?-><- > > Thanks > Rob > > -------------------------- Mail Delivery Subsystem to me show details 9:37 AM (4 minutes ago) Delivery to the following recipient failed permanently: rob at robcole.com Technical details of permanent failure: I tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 Sending address not accepted due to spam filter (state 13). _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig From dave.cowden at gmail.com Wed Mar 30 22:47:54 2011 From: dave.cowden at gmail.com (Dave Cowden) Date: Wed, 30 Mar 2011 16:47:54 -0400 Subject: [Image-SIG] Unexpected behavior of ImageDraw. polygon ? In-Reply-To: References: Message-ID: Hello, everyone: I have been really struggling with a PIL issue, and I'm hoping someone else has experienced the behavior I am seeing. My goal is to use ImageDraw().polygon to produce _only_ the filling, and to draw the border of the polygon in either transparent or in the background color. When I attempt to do this, an odd extra line of pixels appears outside the boundary. The code below draws a simple polygon with a white border and black fill, which works as expected. The second code draws the same polygon with a black border and a white fill. my expected result is to get a white triangle that 'fits inside' the first one. It almost works, but there is an extra line of pixels along the upper-right border. The resulting pictures are attached. Here is my code: from PIL import Image,ImageDraw if __name__=='__main__': ? ? ? ?i = Image.new('L',(50,50), 0 ); ? ? ? ?ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=255, fill=0); ? ? ? ?i.save("c:\\temp\\freak1.bmp",format="bmp"); ? ? ? ?i = Image.new('L',(50,50), 0 ); ? ? ? ?ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=0, fill=255); ? ? ? ?i.save("c:\\temp\\freak2.bmp",format="bmp"); Can anyone help me understand what i'm doing wrong? Help is much appreciated! Python 2.6.6, Windows, PIL version 1.1.7 -------------- next part -------------- A non-text attachment was scrubbed... Name: freak2.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: freak1.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: From dave.cowden at gmail.com Wed Mar 30 22:43:42 2011 From: dave.cowden at gmail.com (Dave Cowden) Date: Wed, 30 Mar 2011 16:43:42 -0400 Subject: [Image-SIG] ImageDraw.polygon produces an extra row of pixels? Message-ID: Hello, everyone: I have been really struggling with a PIL issue, and I'm hoping someone else has experienced the behavior I am seeing. My goal is to use ImageDraw().polygon to produce _only_ the filling, and to draw the border of the polygon in either transparent or in the background color. When I attempt to do this, an odd extra line of pixels appears outside the boundary. The code below draws a simple polygon with a white border and black fill, which works as expected. The second code draws the same polygon with a black border and a white fill. my expected result is to get a white triangle that 'fits inside' the first one. It almost works, but there is an extra line of pixels along the upper-right border. The resulting pictures are attached. Here is my code: from PIL import Image,ImageDraw if __name__=='__main__': i = Image.new('L',(50,50), 0 ); ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=255, fill=0); i.save("c:\\temp\\freak1.bmp",format="bmp"); i = Image.new('L',(50,50), 0 ); ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=0, fill=255); i.save("c:\\temp\\freak2.bmp",format="bmp"); Can anyone help me understand what i'm doing wrong? Python 2.6.6, Windows, PIL version 1.1.7 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: freak2.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: freak1.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: From dave.cowden at gmail.com Wed Mar 30 22:45:35 2011 From: dave.cowden at gmail.com (Dave Cowden) Date: Wed, 30 Mar 2011 16:45:35 -0400 Subject: [Image-SIG] Unexpected behavior of ImageDraw. polygon ? Message-ID: Hello, everyone: I have been really struggling with a PIL issue, and I'm hoping someone else has experienced the behavior I am seeing. My goal is to use ImageDraw().polygon to produce _only_ the filling, and to draw the border of the polygon in either transparent or in the background color. When I attempt to do this, an odd extra line of pixels appears outside the boundary. The code below draws a simple polygon with a white border and black fill, which works as expected. The second code draws the same polygon with a black border and a white fill. my expected result is to get a white triangle that 'fits inside' the first one. It almost works, but there is an extra line of pixels along the upper-right border. The resulting pictures are attached. Here is my code: from PIL import Image,ImageDraw if __name__=='__main__': i = Image.new('L',(50,50), 0 ); ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=255, fill=0); i.save("c:\\temp\\freak1.bmp",format="bmp"); i = Image.new('L',(50,50), 0 ); ImageDraw.Draw(i).polygon([(10,10),(20,20),(10,20) ],outline=0, fill=255); i.save("c:\\temp\\freak2.bmp",format="bmp"); Can anyone help me understand what i'm doing wrong? Help is much appreciated! Python 2.6.6, Windows, PIL version 1.1.7 -------------- next part -------------- A non-text attachment was scrubbed... Name: freak2.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: freak1.bmp Type: image/bmp Size: 3678 bytes Desc: not available URL: From gregghanham at gmail.com Wed Mar 30 22:56:11 2011 From: gregghanham at gmail.com (Gregg Hanham) Date: Wed, 30 Mar 2011 16:56:11 -0400 Subject: [Image-SIG] PIL Message-ID: Hi On the PIL download page (http://pythonware.com/products/pil/index.htm) it says that "A version for 3.X will be released later", however, I have read that there is a pre-release version available. How and from where would I be able to download it? Thanks. -- Gregg Hanham (H) 613-225-6944 -------------- next part -------------- An HTML attachment was scrubbed... URL: