From mich at anorg.net Sat Apr 1 13:43:39 2006 From: mich at anorg.net (michael gross) Date: Sat, 1 Apr 2006 13:43:39 +0200 (CEST) Subject: [Image-SIG] problems compiling pil In-Reply-To: References: Message-ID: <61341.62.167.232.223.1143891819.squirrel@mail.anorg.net> hallo I have compiled pil with the mingw32 compiler with the fallowing commands setup.py build --compiler=mingw32 setup.py install --skip build it all seemd to work ok but if I try to save an image I get the fallowing error Traceback (most recent call last): File "C:\Dokumente und Einstellungen\mich23\Desktop\python_test_code\test.py", line 4, in -toplevel- im.save("testr.bmp") File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1305, in save save_handler(self, fp, filename) File "C:\Python24\Lib\site-packages\PIL\BmpImagePlugin.py", line 236, in _save ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, stride, -1))]) File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 489, in _save s = e.encode_to_file(fh, bufsize) IOError: (0, 'Error') does anyone have an idea why this happens. I have not installed the jpeg decoder. is this the reason for this error? I get the same error when I try to use the im.show methode. thank you for any help best michael From fredrik at pythonware.com Sat Apr 1 15:18:03 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 1 Apr 2006 15:18:03 +0200 Subject: [Image-SIG] problems compiling pil References: <61341.62.167.232.223.1143891819.squirrel@mail.anorg.net> Message-ID: michael gross wrote: > I have compiled pil with the mingw32 compiler with the fallowing commands > setup.py build --compiler=mingw32 > setup.py install --skip build > > it all seemd to work ok but if I try to save an image I get the fallowing > error > > Traceback (most recent call last): > File "C:\Dokumente und > Einstellungen\mich23\Desktop\python_test_code\test.py", line 4, in > -toplevel- > im.save("testr.bmp") > File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1305, in save > save_handler(self, fp, filename) > File "C:\Python24\Lib\site-packages\PIL\BmpImagePlugin.py", line 236, in > _save > ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, stride, > -1))]) > File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 489, in _save > s = e.encode_to_file(fh, bufsize) > IOError: (0, 'Error') > > does anyone have an idea why this happens. > I have not installed the jpeg decoder. is this the reason for this error? > I get the same error when I try to use the im.show methode. a possible cause is that you're mixing runtime libraries. can you verify that Python and the _imaging PYD are both linked against the same runtime lib ? From mich at anorg.net Sat Apr 1 18:19:24 2006 From: mich at anorg.net (michael gross) Date: Sat, 1 Apr 2006 18:19:24 +0200 (CEST) Subject: [Image-SIG] problems compiling pil Message-ID: <63045.62.167.232.223.1143908364.squirrel@mail.anorg.net> hallo all I have done was fallowing the instrucions on http://www.python.org/doc/2.3.4/inst/tweak-flags.html it all worked fine without giving any errors. even the selftest.py gave no errors exept that it detected that there is no jpeg lib which I have not installed. if the runtime lib is the file python24.a it should be linked against the same lib, because thats the lib I have created fallowing the instructions. thanks for any help michael > michael gross wrote: > >> I have compiled pil with the mingw32 compiler with the fallowing commands >> setup.py build --compiler=mingw32 >> setup.py install --skip build >> >> it all seemd to work ok but if I try to save an image I get the fallowing >> error >> >> Traceback (most recent call last): >> File "C:\Dokumente und >> Einstellungen\mich23\Desktop\python_test_code\test.py", line 4, in -toplevel- >> im.save("testr.bmp") >> File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1305, in save >> save_handler(self, fp, filename) >> File "C:\Python24\Lib\site-packages\PIL\BmpImagePlugin.py", line 236, >> in >> _save >> ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, stride, >> -1))]) >> File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 489, in >> _save >> s = e.encode_to_file(fh, bufsize) >> IOError: (0, 'Error') >> >> does anyone have an idea why this happens. >> I have not installed the jpeg decoder. is this the reason for this error? >> I get the same error when I try to use the im.show methode. > > a possible cause is that you're mixing runtime libraries. can you verify that > Python and the _imaging PYD are both linked against the same runtime lib ? > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From nirs at freeshell.org Sun Apr 2 17:38:01 2006 From: nirs at freeshell.org (Nir Soffer) Date: Sun, 2 Apr 2006 18:38:01 +0300 Subject: [Image-SIG] Error when saving JPEG with quality above 85 and optimize Message-ID: <5ff25f09f224e53ca7e796cc6c7f9ced@freeshell.org> When I try to save JPEG files with quality above 85 and optimize=1, I get this traceback: >>> image.save("foo.jpg", quality=86, optimize=1) Suspension not allowed here Traceback (most recent call last): File "", line 2, in ? File "", line 2, in save File "/opt/local/lib/python2.4/site-packages/PIL/Image.py", line 1305, in save save_handler(self, fp, filename) File "/opt/local/lib/python2.4/site-packages/PIL/JpegImagePlugin.py", line 409, in _save ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)]) File "/opt/local/lib/python2.4/site-packages/PIL/ImageFile.py", line 491, in _save raise IOError("encoder error %d when writing image file" % s) IOError: encoder error -2 when writing image file For publishing photographs in both full size and thumbnails, I find quality level of 90-95 to give the best results. I hoped that optimize would give even better results :-) I compared PIL, GIMP and Photoshop output, seems that all give almost identical results for the same output file size. PIL seems to give little sharper results - maybe because I resized the images using ANTIALIAS and both Photoshop and GIMP support only BICUBIC filter? Last, a note about the docs: "Keyword options can be used to provide additional instructions to the writer. If a writer doesn't recognise an option, it is silently ignored." Thats evil - if an option is not recognized, it should raise. "The available options are described later in this handbook." Where is the link to the options? at least where is "later"? Best Regards, Nir Soffer From jwt at onjapan.net Mon Apr 3 01:40:56 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Mon, 3 Apr 2006 08:40:56 +0900 Subject: [Image-SIG] Error when saving JPEG with quality above 85 and optimize In-Reply-To: <5ff25f09f224e53ca7e796cc6c7f9ced@freeshell.org> References: <5ff25f09f224e53ca7e796cc6c7f9ced@freeshell.org> Message-ID: On Apr 3, 2006, at 00:38, Nir Soffer wrote: > When I try to save JPEG files with quality above 85 and optimize=1, I > get this traceback: >>>> image.save("foo.jpg", quality=86, optimize=1) > > Suspension not allowed here Try this workaround for the way the JPEG library works: http://mail.python.org/pipermail/image-sig/1999-August/000816.html > "The available options are described later in this handbook." > Where is the link to the options? at least where is "later"? There is an appendix titled "Image File Formats" that includes notes including the options accepted by save() and the 'info' properties supported by each format. In the online version, it is here: http://www.pythonware.com/library/pil/handbook/formats.htm Of course, looking through the code is the best method to get up to date information. :-) -- Jim Tittsler 7J1AJH/AI8A Tokyo GPG: 0x01159DB6 http://www.qsl.net/7j1ajh/ QRP/Satellites/APRS AMSAT/NZART From eric.germaneau at epfl.ch Wed Apr 5 15:46:17 2006 From: eric.germaneau at epfl.ch (Eric Germaneau) Date: Wed, 05 Apr 2006 15:46:17 +0200 Subject: [Image-SIG] PhotoImage Class Message-ID: <4433CA29.1060903@epfl.ch> Hello, I wish to ise the photimage class and I'm wondering wether someone would have an example .... Thanks in advance, Eric. -- ************************************************************************************************* " Reason" in things existed before things themselves existed and all the changes in things were governed by it. Zhu Xi. Eric Germaneau Assistant Doctorant Ecole polytechnique f?d?rale de Lausanne (EPFL) FSB - IPMC Laboratoire de Cristallographie(LCr) BSP 518 CH-1015 Lausanne Switzerland eric.germaneau at epfl.ch Tel.: +41 (0)21 / 693 06 36 Fax.: +41 (0)21 / 693 05 04 // P Please consider the environment before printing this email - Consid?rez svp l'environnement avant d'imprimer ce courriel // -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060405/2618e2f3/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: petit-pingoin.gif Type: image/gif Size: 1284 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060405/2618e2f3/attachment.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: eric.germaneau.vcf Type: text/x-vcard Size: 437 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060405/2618e2f3/attachment.vcf From fredrik at pythonware.com Thu Apr 6 15:17:59 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 6 Apr 2006 15:17:59 +0200 Subject: [Image-SIG] PhotoImage Class References: <4433CA29.1060903@epfl.ch> Message-ID: Eric Germaneau wrote: > I wish to ise the photimage class and I'm wondering wether someone would > have an example .... the basics are really simple: import ImageTk photo = ImageTk.PhotoImage(file="somefilename") or im = ... some image operation ... photo = ImageTk.PhotoImage(im) The resulting object can be used everywhere you can use a Tkinter.PhotoImage object http://effbot.org/tkinterbook/photoimage.htm e.g. label = Label(image=photo) here's a complete example: import sys import Image, ImageTk, Tkinter root = Tkinter.Tk() im = Image.open(sys.argv[1]) im.thumbnail((400, 400)) photo = ImageTk.PhotoImage(im) label = Tkinter.Label(root, image=photo) label.pack() # see note on http://effbot.org/tkinterbook/photoimage.htm label.image = photo root.mainloop() the above script loads the image given as an argument, resizes it to 400x400 (max), and displays it in a Tkinter label widget. hope this helps! From oogetbil at phys.psu.edu Sat Apr 8 21:10:33 2006 From: oogetbil at phys.psu.edu (Orcan Ogetbil) Date: Sat, 8 Apr 2006 15:10:33 -0400 (EDT) Subject: [Image-SIG] (transparent) PIL image to QImage conversion? Message-ID: <50889.71.162.40.219.1144523433.squirrel@71.162.40.219> Hi, I need to convert a PIL image to a QImage object so I can display it in a PyQt application. I found a basic example at: http://lists.kde.org/?l=pykde&m=114235100819012&w=2 There the PIL image is converted to a string using a jpeg encoder first; then the string is converted to a QByteArray; then Qimage's loadFromData() function is used for the final conversion to a QImage object. My problem is, the JPEG encoding kills the transparency of my PNG images. When I do RAW encoding, I get nothing from the QByteArray object. I also couldn't get the thing work with a GIF encoding. PIL's tostring() function doesn't support PNG encoding. Here I found a list of encodings PIL provides: http://mail.python.org/pipermail/image-sig/2004-September/002908.html Has anybody encountered this problem? Can I use cStringIO.StringIO() instead of PIL's tostring() somehow? Any solutions? Thanks! From ced at bernispa.com Mon Apr 10 11:12:28 2006 From: ced at bernispa.com (Berni CED) Date: Mon, 10 Apr 2006 11:12:28 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space Message-ID: <443A217C.1050405@bernispa.com> I have encountered several images that are not managed well by PIL. Exactly as explainded by the following old mail (which had received no reply) colors are darker and, in general, different from the original: http://mail.python.org/pipermail/image-sig/2001-July/001514.html And like in that mail, my problematic images have one thing in common: they are JPEG using the CMYK color space. JPEG in RGB are elaborated correctly. The problem was verified with: - PIL 1.1.5 under Windows 2000 with Python 2.4.3; - PIL 1.1.4 under Debian GNU/Linux Sarge with Python 2.3.5. On the following address i have set up a little page with links to sample images and a python script that trigger the problem: http://www.bernispa.com/pil/index.html For me there are different important things to note. 1) The script shows the image passed as parameter in the default image viewer and then save a copy of it in a new JPEG file: in my test machine i can see that the image showed is already altered (so some conversion is already happened) and the saved image is double-altered. To be more precise, seems that in the saved image the problem is bigger (much darker picture) as if there is 2 conversions that sums their effects. Since the image showed in the image viewer is a BMP, i suppose this behaviour is by design, and all showed images are first converted in BMP. If it is true i think that should be explained in the handbook, because it is not obvious that show() make some internal conversion. 2) The test images 02 and 03 are particular: all the other images show bad during show() and very bad in the saved file. The 02 and 03, however, seems to show correctly but, as the others, are badly saved. 3) In the script i have inserted a verify() that raises no exception: so from the PIL point of view, the images are correct. So i think there is a bug in the code related to JPEG CYMK or there are some JPEG unsupported feature. What do you think? Some advice? Regards. Cesare. From ced at bernispa.com Thu Apr 13 07:27:12 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Thu, 13 Apr 2006 07:27:12 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <443A217C.1050405@bernispa.com> References: <443A217C.1050405@bernispa.com> Message-ID: <443DE12F.5020103@bernispa.com> Berni CED ha scritto: > I have encountered several images that are not managed well by PIL. > Exactly as explainded by the following old mail (which had received no > reply) colors are darker and, in general, different from the original: > http://mail.python.org/pipermail/image-sig/2001-July/001514.html > And like in that mail, my problematic images have one thing in common: > they are JPEG using the CMYK color space. JPEG in RGB are elaborated > correctly. No one can confirm or add some info? It's a known problem? Fredrik? Regards. Cesare. From adeuring at gmx.net Thu Apr 13 13:58:20 2006 From: adeuring at gmx.net (abel deuring) Date: Thu, 13 Apr 2006 13:58:20 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <443DE12F.5020103@bernispa.com> References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> Message-ID: <443E3CDC.6060905@gmx.net> Cesare Leonardi wrote: > Berni CED ha scritto: >>I have encountered several images that are not managed well by PIL. >>Exactly as explainded by the following old mail (which had received no >>reply) colors are darker and, in general, different from the original: >>http://mail.python.org/pipermail/image-sig/2001-July/001514.html >>And like in that mail, my problematic images have one thing in common: >>they are JPEG using the CMYK color space. JPEG in RGB are elaborated >>correctly. > > No one can confirm or add some info? It's a known problem? Fredrik? Cesare, I can confirm the problems, though I have no idea, why the files written by PIL have completely wrong colours. Regarding the altered colours of the image displayed by im.show() [disclaimer: I'm writing this without actually having a look into the PIL sources, so I can easily be wrong...]: The changes are probably caused by a very simple conversion from CMYK to RGB, like C = 1 - R, M = 1 - G, Y = 1 - B. Both CMYK and RGB are device dependant color spaces, i.e., if you use two different monitors, and let them display some pixels with identical RGB values, the displayed colours are not exactly identical. The same holds for CMYK colours: Two different ink jet printers will most likely show slightly different colours for the same CMYK value. And offset printing machines (for which most CYMK TIFF/JPEG files are intended) will produce even other colours. For a decent RGB <-> CMYK conversion (which you simply need, if you want to display a CMYK image on a CRT or LCD monitor), I'd recommend to use ICC profiles. An ICC profile provides a kind of "colour description" for a certain device, like a CRT monitor, an inkjet printer, a scanner or a digital camera. You'll find more information on ICC at http://www.color.org. A very good free implementation of ICC based colour conversions is Littlecms (http://www.littlecms.com). Aside from a library for ICC colour conversions, littlecms also provides programs for RGB<->CMYK conversions of JPEG and TIFF images. The littlecms web site has also many useful links to other ICC resources. Abel From p.f.moore at gmail.com Thu Apr 13 15:25:41 2006 From: p.f.moore at gmail.com (Paul Moore) Date: Thu, 13 Apr 2006 14:25:41 +0100 Subject: [Image-SIG] Python 2.5 binaries? Message-ID: <79990c6b0604130625i7679875dsbbc0f8fd60f257c9@mail.gmail.com> Does anyone have a binary installer for PIL with Python 2.5 on Windows? I can try building it myself, but traditionally, I've had a lot of trouble assembling all of the necessary imaging libraries, so I thought I'd save myself some time if some kind sould had already done this. (Follow-up question - if no-one else has a binary, and I do build one, would anyone like to host it to save others the trouble?) Thanks, Paul From kevin at cazabon.com Thu Apr 13 21:52:30 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Thu, 13 Apr 2006 21:52:30 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <443E3CDC.6060905@gmx.net> Message-ID: <09dd01c65f33$cce0c050$650aa8c0@duallie> When saving a CMYK file to JPG, PIL seems to invert the colors. I've submitted a patch to Fredrik already for this, and it should be in the next major build. Adding a simple invert to the image before saving will help. Kevin. ----- Original Message ----- From: "abel deuring" To: "Cesare Leonardi" Cc: Sent: Thursday, April 13, 2006 1:58 PM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > Cesare Leonardi wrote: >> Berni CED ha scritto: >>>I have encountered several images that are not managed well by PIL. >>>Exactly as explainded by the following old mail (which had received no >>>reply) colors are darker and, in general, different from the original: >>>http://mail.python.org/pipermail/image-sig/2001-July/001514.html >>>And like in that mail, my problematic images have one thing in common: >>>they are JPEG using the CMYK color space. JPEG in RGB are elaborated >>>correctly. >> >> No one can confirm or add some info? It's a known problem? Fredrik? > > Cesare, > > I can confirm the problems, though I have no idea, why the files > written by PIL have completely wrong colours. > > Regarding the altered colours of the image displayed by im.show() > [disclaimer: I'm writing this without actually having a look into > the PIL sources, so I can easily be wrong...]: The changes are > probably caused by a very simple conversion from CMYK to RGB, like > C = 1 - R, M = 1 - G, Y = 1 - B. Both CMYK and RGB are device > dependant color spaces, i.e., if you use two different monitors, and > let them display some pixels with identical RGB values, the > displayed colours are not exactly identical. The same holds for CMYK > colours: Two different ink jet printers will most likely show > slightly different colours for the same CMYK value. And offset > printing machines (for which most CYMK TIFF/JPEG files are intended) > will produce even other colours. > > For a decent RGB <-> CMYK conversion (which you simply need, if you > want to display a CMYK image on a CRT or LCD monitor), I'd recommend > to use ICC profiles. An ICC profile provides a kind of "colour > description" for a certain device, like a CRT monitor, an inkjet > printer, a scanner or a digital camera. You'll find more information > on ICC at http://www.color.org. A very good free implementation of > ICC based colour conversions is Littlecms > (http://www.littlecms.com). Aside from a library for ICC colour > conversions, littlecms also provides programs for RGB<->CMYK > conversions of JPEG and TIFF images. The littlecms web site has also > many useful links to other ICC resources. > > Abel > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From rowen at cesmail.net Thu Apr 13 22:28:46 2006 From: rowen at cesmail.net (Russell E. Owen) Date: Thu, 13 Apr 2006 13:28:46 -0700 Subject: [Image-SIG] How to display a masked image? Message-ID: I'm trying to use PIL to display a grayscale image with an associated mask. I want the user to clearly see which pixels are masked, yet still be able to see the original data in the masked areas. The algorithm I've come up with is to average the grayscale image with a mask that consists of a tint color. It seems to work (but if there's a better algorithm I'd love to hear of it). However, my code to implement this looks pretty messy. Is there a better way? def addMask(im, mask, maskrgb, intens=75): """Add a mask to a grayscale image in such a way that the masked areas of the image can still be seen. Inputs: - im is an "F" grayscale image that has been scaled into 0-255 range - mask is a mask such that 0 = unmasked, nonzero=masked - maskrgb is a tuple of RGB color values 0-255 each - intens is the intensity of the displayed mask 0-255 Returns the masked image in color """ lmask = mask.convert("L") rgbmaskset = [] # create color image of mask for colval in maskrgb: rgbmaskset.append(lmask.point(lambda i: i * colval)) rgbmask = Image.merge("RGB", rgbmaskset) # create transparency version of mask transmask = lmask.point(lambda i: i * intens) # merge mask and image rgbim = im.convert("RGB") rgbim.paste(rgbmask, mask=transmask) return rgbim -- Russell From ced at bernispa.com Fri Apr 14 09:38:16 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Fri, 14 Apr 2006 09:38:16 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <09dd01c65f33$cce0c050$650aa8c0@duallie> References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <443E3CDC.6060905@gmx.net> <09dd01c65f33$cce0c050$650aa8c0@duallie> Message-ID: <443F5168.8080004@bernispa.com> kevin at cazabon.com ha scritto: > When saving a CMYK file to JPG, PIL seems to invert the colors. I've > submitted a patch to Fredrik already for this, and it should be in the > next major build. > > Adding a simple invert to the image before saving will help. Thanks all for your responses. Kevin, i've made some tests following what you've suggested and here is the results. To obtain the color inversion i've used the function invert() in ImageChops module. I've added the code and the new sample images in this page (see "part 2"): http://www.bernispa.com/pil/index.html As you can see your suggestion works partially. Images 02 and 03 (that was particular in "part 1") are the only that after the inversion looks ok. All the other images looks less dark, but the color are always different than the original. The particular thing to note is that the images produced by the inversion looks the same as Image.show(). Seems that show() already do the inversion. There is another thing that i have noted only now: the images saved by PIL are often less big than the original. Sometimes much less. For example: test01: 1435 KB test01-dst: 198 KB test01-dst-invert: 198 KB test04: 1237 KB test01-dst: 405 KB test01-dst-invert: 405 KB test08: 1647 KB test01-dst: 777 KB test01-dst-invert: 776 KB test09: 1715 KB test01-dst: 665 KB test01-dst-invert: 665 KB test10: 2032 KB test01-dst: 659 KB test01-dst-invert: 659 KB I can think that PIL optimize the compression, but that difference are really big. Isn't it suspicious? I expect that saving an image in a new file without modifications produces a file very similar to the original, isn't it? The original images was not produced by me so the author can have used low compression. I cannot make tests since i haven't a program that can save in CMYK (Gimp seems not able). Regards. Cesare. From kevin at cazabon.com Sat Apr 15 13:32:20 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Sat, 15 Apr 2006 13:32:20 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net> <09dd01c65f33$cce0c050$650aa8c0@duallie> <443F5168.8080004@bernispa.com> Message-ID: <086501c66080$42da7010$650aa8c0@duallie> Actually, the problem is that PIL also has problems reading CMYK JPEG files apparently. I just proved that by loading your CMYK test files and doing a "show", then loading a CMYK TIFF file and doing a show (note that to use show, it converts to RGB with the internal conversion, so the colors won't be perfect). The TIFF loaded fine, the JPEG didn't. The patch I've submitted fixes the problem with saving incorrectly, but doesn't fix the reading issue (yet). So, as long as your source CMYK image doesn't come from a JPEG file it's ok (with my invert patch). I'll see if I can spend some time looking at that this weekend. Kevin. ----- Original Message ----- From: "Cesare Leonardi" To: Sent: Friday, April 14, 2006 9:38 AM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > kevin at cazabon.com ha scritto: >> When saving a CMYK file to JPG, PIL seems to invert the colors. I've >> submitted a patch to Fredrik already for this, and it should be in the >> next major build. >> >> Adding a simple invert to the image before saving will help. > > Thanks all for your responses. > > Kevin, i've made some tests following what you've suggested and here is > the results. > To obtain the color inversion i've used the function invert() in > ImageChops module. I've added the code and the new sample images in this > page (see "part 2"): > http://www.bernispa.com/pil/index.html > > As you can see your suggestion works partially. > Images 02 and 03 (that was particular in "part 1") are the only that > after the inversion looks ok. > All the other images looks less dark, but the color are always different > than the original. > The particular thing to note is that the images produced by the > inversion looks the same as Image.show(). Seems that show() already do > the inversion. > > There is another thing that i have noted only now: the images saved by > PIL are often less big than the original. Sometimes much less. For > example: > test01: 1435 KB test01-dst: 198 KB test01-dst-invert: 198 KB > test04: 1237 KB test01-dst: 405 KB test01-dst-invert: 405 KB > test08: 1647 KB test01-dst: 777 KB test01-dst-invert: 776 KB > test09: 1715 KB test01-dst: 665 KB test01-dst-invert: 665 KB > test10: 2032 KB test01-dst: 659 KB test01-dst-invert: 659 KB > I can think that PIL optimize the compression, but that difference are > really big. Isn't it suspicious? I expect that saving an image in a new > file without modifications produces a file very similar to the original, > isn't it? > The original images was not produced by me so the author can have used > low compression. I cannot make tests since i haven't a program that can > save in CMYK (Gimp seems not able). > > Regards. > > Cesare. > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From kevin at cazabon.com Sat Apr 15 14:01:39 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Sat, 15 Apr 2006 14:01:39 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> Message-ID: <087001c66084$5a9e6f40$650aa8c0@duallie> In the JPEGImagePlugin.py module, there's a hack to handle Photoshop 2.5 CMYK JPEG images (around line 273)... that's causing half the problem upon loading JPEG's. By commenting that out, you get a proper image, although it's still inverted. I can't seem to find the right place to re-invert the image upon load, but I'll see what I can find. Anyone with suggestions would be welcome. There's probably a better way to do this though, so the data is read correctly in the first place (in CMYK, 0,0,0,0 = white, 255,255,255,255 = full black... this is probably the problem). Kevin. ----- Original Message ----- From: To: "Cesare Leonardi" ; Sent: Saturday, April 15, 2006 1:32 PM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > Actually, the problem is that PIL also has problems reading CMYK JPEG > files > apparently. I just proved that by loading your CMYK test files and doing > a > "show", then loading a CMYK TIFF file and doing a show (note that to use > show, it converts to RGB with the internal conversion, so the colors won't > be perfect). The TIFF loaded fine, the JPEG didn't. > > The patch I've submitted fixes the problem with saving incorrectly, but > doesn't fix the reading issue (yet). So, as long as your source CMYK > image > doesn't come from a JPEG file it's ok (with my invert patch). > > I'll see if I can spend some time looking at that this weekend. > > Kevin. > ----- Original Message ----- > From: "Cesare Leonardi" > To: > Sent: Friday, April 14, 2006 9:38 AM > Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > > >> kevin at cazabon.com ha scritto: >>> When saving a CMYK file to JPG, PIL seems to invert the colors. I've >>> submitted a patch to Fredrik already for this, and it should be in the >>> next major build. >>> >>> Adding a simple invert to the image before saving will help. >> >> Thanks all for your responses. >> >> Kevin, i've made some tests following what you've suggested and here is >> the results. >> To obtain the color inversion i've used the function invert() in >> ImageChops module. I've added the code and the new sample images in this >> page (see "part 2"): >> http://www.bernispa.com/pil/index.html >> >> As you can see your suggestion works partially. >> Images 02 and 03 (that was particular in "part 1") are the only that >> after the inversion looks ok. >> All the other images looks less dark, but the color are always different >> than the original. >> The particular thing to note is that the images produced by the >> inversion looks the same as Image.show(). Seems that show() already do >> the inversion. >> >> There is another thing that i have noted only now: the images saved by >> PIL are often less big than the original. Sometimes much less. For >> example: >> test01: 1435 KB test01-dst: 198 KB test01-dst-invert: 198 KB >> test04: 1237 KB test01-dst: 405 KB test01-dst-invert: 405 KB >> test08: 1647 KB test01-dst: 777 KB test01-dst-invert: 776 KB >> test09: 1715 KB test01-dst: 665 KB test01-dst-invert: 665 KB >> test10: 2032 KB test01-dst: 659 KB test01-dst-invert: 659 KB >> I can think that PIL optimize the compression, but that difference are >> really big. Isn't it suspicious? I expect that saving an image in a new >> file without modifications produces a file very similar to the original, >> isn't it? >> The original images was not produced by me so the author can have used >> low compression. I cannot make tests since i haven't a program that can >> save in CMYK (Gimp seems not able). >> >> Regards. >> >> Cesare. >> _______________________________________________ >> 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 kevin at cazabon.com Sun Apr 16 14:25:53 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Sun, 16 Apr 2006 14:25:53 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> <087001c66084$5a9e6f40$650aa8c0@duallie> Message-ID: <003101c66150$e7dff550$650aa8c0@duallie> I've attached a patched JpegImagePlugin.py file (sorry for the 14.5kb attachment to a mailing list). It should fix the inversion problem both upon load and upon save of CMYK JPEG files. Modifications can be found starting on the following lines: line 35: add ImageChops to the import list, for inverting images line 273: comment out previous patch for Adobe Photoshop 2.5 CMYK files... I sure hope nobody uses 2.5 anymore, and this patch breaks newer versions. line 288: invert CMYK images after load line 416: invert CMYK images before save I'm sure there are more elegant an efficient ways of fixing this problem, but this works. I hope it helps you, as I've had the same issues myself. Fredrik - if you're ok with the crude methods of fixing this problem, can you include it in future builds? Thanks. Kevin. ----- Original Message ----- From: To: ; "Cesare Leonardi" ; Sent: Saturday, April 15, 2006 2:01 PM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > In the JPEGImagePlugin.py module, there's a hack to handle Photoshop 2.5 > CMYK JPEG images (around line 273)... that's causing half the problem upon > loading JPEG's. By commenting that out, you get a proper image, although > it's still inverted. > > I can't seem to find the right place to re-invert the image upon load, but > I'll see what I can find. Anyone with suggestions would be welcome. > There's probably a better way to do this though, so the data is read > correctly in the first place (in CMYK, 0,0,0,0 = white, 255,255,255,255 = > full black... this is probably the problem). > > Kevin. > ----- Original Message ----- > From: > To: "Cesare Leonardi" ; > Sent: Saturday, April 15, 2006 1:32 PM > Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > > >> Actually, the problem is that PIL also has problems reading CMYK JPEG >> files >> apparently. I just proved that by loading your CMYK test files and doing >> a >> "show", then loading a CMYK TIFF file and doing a show (note that to use >> show, it converts to RGB with the internal conversion, so the colors >> won't >> be perfect). The TIFF loaded fine, the JPEG didn't. >> >> The patch I've submitted fixes the problem with saving incorrectly, but >> doesn't fix the reading issue (yet). So, as long as your source CMYK >> image >> doesn't come from a JPEG file it's ok (with my invert patch). >> >> I'll see if I can spend some time looking at that this weekend. >> >> Kevin. >> ----- Original Message ----- >> From: "Cesare Leonardi" >> To: >> Sent: Friday, April 14, 2006 9:38 AM >> Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space >> >> >>> kevin at cazabon.com ha scritto: >>>> When saving a CMYK file to JPG, PIL seems to invert the colors. I've >>>> submitted a patch to Fredrik already for this, and it should be in the >>>> next major build. >>>> >>>> Adding a simple invert to the image before saving will help. >>> >>> Thanks all for your responses. >>> >>> Kevin, i've made some tests following what you've suggested and here is >>> the results. >>> To obtain the color inversion i've used the function invert() in >>> ImageChops module. I've added the code and the new sample images in this >>> page (see "part 2"): >>> http://www.bernispa.com/pil/index.html >>> >>> As you can see your suggestion works partially. >>> Images 02 and 03 (that was particular in "part 1") are the only that >>> after the inversion looks ok. >>> All the other images looks less dark, but the color are always different >>> than the original. >>> The particular thing to note is that the images produced by the >>> inversion looks the same as Image.show(). Seems that show() already do >>> the inversion. >>> >>> There is another thing that i have noted only now: the images saved by >>> PIL are often less big than the original. Sometimes much less. For >>> example: >>> test01: 1435 KB test01-dst: 198 KB test01-dst-invert: 198 KB >>> test04: 1237 KB test01-dst: 405 KB test01-dst-invert: 405 KB >>> test08: 1647 KB test01-dst: 777 KB test01-dst-invert: 776 KB >>> test09: 1715 KB test01-dst: 665 KB test01-dst-invert: 665 KB >>> test10: 2032 KB test01-dst: 659 KB test01-dst-invert: 659 KB >>> I can think that PIL optimize the compression, but that difference are >>> really big. Isn't it suspicious? I expect that saving an image in a new >>> file without modifications produces a file very similar to the original, >>> isn't it? >>> The original images was not produced by me so the author can have used >>> low compression. I cannot make tests since i haven't a program that can >>> save in CMYK (Gimp seems not able). >>> >>> Regards. >>> >>> Cesare. >>> _______________________________________________ >>> 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 embedded and charset-unspecified text was scrubbed... Name: JpegImagePlugin.py Url: http://mail.python.org/pipermail/image-sig/attachments/20060416/62df61be/attachment.pot From ced at bernispa.com Sun Apr 16 16:16:15 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Sun, 16 Apr 2006 16:16:15 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <003101c66150$e7dff550$650aa8c0@duallie> References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> <087001c66084$5a9e6f40$650aa8c0@duallie> <003101c66150$e7dff550$650aa8c0@duallie> Message-ID: <444251AF.1030709@bernispa.com> kevin at cazabon.com wrote: > I've attached a patched JpegImagePlugin.py file (sorry for the 14.5kb > attachment to a mailing list). It should fix the inversion problem both > upon load and upon save of CMYK JPEG files. Thank you very much for your work and for trying to find the root of the problem, Kevin. On thuesday i'll be happy to try your patch and post the results. Regards. Cesare. From ced at bernispa.com Mon Apr 17 19:46:35 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Mon, 17 Apr 2006 19:46:35 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <444251AF.1030709@bernispa.com> References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> <087001c66084$5a9e6f40$650aa8c0@duallie> <003101c66150$e7dff550$650aa8c0@duallie> <444251AF.1030709@bernispa.com> Message-ID: <4443D47B.1010900@bernispa.com> Cesare Leonardi wrote: > On thuesday i'll be happy to try your patch and post the results. I haven't resisted so i have set up my home system with PIL and tryed Kevin's patch. ;-) I can confirm that it works and i have updated the site with the images obtained from the patched PIL (see "part 3"): http://www.bernispa.com/pil/index.html Well done, Kevin. Regards. Cesare. From shussai2 at yahoo.com Mon Apr 17 19:49:18 2006 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Mon, 17 Apr 2006 10:49:18 -0700 (PDT) Subject: [Image-SIG] PSDraw in PIL problem with print Message-ID: <20060417174918.22889.qmail@web36803.mail.mud.yahoo.com> Hi, I am trying to follow the Postscript print example in PIL. So I am using PSDraw to create a new ps file from a jpeg. I have ghostview installed, so I can view the resulting ps file (when it is produced successfully). Example from PIL Manual: import Image, PSDraw im = Image.open('lena.jpg').convert('L') box = (1*72, 2*72, 7*72, 10*72) outfp = open('lena.ps','w') ps = PSDraw.PSDraw(outfp) ps.begin_document() ps.image(box,im,72) ps.rectangle(box) ps.end_document() Now when I try to open up the lena.ps (that should contain the lena.jpg) in ghostview, I get Error: undefined gsize. However when I change the gsize to gsave in the lena.ps, the file loads up. Snippet of the actual code is show below: %%EndProlog gsize ------------------> change this to gsave 240.000000 384.000000 translate 0.960000 0.960000 scale gsave I don't know why it is happening. Can you please tell me another solution instead of changing a line manually. I just need to print a jpeg file. Is there any way else to do this. So basically I have an image in a folder, I open it and send it to a printer. Please let me know if you guys know anything. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From fredrik at pythonware.com Mon Apr 17 20:24:49 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 17 Apr 2006 20:24:49 +0200 Subject: [Image-SIG] PSDraw in PIL problem with print References: <20060417174918.22889.qmail@web36803.mail.mud.yahoo.com> Message-ID: Sajjad Hussain wrote (on a number of Python lists): > %%EndProlog > gsize ------------------> change this to gsave > 240.000000 384.000000 translate > 0.960000 0.960000 scale > gsave > > > I don't know why it is happening. Can you please tell > me another solution instead of changing a line > manually. it's a known bug in PIL 1.1.4 and earlier. I suggest upgrading to 1.1.5. From fredrik at pythonware.com Mon Apr 17 20:32:43 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 17 Apr 2006 20:32:43 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> Message-ID: Cesare Leonardi wrote: > No one can confirm or add some info? It's a known problem? Fredrik? it was a while since I last messed around with this, but IIRC, CMYK in JPEG is one big mess, mainly because Adobe got it wrong in Photoshop many years ago. unless anyone can convince me not to, I'm going to trust you and Kevin on this one, and change PIL to always use the Photoshop behaviour. can anyone provide some samples ? (preferrably small images (<50k or so) with colors chosen so it's obvious what's what. i.e. no blue trees or green firetrucks, please ;-). From p.f.moore at gmail.com Mon Apr 17 21:21:07 2006 From: p.f.moore at gmail.com (Paul Moore) Date: Mon, 17 Apr 2006 20:21:07 +0100 Subject: [Image-SIG] Python 2.5 binaries? In-Reply-To: <79990c6b0604130625i7679875dsbbc0f8fd60f257c9@mail.gmail.com> References: <79990c6b0604130625i7679875dsbbc0f8fd60f257c9@mail.gmail.com> Message-ID: <79990c6b0604171221i23e68d2dva42ada54f8d8dc23@mail.gmail.com> On 4/13/06, Paul Moore wrote: > Does anyone have a binary installer for PIL with Python 2.5 on > Windows? I can try building it myself, but traditionally, I've had a > lot of trouble assembling all of the necessary imaging libraries, so I > thought I'd save myself some time if some kind sould had already done > this. I got this built. It's not particularly hard, it's just a matter of getting all the dependencies. I've had an offer of hosting the file, so if anyone else wants it, it'll be made available in due course. Paul. From spe.stani.be at gmail.com Mon Apr 17 21:44:01 2006 From: spe.stani.be at gmail.com (SPE Stani's Python Editor) Date: Mon, 17 Apr 2006 21:44:01 +0200 Subject: [Image-SIG] Python 2.5 binaries? In-Reply-To: <79990c6b0604171221i23e68d2dva42ada54f8d8dc23@mail.gmail.com> References: <79990c6b0604130625i7679875dsbbc0f8fd60f257c9@mail.gmail.com> <79990c6b0604171221i23e68d2dva42ada54f8d8dc23@mail.gmail.com> Message-ID: <2078a7ad0604171244l6b05af1evecaab15f89081ed2@mail.gmail.com> On 4/17/06, Paul Moore wrote: > On 4/13/06, Paul Moore wrote: > > Does anyone have a binary installer for PIL with Python 2.5 on > > Windows? I can try building it myself, but traditionally, I've had a > > lot of trouble assembling all of the necessary imaging libraries, so I > > thought I'd save myself some time if some kind sould had already done > > this. > > I got this built. It's not particularly hard, it's just a matter of > getting all the dependencies. > > I've had an offer of hosting the file, so if anyone else wants it, > it'll be made available in due course. For those who are interested: I've uploaded it on http://pythonide.stani.be under the section News. As soon as Fredrik provides an installer, I'll remove it. I didn't test it yet myself, as now I am on Ubuntu. Stani -- http://pythonide.stani.be http://pythonide.stani.be/screenshots http://pythonide.stani.be/manual/html/manual.html From kevin at cazabon.com Mon Apr 17 22:46:32 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Mon, 17 Apr 2006 22:46:32 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> Message-ID: <003a01c66260$02b4e5b0$650aa8c0@duallie> I've verified that the patch works with current versions of Photoshop, but you do raise a good point Fredrik... it should be checked with other programs too. Unfortuantely I don't have any other programs that read/write CMYK JPEG files... anyone else out there have one we can double-check with? Maybe Corel Draw or something? Kevin. ----- Original Message ----- From: "Fredrik Lundh" To: Sent: Monday, April 17, 2006 8:32 PM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > Cesare Leonardi wrote: > >> No one can confirm or add some info? It's a known problem? Fredrik? > > it was a while since I last messed around with this, but IIRC, CMYK in > JPEG is one big mess, mainly because Adobe got it wrong in Photoshop > many years ago. > > unless anyone can convince me not to, I'm going to trust you and Kevin > on this one, and change PIL to always use the Photoshop behaviour. > > can anyone provide some samples ? (preferrably small images (<50k or so) > with colors chosen so it's obvious what's what. i.e. no blue trees or > green > firetrucks, please ;-). > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From steve at holdenweb.com Tue Apr 18 00:01:19 2006 From: steve at holdenweb.com (Steve Holden) Date: Mon, 17 Apr 2006 23:01:19 +0100 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <4443D47B.1010900@bernispa.com> References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> <087001c66084$5a9e6f40$650aa8c0@duallie> <003101c66150$e7dff550$650aa8c0@duallie> <444251AF.1030709@bernispa.com> <4443D47B.1010900@bernispa.com> Message-ID: <4444102F.2090807@holdenweb.com> Cesare Leonardi wrote: > Cesare Leonardi wrote: > >>On thuesday i'll be happy to try your patch and post the results. > > > I haven't resisted so i have set up my home system with PIL and tryed > Kevin's patch. ;-) > > I can confirm that it works and i have updated the site with the images > obtained from the patched PIL (see "part 3"): > http://www.bernispa.com/pil/index.html > > Well done, Kevin. > I haven't done an exhaustive test, but so far every graphic on http://www.bernispa.com/pil/index.html that I've examined gives me a Firefox error: The image ?http://www.bernispa.com/pil/original-img/test01.jpg? cannot be displayed, because it contains errors. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden From kevin at cazabon.com Tue Apr 18 07:50:17 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Tue, 18 Apr 2006 07:50:17 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com><443DE12F.5020103@bernispa.com><443E3CDC.6060905@gmx.net><09dd01c65f33$cce0c050$650aa8c0@duallie><443F5168.8080004@bernispa.com> <086501c66080$42da7010$650aa8c0@duallie> <087001c66084$5a9e6f40$650aa8c0@duallie> <003101c66150$e7dff550$650aa8c0@duallie> <444251AF.1030709@bernispa.com><4443D47B.1010900@bernispa.com> <4444102F.2090807@holdenweb.com> Message-ID: <038b01c662ab$f9c3db90$650aa8c0@duallie> Even Internet Explorer doesn't support CMYK JPEG images - it's not surprising FireFox can't display them either. You'll have to download the files and use something like Photoshop to view them. That's half the problem with verifying this patch... not many programs can work with CMYK, it's not something the home user usually deals with. THanks for trying though, Kevin. ----- Original Message ----- From: "Steve Holden" To: "Cesare Leonardi" Cc: Sent: Tuesday, April 18, 2006 12:01 AM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space Cesare Leonardi wrote: > Cesare Leonardi wrote: > >>On thuesday i'll be happy to try your patch and post the results. > > > I haven't resisted so i have set up my home system with PIL and tryed > Kevin's patch. ;-) > > I can confirm that it works and i have updated the site with the images > obtained from the patched PIL (see "part 3"): > http://www.bernispa.com/pil/index.html > > Well done, Kevin. > I haven't done an exhaustive test, but so far every graphic on http://www.bernispa.com/pil/index.html that I've examined gives me a Firefox error: The image ?http://www.bernispa.com/pil/original-img/test01.jpg? cannot be displayed, because it contains errors. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden _______________________________________________ Image-SIG maillist - Image-SIG at python.org http://mail.python.org/mailman/listinfo/image-sig From ced at bernispa.com Tue Apr 18 17:11:45 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Tue, 18 Apr 2006 17:11:45 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <003a01c66260$02b4e5b0$650aa8c0@duallie> References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <003a01c66260$02b4e5b0$650aa8c0@duallie> Message-ID: <444501B1.9000904@bernispa.com> kevin at cazabon.com ha scritto: > I've verified that the patch works with current versions of Photoshop, but > you do raise a good point Fredrik... it should be checked with other > programs too. > > Unfortuantely I don't have any other programs that read/write CMYK JPEG > files... anyone else out there have one we can double-check with? Maybe > Corel Draw or something? I have verified that *all* the images produced by patched PIL and i have posted on the site, shows correctly with the following program (under Win2000 platform): IMdisplay 1.0 (the viewer of ImageMagick 6.2.6) ACDSee Classic 2.43 IrfanView 3.97 Inkscape 0.43 Gimp 2.2.10 Corel Photo Paint 8 Corel Draw 8 I have also tryed to insert the images in a Word 2000 document, and all are correctly showed. I have found only one strangeness with OpenOffice Draw and, in general, with the JPEG graphic filter of OpenOffice, both version 2.0.2 and 1.1.5: they cannot open none of the images but since they can open only "test02" and "test03" of the original images, it seems a weakness of the JPEG filter of OpenOffice. Since i've found a machine with Corel Draw 8, i have updated my site with a sample image (see "part 4") that i think can be useful to make tests (as requested). It contains the foundamental colour of both RGB and CMYK color space, with textual annotation: www.bernispa.com/pil/index.html I've already tested the patch on this image and it is ok. Regards. Cesare. From ced at bernispa.com Tue Apr 18 22:10:17 2006 From: ced at bernispa.com (Cesare Leonardi) Date: Tue, 18 Apr 2006 22:10:17 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <444501B1.9000904@bernispa.com> References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <003a01c66260$02b4e5b0$650aa8c0@duallie> <444501B1.9000904@bernispa.com> Message-ID: <444547A9.70007@bernispa.com> Cesare Leonardi wrote: > kevin at cazabon.com ha scritto: > I have verified that *all* the images produced by patched PIL and i have > posted on the site, shows correctly with the following program (under > Win2000 platform): > > IMdisplay 1.0 (the viewer of ImageMagick 6.2.6) > ACDSee Classic 2.43 > IrfanView 3.97 > Inkscape 0.43 > Gimp 2.2.10 > Corel Photo Paint 8 > Corel Draw 8 At home i have verified that *all* the images generated by PIL in the "part 3" and "part 4" of the site are showed correctly also by the following program (under Debian Linux): Eye of Gnome 2.14.0 gThumb 2.6.9 I have to advise that the images on "part 4" (withpatch and nopatch) have an error: the yellow square (between magenta and black) report it as green: the color is ok, but not the writing. Sorry, i have updated only the original image, forgetting the other two. But the result doesn't change. Tomorrow i'll update the site. Regards. Cesare. From ced at bernispa.com Wed Apr 19 15:24:18 2006 From: ced at bernispa.com (Berni CED) Date: Wed, 19 Apr 2006 15:24:18 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space In-Reply-To: <444547A9.70007@bernispa.com> References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <003a01c66260$02b4e5b0$650aa8c0@duallie> <444501B1.9000904@bernispa.com> <444547A9.70007@bernispa.com> Message-ID: <44463A02.8060302@bernispa.com> Cesare Leonardi ha scritto: > I have to advise that the images on "part 4" (withpatch and nopatch) > have an error: the yellow square (between magenta and black) report it > as green: the color is ok, but not the writing. Sorry, i have updated > only the original image, forgetting the other two. But the result > doesn't change. Corrected. Regards. Cesare. From kevin at cazabon.com Wed Apr 19 16:19:58 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Wed, 19 Apr 2006 16:19:58 +0200 Subject: [Image-SIG] Problem with JPEG and CMYK color space References: <443A217C.1050405@bernispa.com> <443DE12F.5020103@bernispa.com> <003a01c66260$02b4e5b0$650aa8c0@duallie> <444501B1.9000904@bernispa.com><444547A9.70007@bernispa.com> <44463A02.8060302@bernispa.com> Message-ID: <069f01c663bc$5f808ee0$650aa8c0@duallie> Thanks for the detailed work testing, Cesare! It sounds like you've verified the input and output fixes successfully with multiple programs. On a side note, I appreciate the credit on your web page, but "the great Kevin Cazabon" reference is certainly un-justified. :) The patches are only a very minor contribution to a substantially larger effort of many people, most notably Fredrik Lundh. Kevin. ----- Original Message ----- From: "Berni CED" To: Sent: Wednesday, April 19, 2006 3:24 PM Subject: Re: [Image-SIG] Problem with JPEG and CMYK color space > Cesare Leonardi ha scritto: >> I have to advise that the images on "part 4" (withpatch and nopatch) >> have an error: the yellow square (between magenta and black) report it >> as green: the color is ok, but not the writing. Sorry, i have updated >> only the original image, forgetting the other two. But the result >> doesn't change. > > Corrected. > > Regards. > > Cesare. > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From mauro.cherubini at epfl.ch Thu Apr 20 15:59:14 2006 From: mauro.cherubini at epfl.ch (Mauro Cherubini) Date: Thu, 20 Apr 2006 15:59:14 +0200 Subject: [Image-SIG] Compiling PIL on the MacBook Pro Message-ID: <32114901-A944-46ED-9407-15C24AA6CAFE@epfl.ch> Dear All, sorry for posting this, maybe, silly request but my knowledge of gcc (et al) is close to zero. I am trying to compile PIL (Python Imaging Library) on my new machine. I tried at first to use the standard way to call the build process with no luck. Then, looking around I found the latest post of this list where it was possible to specify the compiler to use. So I did but again with no luck. Please see below for the transcripts. I have a clean install of OS X 10.4.6 which runs by default Python 2.3.5, and I am trying to install PIL 1.1.5. Any advice will be greatly appreciated. Thanks a lot in advance Mauro ----------------------------- tsf-wpa-1-217:~/Desktop/python/Imaging-1.1.5 mauro$ python setup.py build running build running build_py running build_ext --- using frameworks at /System/Library/Frameworks building '_imaging' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes - DHAVE_LIBJPEG -DHAVE_LIBZ -IlibImaging -I/System/Library/Frameworks/ Tk.framework/Headers -I/usr/local/include -I/usr/include -I/System/ Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c libImaging/Unpack.c -o build/temp.darwin-8.6.1-i386-2.3/libImaging/ Unpack.o In file included from libImaging/Imaging.h:14, from libImaging/Unpack.c:33: libImaging/ImPlatform.h:10:20: error: Python.h: No such file or directory libImaging/ImPlatform.h:14:2: error: #error Sorry, this library requires support for ANSI prototypes. libImaging/ImPlatform.h:17:2: error: #error Sorry, this library requires ANSI header files. libImaging/ImPlatform.h:55:2: error: #error Cannot find required 32- bit integer type In file included from libImaging/Unpack.c:33: libImaging/Imaging.h:90: error: parse error before 'INT32' libImaging/Imaging.h:90: warning: no semicolon at end of struct or union libImaging/Imaging.h:102: error: parse error before '}' token libImaging/Imaging.h:263: error: parse error before 'INT32' libImaging/Imaging.h:263: warning: no semicolon at end of struct or union libImaging/Imaging.h:263: warning: type defaults to 'int' in declaration of 'pixel' libImaging/Imaging.h:263: warning: data definition has no type or storage class libImaging/Imaging.h:263: warning: type defaults to 'int' in declaration of 'ImagingColorItem' libImaging/Imaging.h:263: warning: data definition has no type or storage class libImaging/Imaging.h:264: error: parse error before '*' token libImaging/Imaging.h:265: warning: type defaults to 'int' in declaration of 'ImagingGetColors' libImaging/Imaging.h:265: warning: data definition has no type or storage class libImaging/Imaging.h:391: error: parse error before 'ImagingCRC32' libImaging/Imaging.h:391: error: parse error before 'crc' libImaging/Imaging.h:391: warning: type defaults to 'int' in declaration of 'ImagingCRC32' libImaging/Imaging.h:391: warning: function declaration isn't a prototype libImaging/Imaging.h:391: warning: data definition has no type or storage class libImaging/Unpack.c: In function 'copy1': libImaging/Unpack.c:667: warning: implicit declaration of function 'memcpy' libImaging/Unpack.c:667: warning: incompatible implicit declaration of built-in function 'memcpy' libImaging/Unpack.c: In function 'copy2': libImaging/Unpack.c:674: warning: incompatible implicit declaration of built-in function 'memcpy' libImaging/Unpack.c: In function 'copy4': libImaging/Unpack.c:681: warning: incompatible implicit declaration of built-in function 'memcpy' libImaging/Unpack.c: In function 'unpackI8': libImaging/Unpack.c:709: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:709: error: (Each undeclared identifier is reported only once libImaging/Unpack.c:709: error: for each function it appears in.) libImaging/Unpack.c:709: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:709: error: parse error before ')' token libImaging/Unpack.c: In function 'unpackI8S': libImaging/Unpack.c:710: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:710: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:710: error: parse error before ')' token libImaging/Unpack.c: In function 'unpackI16': libImaging/Unpack.c:711: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:711: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:711: error: parse error before ')' token libImaging/Unpack.c:711: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI16S': libImaging/Unpack.c:712: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:712: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:712: error: parse error before ')' token libImaging/Unpack.c:712: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI16B': libImaging/Unpack.c:713: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:713: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:713: error: parse error before ')' token libImaging/Unpack.c:713: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI16BS': libImaging/Unpack.c:714: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:714: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:714: error: parse error before ')' token libImaging/Unpack.c:714: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI16N': libImaging/Unpack.c:715: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:715: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:715: error: parse error before ')' token libImaging/Unpack.c:715: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI16NS': libImaging/Unpack.c:716: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:716: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:716: error: parse error before ')' token libImaging/Unpack.c:716: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32': libImaging/Unpack.c:717: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:717: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:717: error: parse error before ')' token libImaging/Unpack.c:717: error: nested functions are not supported on MacOSX libImaging/Unpack.c:717: error: syntax error before 'tmp_' libImaging/Unpack.c:717: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:717: error: parse error before 'INT32' libImaging/Unpack.c:717: warning: value computed is not used libImaging/Unpack.c:717: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32S': libImaging/Unpack.c:718: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:718: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:718: error: parse error before ')' token libImaging/Unpack.c:718: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:718: warning: value computed is not used libImaging/Unpack.c:718: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32B': libImaging/Unpack.c:719: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:719: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:719: error: parse error before ')' token libImaging/Unpack.c:719: error: nested functions are not supported on MacOSX libImaging/Unpack.c:719: error: syntax error before 'tmp_' libImaging/Unpack.c:719: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:719: error: parse error before 'INT32' libImaging/Unpack.c:719: warning: value computed is not used libImaging/Unpack.c:719: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32BS': libImaging/Unpack.c:720: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:720: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:720: error: parse error before ')' token libImaging/Unpack.c:720: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:720: warning: value computed is not used libImaging/Unpack.c:720: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32N': libImaging/Unpack.c:721: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:721: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:721: error: parse error before ')' token libImaging/Unpack.c:721: error: nested functions are not supported on MacOSX libImaging/Unpack.c:721: error: syntax error before 'tmp_' libImaging/Unpack.c:721: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:721: error: parse error before 'INT32' libImaging/Unpack.c:721: warning: value computed is not used libImaging/Unpack.c:721: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackI32NS': libImaging/Unpack.c:722: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:722: error: 'out' undeclared (first use in this function) libImaging/Unpack.c:722: error: parse error before ')' token libImaging/Unpack.c:722: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:722: warning: value computed is not used libImaging/Unpack.c:722: error: parse error before 'tmp_' libImaging/Unpack.c: In function 'unpackF32': libImaging/Unpack.c:732: error: nested functions are not supported on MacOSX libImaging/Unpack.c:732: error: syntax error before 'tmp_' libImaging/Unpack.c:732: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:732: error: parse error before 'INT32' libImaging/Unpack.c:732: warning: value computed is not used libImaging/Unpack.c: In function 'unpackF32S': libImaging/Unpack.c:733: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:733: error: parse error before 'tmp_' libImaging/Unpack.c:733: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:733: warning: value computed is not used libImaging/Unpack.c: In function 'unpackF32B': libImaging/Unpack.c:734: error: nested functions are not supported on MacOSX libImaging/Unpack.c:734: error: syntax error before 'tmp_' libImaging/Unpack.c:734: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:734: error: parse error before 'INT32' libImaging/Unpack.c:734: warning: value computed is not used libImaging/Unpack.c: In function 'unpackF32BS': libImaging/Unpack.c:735: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:735: error: parse error before 'tmp_' libImaging/Unpack.c:735: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:735: warning: value computed is not used libImaging/Unpack.c: In function 'unpackF32N': libImaging/Unpack.c:736: error: nested functions are not supported on MacOSX libImaging/Unpack.c:736: error: syntax error before 'tmp_' libImaging/Unpack.c:736: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:736: error: parse error before 'INT32' libImaging/Unpack.c:736: warning: value computed is not used libImaging/Unpack.c: In function 'unpackF32NS': libImaging/Unpack.c:737: error: 'INT32' undeclared (first use in this function) libImaging/Unpack.c:737: error: parse error before 'tmp_' libImaging/Unpack.c:737: error: 'tmp_' undeclared (first use in this function) libImaging/Unpack.c:737: warning: value computed is not used libImaging/Unpack.c: At top level: libImaging/Unpack.c:1006: error: 'NULL' undeclared here (not in a function) libImaging/Unpack.c: In function 'ImagingFindUnpacker': libImaging/Unpack.c:1017: warning: implicit declaration of function 'strcmp' libImaging/Unpack.c:1026: warning: return from incompatible pointer type error: command 'gcc' failed with exit status 1 tsf-wpa-1-217:~/Desktop/python/Imaging-1.1.5 mauro$ -------------------------- tsf-wpa-1-217:~/Desktop/python/Imaging-1.1.5 mauro$ python setup.py build --compiler=gcc running build running build_py running build_ext error: don't know how to compile C/C++ code on platform 'posix' with 'gcc' compiler _______________ Mauro Cherubini | Research Associate Centre de Recherche et d'Appui pour la Formation et ses Technologies (CRAFT) / Center for Research and Support of Training and its Technologies Ecole Polytechnique F?d?rale de Lausanne (EPFL) / Swiss Federal Institute of Technology Lausanne Address: CE 1.631 (B?timent CE), Station 1, EPFL, CH - 1015 Lausanne, Switzerland T?l?phone: +41 (0)21/693.27.05 -- Fax: +41 (0)21/693.60.70 -- Mobile: +41 (0)78/ 913.50.11 web: http://craft.epfl.ch -- blog: http://www.i-cherubini.it/mauro/blog/ From fredrik at pythonware.com Thu Apr 20 17:36:18 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 20 Apr 2006 17:36:18 +0200 Subject: [Image-SIG] Compiling PIL on the MacBook Pro References: <32114901-A944-46ED-9407-15C24AA6CAFE@epfl.ch> Message-ID: Mauro Cherubini wrote: > sorry for posting this, maybe, silly request but my knowledge of gcc > (et al) is close to zero. > I am trying to compile PIL (Python Imaging Library) on my new machine. > I tried at first to use the standard way to call the build process > with no luck. Then, looking around I found the latest post of this > list where it was possible to specify the compiler to use. So I did > but again with no luck. > Please see below for the transcripts. > I have a clean install of OS X 10.4.6 which runs by default Python > 2.3.5, and I am trying to install PIL 1.1.5. looks like you don't have the Python header files: > libImaging/ImPlatform.h:10:20: error: Python.h: No such file or > directory without them, you cannot build any Python C extensions, no matter what compiler you have: there's no shortage of mac folks on this list, so someone will probably sort this out for you soonish. if not, try asking over at the pythonmac list: http://mail.python.org/mailman/listinfo/pythonmac-sig (or donate a macbook to the effbot.org headquarters, and we'll sort this out for you ;-) From nicolas at famillepinault.fr Thu Apr 20 22:24:34 2006 From: nicolas at famillepinault.fr (Nicolas Pinault) Date: Thu, 20 Apr 2006 22:24:34 +0200 Subject: [Image-SIG] cross-compilation Message-ID: <4447EE02.5030008@famillepinault.fr> Hello, I'd like to cross compile PIL for an arm based linux board. How can I do this ? Nicolas From kilzzz at hotmail.com Thu Apr 20 22:24:34 2006 From: kilzzz at hotmail.com (Kilz _) Date: Thu, 20 Apr 2006 15:24:34 -0500 Subject: [Image-SIG] bug in python imaging 1.15 Message-ID: Hi I foound a bug in python imaging 1.15 and would like to pass the info along The program Comix, a .cbr-.cbz file reader uses python imaging. python-imaging 1.15 causes Comix to crash. I use SuSE and found the bug while testing SuSE 10.1 RC1. Novell sugested reporting the info to python-imaging. Here is a link to the report I filed with them. https://bugzilla.novell.com/show_bug.cgi?id=167513 Traceback (most recent call last): File "/usr/local/bin/comix", line 9635, in ? Comix() File "/usr/local/bin/comix", line 9359, in __init__ self.load_file(path, -2) File "/usr/local/bin/comix", line 7627, in load_file self.load_thumbnails() File "/usr/local/bin/comix", line 7071, in load_thumbnails draw.text((0, 0), str(i+1), fill=(255,255,255), font=None) File "/usr/lib64/python2.4/site-packages/PIL/ImageDraw.py", line 257, in text font = self.getfont() File "/usr/lib64/python2.4/site-packages/PIL/ImageDraw.py", line 130, in getfont self.font = ImageFont.load_default() File "/usr/lib64/python2.4/site-packages/PIL/ImageFont.py", line 337, in load_default ''')), Image.open(StringIO(base64.decodestring(''' File "/usr/lib64/python2.4/site-packages/PIL/ImageFont.py", line 103, in _load_pilfont_data image.load() File "/usr/lib64/python2.4/site-packages/PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "/usr/lib64/python2.4/site-packages/PIL/Image.py", line 328, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder zip not available Hope this helps. Sam _________________________________________________________________ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ From fredrik at pythonware.com Fri Apr 21 01:12:48 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 21 Apr 2006 01:12:48 +0200 Subject: [Image-SIG] bug in python imaging 1.15 References: Message-ID: "Kilz _" wrote: > I foound a bug in python imaging 1.15 and would like to pass the info along > > IOError: decoder zip not available this means that PIL was built without ZIP support (i.e. not linked against zlib). it's not a bug in PIL; it's an incomplete build. com- plain to your vendor. From jwt at onjapan.net Fri Apr 21 06:52:56 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Fri, 21 Apr 2006 13:52:56 +0900 Subject: [Image-SIG] Compiling PIL on the MacBook Pro In-Reply-To: References: <32114901-A944-46ED-9407-15C24AA6CAFE@epfl.ch> Message-ID: <04E710DE-EC2B-4F49-83C3-940822D1FDCC@onjapan.net> >> I have a clean install of OS X 10.4.6 which runs by default Python >> 2.3.5, and I am trying to install PIL 1.1.5. Someone recently reported success on the pythonmac list, but they were using the newer Universal Python 2.4. http://mail.python.org/pipermail/pythonmac-sig/2006-April/017005.html There have been comments that building extensions on the Apple supplied i386 Python is problematic. (Unfortunately, I can't verify this. Send me a MacBook after you send the one to the effbot. :-) -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/ Ringo MUG Tokyo http://www.ringo.net/rss.html From jwt at onjapan.net Fri Apr 21 07:05:22 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Fri, 21 Apr 2006 14:05:22 +0900 Subject: [Image-SIG] Compiling PIL on the MacBook Pro In-Reply-To: <04E710DE-EC2B-4F49-83C3-940822D1FDCC@onjapan.net> References: <32114901-A944-46ED-9407-15C24AA6CAFE@epfl.ch> <04E710DE-EC2B-4F49-83C3-940822D1FDCC@onjapan.net> Message-ID: On Apr 21, 2006, at 13:52, Jim Tittsler wrote: >>> I have a clean install of OS X 10.4.6 which runs by default Python >>> 2.3.5, and I am trying to install PIL 1.1.5. > > Someone recently reported success on the pythonmac list, but they > were using the newer Universal Python 2.4. > http://mail.python.org/pipermail/pythonmac-sig/2006-April/ > 017005.html And there is a prebuilt Universal binary available at: http://pythonmac.org/packages/py24-fat/index.html -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/ Ringo MUG Tokyo http://www.ringo.net/rss.html From mauro.cherubini at epfl.ch Fri Apr 21 11:10:40 2006 From: mauro.cherubini at epfl.ch (Mauro Cherubini) Date: Fri, 21 Apr 2006 11:10:40 +0200 Subject: [Image-SIG] Compiling PIL on the MacBook Pro Message-ID: <119D5DFB-B6AE-4455-AC62-97AB188D54AF@epfl.ch> Thanks all for the answers and the help! I found out that when installing the Xcode developer tools it is important to tick the "Web framework", as otherwise it does not install the Python headers files. Once restored this files in the right place everything worked like a charm! Thanks again. "My Prrrecious" MacBook will stay with me for this time :-) Cheers Mauro _______________ Mauro Cherubini | Research Associate Centre de Recherche et d'Appui pour la Formation et ses Technologies (CRAFT) / Center for Research and Support of Training and its Technologies Ecole Polytechnique F?d?rale de Lausanne (EPFL) / Swiss Federal Institute of Technology Lausanne Address: CE 1.631 (B?timent CE), Station 1, EPFL, CH - 1015 Lausanne, Switzerland web: http://craft.epfl.ch -- blog: http://www.i-cherubini.it/mauro/blog/ From fredrik at pythonware.com Sun Apr 23 08:30:47 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 23 Apr 2006 08:30:47 +0200 Subject: [Image-SIG] cross-compilation References: <4447EE02.5030008@famillepinault.fr> Message-ID: Nicolas Pinault wrote: > I'd like to cross compile PIL for an arm based linux board. > How can I do this ? I'm not sure if distutils supports cross-compilation, but people are porting my distutils-stuff to the oddest platforms, so it's definitely possible. if you cannot get distutils to do this for you, you may have to create your own build files. here's an outline: first, figure out if you want JPEG, PNG, and Freetype support. if you do, you have to build the necessary libraries. see the README file for URLs. the core library consists of two parts; the libImaging support library, and the _imaging Python binding. it's probably easiest to build each part for itself. the libImaging source code is located in the libImaging directory (not very surprising). to build this as a library, edit the ImConfig.h file to suit your configuration, and then build a library out of all files in the directory, minus Except.c and coretest.c. here's the complete list of core files (without extensions): LIBIMAGING = [ "Access", "Antialias", "Bands", "BitDecode", "Blend", "Chops", "Convert", "ConvertYCbCr", "Copy", "Crc32", "Crop", "Dib", "Draw", "Effects", "EpsEncode", "File", "Fill", "Filter", "FliDecode", "Geometry", "GetBBox", "GifDecode", "GifEncode", "HexDecode", "Histo", "JpegDecode", "JpegEncode", "LzwDecode", "Matrix", "ModeFilter", "MspDecode", "Negative", "Offset", "Pack", "PackDecode", "Palette", "Paste", "Quant", "QuantHash", "QuantHeap", "PcdDecode", "PcxDecode", "PcxEncode", "Point", "RankFilter", "RawDecode", "RawEncode", "Storage", "SunRleDecode", "TgaRleDecode", "Unpack", "UnpackYCC", "XbmDecode", "XbmEncode", "ZipDecode", "ZipEncode" ] the coretest.c file contains a simple test program; you can try building that and linking that against the libImaging library and the Except.c file (but I have to admit that haven't tried that in years, so if you stumble upon problems, it may be coretest's fault) anyway, when you've successfully built the library, it's time to build the _imaging binding. the sources for the binding is located in the PIL source directory, and consists of _imaging.c plus the following files: IMAGING = [ "decode", "encode", "map", "display", "outline", "path", ] if you build these, and link the result against libImaging, you should have a working PIL binding. good luck! From fredrik at pythonware.com Mon Apr 24 14:23:28 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 24 Apr 2006 14:23:28 +0200 Subject: [Image-SIG] Python 2.5 binaries? References: <79990c6b0604130625i7679875dsbbc0f8fd60f257c9@mail.gmail.com> Message-ID: Paul Moore wrote: > Does anyone have a binary installer for PIL with Python 2.5 on > Windows? I can try building it myself, but traditionally, I've had a > lot of trouble assembling all of the necessary imaging libraries, so I > thought I'd save myself some time if some kind sould had already done > this. I've added an "official" 1.1.5 build for Python 2.5 to: http://effbot.org/downloads/#PIL (there's an 1.1.6 alpha as well, which was uploaded by mistake. use at your own risk ;-) From ironfroggy at gmail.com Sat Apr 15 00:28:04 2006 From: ironfroggy at gmail.com (Calvin Spealman) Date: Fri, 14 Apr 2006 22:28:04 -0000 Subject: [Image-SIG] Writing a Custom PIL ImageFilter Message-ID: <76fd5acf0604141528h54b1d13fyb3dddaddeada3939@mail.gmail.com> I was looking into PIL ImageFilters, but I am unable to find any substansial information about writing new filters for use with PIL.ImageFilter. At this point, I'm still not sure that it is possible or not, because I haven't found a single shred of information about doing so, or spoken with anyone who knows anything about it. I know there is the Kernel convolution filter, as has been suggested before. But that isn't what I need. I actually need to write the filter entirely and have complete per-pixel control. I would like to prototype the filter in python, but some information on writing an extension to optimize it would be fantastic. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060414/86b33bdf/attachment-0001.html From Sheldon.Johnston at smhi.se Mon Apr 24 15:29:34 2006 From: Sheldon.Johnston at smhi.se (Johnston Sheldon) Date: Mon, 24 Apr 2006 15:29:34 +0200 Subject: [Image-SIG] Reading GRIB files Message-ID: <575A94F91D20704387D1C69A913E95EE03578F@CORRE.ad.smhi.se> Hi, I am interested in reading GRIB files and extracting the fields within. I have the Python2.3 package and I don't think that GRIB is supported. But from what I can understand, the GRIB file will only be indetified by the OIL module and not actually read. Is this true? Thanks for your help, /Sheldon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060424/f4241b5e/attachment-0001.htm From ronan at imovelpro.com.br Tue Apr 25 20:15:09 2006 From: ronan at imovelpro.com.br (Ronan Lucio) Date: Tue, 25 Apr 2006 15:15:09 -0300 Subject: [Image-SIG] Join two images Message-ID: <007a01c66894$315e9b10$0301a8c0@Programacao> Hi All, I?d like to join two images. Actually, I need to put a logomark (145 x 70) in front of an image (640 x 480). The logo should be placed in the left top of the image. Could anybody help me how to do it with PIL? Another question: Is it possible to do it as a watermark? Thank you, Ronan From angelatraficante at gmail.com Thu Apr 27 15:16:23 2006 From: angelatraficante at gmail.com (Angela Traficante) Date: Thu, 27 Apr 2006 09:16:23 -0400 Subject: [Image-SIG] Help Opening an Image File Message-ID: <24c9810c0604270616l5d07256cr6fb09e81e3116568@mail.gmail.com> Quick question: I tried using the Library to open an Image, but the interpretor can't find the image file. I also can't find in the documentation where "import Image" is supposed to get the file from. Does anyone know where I should put the file so that the Library/Interpretor can find it? I'm on a PC, with Windows XP, using Python 2.4.1 and PIL 1.1.5. Thanks, Angela Traficante -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060427/0cdf7b38/attachment-0001.html