From ve6ahm@ve6ahm-1.ampr.ab.ca Thu May 2 11:45:02 1996 From: ve6ahm@ve6ahm-1.ampr.ab.ca (Les Davies) Date: Thu, 2 May 1996 03:45:02 -0700 (MST) Subject: [PYTHON IMAGE-SIG] Image docs Message-ID: <199605021045.DAA00529@ve6ahm-1.ampr.ab.ca> I have tried to read the postscript manual docs for Image and only get one color - white. No readability. I am using the Caldera Desktop Preview 2 with kernel 1.2.13 and Ghostview 1.5 - Linux. My interest is in reading a raw stream of bytes in the range 0 - 64 with 0 being white and 64 black and producing an image on the screen using python. I know pbmplus can do this. Is there any modules for python 1.3 available that would help? Is there an interface to the svgalib on linux? Les Davies (ve6ahm@ve6ahm-1.ampr.ab.ca) ================= 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 Fri May 3 01:58:05 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 3 May 1996 02:58:05 +0200 Subject: [PYTHON IMAGE-SIG] Image docs In-Reply-To: <199605021045.DAA00529@ve6ahm-1.ampr.ab.ca> (message from Les Davies on Thu, 2 May 1996 03:45:02 -0700 (MST)) Message-ID: <9605030058.AA24056@arnold.image.ivab.se> > My interest is in reading a raw stream of bytes in the range 0 - 64 > with 0 being white and 64 black and producing an image on the screen > using python. I know pbmplus can do this. Is there any modules for > python 1.3 available that would help? You could try PIL; although the current release cannot display images itself (it calls 'xv' to take care of that), it can read 8-bit images without much ado: fp = open("image") # create an image and load data to it im = Image.new("L", (xsize, ysize)) im._fromstring(fp.read(xsize * ysize)) # adjust polarity (0=black, 255=white) im = im.point(map(lambda a: 255 - (255 * a / 64), range(256)) # PIL 0.1 allows you to write: # im = im.point(lambda a: 255 - (255 * a / 64)) # display (via xv; see PIL 0.1 distribution for Tk support) im.show() Better would of course be to write a real file format handler; to do that, you need to read enough of the file's header to identify the format, and then setup a "tile list" describing where and how to read data from the file. PIL takes care of the rest. Alternatively, I think you could use Jack Jansen's IMG in a similar fashion. > Is there an interface to the svgalib on linux? Not as far as I know, but it sure would be trivial to add to PIL (guess I'd better install Linux on my PC first :-) --- And for those who wonder, I hope to release PIL 0.1 this weekend. Contains *lots* of new, intriguing stuff, including Grail support. 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 ve6ahm@ve6ahm-1.ampr.ab.ca Fri May 3 07:53:48 1996 From: ve6ahm@ve6ahm-1.ampr.ab.ca (Les Davies) Date: Thu, 2 May 1996 23:53:48 -0700 (MST) Subject: [PYTHON IMAGE-SIG] Re: image.docs Message-ID: <199605030653.XAA03181@ve6ahm-1.ampr.ab.ca> I have tried to read the postscript manual docs for Image and only get one color - white. No readability. I am using the Caldera Desktop Preview 2 with kernel 1.2.13 and Ghostview 1.5 - Linux. My interest is in reading a raw stream of bytes in the range 0 - 64 with 0 being white and 64 black and producing an image on the screen using python. I know pbmplus can do this. Is there any modules for python 1.3 available that would help? Is there an interface to the svgalib on linux? Les Davies (ve6ahm@ve6ahm-1.ampr.ab.ca) ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From t150315@proffa.cc.tut.fi Mon May 6 13:56:45 1996 From: t150315@proffa.cc.tut.fi (Tamminen Eero) Date: Mon, 6 May 1996 14:56:45 +0200 (EET DST) Subject: [PYTHON IMAGE-SIG] Image docs Message-ID: <199605061156.OAA18173@proffa.cc.tut.fi> > # adjust polarity (0=black, 255=white) > im = im.point(map(lambda a: 255 - (255 * a / 64), range(256)) > > # PIL 0.1 allows you to write: > # im = im.point(lambda a: 255 - (255 * a / 64)) > > Better would of course be to write a real file format handler; IMHO this kind of stuff would be nice to have as a PIL function, done in C for speed. For those not in hurry there could be a Python function for doing the same with floats ;-). Does PIL have some kind of 'combine' function? For doing something like this: result = (img_1 * 2 / 3) + (img_2 * 1 / 3) Combining two 'full' images is mainly of use only for combining effects (= modified versions of the image) to the original one, but might have some use in combining completely different images too, if PIL would have some functions for doing different color (intensity) 'slide' images that can be used in combining to control how the two images are combined (eg. img_1 gradually changes to img_2 while going from image top to bottom). Circular slides might be nice in addition to vertical, horizontal and diagonal ones too. For combining some defined image parts one needs to do masks by hand. :-( (on some rare cases threshold might suffice though) - Eero ================= 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 May 6 13:28:09 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Mon, 6 May 1996 14:28:09 +0200 Subject: [PYTHON IMAGE-SIG] Image docs In-Reply-To: <199605061156.OAA18173@proffa.cc.tut.fi> (message from Tamminen Eero on Mon, 6 May 1996 14:56:45 +0200 (EET DST)) Message-ID: <9605061228.AA28824@arnold.image.ivab.se> Eero writes: > > # PIL 0.1 allows you to write: > > # im = im.point(lambda a: 255 - (255 * a / 64)) > > IMHO this kind of stuff would be nice to have as a PIL function, > done in C for speed. For those not in hurry there could be a > Python function for doing the same with floats ;-). It is done in C; the wrapper just calculates the expression for each possible pixel value (0..255) and uses a lookup table to process the actual image. > Does PIL have some kind of 'combine' function? For doing something > like this: > result = (img_1 * 2 / 3) + (img_2 * 1 / 3) Yep (it's already there in release 0.0, in fact). result = Image.blend(img_1, img_2, 1.0/3) An important detail is that the alpha may extend outside the range 0.0 to 1.0, allowing you to for example implement unsharp masking using this mechanism (as done by the ImageEnhance module). > /.../ might have some use in combining completely different images > too, if PIL would have some functions for doing different color > (intensity) 'slide' images that can be used in combining to control > how the two images are combined. If you browsed the sample code, you have already seen the (undocumented) _wedge operation. You can implement any linear variant by combining that with point and rotate methods. Radial fills are a different thing, but is sure useful. I'll put in on my list (but not for release 0.1 :-) BTW, PIL 0.1 adds a composite convenience function, which is implemented as a copy/paste(mask) operation: result = Image.composite(img_1, img_2, mask) > For combining some defined image parts one needs to do masks by hand. :-( > (on some rare cases threshold might suffice though) There's a rudimentary file interface to Boutell's GD library in PIL 0.1, allowing you to for example draw a mask using that library, save it as a GD file, and load it into PIL. (Future versions of PIL will include same basic 2D drawing support as well). 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 da@maigret.cog.brown.edu Wed May 8 01:54:07 1996 From: da@maigret.cog.brown.edu (David Ascher) Date: Tue, 7 May 1996 20:54:07 -0400 (EDT) Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, release 0.0 In-Reply-To: <9603280727.AA19093@arnold.image.ivab.se> from "Fredrik Lundh" at Mar 28, 96 08:27:35 am Message-ID: <199605080054.UAA20365@maigret> Hi there. I may soon need PIL, so hopefully you'll get some feedback from me. Quick questions: 1 - has anyone tried PIL on a Win95/NT machine? 2 - do you have any recommendations for an xv equivalent for Win95? --david ================= 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 Wed May 8 08:01:41 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Wed, 8 May 1996 09:01:41 +0200 Subject: [PYTHON IMAGE-SIG] Python Imaging Library on win32 In-Reply-To: <199605080054.UAA20365@maigret> (message from David Ascher on Tue, 7 May 1996 20:54:07 -0400 (EDT)) Message-ID: <9605080701.AA26468@arnold.image.ivab.se> > 1 - has anyone tried PIL on a Win95/NT machine? The core library (libImaging) builds cleanly, given an appropriate ImConfig.h (last time I checked, at least :-). Haven't had time to set up a win32 development environment yet, so I'm not sure about the bindings. Cannot see why they shouldn't work, though... > 2 - do you have any recommendations for an xv equivalent for Win95? You could try "lviewpro". Searching for lview in InfoSeek should help you locate it in no time at all. BTW, I hope to release 0.1 this weekend. Lot's of file formats, channel operations, a Tk interface, some utilities, Grail support, and more... Stay tuned. /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 Thu May 9 23:26:05 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 10 May 1996 00:26:05 +0200 Subject: [PYTHON IMAGE-SIG] Announcing the Python Imaging Library, release 0.1b1 Message-ID: <9605092226.AA14370@arnold.image.ivab.se> Tada! When you read this, the Python Imaging Library, relase 0.1b1 (beta 1, that is) should be available from www.python.org. http://www.python.org/sigs/image-sig/Imaging.html or: ftp://ftp.python.org/pub/www.python.org/sigs/image-sig This beta has a few rough edges, including broken PostScript printer support and an ugly (but working) palette hack, but the rest seems quite stable. And there's lots of new stuff in it. Note that the IJG JPEG library is the standard distribution of version 6 (converted from a zip file, though). If you already have it, you don't need to download this file. If you prefer version 6a, you may have to hack around a little in the Jpeg codec interfaces. Anyway, this code has been compiled on Digital Unix, Solaris 5 and Linux without any problems whatsoever. With a little luck, it will run on your platform as well. Updated documentation will arrive on the server within a few days. In the meanwhile, you may be able to use the draft version. 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 fredrik_lundh@ivab.se Fri May 10 01:16:23 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 10 May 1996 02:16:23 +0200 Subject: [PYTHON IMAGE-SIG] Re: Announcing the Python Imaging Library, release 0.1b1 Message-ID: <9605100016.AA01304@arnold.image.ivab.se> > Updated documentation will arrive on the server within a few days. Now, that is (a postscript version, at least). There's still a few discrepancies between the doc and the code, but hey, they are both betas... If you downloaded the release when you got my previous announcement, and experienced problems when unzipping the file, or with missing files in the libImaging directory, you'd better try again. This time it should work :-) 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 fredrik_lundh@ivab.se Fri May 10 12:58:04 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 10 May 1996 13:58:04 +0200 Subject: [PYTHON IMAGE-SIG] Re: Announcing... Message-ID: <9605101158.AA19970@arnold.image.ivab.se> There's seems to be some kind of mess up with the Python portions of the 1.0b1 release. If you haven't downloaded it yet, please wait until I've had a chance to investigate the problem. Stay tuned /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 Fri May 10 13:23:30 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 10 May 1996 14:23:30 +0200 Subject: [PYTHON IMAGE-SIG] Re: Announcing... Message-ID: <9605101223.AA21830@arnold.image.ivab.se> Okay, there appears to be a few annoying bugs in the Python scripts, especially if you don't have the Numeric extensions patched into your interpreter... I've just uploaded a new version which should work better (still called 1.0b1). Sorry, no patches, but the distribution is not very large anyway :-) Many thanks to everyone involved in tracking those problems! /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 Sat May 11 01:43:29 1996 From: MHammond@skippinet.com.au (Mark Hammond) Date: Sat, 11 May 1996 10:43:29 +1000 Subject: [PYTHON IMAGE-SIG] Re: Announcing... Message-ID: <199605110046.KAA27085@minotaur.labyrinth.net.au> > There's seems to be some kind of mess up with the Python portions of > the 1.0b1 release. If you haven't downloaded it yet, please wait > until I've had a chance to investigate the problem. > > Stay tuned /F Bummer. I just downloaded it :-) I nearly have all the C code building as a windows extension module. I will need some guidance on how to plug in DC support in for Windows, but it shouldnt be too far away... Mark. ---------------------------------------- Mark Hammond - MHammond@skippinet.com.au ================= 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 May 23 16:17:25 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 23 May 1996 17:17:25 +0200 Subject: [PYTHON IMAGE-SIG] The Python Imaging Library -- now for Windows ! Message-ID: <9605231517.AA23937@arnold.image.ivab.se> A sneak release of PIL 0.1b2 is now available, as a PYD file for Mark Hammond's PythonWin. See Regards /F -------------------------------------------------------------------- CHANGES -------------------------------------------------------------------- This is release 0.1b2 (96-05-20) *** Changes from release 0.1b1 *** ACKNOWLEDGEMENTS: David Ascher and Fredrik Nehr pointed out a number of bugs and typos in the original distribution of this version. Mark Hammond provided invaluable help when designing the Windows interface. + The main makefile now builds the dynamic extension as default. To build an interpreter instead, use "make python". + Added Windows display support, via the ImageWin class (see "ImageWin.py" for details). + Makefiles to build Imaging.lib and the bindings for Windows NT and 95 are included. A pre-built PYD for Mark Hammond's PythonWin is distributed separately. + Added raster conversion for EPS files. This requires GNU or Aladdin Ghostscript, and probably works on Unix only. + Added support for yet another file format: PhotoCD (PCD) images. The base resolution (768x512) can be read from a PhotoCD file. + Eliminated some compiler warnings. Bindings now compile cleanly in C++ mode. Note that the Imaging library itself must be compiled in C mode. + Added "bdf2pil.py", which converts BDF fonts into images with associated metrics. This is definitely work in progress. For info, see description in script for details. + Fixed a bug in the "ImageEnhance.py" module. + Fixed a bug in the netpbm save hack in "GifImagePlugin.py" + Fixed 90 and 270 degree rotation of rectangular images. + Now loads 8-bit TIFF palette-color images, and plane separated RGB and CMYK images. + Added driver debug mode. This is enabled by setting Image.DEBUG to a non-zero value. Try the -D option to "pilfile.py" and see what happens. + Don't crash on "atend" constructs in PostScript files. + Only the Image module imports _imaging directly. Other modules should refer to the binding module as "Image.core". ================= 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 Wed May 29 23:46:13 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 00:46:13 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary Message-ID: <9605292246.AA16844@arnold.image.ivab.se> (hello? is there anybody out there?) I've just uploaded a "feature summary" to the web site, but since it isn't that much text, I post it here as well. The 0.1b2 release has been delayed until next week in order to improve the support for 8-bit displays under Windows. This includes adaptive palette generation, fast inverse palette mapping, and floyd-steinberg error diffusion (in other words, decent "RGB" to "P" conversion). And I couldn't resist adding a few more file formats in the process... If you wish to try it out, the PYD sneak release works fine on 15- and 24-bit displays. Comments are welcomed. Would be fun with at least some traffic on this list, wouldn't it? Regards /F -------------------------------------------------------------------- http://www.python.org/sigs/image-sig/Features.html Last updated: May 29, 1996. Here's a summary of the current features in the Python Imaging Library (0.1b1). Things that have been added in the forthcoming 0.1b2 relese are also described. Environments * Unix: known to run on Linux, Digital Unix (OSF/1), SGI, Solaris, and SunOS 4. Requires an ANSI C compiler to build (gcc works fine). * Windows: runs on 95 and NT. A prebuilt PYD for Mark Hammond's PythonWin is available (0.1b2). Image Objects * Bilevel, greyscale, palette, true colour (RGB), colour separation (CMYK). * Copy, cut, paste operations. * Flip, transpose, resize, rotate, and arbitrary affine transforms. * Transparency operations. * Channel and point operations. * Colour transforms, including matrix operations and quantization to predefined palettes (0.1b2). * Image enhancement, including convolution filters. File Formats * Full (Open/Load/Save): BMP, JPEG, PPM, TIFF. * Read only (Open/Load): CUR (0.1b2), DCX, EPS (with ghostscript), GBR, GD, GIF, ICO (0.1b2), PhotoCD (0.1b2), PCX, TGA, SGI, Sun Raster, XBM. * Identify only (Open): EPS, FLC, FLI, MPEG, MSP, PNG. Uses the IJG JPEG library to load and save JPEG files. All other formats are supported by the standard distribution. Display * Tk PhotoImage support for Tkinter. * Windows NT: GUI independent DIB support (0.1b2). This has been tested with PythonWin only. Utilities * Identify, convert, print images. * View images (Tkinter). Other * Documentation (PostScript only). * Postscript printing. * Graphics support (points, lines, rectangles, text). * X BDF font support (0.1b2) * Interface to Jack Jansen's IMG library. ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From mclay@eeel.nist.gov Thu May 30 00:05:52 1996 From: mclay@eeel.nist.gov (Michael McLay) Date: Wed, 29 May 96 19:05:52 EDT Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <9605292246.AA16844@arnold.image.ivab.se> References: <9605292246.AA16844@arnold.image.ivab.se> Message-ID: <9605292305.AA03879@acdc.eeel.nist.gov> Fredrik Lundh writes: > > (hello? is there anybody out there?) > > I've just uploaded a "feature summary" to the web site, but since it > isn't that much text, I post it here as well. > > The 0.1b2 release has been delayed until next week in order to improve > the support for 8-bit displays under Windows. This includes adaptive > palette generation, fast inverse palette mapping, and floyd-steinberg > error diffusion (in other words, decent "RGB" to "P" conversion). And > I couldn't resist adding a few more file formats in the process... > > If you wish to try it out, the PYD sneak release works fine on 15- and > 24-bit displays. > > Comments are welcomed. Would be fun with at least some traffic on > this list, wouldn't it? Ok, I'll speak up so you don't feel so lonely. I tried out the module about a week ago and it worked great. The only problem I found was it's dependance on xv for viewing images. I envisioned the module as a good starting point for the creation of an embeddable and extendable version of xv. How about hooking it up so images can be displayed using a Tkinter Photo widget? With a little effort someone could then come up with an xv like tool that just uses Python, Tkinter and PAL. This would also enable PIL to be used inside of Grail applets. I'd do this myself, but: a) my clones currently on vacation, b) I don't have the time in my schedule this month, or c) I'd rather use *good* code, which means someone else should write it. Take your pick of excuses. Anyway, I was just piping up since you were feeling lonely. PIL looks like a really nice start on an image library. Please keep up the work. Michael ================= 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 May 30 00:37:07 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 01:37:07 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <9605292305.AA03879@acdc.eeel.nist.gov> (message from Michael McLay on Wed, 29 May 96 19:05:52 EDT) Message-ID: <9605292337.AA03717@arnold.image.ivab.se> > How about hooking it up so images can be displayed using a Tkinter > Photo widget? With a little effort someone could then come up with > an xv like tool that just uses Python, Tkinter and PIL. Well, have a look at the pilview.py hack in the 0.1b1 release. It uses the ImageTk module which contains a PhotoImage class. You provide a mode and a size, and get an object into which you can paste stuff. When it's time to display it, accessing the image attribute will create a Tk PhotoImage that can be passed to Tkinter. The 0.1b2 release contains similar stuff for Windows (and an even more rudimentary viewer hack). The show() method is mainly intended for debugging, and quick hacks. > Anyway, I was just piping up since you were feeling lonely. Surely appreciated. There's a lot of people lurking around here, but you don't see much of them, do you? /F -------------------------------------------------------------------- # # here's a minimal viewer supporting ~15 formats (with 0.1b2) import Image, ImageTk, Tkinter def show(i): tkim = ImageTk.PhotoImage(i.mode, i.size) tkim.paste(i) root = Tkinter.Tk() root.label = Tkinter.Label(root, image=tkim.image) root.label.pack() root.mainloop() if __name__ == "__main__": import sys if len(sys.argv) > 1: file = sys.argv[1] else: file = "lena.ppm" show(Image.open(file)) ================= 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 Thu May 30 05:24:07 1996 From: jody@sccsi.com (Jody Winston) Date: Wed, 29 May 1996 23:24:07 -0500 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <9605292246.AA16844@arnold.image.ivab.se> (message from Fredrik Lundh on Thu, 30 May 1996 00:46:13 +0200) Message-ID: <199605300424.XAA03070@friday.houston.net> I'm here ;-). I'm currently using tk's image object and I'm not happy with the mannor that it handles images that have pallettes that approach 256 entries on an 8 bit display. I'd be interested in adding IMG support to python since I'm using the IMG library for other portions of the appliction. But first, I need to know where to ftp the code. Jody Winston ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org ================= From cardenas@uxdea1.iimas.unam.mx> (Javier Cardenas Flores Thu May 30 05:54:38 1996 From: cardenas@uxdea1.iimas.unam.mx> (Javier Cardenas Flores (Fco. Javier Cardenas Flores) Date: Wed, 29 May 1996 22:54:38 -0600 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <9605292337.AA03717@arnold.image.ivab.se> (message from Fredrik Lundh on Thu, 30 May 1996 01:37:07 +0200) Message-ID: <199605300454.WAA04072@uxdea3.iimas.unam.mx> Hi, I've using the PIL and I got a problen whit split method, to solve it, I had to add, in Image.py in the split method, load and rage. like this. self.load() ims[] for c in range(self.im.bands): I'm workin with a SunOS 4.1.3_U1 and Linux Bye the way, How can I manipulate the pixels indivuduality like a unisgned char or int?. I've worked with _tostring method and the array object but, it manipulates a signed integers. Regards Javier Cárdenas ================= 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 May 30 09:15:46 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 10:15:46 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <199605300424.XAA03070@friday.houston.net> (jody@sccsi.com) Message-ID: <9605300815.AA22431@arnold.image.ivab.se> > But first, I need to know where to ftp the code. See ! /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 Thu May 30 09:22:49 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 10:22:49 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <199605300454.WAA04072@uxdea3.iimas.unam.mx> (cardenas@uxdea3.iimas.unam.mx) Message-ID: <9605300822.AA16694@arnold.image.ivab.se> > I've using the PIL and I got a problen whit split method, to solve > it, I had to add, in Image.py in the split method, load and > rage. like this. Thanks. I'll add this fix to 0.1b2. > By the way, How can I manipulate the pixels indivuduality like a > unisgned char or int?. I've worked with _tostring method and the array > object but, it manipulates a signed integers. I plan to add a getpixel() method in 0.1b2, which would at least allow you to implement eyedropper tools and such. If you need performance, you should be able to use numerical extension which includes an enhanced array object (see the matrix-sig FAQ at for details). A rudimentary interface is attached. Regards /F -------------------------------------------------------------------- import Image, Numeric def ImageToArray(i): a = Numeric.array(i._tostring(), "b") a.shape = i.size[1], i.size[0] return a def ArrayToImage(a): i = Image.new("L", (a.shape[1], a.shape[0])) i._fromstring(a.toString()) return i # "If you cannot do it in 8 lines of Python, it is probably # not worth doing." ================= 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 May 30 09:33:31 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 10:33:31 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <199605300424.XAA03070@friday.houston.net> (jody@sccsi.com) Message-ID: <9605300833.AA20037@arnold.image.ivab.se> > I'd be interested in adding IMG support to python since I'm using the > IMG library for other portions of the appliction. Hmm, reading the mail again, I'm noticed that is said IMG and not PIL... Does this refer to Jack Jansen's library or something else? (Jack's stuff is definitely well integrated in Python :-) Anyway, here's a short summary of current image resources. Post any additions or corrections to the list. * The Python Imaging Library (by Fredrik Lundh) Adds an Image object to the Python interpreter, supporting a variety of image operations. Includes Tk and Windows display support, support for some 20 file formats, and more. Current version is 0.1b1. http://www.python.org/sigs/image-sig/Imaging.html * The IMG library (by Jack Jansen) Reads and writes a variety of file formats, and supports display on X and Mac systems. An interface to PIL is available. ftp://ftp.cwi.nl/pub/jack/python-img/ * The GD library (by Richard Jones) 'It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a .GIF file. This is particularly useful in World Wide Web applications, where .GIF is the format used for inline images.' http://daneel.rdt.monash.edu.au/%7Erichard/gdmodule 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 Thu May 30 14:18:16 1996 From: jody@sccsi.com (Jody Winston) Date: Thu, 30 May 1996 08:18:16 -0500 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <9605300833.AA20037@arnold.image.ivab.se> (message from Fredrik Lundh on Thu, 30 May 1996 10:33:31 +0200) Message-ID: <199605301318.IAA10210@friday.houston.net> >>>>> "Fredrik" == Fredrik Lundh writes: >> I'd be interested in adding IMG support to python since I'm >> using the IMG library for other portions of the appliction. I was referring to the following IMG library: IMG* Image Processing Toolset and C Library Version 1.1 (Nov 1994) Copyright 1994 Simon A.J. Winder sajw@maths.bath.ac.uk All Rights Reserved ================= 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 May 30 14:39:05 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Thu, 30 May 1996 15:39:05 +0200 Subject: [PYTHON IMAGE-SIG] PIL Feature Summary In-Reply-To: <199605301318.IAA10210@friday.houston.net> (jody@sccsi.com) Message-ID: <9605301339.AA32442@arnold.image.ivab.se> > I was referring to the following IMG library: Aha. Nice package, but last time I looked it seemed as if a lot of functionality in there were implemented in the utilities and not in the library itself. That would make it rather difficult to turn it into a real Python extension. One solution could be to use Python "pipes" module. That would allow you to design a Python module which builds and runs imgstar processing pipelines. If you have the time... When it comes to PIL, I've decided to let the matrix-sig folks take care of the more serious image/signal processing stuff, including FFT stuff. 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 bbum@friday.com Fri May 31 07:28:31 1996 From: bbum@friday.com (Bill Bumgarner) Date: Fri, 31 May 96 01:28:31 -0500 Subject: [PYTHON IMAGE-SIG] Building the PIL Message-ID: <199605310628.BAA13218@cerebus.friday.com> Frustration, frustration, frustration. Do I really *have* to build it within the python source tree? I don't *want* to build it there... I have python correctly and completely installed-- libraries/headers included-- and don't want to have to maintain a ready-to-build-for-any-custom-module python tree. This is one of the few remaining areas that Perl5 has Python beat hands down... b.bum ================= 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 Fri May 31 09:50:29 1996 From: fredrik_lundh@ivab.se (Fredrik Lundh) Date: Fri, 31 May 1996 10:50:29 +0200 Subject: [PYTHON IMAGE-SIG] Building the PIL In-Reply-To: <199605310628.BAA13218@cerebus.friday.com> (message from Bill Bumgarner on Fri, 31 May 96 01:28:31 -0500) Message-ID: <9605310850.AA00530@arnold.image.ivab.se> Bill Bumgarner wrote: > Do I really *have* to build it within the python source tree? With the 0.1(b) releases, you shouldn't have to. However, if you placed the Python includes and binaries somewhere else than /usr/local, you probably have to hack a little in Makefile and Setup. (I have to admit that I don't know much about the Makefile.pre.in specifics, really, since it was contributed by others as being the standard way to organize extensions) Regards /F ================= IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org =================