From david@alphagene.com Tue Nov 4 13:33:22 1997 From: david@alphagene.com (David Walton) Date: Tue, 04 Nov 1997 08:33:22 -0500 Subject: [IMAGE-SIG] Palettes and current version Message-ID: <345F2422.2781@alphagene.com> Hello, I'm a bit of a newbie to imaging, and have a couple of questions regarding PIL. First off, I'm curious what the current version for Unix is. 0.2b4 is the version I found on the Image-sig page, but that version seems quite out dated (February?), and I've seen mention in the Image-sig archive of versions .3b1 and .3b2. My second question is in regards to palettes. I'm trying to draw an image based on data that we've collected. It's been requested that I produce a tiff image of the data using false colors, because someone wants an image with raw data and a broad spectrum of color to work with. With that said, I've created an instance of the Image object. Initially I tried creating the image as Image.new('RGB',(width,height),(255,255,255)) However, when I attempted to draw rectangles of various colors onto this image, I got an error: self.im.draw_rectangle(xy, self.ink, self.fill) ValueError: PIL: images do not match After looking into the documentation, I realized that I needed to define my image with a palette to use the rectangle method. I redefined my image using 'P' instead of 'RGB', and then attempted to create image.palette using ImagePalette.ImagePalette('RGB'). When I try to now create an instance of the ImageDraw class, I get an error: self.im.putpalette(self.palette.rawmode, self.palette.data) AttributeError: rawmode After looking at the ImagePalette.py library, I discovered there is no rawmode attribute. Interestingly enough, there is a raw class in that same library which has a rawmode attribute. I can't find anything in the documentation, in the script examples or in the Image-sig mailing list archive that addresses this. Any help anyone can provide me would be very much appreciated. Thank you, Dave -- Dave Walton Scientific Software Engineer AlphaGene, Inc. david@alphagene.com _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From Fred L. Drake, Jr." References: <345F2422.2781@alphagene.com> Message-ID: <199711041429.JAA03068@weyr.cnri.reston.va.us> David Walton writes: > regarding PIL. First off, I'm curious what the current version > for Unix is. 0.2b4 is the version I found on the Image-sig David, I'm using 0.3a1, which is the latest I've seen sources for. It's available at . I'm not sure that Fredrik has had a lot of time to deal with the releases lately, though I think I speak for many of us that we're anxious to see a new release. I don't know anything about creating palettes, sorry. -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@pythonware.com Tue Nov 4 16:22:03 1997 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 4 Nov 1997 17:22:03 +0100 Subject: [IMAGE-SIG] Palettes and current version Message-ID: <01bce93d$c8f4e220$6fadb4c1@fl-pc.image.ivab.se> David wrote: >I'm a bit of a newbie to imaging, and have a couple of questions >regarding PIL. First off, I'm curious what the current version >for Unix is. 0.2b4 is the version I found on the Image-sig >page, but that version seems quite out dated (February?), and >I've seen mention in the Image-sig archive of versions .3b1 and >.3b2. There's a 0.3a1 source kit available from my starship cabin: http://starship.skyport.net/crew/fredrik the 0.3a2 code base is available only in a binary for Win32 (at www.pythonware.com). >However, when I attempted to draw rectangles of various colors onto >this image, I got an error: > self.im.draw_rectangle(xy, self.ink, self.fill) >ValueError: PIL: images do not match The 0.2 lib only supports 8-bit targets for drawing operations; this has been fixed in the current code base. >After looking into the documentation, I realized that I needed >to define my image with a palette to use the rectangle method. >I redefined my image using 'P' instead of 'RGB', and then attempted >to create image.palette using ImagePalette.ImagePalette('RGB'). The palette code is pretty much broken in all the available source kits; in practice, cleaning up this mess is all that remains before we can release 0.3 final (this includes RGB->P conversion, colour allocation stuff, etc). Hopefully, we'll get around to do that before it's time to release PIL Pro 1.0 (aka 'zircon')... Anthony Baxter posted an improved ImagePalette module to this list quite a while ago that may help in your case; you should be able to find that via http://www.findmail.com/listsaver/image-sig/ (in worst case, grab the complete archive from www.python.org). Cheers /F fredrik@pythonware.com http://www.pythonware.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@ruckus.cnri.reston.va.us Fri Nov 7 06:35:40 1997 From: fdrake@ruckus.cnri.reston.va.us (Fred L. Drake) Date: Thu, 6 Nov 1997 23:35:40 -0700 Subject: No subject Message-ID: <199711070635.XAA02995@ruckus.cnri.reston.va.us> _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From Fred L. Drake, Jr." References: <199711070635.XAA02995@ruckus.cnri.reston.va.us> Message-ID: <199711070517.AAA09505@weyr.cnri.reston.va.us> I wrote: > > > _______________ > IMAGE-SIG - SIG on Image Processing with Python > > send messages to: image-sig@python.org > administrivia to: image-sig-request@python.org > _______________ > Ooops... sorry! -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 Fred L. Drake, Jr." Announcing a new Image-SIG project: a Type1 Font Renderer for Python! This new interface to a Type1 font rendering engine allows Python programs access to a large number of fonts which have not been so readily usable before. The interface provides access to the "t1lib" library by Rainer Menzner. The rasterizer is based on the work which IBM contributed to the X Consortium for inclusion in the X11 distribution. More information on the detailed lineage of the rasterizer is included in the t1lib manual. (X11 is not required to use the underlying C code or the Python extensions.) Most aspects of the underlying t1lib have been exposed to the Python layer. The exceptions are the functions which support the rasterization of Type1 fonts directly into X11 bitmaps and pixmaps; these are not needed from Python. An object-oriented layer written in Python makes using the primitives a bit easier, and an additional module supports the conversion of t1lib glyphs to Python Imaging Library (PIL) Image objects, and allows for use of the fonts with PIL's ImageDraw class. The project and preliminary implementation are discussed (and the code is available) at http://www.python.org/sigs/image-sig/t1lib/. Please take a look and send feedback to the Image-SIG mailing list or, if you're just incredibly shy, to me. -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 Kevin Hilman Tue Nov 18 03:10:19 1997 From: Kevin Hilman (Kevin Hilman) Date: 17 Nov 1997 19:10:19 -0800 Subject: [IMAGE-SIG] raw YUV files Message-ID: Has anyone written a ImageFile module for YUV files? specifically for files that are packed UYVY... (interlaced or non-interlaced) I realize there is no header info in these, but all are the same size, so I can hard-code the size into the module. I wrote a module to read raw 8-bit/pixel data from .Y files by hard-coding the size into the module. For UVUY though, I can't seem to figure out how to skip every other pixel, and/or every other line. Thanks. -- Kevin Hilman -- khilman@ee.washington.edu _______________ 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 Thu Nov 20 00:43:47 1997 From: arb@connect.com.au (Anthony Baxter) Date: Thu, 20 Nov 1997 11:43:47 +1100 Subject: [IMAGE-SIG] python-gimp Message-ID: <199711200043.LAA12493@jambu.off.connect.com.au> I don't remember seeing this mentioned here, but people might just be interested in , a binding to the GIMP. () (thanks to Oliver Andrich for the tipoff about this) Anthony _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________