From KCAZA@cymbolic.com Mon Jan 3 17:55:20 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Mon, 03 Jan 2000 09:55:20 -0800 Subject: [Image-SIG] Saving portions of an image.... Message-ID: I've got an interesting problem trying to save part of an image without having to 'crop' it... here's the details: -I'm using PIL to create HUGE image files for producing 3-Dimensional 'lenticular' images -In this process, I create a canvas that is larger than the final image (for technical reasons...) -When the image creation is finished, I need to 'trim' off part of the RIGHT side of the image -Because these image files can be over 1.4 GB (yes, GB, not MB), and because PIL uses 4bits per pixel, even for RGB, it's using about 2GB of memory... I don't want to use im = im.crop(()). -I need some way to save only part of the image, basically cropping while saving without using extra memory. im.save("filename", crop=(0,0,10000,10000)) would be perfect... -I've tried changing the .tile attribute, but unless you're cropping from the top and bottom of the image, it won't work (the lines get shifted if you try cropping from the sides). Obviously, I don't want to have to rotate the image either because of memory requirements. Any suggestions? (Fred?) If this is all successfull, I'll be producing a 4' x 8' 3-D image for display at worldwide trade shows (including the largest Photographic trade show in North America, PMA, in Februaray in Las Vegas, and possibly Photokina in Germany next fall). It would really show some of the capabilities of PIL... pushing it to the extreme in file sizes and complexity anyways. Kevin Cazabon. From bill.shui@eBioinformatics.com Thu Jan 6 04:17:56 2000 From: bill.shui@eBioinformatics.com (Bill Shui) Date: Thu, 06 Jan 2000 15:17:56 +1100 Subject: [Image-SIG] transparency on gif images (URGENT) Message-ID: <38741774.14DC67A3@ebioinformatics.com> Hi I've encountered some problems whilst using PIL and trying to produce a gif file with transparency. #### # ## # ## ##### #### the above image is a double box 20x20 pixels in size. I wanted to set the top right and bottom left corner to transparent. in my code I have: im = Image.open("doublebox.gif") im.info['transparency']=im.getpixel((19,0)) the resulting im.info shows 'transparency': 0} then I did im.save("mybox.gif") and when I displayed it in netscape, the transparency did not work. so I opened up image again using: im = Image.open("mybox.gif") >> im.info {'version': 'GIF87a', 'background': 0} and the transparency is gone.... anyone knows how to set transparencies at all?????? need help... URGENT From benoitde@bigfoot.com Thu Jan 6 04:49:01 2000 From: benoitde@bigfoot.com (Denis Benoit) Date: Wed, 5 Jan 2000 23:49:01 -0500 (EST) Subject: [Image-SIG] transparency on gif images (URGENT) In-Reply-To: <38741774.14DC67A3@ebioinformatics.com> Message-ID: Hi, Last week I posted a recipe explaining how I manage to create a GIF with a transparent background. In short, the current version of PIL won't allow you to save a transparent GIF if you don't modify the library yourself. I must say that I'm NOT a PIL developer, so if you modify the source, you're on your own. Denis Benoit On Thu, 6 Jan 2000, Bill Shui wrote: > Hi > I've encountered some problems whilst using PIL and trying to produce a > gif file with transparency. > > #### > # ## > # ## > ##### > #### > > the above image is a double box 20x20 pixels in size. > I wanted to set the top right and bottom left corner to transparent. > > > in my code I have: > > im = Image.open("doublebox.gif") > im.info['transparency']=im.getpixel((19,0)) > > the resulting im.info shows > 'transparency': 0} > > then I did > > im.save("mybox.gif") > > and when I displayed it in netscape, the transparency did not work. > > so I opened up image again using: > im = Image.open("mybox.gif") > >> im.info > {'version': 'GIF87a', 'background': 0} > > and the transparency is gone.... > > anyone knows how to set transparencies at all?????? > > > need help... URGENT > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://www.python.org/mailman/listinfo/image-sig > From kevin_ng@xoommail.com Fri Jan 7 08:24:32 2000 From: kevin_ng@xoommail.com (Kevin Ng) Date: Fri, 7 Jan 2000 00:24:32 -0800 Subject: [Image-SIG] failed to build PIL 1.0 on Python 1.5.2 - RH Linux 6.0 Mandrake Message-ID: <200001070824.AAA13765@www1.xoommail.com> Dear Sir, I was following the build instruction in the PIL 1.0 and got the following error. Python 1.5.2 (#1, Jan 7 2000, 14:13:07) [GCC pgcc-2.91.66 19990314 (egcs-1.1.2 on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import _imaging Traceback (innermost last): File "", line 1, in ? ImportError: /usr/lib/libtk8.0.so: undefined symbol: XFreePixmap Can you help ? I built PIL 1.0 before on the same machine with Python 1.5.1 and it was working perfectly. But after I built 1.5.2 from Source and then try to rebuilt PIL 1.0 with it, the above problem results. Rgds Kevin I use Linux at home. ______________________________________________________ Get your free web-based email at http://www.xoom.com Birthday? Anniversary? Send FREE animated greeting cards for any occasion at http://greetings.xoom.com From doug@speedex.net Thu Jan 13 16:17:32 2000 From: doug@speedex.net (Douglas Shawhan) Date: Thu, 13 Jan 2000 10:17:32 -0600 (CST) Subject: [Image-SIG] Imaging library under OpenBSD 2.6 Message-ID: -----BEGIN PGP SIGNED MESSAGE----- I have successfully compiled and installed python 1.5.2 on my openbsd (i386) box. I am however, having some trouble getting the Imaging library (Imaging-1.0) to successfully build. I have followed the instructions in README and built the Imaging core libraries, but when I reach step 8, all joy leaves my life in the following fashion: - --------------------------------- doug:~/Imaging-1.0# make gcc -fpic -IlibImaging -I/usr/local/include -I/usr/local/include - -DWITH_TKINTER -I/usr/local/include -g -O2 -I/usr/local/include/python1.5 - -I/usr/local/include/python1.5 -DHAVE_CONFIG_H -c ./_imaging.c ./_imaging.c:2303: tk.h: No such file or directory *** Error code 1 Stop in /root/Imaging-1.0. - --------------------------------- tk.h does indeed exist in: /usr/local/include/tk8.0/tk.h Any suggestions? d - ---------------------------------- E-Mail: Douglas Shawhan Date: 13-Jan-00 Time: 10:10:42 This message was sent by XFMail - ---------------------------------- -----BEGIN PGP SIGNATURE----- Version: 2.6.3a Charset: noconv iQCVAwUBOH36nGnVQEIvp/TRAQFK7gP9FPSFlBXexJyCmgY1EvLbATc4l4xSE3Je 07mE3L2O+HHsRL/2r62c6aJD5Qw2WNSApj4XAZVrKva87f00AqUjVW+DUjxnpEeA tm9X2R7u4q8CRwqEq105MLVb2/u2JM1HqHhxfPh2RUtXZDNumg0bYqerK3MiqcB/ RRzjvxMokQI= =Dkhs -----END PGP SIGNATURE----- From fredrik@pythonware.com Thu Jan 13 16:41:37 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 13 Jan 2000 17:41:37 +0100 Subject: [Image-SIG] Imaging library under OpenBSD 2.6 References: Message-ID: <000b01bf5de5$0fc1b430$f29b12c2@secret.pythonware.com> Douglas Shawhan wrote: > I have followed the instructions in README and built the Imaging core > libraries, but when I reach step 8, all joy leaves my life in the = following > fashion: >=20 > - --------------------------------- >=20 > doug:~/Imaging-1.0# make > gcc -fpic -IlibImaging -I/usr/local/include -I/usr/local/include > - -DWITH_TKINTER -I/usr/local/include -g -O2 = -I/usr/local/include/python1.5 > - -I/usr/local/include/python1.5 -DHAVE_CONFIG_H -c ./_imaging.c > ./_imaging.c:2303: tk.h: No such file or directory > *** Error code 1 >=20 > Stop in /root/Imaging-1.0. adding=20 -I/usr/local/include/tk8.0/tk.h to the Setup file should do the trick. you may have to add a similar -L option for the library. From doug@speedex.net Thu Jan 13 18:11:15 2000 From: doug@speedex.net (Douglas Shawhan) Date: Thu, 13 Jan 2000 12:11:15 -0600 (CST) Subject: [Image-SIG] Imaging library under OpenBSD 2.6 In-Reply-To: <000b01bf5de5$0fc1b430$f29b12c2@secret.pythonware.com> Message-ID: Closer and closer..... I make links to the various tcl, tk and Xlib libs that Ye Makefile wanted. All is well until the last line of the make file when the following disaster occours: ------------------start the madness---------------- /python1.5 -DHAVE_CONFIG_H -c ./Tk/tkImaging.c ld -Bshareable _imaging.o decode.o encode.o map.o display.o outline.o path.o tkImaging.o libImaging/libImaging.a -L/usr/local/lib -ljpeg -L/usr/local/lib -lz -L/usr/local/lib -ltcl8.0 -ltk8.0 -o _imaging.so ld: -ltcl8.0: no match *** Error code 1 Stop in /root/Imaging-1. -------------------end the Madness------------------ I have looked through /Tk/tkImaging.c and have found no reference to tcl or tcl8.0/ at all. All appears to be sane in the Setup file. I realise this is a problem with my setup (not to mention sysadmin skills) but I am stonkered as to how directories and libs that are indeed there: /usr/local/lib/tcl8.0 can come up no match. (wipes drool from chin) d > > adding > > -I/usr/local/include/tk8.0/tk.h > > to the Setup file should do the trick. you > may have to add a similar -L option for the > library. > > ---------------------------------- E-Mail: Douglas Shawhan Date: 13-Jan-00 Time: 11:56:53 This message was sent by XFMail ---------------------------------- From perry_stoll@yahoo.com Thu Jan 13 21:07:31 2000 From: perry_stoll@yahoo.com (Perry Stoll) Date: Thu, 13 Jan 2000 13:07:31 -0800 (PST) Subject: [Image-SIG] Imaging library under OpenBSD 2.6 Message-ID: <20000113210731.24849.qmail@web705.mail.yahoo.com> Just guessing, but if /usr/local/lib/tcl8.0 is a directory, try changing: -L/usr/local/lib to -L/usr/local/lib/tcl8.0 -Perry --- Douglas Shawhan wrote: > Closer and closer..... > > I make links to the various tcl, tk and Xlib libs > that Ye Makefile wanted. All > is well until the last line of the make file when > the following disaster > occours: > > ------------------start the madness---------------- > > /python1.5 -DHAVE_CONFIG_H -c ./Tk/tkImaging.c > ld -Bshareable _imaging.o decode.o encode.o map.o > display.o outline.o path.o > tkImaging.o libImaging/libImaging.a > -L/usr/local/lib -ljpeg -L/usr/local/lib > -lz -L/usr/local/lib -ltcl8.0 -ltk8.0 -o _imaging.so > ld: -ltcl8.0: no match > *** Error code 1 > > Stop in /root/Imaging-1. > > -------------------end the Madness------------------ > > I have looked through /Tk/tkImaging.c and have found > no reference to tcl or > tcl8.0/ at all. All appears to be sane in the Setup > file. > > I realise this is a problem with my setup (not to > mention sysadmin skills) but > I am stonkered as to how directories and libs that > are indeed there: > > /usr/local/lib/tcl8.0 > > can come up no match. > > (wipes drool from chin) > > d > > > > > > > > adding > > > > -I/usr/local/include/tk8.0/tk.h > > > > to the Setup file should do the trick. you > > may have to add a similar -L option for the > > library. > > > > > > ---------------------------------- > E-Mail: Douglas Shawhan > Date: 13-Jan-00 > Time: 11:56:53 > > This message was sent by XFMail > ---------------------------------- > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://www.python.org/mailman/listinfo/image-sig > __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From eddemain@daisy.uwaterloo.ca Wed Jan 19 23:03:12 2000 From: eddemain@daisy.uwaterloo.ca (Erik Demaine) Date: Wed, 19 Jan 2000 18:03:12 -0500 (EST) Subject: [Image-SIG] Line width in PIL? Message-ID: Are there any plans to add line thickness to PIL image drawing? (Let me know if it's there already and I'm just blind.) Ideally, with antialiasing? Currently I've had to resort to ImageMagick, which does nice thick lines with (optional) antialiasing. I would prefer to use PIL because it is *much* faster. An independent question: Is there a working version of PythonMagick anywhere? (I'm currently using the command-line interface, which slows it down a little but not too much.) Erik -- Erik Demaine \) e-mail: eddemain@daisy.uwaterloo.ca (PGP avail.) Dept. of Computer Science \( URL: http://daisy.uwaterloo.ca/~eddemain/ University of Waterloo )\ "Any solution to a problem changes the problem." Waterloo, ON Canada N2L 3G1 (\ -R. W. Johnson From ivanlan@callware.com Thu Jan 20 18:56:30 2000 From: ivanlan@callware.com (Ivan Van Laningham) Date: Thu, 20 Jan 2000 11:56:30 -0700 Subject: [Image-SIG] Retrieving comments from GIF files Message-ID: <38875A5E.C2E70F30@callware.com> Hi All-- I didn't spot any way to retrieve comments from GIF files in the code for PIL. Am I missing something? Are there plans to add a way to do this in the future? This would be particularly helpful, as the image strips for Muhammed Muquit's wwwcount program require extracting information from the GIF comments in order to use the individual pictures correctly. Thanks, Ivan ---------------------------------------------- Ivan Van Laningham Callware Technologies, Inc. ivanlan@callware.com ivanlan@home.com http://www.pauahtun.org See also: http://www.foretec.com/python/workshops/1998-11/proceedings.html Army Signal Corps: Cu Chi, Class of '70 Author: Teach Yourself Python in 24 Hours ---------------------------------------------- From herzog@online.de Thu Jan 20 18:39:14 2000 From: herzog@online.de (Bernhard Herzog) Date: 20 Jan 2000 19:39:14 +0100 Subject: [Image-SIG] Line width in PIL? In-Reply-To: Erik Demaine's message of "Wed, 19 Jan 2000 18:03:12 -0500 (EST)" References: Message-ID: Erik Demaine writes: > Are there any plans to add line thickness to PIL image drawing? > (Let me know if it's there already and I'm just blind.) > Ideally, with antialiasing? FWIW, the development versions of Sketch have Python-bindings for libart (the antialiased rendering engine used by the GNOME canvas), and they can render into PIL images. The code is quite Sketch specific in some areas, though, and it may be a bit of work to turn it into something more general. -- Bernhard Herzog | Sketch, a drawing program for Unix herzog@online.de | http://sketch.sourceforge.net/ From marcel@shadow.sk Wed Jan 26 11:21:26 2000 From: marcel@shadow.sk (=?iso-8859-2?B?TWFyY2VsIE1var5puQ==?=) Date: Wed, 26 Jan 2000 12:21:26 +0100 Subject: [Image-SIG] wmf support Message-ID: <000f01bf67ef$7bfbafc0$028891c2@shadow.sk> Hi, I've got few questions about the support of wmf files. I'd like to make a simple wmf->eps convertor. I tired something like this: > import Image > i = Image.open("a.wmf").resize((128, 128)) > i.save("a", "EPS") however it didn't work because of "attribute error: rawmode" exception... what should i do to get rid of this error? or is it possible to make a wmf->eps convertor using PIL ? or is there any working wmf->eps convertor for linux? thanks in advance marcel marcel@shadow.sk From herzog@online.de Wed Jan 26 19:23:54 2000 From: herzog@online.de (Bernhard Herzog) Date: 26 Jan 2000 20:23:54 +0100 Subject: [Image-SIG] wmf support References: <000f01bf67ef$7bfbafc0$028891c2@shadow.sk> Message-ID: =?iso-8859-2?B?TWFyY2VsIE1var5puQ==?= writes: > Hi, > I've got few questions about the support of wmf files. I'd like to make a > simple wmf->eps convertor. I tired something like this: > > import Image > > i = Image.open("a.wmf").resize((128, 128)) > > i.save("a", "EPS") > > however it didn't work because of "attribute error: rawmode" exception... > what should i do to get rid of this error? or is it possible to make a > wmf->eps convertor using PIL ? or is there any working wmf->eps convertor > for linux? Well, wmf is more a vector format than a raster format, so PIL not exactly the best tool to use here. My drawing program Sketch has an import filter for wmf, although it's incomplete. Sketch can, of course, export as EPS and even has a commandline utility for this. See my .sig for a URL. You might also want to have a look at libwmf: http://www.csn.ul.ie/~caolan/docs/libwmf.html -- Bernhard Herzog | Sketch, a drawing program for Unix herzog@online.de | http://sketch.sourceforge.net/ From jhinsley@telinco.co.uk Thu Jan 27 13:38:58 2000 From: jhinsley@telinco.co.uk (John Hinsley) Date: Thu, 27 Jan 2000 13:38:58 +0000 Subject: [Image-SIG] A right mess I've made! Message-ID: <38904A72.B01EE087@telinco.co.uk> Hi Here's my tale of woe. I downloaded Sketch 6.4 as an .rpm and the python imaging 1.0b1-1.rpm and used them with the python bits & pieces in the SuSE 6.1 distribution. I could save as .ps but I could'nt open any postscript files, even those I'd made in Sketch! It looked as though Sketch was trying to open them, a sort of white ghost square appeared, but it failed. I vaguely remembered that an earlier version did this because of a problem with the Python imaging library, and that there was a patch available. Does this mean that the rpm was built without the patches for the imaging libraries? Is there a "correct" rpm out there somewhere? But here's the BIG, BIG, problem. Attempts to build sketch using a mixture of source and rpms failed dismally. In particular I made a right pigs ear of installing the python imaging library. On step 8, the read me says: "8. To build a dynamically loaded module, just type "make": $ make This will create a file called "_imaging.so". Then type (assuming a standard shell): $ PYTHONPATH=.:./PIL ; export PYTHONPATH $ python >>> import _imaging >>> import Image If both imports works, you've successfully added PIL to your Python environment." Well, for me one of the imports didn't work. At this point I got fed up and decided that I could live with a sketch which wouldn't import postscript files (after all, I could still open them in Gimp) and proceeded to remove all traces of python from my system, along with sketch and to reinstall back to the point where sketch worked without postscript import. (After all, a gtk version will be along shortly!) Now, when I call sketch I get: Traceback (innermost last): File "/usr/bin/sketch", line 35, in ? import Sketch File "/usr/lib/sketch-0.6.4/Sketch/__init__.py", line 108, in ? from Graphics.document import EditDocument, SelectionMode, EditMode File "/usr/lib/sketch-0.6.4/Sketch/Graphics/document.py", line 67, in ? from text import CanCreatePathText, CreatePathText File "/usr/lib/sketch-0.6.4/Sketch/Graphics/text.py", line 97, in ? import graphics, font File "/usr/lib/sketch-0.6.4/Sketch/Graphics/graphics.py", line 32, in ? import Image ImportError: No module named Image As though bash is still trying to do all the import stuff. How do I get rid of this? Any help, counselling, etc. gratefully received. -- ############################################################## Traduttore di madre lingua inglese disponibile per progetti di ogni tipo. Prezzi unici! ############################################################## From herzog@online.de Thu Jan 27 18:51:21 2000 From: herzog@online.de (Bernhard Herzog) Date: 27 Jan 2000 19:51:21 +0100 Subject: [Image-SIG] A right mess I've made! In-Reply-To: John Hinsley's message of "Thu, 27 Jan 2000 13:38:58 +0000" References: <38904A72.B01EE087@telinco.co.uk> Message-ID: John Hinsley writes: Hi > Here's my tale of woe. > > I downloaded Sketch 6.4 as an .rpm and the python imaging 1.0b1-1.rpm > and used them with the python bits & pieces in the SuSE 6.1 > distribution. I could save as .ps but I could'nt open any postscript > files, even those I'd made in Sketch! It looked as though Sketch was > trying to open them, a sort of white ghost square appeared, but it > failed. What did you do exactly? EPS files, even those generated by Sketch, should be embedded with Edit->Create->Load Image... or the equivalent button in the toolbar, the rightmost one, just like a raster image. Sketch treats embedded EPS files pretty much like embedded raster images, except for printing of course. ghostscript is currently required to render a preview image, though. File->Open or File->Insert Document work only when the EPS is an Adobe Illustrator file or sufficiently similar to one. If you want to import an EPS file so that you can edit its contents, you might want to try pstoedit. I should probably make this a little clearer in the UI by removing .ps and .eps from the list of extensions of the AI-import filter. > I vaguely remembered that an earlier version did this because of a > problem with the Python imaging library, and that there was a patch > available. Does this mean that the rpm was built without the patches > for the imaging libraries? Is there a "correct" rpm out there > somewhere? The rpm should work. There's no PIL patch required. > Attempts to build sketch using a mixture of source and rpms failed > dismally. In particular I made a right pigs ear of installing the > python imaging library. On step 8, the read me says: > > "8. To build a dynamically loaded module, just type "make": > > $ make > > This will create a file called "_imaging.so". > > Then type (assuming a standard shell): > > $ PYTHONPATH=.:./PIL ; export PYTHONPATH > $ python > > >>> import _imaging > >>> import Image > > If both imports works, you've successfully added PIL to your Python > environment." > > Well, for me one of the imports didn't work. "didn't work" is a pretty vague description. With the precise error messages we might be able to help you. [...] > (After all, a gtk version will be along shortly!) "shortly" may be a bit optimistic at the moment... > Now, when I call sketch I get: > > Traceback (innermost last): [...] > File "/usr/lib/sketch-0.6.4/Sketch/Graphics/graphics.py", line 32, in > ? > import Image > ImportError: No module named Image copy the PIL.pth file from the PIL distribution to /usr/lib/python1.5/site-packages or whereever you put you PIL/ subdirectory as described in step 9 of the PIL installation instructions. -- Bernhard Herzog | Sketch, a drawing program for Unix herzog@online.de | http://sketch.sourceforge.net/ From Rosshop@aol.com Mon Jan 31 19:56:21 2000 From: Rosshop@aol.com (Rosshop@aol.com) Date: Mon, 31 Jan 2000 14:56:21 EST Subject: [Image-SIG] Python Imaging Message-ID: <86.81e075.25c742e5@aol.com> I downloaded python imaging and i don't understand how to get an image embeded into python to use. Can you help me out??? Ross