From AMARSVASTAVA@Inf.COM Thu Dec 5 21:20:15 1996 From: AMARSVASTAVA@Inf.COM (AMARSVASTAVA) Date: Thu, 5 Dec 1996 16:20:15 -0500 Subject: [PYTHON IMAGE-SIG] querry Message-ID: <2A6CB690.@smtp_gw.inf.com> Dear Sir, Thru' Netsurfing came across your site. I am interested in knowing more about "Python Imaging library'. The compatibiltiy of Python Imaging library with Windows 95(32 bit) is main consideration.I need Imaging library for decoding graphical images that I want to display on CCRT. Send me the details and working conditions of the Library as soon as possible. Thanks, Sincerely Yours Amar Srivastava. amarsvastava@inf.com ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Sun Dec 8 16:06:36 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Sun, 8 Dec 1996 17:06:36 +0100 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, release 0.2b2 Message-ID: <9612081606.AA16610@arnold.image.ivab.se> Kamrater! I've just uploaded release 0.2b2 of the Python Imaging Library 0.2b2 to www.python.org. For more information, see: http://www.python.org/sigs/image-sig/Imaging.html Documentation and a binary distribution for Windows will be made available soon. Regards /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From ivantk@hotmail.com Sun Dec 8 22:12:45 1996 From: ivantk@hotmail.com (ivan tkatchev) Date: 8 Dec 1996 22:12:45 -0000 Subject: [PYTHON IMAGE-SIG] Another PIL bug. Message-ID: <19961208221245.21088.qmail@hotmail.com> I have just gotten PIL 0.2b2 and already there is a major bug. I can't compile the "libImaging" part of the distribution -- i.e. the part that doesn't actually require Python. I have just upgraded to libjpeg 6.0, using the redhat RPM's, and now I get these errors: gcc -O -I./. -I/usr/include -DHAVE_CONFIG_H -c JpegDecode.c -o JpegDecode.o JpegDecode.c:33: syntax error before `void' JpegDecode.c:39: syntax error before `boolean' JpegDecode.c:46: syntax error before `void' JpegDecode.c:66: syntax error before `void' JpegDecode.c:87: syntax error before `void' make: *** [JpegDecode.o] Error 1 It seems like 'METHODDEF' in JpegDecode.c is causing the trouble. Please, help me if you have any ideas. I am running Linux 2.0, i586, GCC 2.7.0. I have Python 1.4. --------------------------------------------------------- Get Your *Web-Based* Free Email at http://www.hotmail.com --------------------------------------------------------- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From MHammond@skippinet.com.au Mon Dec 9 09:41:22 1996 From: MHammond@skippinet.com.au (Mark Hammond) Date: Mon, 9 Dec 1996 19:41:22 +1000 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, r Message-ID: <199612090841.TAA26824@minotaur.labyrinth.net.au> > I've just uploaded release 0.2b2 of the Python Imaging Library 0.2b2 > to www.python.org. For more information, see: Arg - so much fun things, so little time. Ive got some big ideas for this on Windows. I think an imaging OCX would be a good test-harness for general OCX support :-) Depending on the size etc, I may like to include the binaries with the Pythonwin distribution - Numeric already is - any comments on this? Mark. ---------------------------------------------------------------------- Mark Hammond - MHammond@skippinet.com.au Check out Python - _the_ language for the Web/CGI/Windows/MFC/Unix/etc & ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 08:46:57 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 09:46:57 +0100 Subject: [PYTHON IMAGE-SIG] Another PIL bug. In-Reply-To: <19961208221245.21088.qmail@hotmail.com> (ivantk@hotmail.com) Message-ID: <9612090846.AA28893@arnold.image.ivab.se> > I have just upgraded to libjpeg 6.0, using the redhat RPM's, > and now I get these errors: You're obviously using libjpeg 6.0a, not the 6.0 version provided at the PIL distribution site. From the libjpeg change log: "All routine declarations changed to the style "GLOBAL(type) name ...", that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the routine's return type as an argument. This makes it possible to add Microsoft-style linkage keywords to all the routines by changing just these macros. Note that any application code that was using these macros will have to be changed." The following patches might help (thanks to Jan Danielsson). /F --- JpegDecode.c.~1~ Thu Aug 15 15:12:57 1996 +++ JpegDecode.c Tue Oct 29 21:11:36 1996 @@ -33,3 +33,3 @@ -METHODDEF void +METHODDEF(void) stub(j_decompress_ptr cinfo) @@ -39,3 +39,3 @@ -METHODDEF boolean +METHODDEF(boolean) fill_input_buffer(j_decompress_ptr cinfo) @@ -46,3 +46,3 @@ -METHODDEF void +METHODDEF(void) skip_input_data(j_decompress_ptr cinfo, long num_bytes) @@ -66,3 +66,3 @@ -GLOBAL void +GLOBAL(void) jpeg_buffer_src(j_decompress_ptr cinfo, JPEGSOURCE* source) @@ -87,3 +87,3 @@ -METHODDEF void +METHODDEF(void) error(j_common_ptr cinfo) --- JpegEncode.c.~1~ Thu Aug 15 15:12:58 1996 +++ JpegEncode.c Tue Oct 29 21:12:21 1996 @@ -31,3 +31,3 @@ -METHODDEF void +METHODDEF(void) stub(j_compress_ptr cinfo) @@ -37,3 +37,3 @@ -METHODDEF boolean +METHODDEF(boolean) empty_output_buffer (j_compress_ptr cinfo) @@ -44,3 +44,3 @@ -GLOBAL void +GLOBAL(void) jpeg_buffer_dest(j_compress_ptr cinfo, JPEGDESTINATION* destination) @@ -59,3 +59,3 @@ -METHODDEF void +METHODDEF(void) error(j_common_ptr cinfo) ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 08:52:36 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 09:52:36 +0100 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, r In-Reply-To: <199612090841.TAA26824@minotaur.labyrinth.net.au> (MHammond@skippinet.com.au) Message-ID: <9612090852.AA22653@arnold.image.ivab.se> > Depending on the size etc, I may like to include the binaries with > the Pythonwin distribution - Numeric already is - any comments on > this? Do extensions built for Guido's standard 1.4 release work properly with PythonWin? If so, you can simply bundle the relevant parts of my standard Windows distribution with PythonWin (available from the usual place). As for sizes, PIL takes about 100k (including JPEG) for the binary extension, and another 100k for the library files. /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From steve@estel.uindy.edu Mon Dec 9 11:59:22 1996 From: steve@estel.uindy.edu (Steve Spicklemire) Date: Mon, 9 Dec 96 06:59:22 -0500 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, r In-Reply-To: <199612090841.TAA26824@minotaur.labyrinth.net.au> (MHammond@skippinet.com.au) Message-ID: <9612091159.AA09794@estel.uindy.edu> Hi Mark, I noticed that the Numeric stuff in pythonwin-1.4b? that I got most recently was from the 1.0a4? release of NumPy and used 'ni', but the most recent NumPy release doesn't use ni. I don't know what Fredrik is doing wrt 'ni' but I'll be happy when it all gets sorted out! thanks! -steve >>>>> "Mark" == Mark Hammond writes: >> I've just uploaded release 0.2b2 of the Python Imaging Library >> 0.2b2 to www.python.org. For more information, see: Mark> Arg - so much fun things, so little time. Mark> Ive got some big ideas for this on Windows. I think an Mark> imaging OCX would be a good test-harness for general OCX Mark> support :-) Mark> Depending on the size etc, I may like to include the Mark> binaries with the Pythonwin distribution - Numeric already Mark> is - any comments on this? Mark> Mark. Mark> ---------------------------------------------------------------------- Mark> Mark Hammond - MHammond@skippinet.com.au Check out Python - Mark> _the_ language for the Web/CGI/Windows/MFC/Unix/etc Mark> & Mark> Mark> ================= IMAGE-SIG - SIG on Image Processing with Mark> Python Mark> send messages to: image-sig@python.org administrivia to: Mark> image-sig-request@python.org ================= ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From jody@sccsi.com Mon Dec 9 11:58:30 1996 From: jody@sccsi.com (Jody Winston) Date: Mon, 9 Dec 1996 05:58:30 -0600 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library Message-ID: <199612091158.FAA17591@friday.sccsi.com> > I've just uploaded release 0.2b2 of the Python Imaging Library 0.2b2 > to www.python.org. For more information, see: tkImaging.c is missing in this distribution. ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 12:31:32 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 13:31:32 +0100 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library In-Reply-To: <199612091158.FAA17591@friday.sccsi.com> (message from Jody Winston on Mon, 9 Dec 1996 05:58:30 -0600) Message-ID: <9612091231.AA13790@arnold.image.ivab.se> > tkImaging.c is missing in this distribution. Might be that it isn't located where it's supposed to be: $ zcat Imaging-0.2b2.tar.gz | tar tvf - | grep tkIm* blocksize = 128 -r--r--r-- 127/127 3258 Dec 8 16:32:23 1996 Imaging/tkImaging.c Regards /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From jody@sccsi.com Mon Dec 9 13:22:27 1996 From: jody@sccsi.com (Jody Winston) Date: Mon, 9 Dec 1996 07:22:27 -0600 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library In-Reply-To: <9612091231.AA13790@arnold.image.ivab.se> (message from Fredrik Lundh on Mon, 9 Dec 1996 13:31:32 +0100) Message-ID: <199612091322.HAA18804@friday.sccsi.com> Thanks ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 13:57:43 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 14:57:43 +0100 Subject: [PYTHON IMAGE-SIG] PIL 0.2b2: Broken Makefile for Visual C++ Message-ID: <9612091357.AA16765@arnold.image.ivab.se> The Visual C++ project file (_imaging.mak) provided with the original release of 0.2b2 doesn't work properly from within the Developer's Studio. This has now been fixed, and a new distribution kit has just been uploaded to the usual place. The correct size of the project file is 36,314 bytes. /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 13:57:43 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 14:57:43 +0100 Subject: [PYTHON IMAGE-SIG] PIL 0.2b2: Broken Makefile for Visual C++ Message-ID: <9612091357.AA16765@arnold.image.ivab.se> The Visual C++ project file (_imaging.mak) provided with the original release of 0.2b2 doesn't work properly from within the Developer's Studio. This has now been fixed, and a new distribution kit has just been uploaded to the usual place. The correct size of the project file is 36,314 bytes. /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 9 14:09:16 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 9 Dec 1996 15:09:16 +0100 Subject: [PYTHON IMAGE-SIG] PIL 0.2b2: problems with the sample scripts Message-ID: <9612091409.AA28891@arnold.image.ivab.se> The sample scripts (provided in the Scripts subdirectory) make some bold assumptions on what kind of images you'll run them with. The following info might help you avoid incomprehensible error messages: script comments -------------------------------------------------------------------- viewer.py display an image; should work on any image mode. note the improved Tkinter interface, and also the special treatment of 1-bit images. enhancer.py illustrates the ImageEnhance module; use on a truecolour (RGB) image for best effect. thresholder.py illustrates a dynamically updated 1-bit overlay; only works properly on greyscale images. painter.py illustrates selective update of a image canvas; use on a truecolour (RGB) image for best effect; may crash if you move the brush outside the image (due to "undefined behaviour" in the "crop" method) And yes, they all require that you have compiled Tk with the PIL interface (tkImaging.c). Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From MHammond@skippinet.com.au Tue Dec 10 05:44:05 1996 From: MHammond@skippinet.com.au (Mark Hammond) Date: Tue, 10 Dec 1996 15:44:05 +1000 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Librar Message-ID: <199612100443.PAA17400@minotaur.labyrinth.net.au> Thanks for the info... FWIW - Im thinking of putting together a "really simple installer" for Python extension binaries. This would mean I could move PIL/Numeric/COM out of the core, but still make it very very simple to install. Assuming it takes someone 1 hour extra to package a binary (my experience - testing, tweaking, etc), is this worth it (ie, would people take the time) Mark. ---------------------------------------------------------------------- Mark Hammond - MHammond@skippinet.com.au Check out Python - _the_ language for the Web/CGI/Windows/MFC/Unix/etc & ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From bbum@friday.com Tue Dec 10 05:37:45 1996 From: bbum@friday.com (Bill Bumgarner) Date: Tue, 10 Dec 1996 00:37:45 -0500 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Librar References: <199612100443.PAA17400@minotaur.labyrinth.net.au> Message-ID: <32ACF729.59C4@friday.com> Yes, YES, and finally YES!!! I have been working with the Makefile.pre.in that is included in 1.4 as Misc/Makefile.pre.in. This makefile allows one to very easily build module projects completely externally to the python source tree or installed python resource libraries. It takes full advantage of the platform-centric installation information that is found within a full-blown python installation. The only thing it lacks is a 'make install' and 'make installdebug' target! [And, 'make package' would be nice]. b.bum BTW: For those interested, the python objective-C project uses the Makefile.pre.in to do external builds; see ftp://ftp.thoughtport.net/pub/next/lang (i think) for the source. Mark Hammond wrote: > > Thanks for the info... > > FWIW - Im thinking of putting together a "really simple installer" > for Python extension binaries. This would mean I could move > PIL/Numeric/COM out of the core, but still make it very very simple > to install. > > Assuming it takes someone 1 hour extra to package a binary (my > experience - testing, tweaking, etc), is this worth it (ie, would > people take the time) > > Mark. > ---------------------------------------------------------------------- > Mark Hammond - MHammond@skippinet.com.au > Check out Python - _the_ language for the Web/CGI/Windows/MFC/Unix/etc > & > > ================= > IMAGE-SIG - SIG on Image Processing with Python > > send messages to: image-sig@python.org > administrivia to: image-sig-request@python.org > ================= ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From ivantk@hotmail.com Mon Dec 16 22:24:10 1996 From: ivantk@hotmail.com (Ivan Tkatchev) Date: 16 Dec 1996 22:24:10 -0000 Subject: [PYTHON IMAGE-SIG] PIL questions and coments. Message-ID: <19961216222410.7133.qmail@hotmail.com> I just got the handbook postscript file, but for some reason ghostview complains about insufficient memory. The result is that I can neither view nor print the handbook. (I have 32 megabytes of memory, so I don't think there is any real problems with memory.) I can't decide whether this is a local problem or whether something's worng with the handbook file. If you have any insights, please help. Also, I just compiled PIL 0.2b2 for tkinter support, but the instructions given don't match what I did to compile. Since PIL+tkinter work on my computer, I presume that there's some mistake in the docs. --------------------------------------------------------- Get Your *Web-Based* Free Email at http://www.hotmail.com --------------------------------------------------------- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From arb@connect.com.au Tue Dec 17 07:42:34 1996 From: arb@connect.com.au (Anthony Baxter) Date: Tue, 17 Dec 1996 18:42:34 +1100 Subject: [PYTHON IMAGE-SIG] PIL and palettes and drawing. Message-ID: <199612170742.SAA03804@jambu.off.connect.com.au> Does anyone have any nice examples of how to do drawing using PIL and palettes? How do I initialise a colour palette? In particular, I'm trying to use ImageDraw, with a new image object, and I need to know how to drive the constructor &c for the palette. im=Image.new("P",(400,400)) im.palette=ImagePalette.ImagePalette("RGB") when I try to do stuff with this image, I get told 'no palette' or similar. now I want to set colour 0 to #000000, colour 1 to #ff0000, &c. What's the magic required? (On a possibly related note - when I load an existing GIF file, I find it's palette is of type 'tuple', not of type 'ImagePalette'. I wonder if this is what I should be doing?) ta, Anthony ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 17 09:49:52 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 17 Dec 1996 10:49:52 +0100 Subject: [PYTHON IMAGE-SIG] PIL and palettes and drawing. In-Reply-To: <199612170742.SAA03804@jambu.off.connect.com.au> (message from Anthony Baxter on Tue, 17 Dec 1996 18:42:34 +1100) Message-ID: <9612170949.AA06274@arnold.image.ivab.se> > How do I initialise a colour palette? In particular, I'm trying to use > ImageDraw, with a new image object, and I need to know how to drive the > constructor &c for the palette. > > im=Image.new("P",(400,400)) > im.palette=ImagePalette.ImagePalette("RGB") Hmm. You've stumbled upon something that have been on my TODO list a long time... The ImagePalette module doesn't work as it should, so it really takes some magic to do what you need: image = Image.new("P",(400,400)) # create a list to hold the palette palette = [(0,0,0)] * 256 # set an entry palette[1] = (255, 0, 0) palette[255] = (255, 255, 255) # convert the list to a string palette = map(lambda a: chr(a[0])+chr(a[1])+chr(a[2]), palette) palette = string.join(palette, "") # attach it to the image image.im.putpalette("RGB", palette) Note that its "image.im", not just "image". See WmfImagePlugin.py for some variations of this theme. (And yes, now that ImageDraw is getting quite useful, I'd better fix the palette module). Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 17 09:57:29 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 17 Dec 1996 10:57:29 +0100 Subject: [PYTHON IMAGE-SIG] PIL questions and coments. In-Reply-To: <19961216222410.7133.qmail@hotmail.com> (ivantk@hotmail.com) Message-ID: <9612170957.AA11714@arnold.image.ivab.se> > I just got the handbook postscript file, but for some reason > ghostview complains about insufficient memory. The result is that I > can neither view nor print the handbook. (I have 32 megabytes of > memory, so I don't think there is any real problems with memory.) Displays fine on my machine, with Ghostscript 3.6x something. There was a thread on the main list about similar problems with the Reference manual; those problems went away with more recent versions of Ghostscript. Could be idea to check the c.l.py archive for pointers on where to find that. As soon as I find the time (and PIL 0.2 comes closer to a final release), I'll generate PDF and (hopefully) HTML versions of the handbook. > Also, I just compiled PIL 0.2b2 for tkinter support, but > the instructions given don't match what I did to compile. > Since PIL+tkinter work on my computer, I presume that there's some > mistake in the docs. So what did you do? /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From Anthony Baxter Tue Dec 17 10:11:59 1996 From: Anthony Baxter (Anthony Baxter) Date: Tue, 17 Dec 1996 21:11:59 +1100 Subject: [PYTHON IMAGE-SIG] PIL and palettes and drawing. In-Reply-To: Your message of "Tue, 17 Dec 1996 10:49:52 BST." <9612170949.AA06274@arnold.image.ivab.se> Message-ID: <199612171012.VAA04132@jambu.off.connect.com.au> This is a multipart MIME message. --===_0_Tue_Dec_17_21:06:55_EST_1996 Content-Type: text/plain; charset=us-ascii >>> Fredrik Lundh wrote > The ImagePalette module doesn't work as it should, so it really takes > some magic to do what you need: Ok, I've played with this some more (motivated in this case by a desire to avoid writing a whitepaper which really is due all-to-soon :) and I've come up with a new ImagePalette class, which Does What I Want. It's attached at the end. Please let me know what you think. sample usage: im=Image.new("P",(400,400)) pal=ImagePalette.ImagePalette() pal[0] = (0,0,0) pal[1] = (255,0,0) pal[2] = "#FF00E0" # alternative use pal[3] = (100,255,100) pal[4] = (0,0,255) print pal[0],pal[1],pal[2],pal[3],pal[4] # this is the bit I'm not _entirely_ happy with, syntax-wise. pal.attach(im) # or just pal(im) draw=ImageDraw.ImageDraw(im) draw.setink(0) draw.rectangle((0,0,400,400) draw.setink(1) draw.rectangle((10,10,40,40) Anthony. (btw, any ideas which is a good format to be writing type P images to? at the moment I'm converting them to RGB, then writing them as ppm. I can't have the lossiness of jpg, and the tiff writer doesnt write the colourmap) --===_0_Tue_Dec_17_21:06:55_EST_1996 Content-Type: text/plain; charset=us-ascii Content-Description: ImagePalette.py Content-Transfer-Encoding: quoted-printable # # The Python Imaging Library. # $Id: ImagePalette.py,v 1.4 1996/11/10 17:52:14 fredrik Exp $ # # image palette object # # History: # 96-03-11 fl Rewritten. # 1996-12-16 arb Rewritten again, to be useful. :) # # Copyright (c) Fredrik Lundh 1996. All rights reserved. # import array import Image class ImagePalette: def __init__(self,mode=3D"RGB",palette=3DNone): self.mode=3Dmode if not palette: self.palette=3Dlist(range(256)*len(self.mode)) else: if type(palette) =3D=3D type(""): self.palette=3Dmap(ord,palette) else: self.palette=3Dpalette if len(self.mode)*256 !=3D len(self.palette): raise ValueError, "wrong palette size" = def tostring(self): return array.array("b", self.palette).tostring() # handle either a tuple of (r,g,b) or "#RRGGBB" where RR,GG,BB are he= x # numbers in range 00-FF. def set(self,num,col): print num,col,type(num),type(col) if type(col) is type(()): r,g,b=3Dcol self.palette[0+(num*3)] =3D r self.palette[1+(num*3)] =3D g self.palette[2+(num*3)] =3D b return None if type(col) is type(''): if col[0] =3D=3D '#' and len(col) =3D=3D 7: import string self.palette[0+(num*3)] =3D string.atoi(col[1:3],16) self.palette[1+(num*3)] =3D string.atoi(col[3:5],16) self.palette[2+(num*3)] =3D string.atoi(col[5:7],16) return None # handle UNIX rgb.txt? raise ValueError,"not a valid colour setting" def attach(self,image): import string if hasattr(image,'im') and hasattr(image,'mode') and image.mode =3D=3D '= P': p=3Dmap(chr,self.palette) image.im.putpalette(self.mode,string.join(p,'')) def __setitem__(self,name,val): if type(name) =3D=3D type(1): self.set(name,val) def __getitem__(self,num): return self.palette[num*3],self.palette[(num*3)+1],self.palette[(num*3)+= 2] def __call__(self,image): self.attach(image) def save(self, fp): if type(fp) =3D=3D type(""): fp =3D open(fp, "w") fp.write("# Palette\n") fp.write("# Mode: %s\n" % self.mode) for i in range(256): fp.write("%d" % i) for j in range(i, len(self.palette), 256): fp.write(" %d" % self.palette[j]) fp.write("\n") fp.close() # -------------------------------------------------------------------- # Factories = def new(mode, data): Image.core.new_palette(mode, data) = def negative(mode =3D "RGB"): palette =3D range(256) palette.reverse() return ImagePalette(mode, palette * len(mode)) = def random(mode =3D "RGB"): from whrandom import randint palette =3D map(lambda a,randint=3Drandint: randint(0, 255), [0]*256*= len(mode)) return ImagePalette(mode, palette) = def wedge(mode =3D "RGB"): return ImagePalette(mode, range(256) * len(mode)) = # add some psuedocolour palettes as well = def test(): im=3DImage.open("ltest.gif") pal=3DImagePalette(im.palette[0],im.palette[1]) print pal[0],pal[1],pal[2],pal[3],pal[4] print pal[255] if __name__ =3D=3D "__main__": test() --===_0_Tue_Dec_17_21:06:55_EST_1996-- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 17 10:23:46 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 17 Dec 1996 11:23:46 +0100 Subject: [PYTHON IMAGE-SIG] PIL and palettes and drawing. In-Reply-To: <199612171012.VAA04132@jambu.off.connect.com.au> (message from Anthony Baxter on Tue, 17 Dec 1996 21:11:59 +1100) Message-ID: <9612171023.AA06513@arnold.image.ivab.se> > Ok, I've played with this some more (motivated in this case by a desire to > avoid writing a whitepaper which really is due all-to-soon :) and I've > come up with a new ImagePalette class, which Does What I Want. Does What I Want as well. I'll add some "wellknown colour names", a few standard palettes that I have somewhere, and eliminate the need for attach. Stay tuned for a 0.2b4 (early January, probably). > btw, any ideas which is a good format to be writing type P images > to? at the moment I'm converting them to RGB, then writing them as > ppm. I can't have the lossiness of jpg, and the tiff writer doesnt > write the colourmap My current priorities wrt. palette-aware formats: 1. fix PNG write support 2. redesign the TIFF writer; its not very good as it stands 3. make sure that BMP and TIFF work properly with palettes | 99. add GIF write support (not very likely, since Unisys doesn't know the meaning of freeware; it would require me register PIL users, pay 10 cents per user, restrict the use of other parts of PIL, and add a splash screen that is displayed whenever you try to write a GIF file. Same rules apply to everyone using PIL to write an application... I'm tempted to add a "not to be used for any purpose by Unisys" to the PIL license...) Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From Anthony Baxter Tue Dec 17 13:16:11 1996 From: Anthony Baxter (Anthony Baxter) Date: Wed, 18 Dec 1996 00:16:11 +1100 Subject: [PYTHON IMAGE-SIG] PIL and palettes and drawing. In-Reply-To: Your message of "Tue, 17 Dec 1996 11:23:46 BST." <9612171023.AA06513@arnold.image.ivab.se> Message-ID: <199612171316.AAA04795@jambu.off.connect.com.au> ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4788.850828567.1@connect.com.au> >>> Fredrik Lundh wrote > Does What I Want as well. I'll add some "wellknown colour names", a > few standard palettes that I have somewhere, and eliminate the need > for attach. Stay tuned for a 0.2b4 (early January, probably). Oops, I left a debugging 'print' in the code that I sent to the list. Ah well. I was planning on making it possible to use the X11 rgb colours if they are available. Quick hacky patch to my previously posted ImagePalette is at the end of this mail. > My current priorities wrt. palette-aware formats: > 1. fix PNG write support > 2. redesign the TIFF writer; its not very good as it stands These two would be Really Nice. If the TIFF writer works, I can play with plugging it into our fax gateway here. Ooo - the possibilities are endless (and quite twisted :) > [GIF writing] > Same rules apply to everyone using PIL to write an > application... I'm tempted to add a "not to be used > for any purpose by Unisys" to the PIL license...) Sounds like a plan to me. :) Anthony ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4788.850828567.2@connect.com.au> Content-Description: add RGB dbm handling to ImagePalette *** ImagePalette.py.orig Wed Dec 18 00:04:26 1996 --- ImagePalette.py Wed Dec 18 00:12:50 1996 *************** *** 14,19 **** --- 14,21 ---- import array import Image + Colours={} + class ImagePalette: def __init__(self,mode="RGB",palette=None): *************** *** 36,54 **** def set(self,num,col): if type(col) is type(()): r,g,b=col - self.palette[0+(num*3)] = r - self.palette[1+(num*3)] = g - self.palette[2+(num*3)] = b - return None if type(col) is type(''): if col[0] == '#' and len(col) == 7: import string ! self.palette[0+(num*3)] = string.atoi(col[1:3],16) ! self.palette[1+(num*3)] = string.atoi(col[3:5],16) ! self.palette[2+(num*3)] = string.atoi(col[5:7],16) ! return None ! # handle UNIX rgb.txt? ! raise ValueError,"not a valid colour setting" def attach(self,image): import string --- 38,58 ---- def set(self,num,col): if type(col) is type(()): r,g,b=col if type(col) is type(''): if col[0] == '#' and len(col) == 7: import string ! r = string.atoi(col[1:3],16) ! g = string.atoi(col[3:5],16) ! b = string.atoi(col[5:7],16) ! if Colours and len(Colours) and Colours.has_key(col): ! (r,g,b) = Colours[col] ! ! try: ! self.palette[0+(num*3)] = r ! self.palette[1+(num*3)] = g ! self.palette[2+(num*3)] = b ! except: ! raise ValueError,"not a valid colour" def attach(self,image): import string *************** *** 99,105 **** # add some psuedocolour palettes as well ! def test(): im=Image.open("ltest.gif") --- 103,115 ---- # add some psuedocolour palettes as well ! def RGBdbm(file="/usr/openwin/lib/rgb"): ! import dbm ! df=dbm.open(file) ! for i in df.keys(): ! Colours[i]=(ord(df[i][0]),ord(df[i][2]),ord(df[i][4])) ! df.close() ! def test(): im=Image.open("ltest.gif") ------- =_aaaaaaaaaa0-- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From Jack.Jansen@cwi.nl Tue Dec 17 14:52:39 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 17 Dec 1996 15:52:39 +0100 Subject: [PYTHON IMAGE-SIG] PIL 0.2b3 available for MacPython Message-ID: <9612171452.AA18757=jack@schelvis.cwi.nl> I've ported the 0.2b3 distribution of the Python Image Library to the mac, and made it available as . The distribution includes a modified version of the _tkinter plugin module that understands how to paint PIL images in Tk windows. As always, the dynamic extension modules are available for PPC and CFM68K, and all relevant Python modules are included so the distribution is self-contained. The PPC version successfully runs the demo scripts, the CFM68K version has not been tested at all, so please let me know whether it works. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 17 16:42:40 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 17 Dec 1996 17:42:40 +0100 Subject: [PYTHON IMAGE-SIG] Documentation now available in PDF format Message-ID: <9612171642.AA08207@arnold.image.ivab.se> The PIL documentation (0.2b3) is now available as a (hopefully) more portable PostScript file, and as an Acrobat PDF file. Download via: http://www.python.org/sigs/image-sig/Imaging.html Many thanks for Fredrik Nehr for the PostScript to PDF conversion. Cheers /F (who will be back online in January; God Jul and Merry Christmas to you all) ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Thu Dec 12 14:28:50 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 12 Dec 1996 15:28:50 +0100 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, release 0.2b3 for Windows Message-ID: <9612121428.AA00774@arnold.image.ivab.se> A binary distribution of PIL 0.2b3 for Windows 95/NT is now available via: http://www.python.org/sigs/image-sig/Imaging-0.2b3-win32.zip As usual, this was tested with the standard NT version of Python 1.4, but it should work with PythonWin as well (I hope). And yes, the web pages will be updated. As soon as the ftp server lets me modify an existing file, that is... Highlights: + reads non-interlaced PNG files + reads and renders placable WMF files (experimental) And the usual crop of bugfixes and other assorted hacks. Hope to have full PNG compliancy in 0.2final. The distributed version is linked with the external libraries required to enable JPEG and PNG support. A version of _tkinter.dll which supports PIL are also included. The source kit will be made available this weekend. Gotta run /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From Jack.Jansen@cwi.nl Tue Dec 17 14:52:39 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 17 Dec 1996 15:52:39 +0100 Subject: [PYTHON IMAGE-SIG] PIL 0.2b3 available for MacPython Message-ID: <9612171452.AA18757=jack@schelvis.cwi.nl> I've ported the 0.2b3 distribution of the Python Image Library to the mac, and made it available as . The distribution includes a modified version of the _tkinter plugin module that understands how to paint PIL images in Tk windows. As always, the dynamic extension modules are available for PPC and CFM68K, and all relevant Python modules are included so the distribution is self-contained. The PPC version successfully runs the demo scripts, the CFM68K version has not been tested at all, so please let me know whether it works. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Mon Dec 16 19:19:50 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 16 Dec 1996 20:19:50 +0100 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, release 0.2b3 Message-ID: <9612161919.AA01528@arnold.image.ivab.se> (Note for Windows users: the binary distribution of 0.2b3 has been updated to exactly match the source distribution. This includes a few bug fixes, most notably a problem reading some GIF files) PIL 0.2b3 is now available from the usual place: http://www.python.org/sigs/image-sig/Imaging.html This includes sources, documentation and a binary distribution for windows 95/NT; all in separate packages. Highlights: + reads non-interlaced PNG files + reads some variants of MNG files (experimental) + reads and renders placable WMF files (experimental) And the usual crop of bugfixes and other assorted hacks. Hope to have full PNG read/write support in 0.2 final. The Windows version is linked with the external libraries required to enable JPEG and PNG support. A version of _tkinter.dll which supports PIL are also included. Post comments and complaints to image-sig@python.org. Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From Jack.Jansen@cwi.nl Wed Dec 18 15:29:32 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Wed, 18 Dec 1996 16:29:32 +0100 Subject: [PYTHON IMAGE-SIG] Re: [PYTHONMAC-SIG] PIL 0.2b3 available for MacPython In-Reply-To: Message by Jack Jansen , Tue, 17 Dec 1996 15:52:39 +0100 , <9612171452.AA18757=jack@schelvis.cwi.nl> Message-ID: <9612181529.AA01034=jack@schelvis.cwi.nl> > I've ported the 0.2b3 distribution of the Python Image Library to the > mac, and made it available as > . ... And, as Guido pointed out, the CFM68K version of the plugin module was empty. I've rebuilt it, and put the new version of the distribution in the same place. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From ivantk@hotmail.com Wed Dec 18 22:28:16 1996 From: ivantk@hotmail.com (Ivan Tkatchev) Date: 18 Dec 1996 22:28:16 -0000 Subject: [PYTHON IMAGE-SIG] XPM support. Message-ID: <19961218222816.12237.qmail@hotmail.com> Is there any chance of XPM format support in the future of PIL? It would be nice to be able to use XPM's, especially with transparency. --------------------------------------------------------- Get Your *Web-Based* Free Email at http://www.hotmail.com --------------------------------------------------------- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fdrake@CNRI.Reston.Va.US Thu Dec 19 14:37:48 1996 From: fdrake@CNRI.Reston.Va.US (Fred L. Drake) Date: Thu, 19 Dec 1996 09:37:48 -0500 (EST) Subject: [PYTHON IMAGE-SIG] Transparent GIF images & Tk Message-ID: <199612191437.JAA11139@weyr.CNRI.Reston.Va.US> Well, I've finally spent a little time trying to write code using PIL, and am impressed with the ease I've been able to do simple things (like converting an image to EPS;), but am a little confused about even slightly more complex operations. This is likely because I know very little about image processing. In particular, I would like to be able to show a transparent image in a Tk widget. I can load the image and throw it up into the target widget without problems, but transparent areas become white. Typically the images will be GIFs, but I'm interested in PNG as well. I can get the RGB for the desired background, so I think I should be able to create an image of the background color using Image.new(), and a alpha channel (not sure the best way to create this yet), and combine them using Image.composite(bgimg, img, alpha). Unfortunately, I've not figured out how to actually do this. How do I compute the color parameter for Image.new() based on RGB? I tried (R<<16 | G<<8 | B), but that doesn't seem to work. Any ideas would be greatly appreciated! -Fred -- Fred L. Drake, Jr. fdrake@cnri.reston.va.us Corporation for National Research Initiatives 1895 Preston White Drive Reston, VA 20191-5434 ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From ivantk@hotmail.com Fri Dec 20 01:30:42 1996 From: ivantk@hotmail.com (Ivan Tkatchev) Date: 20 Dec 1996 01:30:42 -0000 Subject: [PYTHON IMAGE-SIG] Transparent GIF images & Tk Message-ID: <19961220013042.10242.qmail@hotmail.com> > In particular, I would like to be able to show a transparent image >in a Tk widget. I can load the image and throw it up into the target >widget without problems, but transparent areas become white. >Typically the images will be GIFs, but I'm interested in PNG as well. > I am very much interested in transparent images as well. Could you please forward e-mail replies to me? Thank you very much. --------------------------------------------------------- Get Your *Web-Based* Free Email at http://www.hotmail.com --------------------------------------------------------- ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From whedbee@ddi.digital.net Fri Dec 20 01:42:18 1996 From: whedbee@ddi.digital.net (Ken Whedbee) Date: 19 Dec 1996 20:42:18 -0500 Subject: [PYTHON IMAGE-SIG] Displaying images in X11 extension Message-ID: <87afra2dqd.fsf@bonkers.digital.net> Hi - Is it possible to use Sjoerd Mullender's X(11) Python extension to display images from PIL ? Is it as simple as pasting a PIL RGB image into a visual.CreateImage() with the format ZPixmap ? I would like to do this without going through Jack's Img extension. Thanks -- Ken Whedbee mailto:whedbee@ddi.digital.net ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Sun Dec 29 11:29:00 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Sun, 29 Dec 1996 12:29:00 +0100 Subject: [PYTHON IMAGE-SIG] Displaying images in X11 extension In-Reply-To: <87afra2dqd.fsf@bonkers.digital.net> (message from Ken Whedbee on 19 Dec 1996 20:42:18 -0500) Message-ID: <9612291129.AA09480@arnold.image.ivab.se> > Is it possible to use Sjoerd Mullender's X(11) Python extension to > display images from PIL ? Is it as simple as pasting a PIL RGB image > into a visual.CreateImage() with the format ZPixmap ? Nope. But in the future, it might become that easy. Support for the X extension is definitely on my list, but not very high at the moment. An improved "tostring" method could be a work- around, but I'm not sure that will make it into the next release. Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Sun Dec 29 11:35:08 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Sun, 29 Dec 1996 12:35:08 +0100 Subject: [PYTHON IMAGE-SIG] Transparent GIF images & Tk In-Reply-To: <199612191437.JAA11139@weyr.CNRI.Reston.Va.US> (fdrake@CNRI.Reston.Va.US) Message-ID: <9612291135.AA32614@arnold.image.ivab.se> > Unfortunately, I've not figured out how to actually do this. How do > I compute the color parameter for Image.new() based on RGB? I tried > (R<<16 | G<<8 | B), but that doesn't seem to work. A reasonable attempt, but the color parameter gets lost on its way down to the C code. Joel Shprentz reported this out a while ago, but the fix didn't make it into the latest release (sorry, Joel). I'll try fixing it to the next release. Regards /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fdrake@CNRI.Reston.Va.US Mon Dec 30 17:41:13 1996 From: fdrake@CNRI.Reston.Va.US (Fred L. Drake) Date: Mon, 30 Dec 1996 12:41:13 -0500 (EST) Subject: [PYTHON IMAGE-SIG] Transparent GIF images & Tk In-Reply-To: <9612291135.AA32614@arnold.image.ivab.se> from "Fredrik Lundh" at Dec 29, 96 12:35:08 pm Message-ID: <199612301741.MAA25156@weyr.CNRI.Reston.Va.US> > A reasonable attempt, but the color parameter gets lost on its way > down to the C code. Joel Shprentz reported this out a while ago, but > the fix didn't make it into the latest release (sorry, Joel). I'll > try fixing it to the next release. Hmm.... I couldn't quite figure out where the color value gets lost, so I'll wait for your fix on that. The subscript operator on the image objects defined in _imagingmodule.c is broken: in the function image_item(), the line: y = i / im->ysize; should be changed to: y = i / im->xsize; With this change, I can sometimes get tolerable results with this function: def transp_gif_to_rgb(im, (r, g, b)): """Translate a P-mode GIF with transparency to an RGB image. im The GIF image. (r, g, b) The RGB-value to use for the transparent areas. These should be 8 bits for each band. """ # This is really quite slow. bg = im.info["background"] rgbimg = Image.new("RGB", im.size, (r<<24 | g <<16 | b<<8)) mask = Image.new("1", im.size) drawing = ImageDraw.ImageDraw(mask) getpixel = im.getpixel point = drawing.point yrange = range(im.size[1]) ylength = im.size[1] for x in range(im.size[0]): for pos in map(None, [x]*ylength, yrange): if getpixel(pos) != bg: point(pos) rgbimg.paste(im, None, mask) return rgbimg -Fred -- Fred L. Drake, Jr. fdrake@cnri.reston.va.us Corporation for National Research Initiatives 1895 Preston White Drive Reston, VA 20191-5434 ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 31 10:01:50 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 31 Dec 1996 11:01:50 +0100 Subject: [PYTHON IMAGE-SIG] XPM support. In-Reply-To: <19961218222816.12237.qmail@hotmail.com> (ivantk@hotmail.com) Message-ID: <9612311001.AA02963@arnold.image.ivab.se> > Is there any chance of XPM format support in the future > of PIL? It would be nice to be able to use XPM's, especially > with transparency. I've added an XPM decoder to 0.2b4. Haven't tested it on a wide range of samples, but it works fine with what I got. Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From fredrik_lundh@ivab.se Tue Dec 31 10:07:21 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Tue, 31 Dec 1996 11:07:21 +0100 Subject: [PYTHON IMAGE-SIG] Transparent GIF images & Tk In-Reply-To: <199612191437.JAA11139@weyr.CNRI.Reston.Va.US> (fdrake@CNRI.Reston.Va.US) Message-ID: <9612311007.AA06960@arnold.image.ivab.se> > I can get the RGB for the desired background, so I think I should be > able to create an image of the background color using Image.new(), and > a alpha channel (not sure the best way to create this yet), and > combine them using Image.composite(bgimg, img, alpha). I've fixed transparency handling for GIFs, XPMs and PNGs in 0.2b4. The viewer.py sample script also contains sample code that pastes transparent "P" (GIF, XPM, PNG/P) and "RGBA" (PNG) images onto a given background. 0.2b4 will be released within a week. Cheers /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org =================