From mviljamaa at kapsi.fi Mon Jul 1 00:29:53 2013 From: mviljamaa at kapsi.fi (Matti Viljamaa) Date: Mon, 1 Jul 2013 01:29:53 +0300 Subject: [Image-SIG] Converting from "CMYK" to "RGB" Message-ID: I'm trying to handle CMYK images by converting them to RGB. I'm using the following code snippet: import sys from PIL import Image def loadImage(self, imageFileName): imageFile = open(imageFileName) image = Image.open(imageFile) if(image.mode == 'CMYK' ): image.convert('RGB') However the image is not converted to RGB, although its mode is recognized as CMYK. Later when loading this image into a QImage (of the Qt GUI library), the compiler produces an error indicating that the mode is still CMYK: ValueError: unsupported image mode 'CMYK' So how can CMYK images be handled? My PIL is of version 1.1.6. From kevin at cazabon.com Fri Jul 5 16:04:29 2013 From: kevin at cazabon.com (Kevin Cazabon) Date: Fri, 5 Jul 2013 10:04:29 -0400 Subject: [Image-SIG] Converting from "CMYK" to "RGB" In-Reply-To: References: Message-ID: <02307296-90C9-4B78-A039-E2727B67D441@cazabon.com> Convert does not modify the image in place : it returns a new converted image. Use newim = origim.convert("RGB") Kevin On Jun 30, 2013, at 18:29, Matti Viljamaa wrote: > I'm trying to handle CMYK images by converting them to RGB. I'm using the following code snippet: > > import sys > from PIL import Image > > def loadImage(self, imageFileName): > imageFile = open(imageFileName) > image = Image.open(imageFile) > > if(image.mode == 'CMYK' ): > image.convert('RGB') > > However the image is not converted to RGB, although its mode is recognized as CMYK. > > Later when loading this image into a QImage (of the Qt GUI library), the compiler produces an error indicating that the mode is still CMYK: > ValueError: unsupported image mode 'CMYK' > > So how can CMYK images be handled? > > My PIL is of version 1.1.6. > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From charlesc-pyimagesig at pyropus.ca Fri Jul 5 16:01:44 2013 From: charlesc-pyimagesig at pyropus.ca (Charles Cazabon) Date: Fri, 5 Jul 2013 08:01:44 -0600 Subject: [Image-SIG] Converting from "CMYK" to "RGB" In-Reply-To: References: Message-ID: <20130705140144.GA824@pyropus.ca> Matti Viljamaa wrote: > I'm trying to handle CMYK images by converting them to RGB. I'm using the > following code snippet: [...] > if(image.mode == 'CMYK' ): > image.convert('RGB') That would work, but you're throwing away the converted image and continuing with the original CMYK one. Image.convert() returns a new image and leaves the original alone! Charles -- ------------------------------------------------------------------ Charles Cazabon Software, consulting, and services available at http://pyropus.ca/ ------------------------------------------------------------------ From skip at pobox.com Fri Jul 5 15:40:20 2013 From: skip at pobox.com (Skip Montanaro) Date: Fri, 5 Jul 2013 08:40:20 -0500 Subject: [Image-SIG] Status messages from notifications@travis-ci.org Message-ID: While reviewing held messages for the image-sig list, I came across a bunch which seemed to be test failure/recovery status messages from notifications at travis-ci.org. They look to be related to Pillow. Here's an example: Build Update for python-imaging/Pillow ------------------------------------- Build: #392 Status: Broken Duration: 52 seconds Commit: fd29e70 (master) Author: Alex Clark Message: Apply @Arfrever patch, fixes #258 View the changeset: https://github.com/python-imaging/Pillow/compare/54cb132b8303...fd29e707e967 View the full build log and details: https://travis-ci.org/python-imaging/Pillow/builds/8591059 ... I can't imagine that these sorts of automated messages should be going to this list, but am happy to be proven wrong. If the list members decided they want these messages, I can set things up so they sail through. Please let me know what I should do with these messages now, and in the future. Skip Montanaro PIL moderator in /F's absence -------------- next part -------------- An HTML attachment was scrubbed... URL: From nakagami at gmail.com Fri Jul 5 15:56:11 2013 From: nakagami at gmail.com (Hajime Nakagami) Date: Fri, 5 Jul 2013 22:56:11 +0900 Subject: [Image-SIG] Converting from "CMYK" to "RGB" In-Reply-To: References: Message-ID: Hi Matti > image.convert('RGB') this code return converted image but abandoned Please rewrite as below > image = image.convert('RGB') 2013/7/1 Matti Viljamaa > I'm trying to handle CMYK images by converting them to RGB. I'm using the > following code snippet: > > import sys > from PIL import Image > > def loadImage(self, imageFileName): > imageFile = open(imageFileName) > image = Image.open(imageFile) > > if(image.mode == 'CMYK' ): > image.convert('RGB') > > However the image is not converted to RGB, although its mode is recognized > as CMYK. > > Later when loading this image into a QImage (of the Qt GUI library), the > compiler produces an error indicating that the mode is still CMYK: > ValueError: unsupported image mode 'CMYK' > > So how can CMYK images be handled? > > My PIL is of version 1.1.6. > > _______________________________________________ > 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 aclark at aclark.net Fri Jul 5 21:06:54 2013 From: aclark at aclark.net (Alex Clark) Date: Fri, 5 Jul 2013 19:06:54 +0000 (UTC) Subject: [Image-SIG] Status messages from notifications travis-ci.org References: Message-ID: Hi Skip, Skip Montanaro pobox.com> writes: > I can't imagine that these sorts of automated messages should be going to this list, but am happy to be proven wrong. If the list members decided they want these messages, I can set things up so they sail through. Please let me know what I should do with these messages now, and in the future. Sorry, that was an oversight on my part. I configured the python-imaging organization on GitHub to use that email address[1] merely to encourage folks to subscribe to it. I don't have a strong preference either way, but if they are annoying I can remove the address. If I had to pick one way or the other, I'd probably allow them to go through. At least they are a sign of active development. [1] https://github.com/python-imaging From sienkiew at stsci.edu Mon Jul 8 14:47:57 2013 From: sienkiew at stsci.edu (Mark Sienkiewicz) Date: Mon, 8 Jul 2013 08:47:57 -0400 Subject: [Image-SIG] Status messages from notifications@travis-ci.org In-Reply-To: References: Message-ID: <51DAB4FD.50405@stsci.edu> On 07/05/2013 09:40 AM, Skip Montanaro wrote: > > I can't imagine that these sorts of automated messages should be going > to this list, but am happy to be proven wrong. If the list members > decided they want these messages, I can set things up so they sail > through. Please let me know what I should do with these messages now, > and in the future. In case anybody disagrees with you: No, that email should only go to people who have at least some small chance of caring about it. Otherwise, this list becomes dominated by junk, and all the users will unsubscribe. If necessary, you could have a second list for people who want this information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aclark at aclark.net Wed Jul 10 00:20:41 2013 From: aclark at aclark.net (Alex Clark) Date: Tue, 9 Jul 2013 22:20:41 +0000 (UTC) Subject: [Image-SIG] Status messages from notifications travis-ci.org References: <51DAB4FD.50405@stsci.edu> Message-ID: Mark Sienkiewicz stsci.edu> writes: > In case anybody disagrees with you:? No, that email should only go > to people who have at least some small chance of caring about it.? > Otherwise, this list becomes dominated by junk, and all the users > will unsubscribe. > If necessary, you could have a second list for people who want this > information. Normally I would agree with you, but this list has approximately zero traffic right now so I don't think the occasional CI message would bother me. From rowen at uw.edu Mon Jul 22 20:07:37 2013 From: rowen at uw.edu (Russell E. Owen) Date: Mon, 22 Jul 2013 11:07:37 -0700 Subject: [Image-SIG] A new Mac binary installer for PIL 1.1.7 Message-ID: It turns out that my previous binary installer for PIL 1.1.7 on MacOS X 10.6 and later would not run in 32-bit mode. I've rebuilt the installer to fix this problem (building a new jpeg and lcms2). The results are available here: it requires python 2.7 for MacOS X 10.6 or later from python.org. One of these days I hope to provide binaries for Pillow. I just haven't found the time to switch my own project. -- Russell From aclark at aclark.net Mon Jul 22 23:42:07 2013 From: aclark at aclark.net (Alex Clark) Date: Mon, 22 Jul 2013 21:42:07 +0000 (UTC) Subject: [Image-SIG] A new Mac binary installer for PIL 1.1.7 References: Message-ID: Hi Russell, Russell E. Owen uw.edu> writes: > > One of these days I hope to provide binaries for Pillow. I just haven't > found the time to switch my own project. Great! I've created a ticket so we can track this task: https://github.com/python-imaging/Pillow/issues/296. If you get inspired, the next release is approximately 2 months from now. Alex From julien at palard.fr Thu Jul 25 17:11:58 2013 From: julien at palard.fr (Julien Palard) Date: Thu, 25 Jul 2013 15:11:58 -0000 Subject: [Image-SIG] [bug report] OverflowError: signed integer is greater than maximum Message-ID: Hi there, I'm facing a bug in PIL, from the stable Debian Package, don't know the PIL exact version number as it's not exposed by the package but I got : apt-cache policy python-imaging python-imaging: Installed: 1.1.7-4 Here come the bug : $ python Python 2.7.3 (default, Jan 2 2013, 13:56:14) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from PIL import Image as PILImage >>> from pilkit.utils import save_image >>> >>> img = PILImage.open('./1889935.jpg') >>> save_image(img, '/tmp/1889935.jpg', 'JPEG', {}, True) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/pilkit-1.0.0-py2.7.egg/pilkit/utils.py", line 175, in save_image img.save(outfile, format, **options) File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1439, in save save_handler(self, fp, filename) File "/usr/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line 471, in _save ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 499, in _save s = e.encode_to_file(fh, bufsize) OverflowError: signed integer is greater than maximum How I may help ? -- Julien Palard - http://julien.palard.fr IRC : mandark at freenode.net, mandark at quakenet.org TEL : 06.21.19.49.10 / FAX : 09.72.28.06.72 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien at palard.fr Thu Jul 25 17:20:58 2013 From: julien at palard.fr (Julien Palard) Date: Thu, 25 Jul 2013 15:20:58 -0000 Subject: [Image-SIG] [bug report] OverflowError: signed integer is greater than maximum In-Reply-To: References: Message-ID: I jiust reproduced the bug with another image that I can publicly release, so you may easily reproduce it : http://mandark.fr/art/art/2011/01/16/2011-01-16-14-54-22.jpg On Thu, Jul 25, 2013 at 5:11 PM, Julien Palard wrote: > Hi there, I'm facing a bug in PIL, from the stable Debian Package, don't > know the PIL exact version number as it's not exposed by the package but I > got : > > apt-cache policy python-imaging > python-imaging: > Installed: 1.1.7-4 > > Here come the bug : > > $ python > Python 2.7.3 (default, Jan 2 2013, 13:56:14) > [GCC 4.7.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from PIL import Image as PILImage > >>> from pilkit.utils import save_image > >>> > >>> img = PILImage.open('./1889935.jpg') > >>> save_image(img, '/tmp/1889935.jpg', 'JPEG', {}, True) > Traceback (most recent call last): > File "", line 1, in > File > "/usr/local/lib/python2.7/dist-packages/pilkit-1.0.0-py2.7.egg/pilkit/utils.py", > line 175, in save_image > img.save(outfile, format, **options) > File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1439, in save > save_handler(self, fp, filename) > File "/usr/lib/python2.7/dist-packages/PIL/JpegImagePlugin.py", line > 471, in _save > ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) > File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 499, in > _save > s = e.encode_to_file(fh, bufsize) > OverflowError: signed integer is greater than maximum > > How I may help ? > > -- > Julien Palard - http://julien.palard.fr > IRC : mandark at freenode.net, mandark at quakenet.org > TEL : 06.21.19.49.10 / FAX : 09.72.28.06.72 > -- Julien Palard - http://julien.palard.fr IRC : mandark at freenode.net, mandark at quakenet.org TEL : 06.21.19.49.10 / FAX : 09.72.28.06.72 -------------- next part -------------- An HTML attachment was scrubbed... URL: From benj at pml.ac.uk Fri Jul 26 14:02:16 2013 From: benj at pml.ac.uk (Ben Taylor) Date: Fri, 26 Jul 2013 12:02:16 -0000 Subject: [Image-SIG] Corruption writing PNG data Message-ID: <51F263B3.9050104@pml.ac.uk> Hi all I've got some data that should be fine (came from a known-good netCDF file) but causes PIL to write an invalid image if it is used to save in PNG format (it's happy writing GIF format). The same code writes PNGs quite happily 99% of the time, but just occasionally we generate a netCDF that causes this bug - we don't know why. We're not sure if the problem is actually in PIL or if it might be in libpng. Anyone mind taking a look please? Test data at ftp://rsg.pml.ac.uk/rsg/benj/pil_problem/: data.npz - Numpy npz data with data that causes the issue working_data.npz - npz file from another source that works fine test_harness.py - Run this with the two test files to demonstrate the problem - the PNG generated from data.npz is corrupt. Test harness code below (just to demonstrate it's nothing complicated). TIA Ben #!/usr/bin/env python import numpy import Image def test(infile, prefix): npz = numpy.load(infile) imagedata = npz['arr_0'] palette = npz['arr_1'] out_image = Image.fromarray(imagedata, 'P') out_image.putpalette(palette) out_image.save(prefix + ".gif") # ok out_image.save(prefix + ".png") # bust # end function test("data.npz", "broken") test("working_data.npz", "working") -- Ben Taylor , http://rsg.pml.ac.uk/ Remote Sensing Group, Plymouth Marine Laboratory Tel: +44 (0)1752 633432, Fax: +44 (0)1752 633101 Latest news: www.pml.ac.uk and @PlymouthMarine Plymouth Marine Laboratory (PML) is a company limited by guarantee registered in England & Wales, company number 4178503. Registered Charity No. 1091222. Registered Office: Prospect Place, The Hoe, Plymouth PL1 3DH, UK. This message is private and confidential. If you have received this message in error, please notify the sender and remove it from your system. You are reminded that e-mail communications are not secure and may contain viruses; PML accepts no liability for any loss or damage which may be caused by viruses. From notifications at travis-ci.org Mon Jul 22 20:12:17 2013 From: notifications at travis-ci.org (Travis CI) Date: Mon, 22 Jul 2013 18:12:17 -0000 Subject: [Image-SIG] [Broken] python-imaging/Pillow#460 (master - 0884edd) Message-ID: <51ed727538e28_29730562521f8@808ddac0-3d24-49f8-a063-9a0cdf6e7ccc.mail> Build Update for python-imaging/Pillow ------------------------------------- Build: #460 Status: Broken Duration: 46 seconds Commit: 0884edd (master) Author: Alex Clark Message: Rename View the changeset: https://github.com/python-imaging/Pillow/compare/b8b5cb37559f...0884edd7f3d6 View the full build log and details: https://travis-ci.org/python-imaging/Pillow/builds/9362054 -- You can configure recipients for build notifications in your .travis.yml file. See http://about.travis-ci.org/docs/user/build-configuration -------------- next part -------------- An HTML attachment was scrubbed... URL: From notifications at travis-ci.org Mon Jul 22 20:29:19 2013 From: notifications at travis-ci.org (Travis CI) Date: Mon, 22 Jul 2013 18:29:19 -0000 Subject: [Image-SIG] [Fixed] python-imaging/Pillow#461 (master - 2f803e6) Message-ID: <51ed7671c2178_2195ab42363f4@9f199514-226e-4fb3-b804-139dcbe95f04.mail> Build Update for python-imaging/Pillow ------------------------------------- Build: #461 Status: Fixed Duration: 2 minutes and 54 seconds Commit: 2f803e6 (master) Author: Alex Clark Message: Rename View the changeset: https://github.com/python-imaging/Pillow/compare/0884edd7f3d6...2f803e653c3e View the full build log and details: https://travis-ci.org/python-imaging/Pillow/builds/9362658 -- You can configure recipients for build notifications in your .travis.yml file. See http://about.travis-ci.org/docs/user/build-configuration -------------- next part -------------- An HTML attachment was scrubbed... URL: