From jiang@geosun.indstate.edu Fri Oct 3 18:23:03 1997 From: jiang@geosun.indstate.edu (Yu Jiang) Date: Fri, 3 Oct 1997 12:23:03 -0500 Subject: [IMAGE-SIG] histogram Message-ID: <199710031723.MAA26221@geosun> Hi Everybody, I created a big image by merging a number of small images together using PIL. However, the big image looks like a chess board because the histograms of the each small images are different. I want to smooth the chess board like stuff by uniting the histogram of the big image. I wonder anybody can give me any hint of doing so? Thanks! Huey _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From amk@magnet.com Sun Oct 5 01:38:53 1997 From: amk@magnet.com (Andrew Kuchling) Date: Sat, 4 Oct 1997 20:38:53 -0400 (EDT) Subject: [IMAGE-SIG] histogram In-Reply-To: <199710031723.MAA26221@geosun> (jiang@geosun.indstate.edu) Message-ID: <199710050038.UAA26857@lemur.magnet.com> jiang@geosun.indstate.edu (Yu Jiang) wrote: >I created a big image by merging a number of small images together >using PIL. However, the big image looks like a chess board because the >histograms of the each small images are different. I want to smooth >the chess board like stuff by uniting the histogram of the big image. >I wonder anybody can give me any hint of doing so? You might want to ask about this on sci.image.processing, because it may be fairly complicated. You'd have to determine some universal histogram, and recolour all the small images to match that histogram. But I have no idea how you'd get the universal histogram; presumably one would want to have it be as similar as possible to all the histograms on the subimages, in some sense. Even after that, there would probably be visible joins between the subimages because they have different values at the edges. You could run an averaging filter over the joins and try to smooth that out, at the cost of some blurring. Andrew Kuchling amk@magnet.com http://starship.skyport.net/crew/amk/ _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From Dirk.Engelmann@iwr.uni-heidelberg.de Tue Oct 14 14:04:21 1997 From: Dirk.Engelmann@iwr.uni-heidelberg.de (Dirk Engelmann) Date: Tue, 14 Oct 1997 15:04:21 +0200 (MET DST) Subject: [IMAGE-SIG] Text in Image? Message-ID: Hi! First, I would like to know, if there is a image-format were I can put a comment or note into the image (not into the grafics). Second, I've got problems with putting text into an image. The font conversion to pil was correctly working. If I have a something like this: import Image import ImageDraw im = Image.open("testimage.ppm") draw = ImageDraw.ImageDraw(im) draw.text((20,20), "text") I get an error message: draw.text((20,20), "text") File "/home/dengel/applications/Python/extensions/Imaging/Imaging/Lib/ImageDraw.py", line 68, in text m = self.font.getmask(text) File "/home/dengel/applications/Python/extensions/Imaging/Imaging/Lib/ImageFont.py", line 84, in getmask im.im.paste(self.image.im.crop(tuple(m[6:10])), SystemError: NULL result without error in call_object I looked into ImageFont and ImageDraw module, but it wasn't quite clear to me what went wrong - or if it's my fault. Thanks for help! Cheers, Dirk Engelmann _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From Dirk.Engelmann@iwr.uni-heidelberg.de Wed Oct 15 11:04:17 1997 From: Dirk.Engelmann@iwr.uni-heidelberg.de (Dirk Engelmann) Date: Wed, 15 Oct 1997 12:04:17 +0200 (MET DST) Subject: [IMAGE-SIG] ImageTk Problem with PIL-0.3a1 Message-ID: Hi! I've got a Problem with ImageTk in PIL-0.3a1. I.e. the thresholder.py as an example doesn't work. In PIL-0.2b4 it is working fine. Is this a problem of PIL 0.3a1 or is it a problem of configuration ? The command in threshold.py which causes the error is: self.canvas.create_image(0, 0, image=self.backdrop, anchor=Tk.NW) The error message is: File "thresholder.py", line 24, in __init__ self.backdrop = ImageTk.PhotoImage(im) File "/home/dengel/applications/Python/extensions/Imaging/Imaging/Lib/ImageTk.py", line 65, in __init__ self.paste(image) File "/home/dengel/applications/Python/extensions/Imaging/Imaging/Lib/ImageTk.py", line 81, in paste self.__photo.tk.call("PyImagingPhoto", self.__photo, block.id) TclError: invalid command name "PyImagingPhoto" Thanks for help! Cheers, Dirk Engelmann _______________ 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@image.combitech.se Wed Oct 15 13:29:32 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Wed, 15 Oct 1997 13:29:32 +0100 Subject: [IMAGE-SIG] ImageTk Problem with PIL-0.3a1 Message-ID: <01bcd965$fd571c00$6fadb4c1@fl-pc.image.ivab.se> >TclError: invalid command name "PyImagingPhoto" The Tk interface was changed between 0.2 and 0.3; in 0.2, PIL used a custom Tk image type, in 0.3, it uses a command instead. This error seems to indicate that you're still using the 0.2 interface code. Make sure to double-check the code you have in tkappinit.c so it matches the instructions in the 0.3 readme, and rebuild your _tkinter module. Cheers /F PS. In 0.3a1, there's a bogus reference to something called ImagingCrack. If you get linker problems, just comment away that call in _imagingmodule.c. _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From hannu@trust.ee Wed Oct 15 18:05:38 1997 From: hannu@trust.ee (Hannu Krosing) Date: Wed, 15 Oct 1997 20:05:38 +0300 Subject: [IMAGE-SIG] Are there any font rasterizers supported by PIL? Message-ID: <3444F7E2.F91210DC@sid.trust.ee> Hi, Are there any font rasterizers supported by PIL? I mean either Type1 (which could be lifted from the XFree font server) or TrueType (using the freetype library)? Hannu _______________ 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: <3444F7E2.F91210DC@sid.trust.ee> Message-ID: <199710151819.OAA29273@weyr.cnri.reston.va.us> Hannu Krosing writes: > Are there any font rasterizers supported by PIL? > > I mean either Type1 (which could be lifted from the XFree font server) > or TrueType (using the freetype library)? Hannu, There's a new TrueType rasterizer from the freetype project; information is available at http://www.physiol.med.tu-muenchen.de/~robert/freetype.html. The current state is labelled "beta", and I've not had a chance to look at it. It might be usable. There's a Type1 rasterizer calle T1Lib based in part on the X11 Type1 rasterizer, which is currently at "0.3-beta". (Only a little farther along than PIL itself, if version numbers mean anything. ;) It looks pretty cool; I was just planning to work up a quick Python extension for it while my wife & kids are visiting her parents. We'll see if I actually get to it. Once done, I'll announce it to the Image-SIG for preliminary testing. Since it supports antialiased text, it might be good to have as a Canvas item type as well; maybe it should be a Tk-level extension? -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 hannu@trust.ee Wed Oct 15 19:43:54 1997 From: hannu@trust.ee (Hannu Krosing) Date: Wed, 15 Oct 1997 21:43:54 +0300 Subject: [IMAGE-SIG] Are there any font rasterizers supported by PIL? References: <3444F7E2.F91210DC@sid.trust.ee> <199710151819.OAA29273@weyr.cnri.reston.va.us> Message-ID: <34450EEA.81B466ED@sid.trust.ee> Fred L. Drake wrote: > Hannu Krosing writes: > > Are there any font rasterizers supported by PIL? > > > > I mean either Type1 (which could be lifted from the XFree font server) > > or TrueType (using the freetype library)? > > Hannu, > There's a new TrueType rasterizer from the freetype project; > information is available at > http://www.physiol.med.tu-muenchen.de/~robert/freetype.html. The > current state is labelled "beta", and I've not had a chance to look at > it. It might be usable. It is the one that inspired my question. Seems to very neat rasterizing,can also do antialiased text (only diagonals, leaving horisontals and verticals intact.) > There's a Type1 rasterizer calle T1Lib based in part on the X11 Type1 > rasterizer, which is currently at "0.3-beta". (Only a little farther > along than PIL itself, if version numbers mean anything. ;) It looks > pretty cool; I was just planning to work up a quick Python extension > for it while my wife & kids are visiting her parents. We'll see if I > actually get to it. Once done, I'll announce it to the Image-SIG for > preliminary testing. Since it supports antialiased text, it might be > good to have as a Canvas item type as well; maybe it should be a > Tk-level extension? I don't have enough time presently to promise to try the same with freetype, even tho I'm eager to try. When and if I will try it, I will check your status to syncronize the efforts. Anyhow I advise you to take a look at the freetype API to make sure that the implementations of both rasterizers should look alike from the users point of view. Hannu _______________ 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." I was just working on my interface to the t1lib Type1 font rasterizer, and determined (without RTFS!) that there is a rawmode value "1;IR" which does both "1;I" and "1;R". Fredrik, you might want to document this, or at least that the flags after the semi-colon are cumulative in some way, because this proved useful. Thanks for getting it right! ;-) At the moment, the t1lib interface is ~1000 lines of (mostly boilerplate) C, ~300 lines of Python to wrap a nice O-O model around it, and less than 100 lines of Python to support integration with PIL. The two Python modules will probably grow a bit before I'm done, and there's no documentation to speak of, but the C extension provides a 1-to-1 correspondence with t1lib, excepting the X11 support (which I still need to deal with, but mostly to prevent link failures when it's there, since everyone would be expected to use the PIL interface). -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 dave@zeus.hud.ac.uk Thu Oct 23 08:53:18 1997 From: dave@zeus.hud.ac.uk (Dave Dench) Date: Thu, 23 Oct 1997 08:53:18 +0100 Subject: [IMAGE-SIG] Mac PPC1.4 + PIL + NumPy Message-ID: <199710230753.IAA01609@ye.csm> Dear All, Does anyone have a Mac PPC python 1.4 binary complete with PIL and NumPy available on-line? I am having an inordinate amount of difficulty downloading the versions from Jack Jansen's site. It seems to be a permanently slow link. Best wishes, David ________________________________________________________________________________ ************************************************ * David Dench * * The University of Huddersfield , UK * * Tel: 01484 472083 * * email: d.j.dench@hud.ac.uk * ************************************************ ________________________________________________________________________________ _______________ 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." I mentioned a week or so ago that I've been working on an extension which provides access to the t1lib library; this library is a rasterizer for Type1 fonts. I have a question regarding how others would like to see the integration of t1lib with PIL. The structure of my package includes the following modules: _t1lib -- C extension providing low-level access to the C t1lib implementation t1lib -- Python modules which wraps things up in a sensible, O-O interface which is what would actually be used t1Imaging -- Python module integrating the t1lib module with PIL The t1lib module provides a number of functions and classes. For my question, only the organization of a few of these is really relevant. class FontSetter -- provides operations to rasterize characters and strings in a given font with parameters set through the constructor class Glyph -- the result of the rasterizing methods of the FontSetter; encapsulates the bitmap information Both of these classes are subclassed by t1Imaging; the FontSetter subclass creates instances of the Glyph subclass which actually performs most of the integration. The Glyph subclass provides a new method which returns an Image.Image instance which can be used to feed image operations or a graphical display. This gets to the issue I have and my question for the SIG. I am starting to think that the interface might be improved by doing something a little different. The Glyph subclass created to perform the PIL integration could actually be a subclass of both Image.Image and t1lib.Glyph; the glyph object returned by the rasterizing methods could simply be used directly anywhere a PIL image is used. This had the advantage of a simple model, but the disadvantage of not being able to delay creation of the PIL image until it's actually requested. (Creating the PIL image is actually pretty cheap, as it uses the Image.fromstring(..., "raw", ...) operation.) What are other people's thoughts on this? I still need to write a demo program; perhaps seeing how that goes will help resolve the question. As far as my status on this goes: the implementation seems stable, but I'm still working on docstring and an HTML page will be necessary. I'd like to be able to generate a better document, so I've spent a little time enhancing a .py->HTML converter I played with a while ago, but I keep running across limitations in the work I'd done on the thing long ago; so I may settle for docstrings only for now. Once I've improved the documentation a bit I'll make it available for the SIG. I still have a few questions for the author of t1lib; hopefully I'll be able to get a message off to him in the next day or two. -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 Dirk.Engelmann@iwr.uni-heidelberg.de Fri Oct 31 16:32:18 1997 From: Dirk.Engelmann@iwr.uni-heidelberg.de (Dirk Engelmann) Date: Fri, 31 Oct 1997 17:32:18 +0100 (MET) Subject: [IMAGE-SIG] Tk-events in PIL ? Message-ID: Hi! How can I handle tk-events in PIL ? I would like to have an image "in the background" and get i.e. mouse coordinates if the mouse button is clicked onto the image. Thanks for help! Cheers, Dirk Engelmann _______________ 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 Fri Oct 31 17:28:51 1997 From: fredrik@pythonware.com (Fredrik Lundh) Date: Fri, 31 Oct 1997 18:28:51 +0100 Subject: SV: [IMAGE-SIG] Tk-events in PIL ? Message-ID: <9710311728.AA25436@arnold.image.ivab.se> > How can I handle tk-events in PIL ? As you'd handle them in Tkinter... > I would like to have an image "in the background" and > get i.e. mouse coordinates if the mouse button > is clicked onto the image. Simply display the image in a label (or perhaps a canvas), and bind an event handler to that widget. See the sample files provided with PIL and Guido's Tkinter demos provided with the 1.4 source distribution (Demo/tkinter/guido). 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 _______________