From samuelv@hotmail.com Fri Aug 8 00:43:55 1997 From: samuelv@hotmail.com (Samuel Villamonte) Date: Thu, 07 Aug 1997 16:43:55 PDT Subject: [IMAGE-SIG] Problem with PIL 0.3a1 and Grail Message-ID: <199708072343.QAA23197@f28.hotmail.com> Hello: I don't know if this has been reported before, but in my PC the new PIL release seems to crash my copy of Grail 0.3 final. i think the problem is in the module AsyncImage.py of the Grail distribution, which tries to find out if PIL is available and works with Tk, creating an PhotoImage; look here, --extract from AsyncImage.py, lines 27-37: import Image import ImageTk # Now check the integration with Tk: try: ImageTk.PhotoImage(Image.new("L", (1, 1))) except TclError: use_pil = 0 else: import ImageDraw PILPhotoImage = ImageTk.PhotoImage use_pil = 1 Maybe the problem is that the code doesn't specifies the parent frame it should be on, and this interferes with the new features of ImageTk in PIL 0.3. Another reason could be that the test image object should be created a "bit" earlier before attaching it to the frame, don't know much about that. The thing is that it seemed to work fine with PIL 0.2b4 and now it doesn't. And another question that must have been answered before: well..., Who is Lena? Just curious :) Samuel Villamonte samuelv@hotmail.com ______________________________________________________ Get Your Private, 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 fredrik.lundh@image.combitech.se Fri Aug 8 08:59:37 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Fri, 8 Aug 1997 09:59:37 +0200 Subject: [IMAGE-SIG] Problem with PIL 0.3a1 and Grail Message-ID: <9708080858.AA13502@arnold.image.ivab.se> >I don't know if this has been reported before, but in my PC the new PIL >release seems to crash my copy of Grail 0.3 final. I think the problem >is in the module AsyncImage.py of the Grail distribution, which tries to >find out if PIL is available and works with Tk, creating an PhotoImage. The problem is more intricate than that; the AsyncImage module inherits from the ImageTk PhotoImage class, without calling it's constructor. Since the inner workings of the class was changed, Grail no longer set things up correctly, and the ImageTk module then raised an exception when called from _tkinter. Unfortunately, _tkinter wasn't prepared to handle that situation... Here's a quick fix: In AsyncImage.py, in the PILAsyncImage constructor, change: self._PhotoImage__tk = self.image to self._PhotoImage__photo = self.image (you could simply add the second line just after the first one; should make it work with both versions of PIL). I started working on a better solution, but got distracted by more urgent stuff :-( 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 emlist@braznet.com.br Fri Aug 8 18:25:14 1997 From: emlist@braznet.com.br (E.M.L.) Date: Fri, 08 Aug 1997 14:25:14 -0300 Subject: [IMAGE-SIG] Font types with PIL Message-ID: <33EB567A.15FB7483@braznet.com.br> i am new to this list so i would like to apologize if i am being too obvious. is there a way to write a character string onto an image and use different or personalized types of fonts? is there any limit for fonts? thanks in advance. Paulo B. Bloedorn web@braznet.com.br emlist@braznet.com.br Braznet - Brazilian Network _______________ 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 Fri Aug 8 19:42:22 1997 From: amk@magnet.com (Andrew Kuchling) Date: Fri, 8 Aug 1997 14:42:22 -0400 (EDT) Subject: [IMAGE-SIG] Font types with PIL In-Reply-To: <33EB567A.15FB7483@braznet.com.br> (emlist@braznet.com.br) Message-ID: <199708081842.OAA22007@lemur.magnet.com> >is there a way to write a character string onto an image and use >different or personalized types of fonts? >is there any limit for fonts? There doesn't seem to be any support for fonts in 0.3a1, though only Fredrik knows what he's implemented for future releases. Assuming you have bitmaps for the characters, the paste() method of Image objects could be used to add them to an image, but getting those bitmaps is the tough part! You'd have to either convert font files to a bunch of files that PIL can read, one file per character, or write Python code to read the font files and generate bitmaps. Actually, this would make a very interesting project for someone looking to improve their Python/PIL skills, and would (mostly) be feasible in pure Python. A possible design: * An ImageWriter class analogous to the existing ImageDraw class; ImageWriter requires the image to be written on, and an instance of the Font class (see below). Various methods write one or more characters to the image, updating the current position; there are also utility methods to do things like fit a string of text into a given box, move the current position, and so forth. * Font objects encapsulate the information about a font, such as the bitmap (and its size) for each character. Font objects could also expose kerning information, which could be used by the ImageWriter class in updating the current position after each character. For example, if the previously written character was a 'T', the current character may be able to nestle underneath the crossbar to some degree. * Various functions which read font files and return a corresponding Font object: ReadTTFont(), ReadAFMFont(), etc. This is the only part which might have to be written in C, depending on the complexity of the format and the computations required to render it. Possible starting points: * The FreeType project is a freeware library (under the LGPL) to render TrueType fonts. A PIL interface to it would be quite useful. http://www.physiol.med.tu-muenchen.de/~robert/freetype.html * I have code to read TeX's gf-format files. I also once wrote some code to read TrueType font files, but not to render them (which is the complicated part!). http://starship.skyport.net/crew/amk/unmaintained/ 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 fredrik.lundh@image.combitech.se Fri Aug 8 21:30:26 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Fri, 8 Aug 1997 22:30:26 +0200 Subject: [IMAGE-SIG] Font types with PIL Message-ID: <9708082022.AA11078@arnold.image.ivab.se> >There doesn't seem to be any support for fonts in 0.3a1, >though only Fredrik knows what he's implemented for future releases. Well, in fact there is some undocumented stuff in there: 1. there's a text method in the ImageDraw class. it takes a position, and a string, and draws it using a font specified with the setfont method. 2. the ImageFont module contains code to load fonts (generating instances suitable for setfont) 3. the bdf2pil.py script converts fonts in the BDF format (X window source fonts) to a format that can be read by ImageFont. You can find a bunch of BDF files in the X11R6 distribution, or extract them from an X server using the appropriate utilities. I have some incomplete drivers for Mac and Windows raster formats too, but they're not ready for release. Don't know when I'll get time to release the next PIL release; things related to books and PythonWare will occupy 142% of my time for the next few weeks... (And of course, all the stuff outlined by Andrew would of course be really cool...) 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 amk@magnet.com Fri Aug 8 22:03:11 1997 From: amk@magnet.com (Andrew Kuchling) Date: Fri, 8 Aug 1997 17:03:11 -0400 (EDT) Subject: [IMAGE-SIG] Font types with PIL In-Reply-To: <9708082022.AA11078@arnold.image.ivab.se> (fredrik.lundh@image.combitech.se) Message-ID: <199708082103.RAA26094@lemur.magnet.com> "Fredrik Lundh" wrote: >Well, in fact there is some undocumented stuff in there: Oh, very good! That undocumented stuff is about 75% of what's required; all that's needed is to write higher-level functions that keep track of the cursor position, and more conversion programs for different font formats. A question: why does getmask() assemble the mask for the entire string, as opposed to having Image.text() loop over each character and update a position? Then getmask() would be essentially a dictionary retrieval--take character, return Image object containing bitmap--and ImageFont objects become just a collection of data. I'm simply curious why things were implemented the way they are... >Don't know when I'll get time to release the next PIL release; things >related to books and PythonWare will occupy 142% of my time for the >next few weeks... Ah, well... we'll be waiting for it with bells on. :) (Particularly the tostring()/fromstring() fixes, in my case; I promise to write a generic Numeric-to-PIL-and-back conversion function.) 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 Daniel.Michelson@smhi.se Wed Aug 13 11:56:06 1997 From: Daniel.Michelson@smhi.se (Daniel Michelson) Date: Wed, 13 Aug 1997 12:56:06 +0200 Subject: [IMAGE-SIG] stamping strings Message-ID: <33F192C6.5358@smhi.se> Hej, Using PIL, is it possible to stamp a string into a given image? I'm experimenting with PSDraw and an not making any headway. Even if this strategy did work, it would be inferiour to just defining a string, a font, a position and and a method of stamping it... Any tips? best, -d +------------------+--------------------------------------------------+ | | Daniel B. Michelson | | /\ |\ /| | | | | Swedish Meteorological and Hydrological Institute| | \ | \/ | |__| | | S-601 76 Norrk=F6ping, Sweden |= | \ | | | | | | Telephone: +46 11 - 15 84 94 | | \/ | | | | | | Telefax: +46 11 - 17 02 07 | | | Internet: Daniel.Michelson@smhi.se | +------------------+--------------------------------------------------+ _______________ 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 Thu Aug 14 10:23:13 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Thu, 14 Aug 1997 11:23:13 +0200 Subject: [IMAGE-SIG] stamping strings Message-ID: <9708140914.AA27961@arnold.image.ivab.se> >Using PIL, is it possible to stamp a string into a given image? I'm >experimenting with PSDraw and an not making any headway. Even if this >strategy did work, it would be inferiour to just defining a string, a >font, a position and and a method of stamping it... Yes, it can be done, using the (undocumented) font support in ImageDraw (see a recent post for an overview). Roughly, you'll have to: 1) find a suitable font in the PILfont format (use "bdf2pil.py" to convert BDF font files to this format, and the X utility "fstobdf" to extract suitable fonts from your X server... if you use Windows, you can get BDF fonts from the X11R6 distribution which are available in many places on the net). (SMHI-specifikt: fast du kan fvrstes titta i den senaste itip-distributionen pe earth, jag tror det ska finnas ett gdng konverterade fonter i ett under- bibliotek som heter BDF) 2) load the font using the stuff in the ImageFont module 3) create an ImageDraw object, and use the setfont method to set the font 4) use the text method to draw the actual text into the image Caveat: as of 0.3a1, the ImageDraw package still doesn't work on RGB/CMYK images. In this case, you can draw into a mode 1 image, create a blank image (initialized to the appropriate colour) with the same size as the drawing, and use paste to paste the colour onto the original image, using the drawing as a bitmap. I'm afraid you have to use the source for more details; when I get the time, I'll post something on various ways to combine draw and paste to do overlays, watermarks, etc. 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 Daniel.Michelson@smhi.se Thu Aug 14 12:16:30 1997 From: Daniel.Michelson@smhi.se (Daniel Michelson) Date: Thu, 14 Aug 1997 13:16:30 +0200 Subject: [IMAGE-SIG] broken ImageFont Message-ID: <33F2E90E.1A9F@smhi.se> Hej, I got pretty far but: import Image, ImageDraw, ImageFont test =3D "This is a test." this =3D Image.new("1", (512, 512)) font =3D ImageFont.load("courBO18.pil") draw =3D ImageDraw.ImageDraw(this) draw.setfont(font) draw.setink(0) draw.text((0,0), test) Traceback (innermost last): File "text.py", line 10, in ? draw.text((0,0), teststring) File "...Imaging/Lib/ImageDraw.py", line 68, in text m =3D self.font.getmask(text) File "...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 What next? best, -d +------------------+--------------------------------------------------+ | | Daniel B. Michelson | | /\ |\ /| | | | | Swedish Meteorological and Hydrological Institute| | \ | \/ | |__| | | S-601 76 Norrk=F6ping, Sweden |= | \ | | | | | | Telephone: +46 11 - 15 84 94 | | \/ | | | | | | Telefax: +46 11 - 17 02 07 | | | Internet: Daniel.Michelson@smhi.se | +------------------+--------------------------------------------------+ _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From cjr@bound.xs4all.nl Thu Aug 14 19:07:30 1997 From: cjr@bound.xs4all.nl (Case Roole) Date: Thu, 14 Aug 1997 19:07:30 +0100 (WET DST) Subject: [IMAGE-SIG] [Q] GIF as string Message-ID: <199708141807.TAA03318@axiom.bound.xs4all.nl> I'd like to put a string representation of a GIF - actually, the PythonPowered logo - in a script. This is to be used to create a Tkinter PhotoImage by calling PhotoImage(data=imagevar). The image2py script in PIL seems to be just what I need, but PIL 0.2b4 seems to be at odds with the transparant background of the GIF and my (Linux) system seems to be at odds with PIL 0.3a1. (If this is still the case when I have given the matter a better look, I'll of course send a report to this list.) My question: is there an alternative way to convert a simple gif to a string usable as data for the creation of a PhotoImage? cjr -- Case Roole _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From jiang@geosun.indstate.edu Fri Aug 15 17:32:38 1997 From: jiang@geosun.indstate.edu (Yu Jiang) Date: Fri, 15 Aug 1997 11:32:38 -0500 Subject: [IMAGE-SIG] Animation Message-ID: <199708151632.LAA02050@geosun.indstate.edu> Hi Everybody, I have displayed a .tif file in a canvas with scrollbars, by importing PIL. Now I need to do such a thing: As the scrollbars move, the image will rotate according to the scrollbar's position, such as left, right. I can make the image to rotate an angle by calling Image.rotate() of PIL, however, I failed to make the image to continue to rotate according to the scrollbars's positions. I hope somebody can help me out, or tell me what manual I can read. So far, I tried to achieve this goal by a strategy of 'copy & paste': 1) As scrollbars moved in a new position, copy the original image by PIL copy function: im = image.copy() 2) Then rotate it by im.rotate(angle) 3) Finally, paste it on the original: image.paste(im) def rePaint(self, angle): im = self.image.copy() im.rotate(angle) self.image.paste(im) self.update_idletasks() However, my code does not work, nor with error. I hope somebody help me. Thank you! huey _______________ 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 Mon Aug 18 12:56:39 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Mon, 18 Aug 1997 13:56:39 +0200 Subject: [IMAGE-SIG] ANNOUNCE: on-line version of PIL documentation Message-ID: <9708181148.AA29511@arnold.image.ivab.se> The PIL handbook is now available as HTML at http://www.pythonware.com/library/pil/handbook This handbook covers most of the stuff in 0.3a1. There's also some PIL related material at: http://www.pythonware.com/library/pil/notes Comments and suggestions are welcome. 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 Daniel.Michelson@smhi.se Tue Aug 19 07:40:41 1997 From: Daniel.Michelson@smhi.se (Daniel Michelson) Date: Tue, 19 Aug 1997 08:40:41 +0200 Subject: [Fwd: [IMAGE-SIG] broken ImageFont?] Message-ID: <33F93FE9.371E@smhi.se> Hej, Nice on-line PIL documentation! = Does anyone (/F) have any suggestions on how to proceed with the issue of stamping strings into an image? To be honest, I have no idea what the error below means other than that I can't stamp my string... On a related matter, /F mentions that new PIL fonts can be created using fstobdf first and bdf2pil.py second. My man pages are very terse on the subject of fstobdf: the -server option "specifies the server from which the font should be read". But what's the correct syntax for the -s option (my hostname doesn't work)? Could someone please give me an example to copy? > import Image, ImageDraw, ImageFont > = > test =3D "This is a test." > = > this =3D Image.new("1", (512, 512)) > font =3D ImageFont.load("courBO18.pil") > draw =3D ImageDraw.ImageDraw(this) > draw.setfont(font) > draw.setink(0) > draw.text((0,0), test) > Traceback (innermost last): > File "text.py", line 10, in ? > draw.text((0,0), teststring) > File "...Imaging/Lib/ImageDraw.py", line 68, in text > m =3D self.font.getmask(text) > File "...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 > = > What next? best, -d +------------------+--------------------------------------------------+ | | Daniel B. Michelson | | /\ |\ /| | | | | Swedish Meteorological and Hydrological Institute| | \ | \/ | |__| | | S-601 76 Norrk=F6ping, Sweden |= | \ | | | | | | Telephone: +46 11 - 15 84 94 | | \/ | | | | | | Telefax: +46 11 - 17 02 07 | | | Internet: Daniel.Michelson@smhi.se | +------------------+--------------------------------------------------+ _______________ 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 Tue Aug 19 09:58:02 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Tue, 19 Aug 1997 10:58:02 +0200 Subject: [Fwd: [IMAGE-SIG] broken ImageFont?] Message-ID: <9708190850.AA12476@arnold.image.ivab.se> > Does anyone (/F) have any suggestions on how to proceed with the issue > of stamping strings into an image? To be honest, I have no idea what the > error below means other than that I can't stamp my string... Not sure either; haven't had time to look further on this problem... Rebuilding the fonts might help (see below). > On a related matter, /F mentions that new PIL fonts can be created using > fstobdf first and bdf2pil.py second. My man pages are very terse on the > subject of fstobdf: the -server option "specifies the server from which > the font should be read". But what's the correct syntax for the -s > option (my hostname doesn't work)? Could someone please give me an > example to copy? The fstobdf utility uses an X11 font server (not a plain X11 display server). It's likely that you don't have a font server running on your host. If I remember correctly, the font server is called "fs". Check the man page and see if you can get that one running. 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 Aug 19 11:26:09 1997 From: Anthony Baxter (Anthony Baxter) Date: Tue, 19 Aug 1997 20:26:09 +1000 Subject: [Fwd: [IMAGE-SIG] broken ImageFont?] In-Reply-To: Your message of "Tue, 19 Aug 1997 10:58:02 +0200." <9708190850.AA12476@arnold.image.ivab.se> Message-ID: <199708191026.UAA24667@jambu.off.connect.com.au> >>> "Fredrik Lundh" wrote > The fstobdf utility uses an X11 font server (not a plain X11 display > server). It's likely that you don't have a font server running on your > host. If I remember correctly, the font server is called "fs". Check > the man page and see if you can get that one running. You can also use various tools to convert whatever your native X11 fonts are to bdf, without needing a fontserver. On openwindows, you can use makebdf or convertfont. There's similar tools with most X11 distributions (often called pcftobdf or something similar). Fonts usually live somewhere like $(X11HOME)/lib/X11/fonts/, where X11HOME is /usr/openwin, /usr/X11R6, or similar. On a related note, has anyone else noticed bdf2pil likes to chop off the bottom of descenders? (eg j,g,y,q,p - particularly noticable with j and g). 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@image.combitech.se Wed Aug 20 05:53:52 1997 From: fredrik.lundh@image.combitech.se (Fredrik Lundh) Date: Wed, 20 Aug 1997 06:53:52 +0200 Subject: [Fwd: [IMAGE-SIG] broken ImageFont?] Message-ID: <9708200445.AA15245@arnold.image.ivab.se> This is a multi-part message in MIME format. ------=_NextPart_000_0000_01BCAD35.D1DB1880 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > File "...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 The attached version of ImageFont.py should eliminate this problem. Cheers /F ------=_NextPart_000_0000_01BCAD35.D1DB1880 Content-Type: application/octet-stream; name="ImageFont.py" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ImageFont.py" # $Id: ImageFont.py,v 1.1 1996/10/04 19:40:50 fredrik Exp $ # # THIS IS WORK IN PROGRESS. # # The Python Imaging Library. # # File: # ImageFont.py -- PIL raster font management # # History: # 96-08-07 fl Created (experimental) # # Copyright (c) Fredrik Lundh 1996. All rights reserved. # # See the README file for information on usage and redistribution. # import Image import math, os, string, sys # -------------------------------------------------------------------- # Font metrics format: # "PILfont" LF # fontdescriptor LF # (optional) key=value... LF # "DATA" LF # binary data: 256*10*2 bytes (dx, dy, dstbox, srcbox) # # To place a character, cut out srcbox and paste at dstbox, # relative to the character position. Then move the character # position according to dx, dy. # -------------------------------------------------------------------- def i16(c): v = (ord(c[0])<<8) + ord(c[1]) if v >= 32768: v = v - 65536 return v class ImageFont: def _load_pilfont(self, filename): fp = open(filename, "rb") # read PILfont header if fp.readline() != "PILfont\n": raise SyntaxError, "Not a PILfont file" d = string.split(fp.readline(), ";") self.ysize = string.atoi(d[6]) self.props = [] # FIXME: should be a dictionary s = fp.readline() while s and s != "DATA\n": self.props.append(s) # read PILfont metrics self.metrics = [] for i in range(256): s = fp.read(20) if len(s) != 20: raise SyntaxError, "Broken PILfont file" m = map(lambda a,s=s: i16(s[a:a+2]), range(0,20,2)) self.metrics.append(m) try: self.image = Image.open(os.path.splitext(filename)[0] + ".gif") except: self.image = Image.open(os.path.splitext(filename)[0] + ".pbm") self.image.load() def getsize(self, str): w = 0 for id in map(ord, str): w = w + self.metrics[id][0] if w == 0: return 0, 0 return w, self.ysize def getmask(self, str): # FIXME: this should be reimplemented in C im = Image.new("1", self.getsize(str), 0) x = 0 for m in map(lambda c, m=self.metrics: m[ord(c)], str): [x0, y0, x1, y1] = m[2:6] im.paste(self.image.crop(tuple(m[6:10])), (x0+x, y0, x1+x, y1)) x = x + m[0] return im # # -------------------------------------------------------------------- def load(filename): "Load a font file." f = ImageFont() f._load_pilfont(filename) return f def load_path(filename): "Load a font file, searching along the Python path." for dir in sys.path: try: return load(os.path.join(dir, filename)) except: pass raise IOError, "cannot find font file" ------=_NextPart_000_0000_01BCAD35.D1DB1880-- _______________ IMAGE-SIG - SIG on Image Processing with Python send messages to: image-sig@python.org administrivia to: image-sig-request@python.org _______________ From Daniel.Michelson@smhi.se Wed Aug 20 09:30:40 1997 From: Daniel.Michelson@smhi.se (Daniel Michelson) Date: Wed, 20 Aug 1997 10:30:40 +0200 Subject: [Fwd: [IMAGE-SIG] broken ImageFont?] References: <9708200445.AA15245@arnold.image.ivab.se> Message-ID: <33FAAB2F.1E71@smhi.se> Hej, > The attached version of ImageFont.py should eliminate > this problem. Thanks. Getting closer... Assuming I want to use a mode "1" Image to write my text, how does one define a palette for such an image? You see, the ImageDraw.text() method propagates down into Image.py and the convert method. To make a long story short: File "/local_disk/python/lib/python1.4/Imaging/Lib/Image.py", line 220, in _makeself new.palette =3D self.palette AttributeError: palette Or should one just concentrate on "P" Images? best, -d +------------------+--------------------------------------------------+ | | Daniel B. Michelson | | /\ |\ /| | | | | Swedish Meteorological and Hydrological Institute| | \ | \/ | |__| | | S-601 76 Norrk=F6ping, Sweden |= | \ | | | | | | Telephone: +46 11 - 15 84 94 | | \/ | | | | | | Telefax: +46 11 - 17 02 07 | | | Internet: Daniel.Michelson@smhi.se | +------------------+--------------------------------------------------+ _______________ 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 Wed Aug 27 19:02:40 1997 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 27 Aug 1997 20:02:40 +0200 Subject: [IMAGE-SIG] ANNOUNCE: PIL 0.3a2 for Windows 95/NT Message-ID: <199708271754.NAA21555@python.org> Just uploaded a kit containing Python 1.4, Tk 8.0b2, and PIL 0.3a2 for Win32 to: http://www.pythonware.com/downloads.htm Note that this is alpha software; don't download it unless you know why you would like to look at it ;-) (a build with Tk 8.0 final will be made available within short) 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 _______________