From fredrik@pythonware.com Sat Jan 9 20:28:15 1999 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sat, 9 Jan 1999 21:28:15 +0100 Subject: [Image-SIG] PIL 1.0b1 finally available for download Message-ID: <015901be3c0e$98f34100$f29b12c2@pythonware.com> Some 30,000 lines of shining new code is now available via http://www.pythonware.com/downloads.htm give it a try and tell me what doesn't work. on official announcement will follow on monday (unless everyone on this list tells me the release is seriously broken, of course). Cheers /F http://www.pythonware.com/people/fredrik/status.htm From pratt@andrew.cmu.edu Sun Jan 10 02:26:33 1999 From: pratt@andrew.cmu.edu (Jason Pratt) Date: Sat, 9 Jan 1999 21:26:33 -0500 (EST) Subject: [Image-SIG] putpixel? Message-ID: Hello. I'm just beginning to use PIL, and just subscribed to this list. The first thing I wanted to use the library for seems like a very simple thing to do, but I can't for the life of me figure out how to do it. All I want to do is create a new image, start writing individual pixels to it, and then save it out again. I have no problem creating the new image and saving it out, but I don't see how I can write to individual pixels within the image. The only solution I've seen is to create a new 1x1 Image of the appropriate color for each pixel, and then paste that Image into my larger Image. This seems like a horribly inefficient hack, and I have to believe there's a better way to do it. putdata looked slightly promising, although it doesn't look designed for writing individual pixels either, but it's not documented... Suggestions? ___________________________ Jason Pratt pratt@andrew.cmu.edu From sk@nvg.ntnu.no Sun Jan 10 03:05:42 1999 From: sk@nvg.ntnu.no (Steinar Knutsen) Date: Sun, 10 Jan 1999 04:05:42 +0100 (CET) Subject: [Image-SIG] putpixel? In-Reply-To: Message-ID: On Sat, 9 Jan 1999, Jason Pratt wrote: > All I want to do is create a new image, start writing individual pixels to > it, and then save it out again. I have no problem creating the new image > and saving it out, but I don't see how I can write to individual pixels > within the image. I believe the point-method of ImageDraw objects may be what you are looking for. -- Steinar From cgw@pgt.com Sun Jan 10 03:29:12 1999 From: cgw@pgt.com (Charles G Waldman) Date: Sat, 9 Jan 1999 22:29:12 -0500 (EST) Subject: [Image-SIG] putpixel? In-Reply-To: References: Message-ID: <13976.7816.26191.514200@sirius> > All I want to do is create a new image, start writing individual pixels to > it, and then save it out again. I have no problem creating the new image > and saving it out, but I don't see how I can write to individual pixels > within the image. Perhaps you are using an older version of the Python Imaging Library? Since 0.3b2 there has been an Image "putpixel" method. From fredrik@pythonware.com Sun Jan 10 11:55:39 1999 From: fredrik@pythonware.com (Fredrik Lundh) Date: Sun, 10 Jan 1999 12:55:39 +0100 Subject: [Image-SIG] Re: PIL 1.0b1 finally available for download Message-ID: <00e901be3c90$25561bf0$f29b12c2@pythonware.com> I wrote: >Some 30,000 lines of shining new code is now available >via http://www.pythonware.com/downloads.htm a few notes: - the 16-bit support code may not work as well as the CHANGES file says; the test program was partially broken. use at your own risk... - the updated version of "pilconvert.py" didn't make it into the distribution kit. - the Sane code included in this release is not the latest version; if you need that, get it from http://starship.skyport.net/crew/amk/ - this release hasn't been tested with 1.5.2b, but I see no reason why it shouldn't work. however, you still need to link PIL to Tk the hard way even if you have 1.5.2b... - despite what the README says, the quantization parts of this release has not been built on Digital Unix. all the other parts are fully cross tested, though. all the above will be fixed for 1.0 final. in addition, we hope to get around to do some- thing about the TIFF support in PIL before 1.0 final. a new TIFF driver is in the works. this may include an optional libtiff interface. and the documentation will be updated, of course. if there's anything else you would like me to look at, please tell me asap. Cheers /F fredrik@pythonware.com http://www.pythonware.com From da@skivs.ski.org Mon Jan 11 21:42:23 1999 From: da@skivs.ski.org (David Ascher) Date: Mon, 11 Jan 1999 13:42:23 -0800 (Pacific Standard Time) Subject: [Image-SIG] Fix for use of tkImaging as a dynloadable command Message-ID: Starting with PIL 1.0b1, I've managed to patch tkImaging so that it can be loaded dynamically from an unmodified tk or _tkinter. It's surprisingly not too bad, once one has done it for Togl =). The patches are very minor, but require changing the name of the init function to Tkimaging_Init (that's a requirement of the dynloading of Tk -- it has to be Upper_Init). That function should read: int Tkimaging_Init(Tcl_Interp* interp) { if (Tcl_PkgProvide(interp, "Tkimaging", "1.0") != TCL_OK) { return TCL_ERROR; } Tcl_CreateCommand(interp, "PyImagingPhoto", PyImagingPhoto, (ClientData) NULL, (Tcl_CmdDeleteProc*) NULL); return TCL_OK; } I suppose one could have two entry points, but that seems gross. and ImageTk.py should be modified to read: in class PhotoImage, __init__, insert the indicated code: self.__mode = mode self.__size = size #<<< # load the Tkimaging Tk extension in the master's interpreter # if it's isn't there already DAA - Jan 99 if kw.has_key('master'): kw['master'].tk.call('package', 'require', 'Tkimaging') else: if Tkinter._default_root is None: Tk().tk.call('package', 'require', 'Tkimaging') else: Tkinter._default_root.tk.call('package', 'require', 'Tkimaging') #>>> self.__photo = apply(Tkinter.PhotoImage, (), kw) and then the usual stuff about actually getting the thing to a place in which it's recognized as a package with: ../lib/tk8.0> mkdir tkImaging ../lib/tk8.0> cp /tkImaging.dll tkImaging/tkImaging.dll ../lib/tk8.0> tclsh80.exe % pkg_mkIndex tkImaging % exit [replacing tkImaging.dll with tkImaging.so on appropriate platforms] [the case of the filenames might be important on unix, I don't know] I haven't tested it very thoroughly, but it seems to work ok for me so far. I propose that these patches be added to PIL for future releases. Having dynamically loaded extensions is a GoodThing(tm). --david PS: I have a .pyd of the PIL 1.0b1 with jpeg included if anyone is interested in avoiding the compilation process (and of course the tkImaging.dll mentioned above). Also, you can have my VC5 directory if you want, but it'll require some tweaking depending on where you have other things. Just email me. [I use 1.5.2b1]. PPS: Fredrik -- FYI, I still have that problem with the Adobe CMYK file -- is that just a difference of opinion among 'standards'? From fredrik@pythonware.com Tue Jan 12 07:35:59 1999 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 12 Jan 1999 08:35:59 +0100 Subject: [Image-SIG] Fix for use of tkImaging as a dynloadable command Message-ID: <00be01be3e02$95d47ca0$f29b12c2@pythonware.com> David Ascher wrote: >Starting with PIL 1.0b1, I've managed to patch tkImaging so that it can be >loaded dynamically from an unmodified tk or _tkinter. It's surprisingly >not too bad, once one has done it for Togl =). > >The patches are very minor, but require changing the name of the init >function to Tkimaging_Init (that's a requirement of the dynloading of Tk >-- it has to be Upper_Init). Interesting. I have similar patches that does it the other way -- it calls a function in _imaging.dll with a pointer to the Tcl interpreter. In other words, I let Python do the dynamic loading... >I propose that these patches be added to PIL for future releases. Having >dynamically loaded extensions is a GoodThing(tm). One of these solutions will definitely be added before 1.0 final. >PPS: Fredrik -- FYI, I still have that problem with the Adobe CMYK file -- >is that just a difference of opinion among 'standards'? Didn't get around to fix that before the 1.0b1 release (the code was "frozen" before I got your sample. In the meantime, you can try removing the following two lines from JpegImagePlugin.py: if self.mode == "CMYK" and self.info.has_key("adobe"): rawmode = "CMYK;I" # Photoshop 2.5 is broken! Cheers /F fredrik@pythonware.com http://www.pythonware.com From gherron@aw.sgi.com Tue Jan 12 19:26:38 1999 From: gherron@aw.sgi.com (Gary Herron) Date: Tue, 12 Jan 1999 11:26:38 -0800 Subject: [Image-SIG] PIL 1.0b1 finally available for download References: <015901be3c0e$98f34100$f29b12c2@pythonware.com> Message-ID: <369BA1EE.B47DE6FF@aw.sgi.com> Fredrik Lundh wrote: > > Some 30,000 lines of shining new code is now available > via http://www.pythonware.com/downloads.htm > I've built the new PIL on my UNIX system, and it seems to work (at least no old code broke). So now I have two questions: (1) Is there documentation. I'm especially interested in the bilinear/bicubic sampling. (2) Is there a Windows/NT loader yet. I have an NT application which could benefit from the new version. Thanks for your help, Gary Herron -- +-------------------+-----------------------------------+ | Dr. Gary Herron | E-mail: gherron@aw.sgi.com | | Alias | Wavefront | Snail-mail: Alias | Wavefront | | 206-287-5616 | 1218 3rd Ave, Floor 8 | | | Seattle WA 98101 | +-------------------+-----------------------------------+ From fredrik@pythonware.com Wed Jan 13 08:39:49 1999 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 13 Jan 1999 09:39:49 +0100 Subject: [Image-SIG] PIL 1.0b1 finally available for download Message-ID: <01ce01be3ed0$498fc0b0$f29b12c2@pythonware.com> > (1) Is there documentation. I'm especially interested in > the bilinear/bicubic sampling. Just pass Image.BILINEAR or Image.BICUBIC as an extra argument to resize/rotate/transform. The docs will be updated in 1.0 final (I'll post on the site as soon as they are finished). > (2) Is there a Windows/NT loader yet. I have an NT > application which could benefit from the new version. In a recent Image SIG mail, David Ascher wrote: I have a .pyd of the PIL 1.0b1 with jpeg included if anyone is interested in avoiding the compilation process (and of course the tkImaging.dll mentioned above). Also, you can have my VC5 directory if you want, but it'll require some tweaking depending on where you have other things. Just email me. [I use 1.5.2b1]. We'll release a new PY15 when both PIL and 1.5.2 goes final (that is, within 30 days or so). Cheers /F fredrik@pythonware.com http://www.pythonware.com From joe@strout.net Wed Jan 13 20:56:23 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 13 Jan 1999 12:56:23 -0800 Subject: [Image-SIG] PIL still alive? Message-ID: I just downloaded a fresh copy of (Mac) Python with PIL. The Read Me sez: >I've decided to skip the 0.2final, and instead update the version >number to reflect the large number of new features that made their >way into the library during the 0.2 beta phase. To compensate, I >plan to make a quick test cycle for 0.3. There will probably be only >one beta (including the handbook), in mid-June, followed by a >0.3final towards the end of the month. That was in June of 1997, a year and a half ago. What's the deal? (There's no indication of who "I" refers to, and the only address given was this image-sig one.) What happened to PIL? Did it just get dropped for lack of interest? Or has it actually been updated in the last 1.5 years, and I somehow grabbed an old version? Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout developer: MacOS, Unix, 3D, AI | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From cgw@pgt.com Wed Jan 13 21:09:46 1999 From: cgw@pgt.com (Charles G Waldman) Date: Wed, 13 Jan 1999 16:09:46 -0500 (EST) Subject: [Image-SIG] PIL still alive? In-Reply-To: References: Message-ID: <13981.2970.484125.98969@janus.pgt.com> Joseph J. Strout writes: > That was in June of 1997, a year and a half ago. What's the deal? > (There's no indication of who "I" refers to, and the only address given was > this image-sig one.) Frederik Lundh announced the availability of version 1.0b1 just a few days ago. See http://www.python.org/pipermail/image-sig/1999-January/000603.html > What happened to PIL? Did it just get dropped for lack of > interest? No. Some of us are *quite* interested in PIL and use it every day in our work. > Or has it actually been updated in the last 1.5 years, and I > somehow grabbed an old version? Sounds like.... From Jack.Jansen@cwi.nl Wed Jan 13 23:02:26 1999 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Thu, 14 Jan 1999 00:02:26 +0100 Subject: [Image-SIG] PIL still alive? In-Reply-To: Message by Charles G Waldman , Wed, 13 Jan 1999 16:09:46 -0500 (EST) , <13981.2970.484125.98969@janus.pgt.com> Message-ID: Recently, Charles G Waldman said: > Joseph J. Strout writes: > > That was in June of 1997, a year and a half ago. What's the deal? > > (There's no indication of who "I" refers to, and the only address given wa > s > > this image-sig one.) > > Frederik Lundh announced the availability of version 1.0b1 just a few > days ago. ... and the MacPython 1.5.2b1 distribution, which Just is packaging as we speak, will contain it. Absolutely untested, but hey, that's what beta software is, isn't it? :-) Seriously: I would really like it if there was some sort of automatic test suite for PIL. Nothing fancy, but something that would check that the basic functionality was there, sort of similar to what the python test.autotest does. It shouldn't be too hard, I guess, to do some operations on a 2x2 image or something similarly small that at least show that things don't crash immedeately. This would really help my confidence tests before doing a Mac distribution. -- 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 From r.hooft@euromail.net Thu Jan 14 14:10:20 1999 From: r.hooft@euromail.net (Rob Hooft) Date: Thu, 14 Jan 1999 15:10:20 +0100 (MET) Subject: [Image-SIG] raw decoder change 0.3a4 -> 1.0b1 Message-ID: <13981.64204.377284.363505@octopus.chem.uu.nl> With 0.3a4, I could do: im=Image.fromstring("P",(self.h.xsize,self.h.ysize), data.astype(Numeric.Int8).tostring(),"raw","L") im.palette=Palette(self.palette) This now gives a "ValueError" exception. I currently (1.0b1) have the code: im=Image.fromstring("L",(self.h.xsize,self.h.ysize), data.astype(Numeric.Int8).tostring(),"raw","L") im.mode="P" im.palette=Palette(self.palette) Just to make sure: is this "proper-PIL" coding? Any cleaner alternatives? Rob -- ===== R.Hooft@EuroMail.net http://www.xs4all.nl/~hooft/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= From gherron@aw.sgi.com Thu Jan 14 19:54:21 1999 From: gherron@aw.sgi.com (Gary Herron) Date: Thu, 14 Jan 1999 11:54:21 -0800 Subject: [Image-SIG] PIL 1.0b1 finally available for download References: <015901be3c0e$98f34100$f29b12c2@pythonware.com> Message-ID: <369E4B6D.EE2BE23C@aw.sgi.com> Fredrik Lundh wrote: > > Some 30,000 lines of shining new code is now available > via http://www.pythonware.com/downloads.htm > > give it a try and tell me what doesn't work. > > on official announcement will follow on monday > (unless everyone on this list tells me the release > is seriously broken, of course). > > Cheers /F > http://www.pythonware.com/people/fredrik/status.htm > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://www.python.org/mailman/listinfo/image-sig I found a small bug (typo actually) in PIL-1.01b. The file is Imaging-1.0b1/libImaging/Geometry.c. One of the calls that *should* be call a bicubic filter actually calls a bilinear filter. Here is a patch, however it would probably be easier to just hand edit it. *** Geometry.c.~1~ Sat Jan 9 11:58:35 1999 --- Geometry.c Thu Jan 14 11:40:31 1999 *************** *** 442,448 **** else if (im->image32) { switch (im->type) { case IMAGING_TYPE_UINT8: ! return bilinear_filter32RGB; case IMAGING_TYPE_INT32: return bicubic_filter32I; case IMAGING_TYPE_FLOAT32: --- 442,448 ---- else if (im->image32) { switch (im->type) { case IMAGING_TYPE_UINT8: ! return bicubic_filter32RGB; case IMAGING_TYPE_INT32: return bicubic_filter32I; case IMAGING_TYPE_FLOAT32: -- +-------------------+-----------------------------------+ | Dr. Gary Herron | E-mail: gherron@aw.sgi.com | | Alias | Wavefront | Snail-mail: Alias | Wavefront | | 206-287-5616 | 1218 3rd Ave, Floor 8 | | | Seattle WA 98101 | +-------------------+-----------------------------------+ From seant@iname.com Wed Jan 27 04:47:37 1999 From: seant@iname.com (Sean True) Date: Tue, 26 Jan 1999 23:47:37 -0500 Subject: [Image-SIG] image.show() for Windows? Message-ID: <3.0.5.32.19990126234737.008416b0@pop.ne.mediaone.net> I suppose that I could employ the same strategy used in Unix: write a temp file and display it from an external program. But I was hoping for a utility function that would create a window and display it as a DIB, directly. Anyone got one? -- Sean ========== Sean True seant@iname.com http://striper.ne.mediaone.net