From virtue at rocketmonkeys.com Sat Oct 1 18:30:37 2011 From: virtue at rocketmonkeys.com (James) Date: Sat, 1 Oct 2011 12:30:37 -0400 Subject: [Image-SIG] Calling img.filter(ImageFilter.SMOOTH) destroys partially-transparent alpha? Message-ID: Sorry if this has been covered, I couldn't seem to find anything on it. I have a transparent PNG file. I want to render nicely-smoothed, transparent antialiased text on top of it. This will be pasted onto other images, so I can't have the typical background-blended antialias edges PIL normally does. I used Ned Batchelder's method (http://nedbatchelder.com/blog/200801/truly_transparent_text_with_pil.html) for rendering antialiased text, and that works. But when I try to run "img.filter(ImageFilter.SMOOTH)", the filter replaces all semi-transparent values with the background color blended ones instead. How can I run a smoothing filter on an image with per-pixel alpha without destroying it? Thanks! -James From gdxxhg at gmail.com Sat Oct 1 08:45:49 2011 From: gdxxhg at gmail.com (Guan Huang) Date: Sat, 1 Oct 2011 14:45:49 +0800 Subject: [Image-SIG] Question About Memory Usage Of Image Plugins Message-ID: Developers Of PIL, Hi, I am using PIL these days for my project. I found PIL allocates a lot of memory when I save my Image. I looked into Image.py and I found the memory increased after preinit(). I thought the main reason is that PIL loads a lot of image plugins so that it allocates the memory. However, what I really need is just PNG Image Plugin. So, what can I do if I just want to load the PNG Plugin using PIL for my project? -- Xiaoxia from xiaoxia.org gdxxhg at gmail.com From tiit at sympatico.ca Sat Oct 1 16:30:46 2011 From: tiit at sympatico.ca (Etienne Desautels) Date: Sat, 1 Oct 2011 10:30:46 -0400 Subject: [Image-SIG] Possible to add jpeg_add_quant_table to the JPEG encoder ? References: Message-ID: Hi, In my quest to better image quality, I was wondering if it could be possible to add to the JPEG encoder the possibility to pass it the quantization tables instead of using the default tables? In libjpeg there's a call for that: jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, const unsigned int *basic_table, int scale_factor, boolean force_baseline) Presently I'm using cjpeg to save the file because it give me this option but I would prefer if it be integrated directly in PIL. Here's how I save it with cjpeg: proc = subprocess.Popen('cjpeg -sample 1x1 -qtables my_qtables.qtb -outfile %s' % imgpath, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate('P6\n%s %s\n255\n%s' % (im.size[0], im.size[1], im.tostring())) The motivation to add that is to be able to specify the tables to improve the output quality because the base tables (use in libjpeg) are far from ideal. With other tables you can achieve prettier result for the same file size. Another motivation could be to experiment with different tables for different purposes. I could try to do a patch but my C++ is far from good! For the format of the tables (int *basic_table) on the python side, I think it could be an array object or more simpler a string with number separated by any spaces (it's the format use in cjpeg), this way it could be easy to embed tables in code with triple quoted string or read it from a file. You could also copy directly the output of djpeg - v -v. But any format will do the job because it will be easy to write some transform functions from one format to another. What do you think ? Etienne From Tommy.Rasmussen at holstebro.dk Tue Oct 4 12:57:36 2011 From: Tommy.Rasmussen at holstebro.dk (Tommy Rasmussen (Holstebro Kommune)) Date: Tue, 4 Oct 2011 12:57:36 +0200 Subject: [Image-SIG] Silent install of PIL? Message-ID: Is there a switch for the PIL-1.1.7.win32-py2.5.exe that enables silent installation? Thanks Venlig hilsen Tommy Rasmussen IT-konsulent ________________________________ IT-afdelingen R?dhuset 7500 Holstebro tlf.: 9611 7350, direkte: 9611 7368 mobil: 2335 2067 CVR: 29 18 99 27 Mail: IT-afdelingen at Holstebro.dk Sikker mail: it at holstebro.dk Direkte mail: Tommy.Rasmussen at holstebro.dk ________________________________ Holstebro Kommune - vi har dr?ber af kultur i alt! Hold dig orienteret p? www.holstebro.dk eller tilmeld dig vores nyhedsbrev ________________________________ Disclaimer: Denne e-mail kan indeholde fortrolig information. Hvis du ikke er den rette modtager af denne e-mail, eller hvis du modtager den ved en fejltagelse, beder vi dig venligst informere afsender om fejlen ved at bruge svar-funktionen. Samtidig bedes du slette e-mailen med det samme uden at videresende eller kopiere den. Holstebro Kommune p?tager sig intet ansvar for virus, som er opst?et i forbindelse med modtagelse af denne e-mail. Holstebro Kommune p?tager sig intet ansvar for eventuelle tab og skader, som er opst?et i forbindelse med at modtage og bruge e-mailen. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredrik at pythonware.com Mon Oct 10 13:56:56 2011 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 10 Oct 2011 13:56:56 +0200 Subject: [Image-SIG] What is the best way to anti-alias a very large resolution image in PIL In-Reply-To: References: Message-ID: Looks like you've found a working approach, but I'm still a bit curious what "crash" means here -- do you get a segmentation violation or a MemoryError exception? PIL needs about 2G to load that image into memory and an additional 50% of that to finish the resizing (it's done in two passes), so you need decent hardware, but unless the memory allocator is messing things up, it shouldn't crash hard if it runs out of memory. >>> from PIL import Image >>> im = Image.new("RGB", (22633, 22633)) >>> im >>> out = im.resize((7874, 7874), Image.ANTIALIAS) >>> out >>> ^Z $ ps u | grep python 91700 3151 28.9 23.9 2982192 2946292 pts/0 TN 13:49 0:56 python On 8 September 2011 13:07, Craig Coleman (C) wrote: > Hi, > > I have a really thorny problem. > > I need to downsample a raster map that is 23622x23622 pixels to 7874x7874 > pixels using the ANTIALIAS filter. > > I have the following Python code: > >>>> import Image >>>> img = Image.open(r"C:\temp\24bit_nd.tif") >>>> nimg = img.resize((7874,7874),Image.ANTIALIAS) > > As soon as the resize method is called, python crashes instantly.? I presume > this is a memory allocation issue. > > Is there another way of performing anti-aliasing on such a large image (its > 2.7GB uncompressed although I'm using LZW for storage). > > I have tried converting the file to 8bit with a palette and this > successfully downsamples but the ANTIALIAS is not performed.? What am I > doing wrong? > > Craig Coleman > Technical Lead > Information Systems, Ordnance Survey > L0F2, Adanac Drive, SOUTHAMPTON, United Kingdom, SO16 0AS > Phone: +44 (0) 2380 054641 > www.ordnancesurvey.co.uk | craig.coleman at ordnancesurvey.co.uk > Please consider your environmental responsibility before printing this > email. > > This email is only intended for the person to whom it is addressed and may > contain confidential information. If you have received this email in error, > please notify the sender and delete this email which must not be copied, > distributed or disclosed to any other person. > > Unless stated otherwise, the contents of this email are personal to the > writer and do not represent the official view of Ordnance Survey. Nor can > any contract be formed on Ordnance Survey's behalf via email. We reserve the > right to monitor emails and attachments without prior notice. > > Thank you for your cooperation. > > Ordnance Survey > Adanac Drive > Southampton SO16 0AS > Tel: 08456 050505 > http://www.ordnancesurvey.co.uk > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From virtue at rocketmonkeys.com Tue Oct 4 20:54:41 2011 From: virtue at rocketmonkeys.com (James) Date: Tue, 4 Oct 2011 14:54:41 -0400 Subject: [Image-SIG] Silent install of PIL? In-Reply-To: References: Message-ID: I'm not sure. You could try "easy_install PIL-1.1.7.win32-py2.5.exe", I can't remember if that's silent or not. 2011/10/4 Tommy Rasmussen (Holstebro Kommune) > ** > Is there a switch for the PIL-1.1.7.win32-py2.5.exe that enables silent > installation? > Thanks > Venlig hilsen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tommy.Rasmussen at holstebro.dk Wed Oct 5 10:59:03 2011 From: Tommy.Rasmussen at holstebro.dk (Tommy Rasmussen (Holstebro Kommune)) Date: Wed, 5 Oct 2011 10:59:03 +0200 Subject: [Image-SIG] Silent install of PIL? In-Reply-To: References: Message-ID: easy_install did the trick! Thanks :-) Venlig hilsen Tommy Rasmussen IT-konsulent ________________________________ Holstebro Kommune - vi har dr?ber af kultur i alt! Hold dig orienteret p? www.holstebro.dk eller tilmeld dig vores nyhedsbrev ________________________________ Disclaimer: Denne e-mail kan indeholde fortrolig information. Hvis du ikke er den rette modtager af denne e-mail, eller hvis du modtager den ved en fejltagelse, beder vi dig venligst informere afsender om fejlen ved at bruge svar-funktionen. Samtidig bedes du slette e-mailen med det samme uden at videresende eller kopiere den. Holstebro Kommune p?tager sig intet ansvar for virus, som er opst?et i forbindelse med modtagelse af denne e-mail. Holstebro Kommune p?tager sig intet ansvar for eventuelle tab og skader, som er opst?et i forbindelse med at modtage og bruge e-mailen. ________________________________ Fra: James [mailto:virtue at rocketmonkeys.com] Sendt: 4. oktober 2011 20:55 Til: Tommy Rasmussen (Holstebro Kommune) Cc: image-sig at python.org Emne: Re: [Image-SIG] Silent install of PIL? I'm not sure. You could try "easy_install PIL-1.1.7.win32-py2.5.exe", I can't remember if that's silent or not. 2011/10/4 Tommy Rasmussen (Holstebro Kommune) Is there a switch for the PIL-1.1.7.win32-py2.5.exe that enables silent installation? Thanks Venlig hilsen -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjauvin at gmail.com Sat Oct 15 17:56:32 2011 From: cjauvin at gmail.com (Christian Jauvin) Date: Sat, 15 Oct 2011 11:56:32 -0400 Subject: [Image-SIG] binary image rotation Message-ID: Hi, I'm very new to PIL, and I'm exploring it as a way to rotate simple binary images. Suppose I have an image like this: 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 created with: from PIL import Image im = Image.new('1', (7,7)) for p in [(1,3), (2,3), (3,3), (4,2), (4,3), (4,4), (5,1), (5,2), (5,3), (5,4), (5,5)]: im.putpixel(p, 1) that I'd like to rotate 45 degrees: im = im.rotate(45) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 or with expansion: im = im.rotate(45, expand=True) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 The results don't look 100% right.. Am I doing something wrong? Is there a way to obtain better results? Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehs at pobox.com Wed Oct 19 03:03:57 2011 From: ehs at pobox.com (Ed Summers) Date: Tue, 18 Oct 2011 21:03:57 -0400 Subject: [Image-SIG] buffer is not large enough Message-ID: I was wondering if anyone has seen the "buffer is not large enough" error before. I'm attempting to read in a TIF and write out a JPG. Is it possible that the TIF is corrupted somehow? It seems remarkably small. If you want to reproduce I've put the TIF file up at http://inkdroid.org/tmp/x.tif //Ed >>> import Image >>> i = Image.open('x.tif') >>> i.save('x.jpg') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1406, in save self.load() File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 158, in load self.map, self.size, d, e, o, a ValueError: buffer is not large enough From cgohlke at uci.edu Wed Oct 19 03:44:34 2011 From: cgohlke at uci.edu (Christoph Gohlke) Date: Tue, 18 Oct 2011 18:44:34 -0700 Subject: [Image-SIG] buffer is not large enough In-Reply-To: References: Message-ID: <4E9E2B82.9080400@uci.edu> On 10/18/2011 6:03 PM, Ed Summers wrote: > I was wondering if anyone has seen the "buffer is not large enough" > error before. I'm attempting to read in a TIF and write out a JPG. Is > it possible that the TIF is corrupted somehow? It seems remarkably > small. If you want to reproduce I've put the TIF file up at > http://inkdroid.org/tmp/x.tif > > //Ed > >>>> import Image >>>> i = Image.open('x.tif') >>>> i.save('x.jpg') > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1406, in save > self.load() > File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 158, in load > self.map, self.size, d, e, o, a > ValueError: buffer is not large enough Looks like a corrupted file. The tags are there but the image data is missing (strip_offsets and strip_byte_counts are zero): PAGE 0: 4387 x 3368, uint8, 8 bit, minisblack, raw * 254 new_subfile_type (1I) 0 * 256 image_width (1H) 3368 * 257 image_length (1H) 4387 * 258 bits_per_sample (1H) 8 * 259 compression (1H) 1 * 262 photometric (1H) 1 * 266 fill_order (1H) 1 * 269 document_name (27s) /llcr/12217/0000100000.tif * 271 make (7s) Inotec * 272 model (6s) 412BD * 273 strip_offsets (1I) 0 * 274 orientation (1H) 1 * 277 samples_per_pixel (1H) 1 * 278 rows_per_strip (1H) 4387 * 279 strip_byte_counts (1I) 0 * 282 x_resolution (2I) (400, 1) * 283 y_resolution (2I) (400, 1) * 284 planar_configuration (1H) 1 * 296 resolution_unit (1H) 2 * 305 software (55s) Pixel Translations Inc., PIXTIFF Version 57.5.218.4430 * 306 datetime (20s) 2011:08:29 12:31:02 * 315 artist (29s) Library of Congress; Crowley * 317 predictor (1H) 1 * 339 sample_format (1H) 1 Christoph From hanserik14411 at gmail.com Sat Oct 22 07:42:31 2011 From: hanserik14411 at gmail.com (FiverChinook) Date: Fri, 21 Oct 2011 22:42:31 -0700 (PDT) Subject: [Image-SIG] problem with TIF image in PIL Message-ID: <32700359.post@talk.nabble.com> I'm having a problem with opening a TIF image in PIL, rotating it, and then converting it to a string for use somewhere else. This is the Python code: im1 = open("c:\image.TIF") im2 = im1.transpose(ROTATE_90) im3 = im2.tostring("raw", "RGB", 0, -1) When I display the rotated image using the PIL show() function (immediately after the rotation is applied) it looks OK. However, when I convert the image to a string and display it elsewhere, it appears diagonally warped, although the colors are OK. If I do not rotate the image, then it looks OK after the "tostring" conversion. So, it seems that the "transpose(ROTATE_90)" function is doing something to the image that is not evident until it is converted to a string... I'm completely baffled. FYI - I've checked the mode of the image after opening it and it is "RGB" Thanks for the help!! -- View this message in context: http://old.nabble.com/problem-with-TIF-image-in-PIL-tp32700359p32700359.html Sent from the Python - image-sig mailing list archive at Nabble.com. From edward at unicornschool.org Sun Oct 23 00:46:48 2011 From: edward at unicornschool.org (Edward Cannon) Date: Sat, 22 Oct 2011 15:46:48 -0700 Subject: [Image-SIG] problem with TIF image in PIL In-Reply-To: <32700359.post@talk.nabble.com> References: <32700359.post@talk.nabble.com> Message-ID: this seems odd. My only guess is that the tostring call is not so good. Try just calling the tostring() method without any arguments and see what happens. On Fri, Oct 21, 2011 at 10:42 PM, FiverChinook wrote: > > I'm having a problem with opening a TIF image in PIL, rotating it, and then > converting it to a string for use somewhere else. This is the Python code: > > im1 = open("c:\image.TIF") > im2 = im1.transpose(ROTATE_90) > im3 = im2.tostring("raw", "RGB", 0, -1) > > When I display the rotated image using the PIL show() function (immediately > after the rotation is applied) it looks OK. However, when I convert the > image to a string and display it elsewhere, it appears diagonally warped, > although the colors are OK. If I do not rotate the image, then it looks OK > after the "tostring" conversion. So, it seems that the > "transpose(ROTATE_90)" function is doing something to the image that is not > evident until it is converted to a string... I'm completely baffled. > > FYI - I've checked the mode of the image after opening it and it is "RGB" > > Thanks for the help!! > -- > View this message in context: http://old.nabble.com/problem-with-TIF-image-in-PIL-tp32700359p32700359.html > Sent from the Python - image-sig mailing list archive at Nabble.com. > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From hanserik14411 at gmail.com Fri Oct 21 22:19:57 2011 From: hanserik14411 at gmail.com (Hans-Erik Andersen) Date: Fri, 21 Oct 2011 13:19:57 -0700 Subject: [Image-SIG] problem with tiff image in PIL Message-ID: I'm having a problem with opening a TIF image in PIL, rotating it, and then converting it to a string for use in PyOpenGL. This is the Python code: im1 = open("c:\image.TIF") im2 = im1.transpose(ROTATE_90) im3 = im2.tostring("raw", "RGB", 0, -1) When I display the rotated image using the PIL show() function (immediately after the rotation is applied) it looks OK. However, when I convert the image to a string and display it elsewhere, it appears diagonally warped, although the colors are OK. If I do not rotate the image, then it looks OK after the "tostring" conversion. So, it seems that the "transpose(ROTATE_90)" function is doing something to the image that is not evident until it is converted to a string... I'm completely baffled. FYI - I've checked the mode of the image after opening it and it is "RGB" Thanks for the help!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From short.jones.cipher at gmail.com Sat Oct 22 03:13:18 2011 From: short.jones.cipher at gmail.com (Christopher Jones) Date: Sat, 22 Oct 2011 12:13:18 +1100 Subject: [Image-SIG] PIL uses obsolete JPEG decoder Message-ID: PIL 1.1.7 exhibits the problem discussed below. Guido at the Independent JPEG Group http://www.ijg.org/ recommends updating the JPEG decoder to avoid this problem. Christopher Jones Sydney Australia http://chrisjones.id.au/ ---------- Forwarded message ---------- From: Guido Vollbeding Date: Fri, Oct 21, 2011 at 22:11 Subject: Re: jpegtran crop/drop problem? To: Christopher Jones Hello Chris Thank you for the feedback. This is a known issue. Yes, you are right that this is only a decoding problem. IJG decoder before v7 used an inferior method to resolve the color subsampling which leads to the described effect. IJG since v7 uses a new method for resolving the color subsampling which does not have that odd effect and which behaves as expected when joining JPEG images, not smearing colors beyond block edges. Unfortunately, IrfanView and many other softwares did not update to a newer IJG release, they still use a release or derivative which was published in 1998 (v6b) and is now obsolete. I recommend that you inform the authors of such software about the problem and suggest an update to the current IJG release which does not have this problem and which does have many other enhancements. Here is an earlier report about the same problem (in German) with example images attached: Betreff: Re: very important question about fantastic JPEGjoin software Datum: Mon, 3 Sep 2007 15:17:14 +0200 Von: "Nikolas Kovats" An: "Guido Vollbeding" Ich habe im Anhang an diese E-Mail etwas zur Demonstration vorbereitet: Dort sind zwei JPEGs. Beide sind 336 Pixel breit und 480 Pixel hoch, also auch jeweils ein vielfaches von 8 und 16. Das JPEG mit dem Namen "left" besteht nur aus einer einzigen Farbe, und zwar aus der Farbe RGB 0 0 254. Das JPEG mit dem Namen "right" besteht ebenfalls nur aus einer einzigen Farbe, und zwar RGB 255 255 0. Das dritte JPEG mit dem Namen "result" ist das Bild nach dem zusammenf?gen. Die Gr??e ist korrekt (672x960) und nat?rlich immernoch ein vielfaches von 8 und 16. Es sind aber jetzt vier Farben und nicht mehr zwei. Dort, wo es zusammengef?gt ist, sind zwei neue Farben entstanden (RGB 14 15 141 und 241 240 113). Die Farbe der a??erten rechten Pixelspalte von "left" wurde ver?ndert. Wie auch die Farbe der ?u?ersten linken Spalte von "right". Kann ich das mit irgendeiner Einstellung verhindern? Viele Gr??e Nick Regards Guido Vollbeding Organizer Independent JPEG Group -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: result.jpg Type: image/jpeg Size: 6131 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: right (rgb 255 255 0).jpg Type: image/jpeg Size: 1235 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: left (rgb 0 0 254).jpg Type: image/jpeg Size: 1233 bytes Desc: not available URL: From intnrmri at gmail.com Tue Oct 25 12:20:16 2011 From: intnrmri at gmail.com (rmri) Date: Tue, 25 Oct 2011 12:20:16 +0200 Subject: [Image-SIG] PIL: pasting RGBA images to RGBA images Message-ID: Hello Everyone, I have a problem pasting RGBA images to RGBA images. It's a bit hard to describe the output, but it seems like the alpha channel of the original image is affected by the pasted image alpha channel, so the original images becomes transparent in places it wasn't before. I googled around and only found answers regarding the third "mask" parameter of the paste function, but that didn't help in the case of two RGBA images. In most PIL use cases people paste RGBA images to RGB images (ex. watermarking images) so the current setup doesn't result in any artifacts, but in my case with two RGBA images it does. I looked further in the source code and found the related code in Paste.c: Line 134: paste_mask_RGBA() ?. for (i = 0; i < pixelsize; i++) { *out = BLEND(*mask, *out, *in, tmp1, tmp2); out++, in++; } ? So all 4 channels (R,G,B,A) are handled the same way. I looked up the topic and found this useful Cairo project page which describes all of the widely used operators in image processing but none of them seemed to match this behavior. (http://cairographics.org/operators/) Finally I modified the source code to my needs, and implemented the CAIRO_OPERATOR_OVER for PIL, handling the alpha channel blending separately, following the description in the Cairo docs. But I am still wondering if anybody ever had the same problem, or if there is some more simple and elegant solution by just parametrize the PIL functions differently? (I couldn't find one) Also I think the CAIRO_OPERATOR_OVER behavior is the one that most people would expect from a paste function so I would recommend to change the source code accordingly if no simple solution is available. Thanks for your answers in advance, I hope my description is clear enough. Daniel From jhonlier12017 at hlg.jovenclub.cu Tue Oct 25 18:20:28 2011 From: jhonlier12017 at hlg.jovenclub.cu (jhonlier suarez molina) Date: Tue, 25 Oct 2011 12:20:28 -0400 Subject: [Image-SIG] Problem generating images secuences with increasing/decreasing zooms Message-ID: <1319559628.4083.40.camel@jccefp-server> I am doing a tool to make animations with PIL but a have troubles when in the secuences with consecutives zoom ins or zoom outs because the zoomed object in the secuence get very perceptible shakes. I noticed that was due to the reference vertex point when the image object is zoomed moved around the mathemathical calculated vertex point one pixel in any direction because of the integer adjustment from exact calculations and integer positions pixels. I normally use the image center as vertex. Do anyone knows how to solve this? Any help is welcome. Thanks in advance Jhonlier. From edward at unicornschool.org Tue Oct 25 22:25:27 2011 From: edward at unicornschool.org (Edward Cannon) Date: Tue, 25 Oct 2011 13:25:27 -0700 Subject: [Image-SIG] Problem generating images secuences with increasing/decreasing zooms In-Reply-To: <1319559628.4083.40.camel@jccefp-server> References: <1319559628.4083.40.camel@jccefp-server> Message-ID: I have done this and I seem to recall that I scaled the image before cropping. This worked pretty well for me, but I did zooms on the slow side. Try scaling the image up by the appropriate amount and cutting the next frame out of the new, larger image. Also make sure that each frame is made by rescaling the original, rather than the previous frame. Edward On Tue, Oct 25, 2011 at 9:20 AM, jhonlier suarez molina wrote: > I am doing a tool to make animations with PIL but a have troubles when > in the secuences with consecutives zoom ins or zoom outs because the > zoomed object in the secuence get very perceptible shakes. > > I noticed that was due to the reference vertex point when the image > object is zoomed moved around the mathemathical calculated vertex point > one pixel in any direction because of the integer adjustment from exact > calculations and integer positions pixels. > > I normally use the image center as vertex. > > Do anyone knows how to solve this? > > Any help is welcome. > > Thanks in advance > Jhonlier. > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From aclark at aclark.net Thu Oct 27 02:46:28 2011 From: aclark at aclark.net (Alex Clark) Date: Wed, 26 Oct 2011 20:46:28 -0400 Subject: [Image-SIG] Canonical PIL issues location Message-ID: Hi, Am I correct that https://bitbucket.org/effbot/pil-2009-raclette/issues is the right place to report PIL issues? I'm planning to ensure that any non-packaging related bugs filed against Pillow make it upstream. Thanks, Alex From jsbmsu at gmail.com Wed Oct 26 23:49:33 2011 From: jsbmsu at gmail.com (Jeff Brantley) Date: Wed, 26 Oct 2011 17:49:33 -0400 Subject: [Image-SIG] Does PIL ImageDraw create shape objects or stain pixels? Message-ID: Hi, I am working on code to draw tens or hundreds of thousands of squares and connecting lines using the tkinter canvas, and it is incredibly slow because, as I understand it, the canvas keeps the individual shape objects around in memory and tests for the current visible bounding box to touch them, and redraws them. I am wondering whether PIL's ImageDraw module behaves in this manner, or whether it instead just paints the shapes onto a raw pixel buffer, effectively "staining" the pixels, rather than holding onto thousands of identical objects. I assume that this would be much faster if it is the case. Thanks for your help, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbabcock at creatureshop.com Fri Oct 28 18:14:33 2011 From: mbabcock at creatureshop.com (Michael Babcock) Date: Fri, 28 Oct 2011 09:14:33 -0700 Subject: [Image-SIG] PIL cannot read RGBA tiffs with no ExtraSamples tag Message-ID: <4EAAD4E9.7020607@creatureshop.com> Maya 2012 writes these kind of tiff files. There is an alpha channel, but no ExtraSamples tag. Tracing the code, I believe adding a line such as (II, 2, 1, 1, (8,8,8,8), ()): ("RGBA", "RGBa"), to the OPEN_INFO dictionary in TiffImagePlugin.py would fix this. I'm only guessing at the "1" default value for ExtraSamples because that's what Maya used to add in older versions. From hquan at purdue.edu Sun Oct 30 08:17:03 2011 From: hquan at purdue.edu (Heran Quan) Date: Sun, 30 Oct 2011 00:17:03 -0700 Subject: [Image-SIG] patch request Message-ID: <4EACF9EF.90002@purdue.edu> Hi all, I guess I found a bug in _image.c. CObject is already deprecated and Capsules should be used. It seems in Python 3.2.2 CObject is removed. The attachment is the diff file for this. Hope this is helpful. Thanks, Heran -------------- next part -------------- A non-text attachment was scrubbed... Name: pil.diff Type: text/x-patch Size: 479 bytes Desc: not available URL: