From jack@oratrix.nl Wed Mar 1 09:35:05 2000 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 01 Mar 2000 10:35:05 +0100 Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: Message by "Jeffrey Kunce" , Tue, 29 Feb 2000 11:23:16 -0600 , Message-ID: <20000301093505.74B9C371868@snelboot.oratrix.nl> You could also try "python -vv" if that is possible on Windows. "python -v" will trace all the import statements, i.e. tell you where all modules were loaded from, and "python -vv" will also tell you where it looked (but didn't find any module). This should probably tell you why _imaging.pyd isn't found. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From fredrik@pythonware.com Wed Mar 1 11:25:01 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 1 Mar 2000 12:25:01 +0100 Subject: [Image-SIG] trouble using PIL on windows References: <000001bf82dd$187d6e80$b5776395@newton> Message-ID: <00ab01bf8370$c94e9750$f29b12c2@secret.pythonware.com> Reza Habib wrote: > Does anyone seem to know why there are these problems with the PIL = module. > None of the other modules I've used have been this difficult to setup? the pil distribution from our site is a patch to our own py15 distribution (available from the same place). if you just unpack it on top of the py15 directories, it should work. others have told me that this patch works just fine with the python.org distribution, but I haven't tried it myself (I don't use the standard distribution, by obvious reasons). I'm still looking for volunteers to create an installer that fits right in with the python.org distro... (the linux folks can handle this, you know ;-). anyone? (it shouldn't take more than an hour or two to set things up, which makes it a rather easy way to earn a lot of cred points ;-) From rm1@student.cs.ucc.ie Thu Mar 2 15:30:43 2000 From: rm1@student.cs.ucc.ie (Robert Moloney) Date: Thu, 2 Mar 2000 15:30:43 +0000 (GMT) Subject: [Image-SIG] PIL on the MAC Message-ID: Hi How do I install PIL on the mac? Do I need a C compiler? Cheers Rob From kuncej@mail.conservation.state.mo.us Fri Mar 3 16:48:45 2000 From: kuncej@mail.conservation.state.mo.us (Jeffrey Kunce) Date: Fri, 03 Mar 2000 10:48:45 -0600 Subject: [Image-SIG] trouble using PIL on windows Message-ID: >I'm still looking for volunteers to create an installer that >fits right in with the python.org distro... (the linux folks >can handle this, you know ;-). anyone? Would you want to use WISE? Or jump on the distutils bandwagon? It wont be hard to simply install the PIL files. This "DLL load failed" = problem may be trickier to deal with. Should "import FixTk" be added to Image.py for windows installations? That seems to fix it for most people. I guess the bigger question was raised by Cristian Echeverria: >A question for the SecretLab People: Why _imaging.dll is linked >to the tcl/tk DLLs ? That means that PIL did t work without tcl/tk? --Jeff From jessw@ritchie.loop.com Sat Mar 4 12:41:57 2000 From: jessw@ritchie.loop.com (Jesse W) Date: Sat, 4 Mar 2000 12:41:57 +0000 Subject: [Image-SIG] PIL Install Woes Message-ID: <200003042042.MAA11606@stevie.loop.com> I am trying to install PIL 2b4-win32 and when I run viewer.py I get this error. Traceback (innermost last): File "viewer.py", line 44, in ? UI(root, im).pack() File "viewer.py", line 23, in __init__ self.image = ImageTk.PhotoImage(im.convert("L")) File "C:\Python\Programs\Imaging-2b4\Lib\ImageTk.py", line 83, in __init__ self.paste(image) File "C:\Python\Programs\Imaging-2b4\Lib\ImageTk.py", line 113, in paste self.__photo.tk.call("PyImagingPhoto", self.__photo, block.id) TclError: invalid command name "PyImagingPhoto" I have tried to find instences of PyImagingPhoto in the source, but there are none. I have done what it says in the install notes, and can import Image. If anyone has any solutions to this error, please let me know. Jesse Weinstein From fredrik@pythonware.com Wed Mar 8 11:56:50 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 8 Mar 2000 12:56:50 +0100 Subject: [Image-SIG] trouble using PIL on windows References: Message-ID: <001601bf88f5$65de5d60$f29b12c2@secret.pythonware.com> Jeffrey Kunce wrote: > >I'm still looking for volunteers to create an installer that > >fits right in with the python.org distro... (the linux folks > >can handle this, you know ;-). anyone? >=20 > Would you want to use WISE? Or jump on the distutils bandwagon? I think I would prefer something like the win32all distribution, which means WISE. > It wont be hard to simply install the PIL files. This "DLL load = failed" problem > may be trickier to deal with. Should "import FixTk" be added to = Image.py > for windows installations? That seems to fix it for most people. sounds reasonable -- but see (4) below. > I guess the bigger question was raised by Cristian Echeverria: >=20 > A question for the SecretLab People: Why _imaging.dll is linked > to the tcl/tk DLLs ? That means that PIL did t work without tcl/tk? PIL 1.0 can be built in three ways: 1) without Tkinter support 2) with Tkinter support in the _tkinter DLL 3) with Tkinter support in the _imaging DLL (2) was used for earlier windows distributions, (3) is used for the current Windows distribution. 1.0.1 will support a fourth alternative: 4) with Tkinter support in a separate _imaging_tk DLL. (thanks to the debian folks, who tricked me in to implementing it ;-) with this on in place, FixTk should probably be imported from ImageTk, not Image. however, I probably don't have time to do a full release of 1.0.1 before next month, but I can definitely provide the necessary patches if someone wants to work on a better windows installation. just let me know. From fredrik@pythonware.com Wed Mar 8 12:00:08 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 8 Mar 2000 13:00:08 +0100 Subject: [Image-SIG] PIL Install Woes References: <200003042042.MAA11606@stevie.loop.com> Message-ID: <002001bf88f5$da6e9af0$f29b12c2@secret.pythonware.com> Jesse wrote: > I am trying to install PIL 2b4-win32 and when I run viewer.py I get=20 > this error. 0.2b4 is over three years old or so. where did you find it? > Traceback (innermost last): > File "viewer.py", line 44, in ? > UI(root, im).pack() > File "viewer.py", line 23, in __init__ > self.image =3D ImageTk.PhotoImage(im.convert("L")) > File "C:\Python\Programs\Imaging-2b4\Lib\ImageTk.py", line 83, in = __init__ > self.paste(image) > File "C:\Python\Programs\Imaging-2b4\Lib\ImageTk.py", line 113, in = paste > self.__photo.tk.call("PyImagingPhoto", self.__photo, block.id) > TclError: invalid command name "PyImagingPhoto" >=20 > I have tried to find instences of PyImagingPhoto in the source, but = there=20 > are none. I have done what it says in the install notes, and can = import=20 > Image. this means that _tkinter doesn't know about PIL. if you insist on using 0.2b4, you need a patched version of _tkinter. the standard version you get with Python won't work. but it's probably better to get the 1.0 distribution from http://www.pythonware.com/downloads.htm (also see the "trouble using PIL on windows" thread) From fredrik@pythonware.com Wed Mar 8 12:11:32 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 8 Mar 2000 13:11:32 +0100 Subject: [Image-SIG] PIL on the MAC References: Message-ID: <002701bf88f7$75f03780$f29b12c2@secret.pythonware.com> Robert Moloney wrote: > How do I install PIL on the mac? > Do I need a C compiler? if you wish to build it from sources, yes. afaik, a precompiled version is included in the standard distribution for macintosh: http://www.python.org/download/download_mac.html http://www.cwi.nl/~jack/macpython.html (so maybe you already have it? what happens if you import the "Image" module? ;-) From jessw@loop.com Sat Mar 11 12:18:01 2000 From: jessw@loop.com (Jesse W) Date: Sat, 11 Mar 2000 12:18:01 +0000 Subject: [Image-SIG] PIL Install Woes In-Reply-To: <002001bf88f5$da6e9af0$f29b12c2@secret.pythonware.com> Message-ID: <200003112019.MAA60398@ritchie.loop.com> I did not realize that .2b4 was old. I got it on http://python.org/sigs/image-sig/Imaging.html the downlode that was available on the page, as opposed to the link to pythonware.com, was for version 2b4. It would be more kind to newbies if you but a stronger warning about downloading the old version. But, on a happier note, I downloaded the new version and it works. Thank you very much, Jesse Weinstein > Jesse wrote: > > I am trying to install PIL 2b4-win32 and when I run viewer.py I get > > this error. > > 0.2b4 is over three years old or so. where did you find it? From KCAZA@cymbolic.com Wed Mar 15 19:34:19 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Wed, 15 Mar 2000 11:34:19 -0800 Subject: [Image-SIG] PilFont... Message-ID: Just wondering if there's any more documentation on PilFont than this (which is in the current manuals posted on PythonWare): Converts BDF or PCF font files to a format that can be used with PIL's ImageFont module. $ pilfont *.pdf I remember last year a discussion of providing a library of pre-PIL-ed fonts... are there copyright problems with X-Windows fonts? Assuming I can get things working (which was a problem on my Windows box last time I tried), I'd be happy to help out with the conversions. Kevin From dougal@blackhawk.jeffsikes.com Fri Mar 17 16:11:14 2000 From: dougal@blackhawk.jeffsikes.com (Dougal Campbel) Date: Fri, 17 Mar 2000 10:11:14 -0600 (EST) Subject: [Image-SIG] MODCA/IOCA formats? In-Reply-To: Message-ID: Does anyone know anyplace where I get code for converting MODCA files to other formats (preferably JPEG or GIF)? It doesn't necessarily have to be through PIL, any references would be appreciated. -- Ernest MacDougal Campbell III, MCP http://www.gunters.org/~dougal/ "The medium is not the message. The *message* is the message." From KCAZA@cymbolic.com Fri Mar 17 18:03:10 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Fri, 17 Mar 2000 10:03:10 -0800 Subject: [Image-SIG] Pil format fonts... creating a high-res library for all to use... Message-ID: As I mentioned earlier in the week, I wish to create a library of high-resolution PIL fonts for the PIL world to use. To this end, I've purchased a program that will RIP Windows fonts into BDF format at any resolution... and it works quite well! However, there's some problems with the formatting in their BDF files, which I need some clarafication on so that I can 'hobble' BdfFontFile.py to accept them. Fred, if there's anything you can provide for suggestions, I'd greatly appreciate it! -It does not provide proper "ENCODING" values: all are -1. I don't see this as a big problem, as it RIPS all 255 characters whether they're present or not, and puts them in the BDF file in order. I've patched it to count upwards, and I'm hoping that they're in the correct order... maybe. If not, I may be able to get the values from another field that 'looks' like the correct number to me, at least... q:] -It does not provide "ASCENT" and "DESCENT" values... what are these, and can I use a 'default' value that will work? -It does not provide all the info in the "FONT" field that BdfFontFile.py expects, bur just the name of the font. How do I figure out what these values should be, if it's at all possible? This includes the type of font ("Roman", "Itallic", etc.), the spacing, etc. Seeing as I'm creating the font to my own specifications (resolution and point size), I may be able to manually configure this data...? I can send you a sample font file if you like, it may help. If this endeavour is successful, we may be able to provide some very good quality fonts for inclusion in the PIL library, or at least as a separate download. Kevin Cazabon. From godzilla@netmeg.net (Les Schaffer) Fri Mar 17 19:03:36 2000 From: godzilla@netmeg.net (Les Schaffer) (Les Schaffer) Date: Fri, 17 Mar 2000 14:03:36 -0500 (EST) Subject: [Image-SIG] Pil format fonts use... In-Reply-To: References: Message-ID: <14546.33160.221162.373270@gargle.gargle.HOWL> Kevin said: > As I mentioned earlier in the week, I wish to create a library of > high-resolution PIL fonts for the PIL world to use. just out of curiousity, for what purpose would these fonts serve PIL users? right now i use PIL for astro image processing, and i am usually not allowed to add lettering to the Jupiter Ring System :-) so what do other people using image proc tools need with good font support under PIL? are people using PIL for graphics production? adding text to images as i might do in a Gimp or PhotoShop?? les 'just curious' schaffer From joshua.kifer@supplysolution.com Fri Mar 17 19:31:08 2000 From: joshua.kifer@supplysolution.com (Joshua Kifer) Date: Fri, 17 Mar 2000 11:31:08 -0800 (PST) Subject: [Image-SIG] Pil format fonts use... In-Reply-To: <14546.33160.221162.373270@gargle.gargle.HOWL> Message-ID: Les, I use PIL to generate dynamic graphs and charts. Thus, for the labelling I require font support. I applaud any effort to increase the number of available fonts and would love to hear where I might be able to find them when they are ready. Joshua --- Joshua Kifer Web Design Programmer SupplySolution.com On Fri, 17 Mar 2000, Les Schaffer wrote: > Kevin said: > > > As I mentioned earlier in the week, I wish to create a library of > > high-resolution PIL fonts for the PIL world to use. > > just out of curiousity, for what purpose would these fonts serve PIL > users? right now i use PIL for astro image processing, and i am > usually not allowed to add lettering to the Jupiter Ring System :-) > > so what do other people using image proc tools need with good font > support under PIL? are people using PIL for graphics production? > adding text to images as i might do in a Gimp or PhotoShop?? > > les 'just curious' schaffer > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://www.python.org/mailman/listinfo/image-sig > From KCAZA@cymbolic.com Fri Mar 17 19:31:23 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Fri, 17 Mar 2000 11:31:23 -0800 Subject: [Image-SIG] Pil format fonts use... Message-ID: Astronomics is one application for PIL, but I'm using it for many other purposes (mostly personal). I work for a company called Cymbolic Sciences, and we produce high resolution laser imaging devices that output to photographic film or paper (up to 4 feet by 8 feet). I'm using PIL to create everything from 1.4 GB size 3-D lenticular images to pacakge prints for portrait labs. Most of the work I'm doing is "proof of concept" or prototyping, but it's nice to be able to show good quality images and full-featured software. For this kind of work, PIL is perfect... the last thing I want to do is write a C library to do all the functions readily available in PIL already. Seeing as I use Python for the main program usually anyways, it makes sense. Could you not use text to label your images? I'm sure there's many applications for features such as text addition, but I've had difficulty in getting it to work due to limited font types, and how low-res the available fonts are. For my application, I need fonts that are up to 300 or 400 ppi... not something you'd find on an X-Windows system for sure (which is what most of the BDF fonts are for). Kevin. >>> Les Schaffer 03/17/00 11:03AM >>> Kevin said: > As I mentioned earlier in the week, I wish to create a library of > high-resolution PIL fonts for the PIL world to use. just out of curiousity, for what purpose would these fonts serve PIL users? right now i use PIL for astro image processing, and i am usually not allowed to add lettering to the Jupiter Ring System :-) so what do other people using image proc tools need with good font support under PIL? are people using PIL for graphics production? adding text to images as i might do in a Gimp or PhotoShop?? les 'just curious' schaffer _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From godzilla@netmeg.net (Les Schaffer) Fri Mar 17 20:28:04 2000 From: godzilla@netmeg.net (Les Schaffer) (Les Schaffer) Date: Fri, 17 Mar 2000 15:28:04 -0500 (EST) Subject: [Image-SIG] Pil format fonts use... In-Reply-To: References: Message-ID: <14546.38228.514532.121803@gargle.gargle.HOWL> Joshua/Kevin: Thanks for the description of your PIL uses. Now you __have__ given me an idea: i would love to be able to put TeX formatted labels on some images. Basically, i'd like to be able to take a TeX string and place it in an image. The strings will have usually equations and greek symbols. is that doable with PIL, your fonts, and some added tools? les schaffer From KCAZA@cymbolic.com Fri Mar 17 20:46:47 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Fri, 17 Mar 2000 12:46:47 -0800 Subject: [Image-SIG] Pil format fonts use... Message-ID: I'm sure it probably is... you just need a font that has the greek symbols that you need. Once I get a "system" in place for properly converting these fonts, it shouldn't be too hard to do. As I mentioned though, I'm having a few problems, but they don't seem insurmountable. The font support in PIL is easy to use, provided that you have the fonts you need pre-formatted into PIL font format (which is the difficult part... at least for me!) Kevin. >>> Les Schaffer 03/17/00 12:28PM >>> Joshua/Kevin: Thanks for the description of your PIL uses. Now you __have__ given me an idea: i would love to be able to put TeX formatted labels on some images. Basically, i'd like to be able to take a TeX string and place it in an image. The strings will have usually equations and greek symbols. is that doable with PIL, your fonts, and some added tools? les schaffer _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From jack@oratrix.nl Fri Mar 17 22:18:04 2000 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 17 Mar 2000 23:18:04 +0100 Subject: [Image-SIG] Pil format fonts use... In-Reply-To: Message by Kevin Cazabon , Fri, 17 Mar 2000 12:46:47 -0800 , Message-ID: <20000317221810.3A956E2673@oratrix.oratrix.nl> Just an idle thought: wouldn't it be better to invest some time in creating a renderer for a simple scalable font to use with PIL? Wasn't Type 42 designed to be easily parseable and executable even without a fullblown PostScript interpreter? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From Joerg.Baumann@stud.informatik.uni-erlangen.de Sat Mar 18 20:37:19 2000 From: Joerg.Baumann@stud.informatik.uni-erlangen.de (Joerg Baumann) Date: Sat, 18 Mar 2000 21:37:19 +0100 (MET) Subject: [Image-SIG] Pil format fonts use... In-Reply-To: <14546.38228.514532.121803@gargle.gargle.HOWL> Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-851401618-953411712=:6605 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: On Fri, 17 Mar 2000, Les Schaffer wrote: > Joshua/Kevin: > > Thanks for the description of your PIL uses. > > Now you __have__ given me an idea: i would love to be able to put TeX > formatted labels on some images. Basically, i'd like to be able to > take a TeX string and place it in an image. The strings will have > usually equations and greek symbols. > > is that doable with PIL, your fonts, and some added tools? I don't know much about PIL, because I started just looking at it. Latex2html or doxygen (a documentation tool for c++ and idl) simply use latex, dvips and gs to convert tex->ps->pnm. I have attached a litte tar.gz with the c++ class (from doxygen) doing that. It should be no problem to see what's going on and achieve the same with PIL (call tex,dvips, do some calculations gs and read the bitmap) Regards, joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Beware of bugs in the above code; I have only proved it correct, not tried it. Don Knuth ---559023410-851401618-953411712=:6605 Content-Type: APPLICATION/OCTET-STREAM; NAME="formula.tar.gz" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="formula.tar.gz" H4sIAPLn0zgAA+0aa3fbtjWf/StgpnEpS6JE2bFb2cpO4jitz0kTt3HW7SRp DiRCEhaKZAjIFue6v333AiAJUpLTuGu2swlpLQm4L1zcFx7jOJ3NQ+qNkuTe n9W6frd7sL9/rwvt8EB/+uZ3t9t72Ns7uNc97B7sdfcPDw8fAnzv8ODgHun+ aRJZbS4kTQm594/JkM5nNFoPx1LxJQT6sq2z+29tWwT/I1+dBX0yLk2rdUl8 z39IerDene5ex+8R/7C/v9f3vyUBn3GZcnK6SMhXBv8kTrKUT6aSuCcN4n/7 7WEbUckwI08N+CWNyPeMidHUM0jnLJ1xIXgcERkTWK8WGQGdFpnFAR/DJ40C 4CYAeziXjMgpF0TEY3lFU6YGuRRIKIhH8xmLJJVIax4FLAVgQAAGgsRj9eO7 F6/JdyxiKQ3J+XwY8hF5zkcsEowA2SlLGQiL1CYpjSQLPPIiJilLUiZy0oIg 4xkNgPswnktFV8y5pEMecplpVraQSA/UCsJmJJmnSSyYR84kckzS+JIHLCAO FfDbIVdcTpEoWyBPkDslfJaEHECAFgqVoebIK8Y+NSFkOYuBf8Ak5aHINf44 DAmwSIDLRGFKJA58ydN4kUEXChbFEtbhEhQS4PqpCYWasKHT2dq6z6NROAdF HAsZhHzoTR9ZffMIVi3AvrLT+SiHI2/qWGAfxzxkVcyPki0krDijs9oAwvJo HNe6A57W+ORmbLNy+Ix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Vrxv/RB63v//u9vYPl95/7+/tb95/f4n2Bd5/Tzev vzevvz/x+nsc2cns+6378BOPlMue219+h/hWsf6Se6S6ttT7zTxNqcSYqAn2 VaZe+/ZapfPy6XT5oMmUBuaBVL5VWaoKNMHrPK2hNxyZ6gBFSPklKKxfUM0f XVeIKqStm6PaJFRG75tpmCe9ZujR0gRVdffJV9truBTPe6vcihdha7muoGGY 2nPYCRtA2VRjqym7AHJ9syzdU1heSyr8+UlpEMhVB+14EWKzrqC7evT6xrYA hVuIsqlPNm3TNm3TNm3TNm3TNm3TNm3TNm3TNm3TNm3TNm3TNm3TNm3TNu2/ sv0La90RpQBQAAA= ---559023410-851401618-953411712=:6605-- From krt@krt.com.au Sun Mar 19 20:50:55 2000 From: krt@krt.com.au (Kingsley Turner) Date: Mon, 20 Mar 2000 07:50:55 +1100 Subject: [Image-SIG] Pil format fonts use... References: <20000318170020.B5A491CD27@dinsdale.python.org> Message-ID: <38D53DAF.FA46D654@krt.com.au> > Subject: [Image-SIG] Pil format fonts use... > Date: Fri, 17 Mar 2000 14:03:36 -0500 (EST) > From: Les Schaffer > To: image-sig@python.org > References: > > Kevin said: > > > As I mentioned earlier in the week, I wish to create a library of > > high-resolution PIL fonts for the PIL world to use. > > just out of curiousity, for what purpose would these fonts serve PIL > users? right now i use PIL for astro image processing, and i am > usually not allowed to add lettering to the Jupiter Ring System :-) > > so what do other people using image proc tools need with good font > support under PIL? are people using PIL for graphics production? > adding text to images as i might do in a Gimp or PhotoShop?? > > les 'just curious' schaffer I use PIL to place a watermark on the bottom of images that are added to our website (see .sig). Using Python http upload, we grab an image, save an original, then use PIL to scale it (down) to a reasonable size (450^2), then make a thumbnail of this (about 200^2). The 450 is blended with an image of the words 'Mad Dogs Breakfast' . The results are varying- on some images it looks great, other times it looks crap (impossible to read). It would be great to just write it there, and then I could select a good contrasting grey scale to write it with, rather than just using grey 50% + some alpha. I'm not sure if I would vary the opacity this time though. cheers, -kt Here's some examples of it - and a shameful plug of my website... :) Good example: http://maddogsbreakfast.com/mdb/gui/art/art42c_exp.shtml OK example: http://maddogsbreakfast.com/mdb/gui/art/art34c_exp.shtml Bad example: http://maddogsbreakfast.com/mdb/gui/art/art45c_exp.shtml -- Kingsley Turner, mailto:kingsley@krt.com.au Mad Dog's Breakfast: The Travel Magazine that doesn't take itself too seriously http://www.MadDogsBreakfast.com From Joerg.Baumann@stud.informatik.uni-erlangen.de Sat Mar 18 23:32:03 2000 From: Joerg.Baumann@stud.informatik.uni-erlangen.de (Joerg Baumann) Date: Sun, 19 Mar 2000 00:32:03 +0100 (MET) Subject: [Image-SIG] Pil format fonts use... In-Reply-To: <20000317221810.3A956E2673@oratrix.oratrix.nl> Message-ID: On Fri, 17 Mar 2000, Jack Jansen wrote: > Just an idle thought: wouldn't it be better to invest some time in > creating a renderer for a simple scalable font to use with PIL? Wasn't=20 > Type 42 designed to be easily parseable and executable even without a > fullblown PostScript interpreter? Type 42 was designed as "wrapper" around a TrueType font. < adobe 5012.Type42_spec > ... the PostScript =AE Type 42 font format which can be used to download TrueType (r) fonts to PostScript printers (or PostScript compatible printers) that contain a TrueType rasterizer. This method yields better print quality than can be achieved by converting a TrueType font to a Type 1 or Type 3 font. =20 So you don't need a fullblown PostScript interpreter, but=20 Postscript-wrapper unpacking code and a fullblown TrueType interpreter. There is the FreeType library, a GPLed TrueType Rasterizer (http://www.freetype.org/), perhaps that would be worth looking at? But I think it handles only native TrueType fonts.=20 =20 Regards, joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ =20 Beware of bugs in the above code; I have only proved it correct,=20 not tried it. Don Knuth=20 =20 From kcazabon" Message-ID: <001a01bf9170$8f89ca40$16107118@rct1.bc.wave.home.com> In any case, it seems like I have the compatibility problems I've been experiencing under control. I have a program on order that can rasterize most Windows fonts to BDF format, and I've 'hobbled' Fred's original BdfFontFile.py to be compatible with them (even though they're missing some of the data in a 'full' BDF font). I'll put together a few packages of fonts, and let everyone know where they can be found. I'll have to do a little investigation into copyrights on the fonts I provide first though... q:[ Out of curiosity, what resolutions are useful to all those on this list that would have need of such ready-made PIL fonts? I need fairly high res files, say 300-400 pixels/inch, but what about everyone else? Most screen fonts are 72 or 100dpi, but they look like garbage when printed on a good quality printer... It shouldn't be hard to put together 72, 100, 200, 250, 300, 305, 400, 406 ppi packages (each separate), but are there any 'common' res's that I'm missing? (The 305 and 406 are for my needs...) It seems that I start to blow things up (i.e. crash...) when I go above 72 points at 406dpi... q:] Kevin Cazabon ----- Original Message ----- From: "Joerg Baumann" To: Sent: Saturday, March 18, 2000 3:32 PM Subject: Re: [Image-SIG] Pil format fonts use... On Fri, 17 Mar 2000, Jack Jansen wrote: > Just an idle thought: wouldn't it be better to invest some time in > creating a renderer for a simple scalable font to use with PIL? Wasn't > Type 42 designed to be easily parseable and executable even without a > fullblown PostScript interpreter? Type 42 was designed as "wrapper" around a TrueType font. < adobe 5012.Type42_spec > ... the PostScript ® Type 42 font format which can be used to download TrueType (r) fonts to PostScript printers (or PostScript compatible printers) that contain a TrueType rasterizer. This method yields better print quality than can be achieved by converting a TrueType font to a Type 1 or Type 3 font. So you don't need a fullblown PostScript interpreter, but Postscript-wrapper unpacking code and a fullblown TrueType interpreter. There is the FreeType library, a GPLed TrueType Rasterizer (http://www.freetype.org/), perhaps that would be worth looking at? But I think it handles only native TrueType fonts. Regards, joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Beware of bugs in the above code; I have only proved it correct, not tried it. Don Knuth _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From kcazabon" I've put together a 'base' package of PIL-format fonts... a bit over the top, but oh well. The only one I have room to post on my web space is the 100dpi package for now. There's fonts from 8pt to 72pt in it, that you can use at other resolutions too, but the sizing will change accordingly. It's a fairly large zip, 4.5mb, which I'll split up later when I figure out where these can be hosted. see http://members.home.com/lenticular for details. I hope these are useful to some of you! Kevin Cazabon. (fyi, PIL fonts are in 2 pieces: a "pbm" file, which is actually a "PNG" format image that you can open and view, and a "pil" file that contains the metrics for the image file. You need both to use them with PIL) From carlson@cems.umn.edu Wed Mar 22 23:38:27 2000 From: carlson@cems.umn.edu (Bryan Carlson) Date: Wed, 22 Mar 2000 17:38:27 -0600 Subject: [Image-SIG] Problems with Imaging 1.0 Message-ID: I am trying to build the imaging library (PIL 1.0). I have made it through the first 7 steps of the README build successfully. I'm getting stopped at step 8. The output from the session looks like this: Python 1.5.2 (#1, Mar 21 2000, 15:31:37) [GCC 2.8.1] on sunos5 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import _imaging Traceback (innermost last): File "", line 1, in ? ImportError: ld.so.1: python: fatal: libtcl8.3.so: open failed: No such file or directory >>> import Image >> The "import Image" seems ok but as you can see it is balking at "import _imaging". I have installed python 1.5.2 and tcl 8.3 and tk 8.3 on my system. The libtcl8.3.so library is installed in /usr/local/lib. This is in my path and also I put in PYTHONPATH - but python doesn't seem aware of it. I think this is the problem - python doesn't seem to be aware tcl/tk - but I don't know how to rectify this. Also, in the Setup file I changed the tcl line to: # *** Tcl/Tk support and library location Tk/tkImaging.c -DWITH_TKINTER -I/usr/local/include -L/usr/local/lib -ltcl8.3 -ltk8.3 Any suggestions here? BTW, I have no feel for these programs. Someone in our department asked me to install Sketch which is built on python, PIL, tcl/tk, etc. Not sure if the above is even a problem. Also, found it confusing to go through the build and successfully do a make only to have to run another make - didn't really understand this. Just following the steps. Bryan Bryan Jon Carlson Systems Administrator Chem. Eng. & Mat. Sci. Dept. University of Minnesota 421 Washington Ave. SE Minneapolis, MN 55455 Work: 612-624-2557 Fax: 612-626-7246 e-mail: carlson@cems.umn.edu From kcazabon" Piers Lauder has kindly provided some FTP hosting space for all of the PIL font packages that I produced this week. The available packages are 72, 100, 200, 250, 300, 305, 400, and 406dpi, each in a separate ZIP file. Each package contains 480 fonts... 16 sizes each of 30 different fonts. They are available at: http://www.cs.usyd.edu.au/~piers/python/pilfonts.html Thank you very much Piers for the space... I hope you are able to keep them there for a while at least. Kevin Cazabon. (PS: if there's a North Americain FTP site that you can provide space on, it would be greatly appreciated: Piers' site is in Australia, and could get slow in peak periods for us N.A. people...) From pf@artcom-gmbh.de Thu Mar 23 07:09:32 2000 From: pf@artcom-gmbh.de (Peter Funk) Date: Thu, 23 Mar 2000 08:09:32 +0100 (MET) Subject: [Image-SIG] Problems with Imaging 1.0 In-Reply-To: from Bryan Carlson at "Mar 22, 2000 5:38:27 pm" Message-ID: Hi! Bryan Carlson: > I am trying to build the imaging library (PIL 1.0). [...] > ImportError: ld.so.1: python: fatal: libtcl8.3.so: open failed: No such file > or directory [...] > Any suggestions here? In SunOS aka Solaris you have to specifiy additional search paths for shared libraries in the linker command. This is different from the '/etc/ld.so.conf' global system configuration you might be familar with from Linux. If you want to use /usr/local/lib, the relevant portion of your $BUILD/Modules/Setup should read: # *** Uncomment and edit to reflect where your Tcl/Tk libraries are: -L/usr/local/lib -R/usr/local/lib \ # *** Uncomment and edit to reflect your Tcl/Tk versions: -ltk8.3 -ltcl8.3 \ However you should know, that two small patches are required, to make the Python1.5.2 source distribution go with Tcl/Tk 8.3.0. I can send you this patches, if you want. But I suggest to stay with Tcl/Tk 8.0.5 for the time being. It has been discovered on several platforms (Linux, Win32), that under very rare cirumstances the combination Python/Tcl/Tk 8.3.0 may crash with memory violation problem, where Tcl/Tk 8.0.5 is rock stable. I've discovered this, while running the testsuite coming with the Python Mega Widget (Pmw) package, see . Since this test suite makes heavy use of widget creation and desctruction, the probability of this bug showing up in a real world app is low. > BTW, I have no feel for these programs. Someone in our department asked me > to install Sketch which is built on python, PIL, tcl/tk, etc. Not sure if > the above is even a problem. I haven't yet tried Sketch 0.6.5 on our Solaris box (it is an old Sparc 10). Would be interesting to here, whether is will run there. > Also, found it confusing to go through the build and successfully do a make > only to have to > run another make - didn't really understand this. Just following the steps. Well, you are brave to try this on Solaris! ;-) If you can't get further with my hints, please ask again. Regards, Peter -- Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260 office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen) From rrdn60@email.sps.mot.com Thu Mar 23 17:50:48 2000 From: rrdn60@email.sps.mot.com (Norman Shelley (rrdn60)) Date: Thu, 23 Mar 2000 10:50:48 -0700 Subject: [Image-SIG] PIL 1.0 and ImportError: ... (init_imaging) Message-ID: <38DA5978.E7E94333@email.sps.mot.com> This is a multi-part message in MIME format. --------------59A5903C7B6CE73CFA04BB40 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Some installation comments and one major problem with PIL Release 1.0 (Jul 31, 1999) Please copy me directly as I am not a subscribed member of this list Environment: [246] % uname -a HP-UX wvenus B.10.20 A 9000/782 2009382447 two-user license [247] % gcc --version 2.95.1 o Setup.in copied to Setup does NOT work until backslashes on these three lines are removed: -IlibImaging libImaging/libImaging.a \ -I/usr/local/include -L/usr/local/lib -ljpeg \ -I/usr/local/include -L/usr/local/lib -lz \ o When building the shared library it complains that libImaging.a was not built relative. Had to rebuild it with the -fpic gcc option o $ ls *.sl _imaging.sl $ PYTHONPATH=.:./PIL ; export PYTHONPATH $ python Python 1.5.2 (#4, Nov 10 1999, 09:23:22) [GCC 2.95.1 19990816 (release)] on hp-uxB Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import _imaging Traceback (innermost last): File "", line 1, in ? ImportError: dynamic module does not define init function (init_imaging) $ nm _imaging.sl | grep init_ 00018700 T init_imaging 00018730 T init_imaging -- Best regards, --------------59A5903C7B6CE73CFA04BB40 Content-Type: text/x-vcard; charset=us-ascii; name="Norman_Shelley-RRDN60.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Norman Shelley Content-Disposition: attachment; filename="Norman_Shelley-RRDN60.vcf" begin:vcard n:Shelley;Norman tel;work:(480) 413-3895 x-mozilla-html:FALSE org:Motorola-SPS version:2.1 email;internet:rrdn60@email.sps.mot.com adr;quoted-printable:;;2100 E. Elliot Rd.=0D=0AAZ34-MD EL701;Tempe;AZ;85284; x-mozilla-cpt:;-4336 fn:Norman Shelley end:vcard --------------59A5903C7B6CE73CFA04BB40-- From PeloquinW@esi.com Fri Mar 24 22:46:53 2000 From: PeloquinW@esi.com (William Peloquin) Date: Fri, 24 Mar 2000 14:46:53 -0800 Subject: [Image-SIG] Trying to display a BMP image Message-ID: Hi, I am trying to load a BMP image and display it in a label. I am pretty new to using PIL, and I have not used Python in quite a while. I will appreciate any hints! I am using the following bit of code, and I am having no luck.... img = Image.open('im000001.bmp') img.load() #tried with and without load print 'mode = ', img.mode print 'size = ', img.size pi = BitmapImage(img) #or PhotoImage(img) Label(liveRawF, image=pi).pack(side=TOP, expand=YES, fill=BOTH) Thanks, Willie Willie Peloquin esi - Vision Products Division 734.332.7180 phone 734.332.7077 fax From kingsley@krt.com.au Sat Mar 25 00:07:20 2000 From: kingsley@krt.com.au (Kingsley Turner) Date: Sat, 25 Mar 2000 11:07:20 +1100 Subject: [Image-SIG] Q: resizing (smaller) with anti-aliasing Message-ID: <38DC0338.64FD4F95@krt.com.au> Just a quick question: Is there a way to scale an image (smaller) that includes some form of antialiasing? My thumbnails are coming out a little chunky, partucularly when the original is a line-drawing or diagram. If I reduce them with gimp they come out a lot smoother. cheers, -kt -- Kingsley Turner, mailto:kingsley@krt.com.au Mad Dog's Breakfast: The Travel Magazine that doesn't take itself too seriously http://www.MadDogsBreakfast.com From Joerg.Baumann@stud.informatik.uni-erlangen.de Sat Mar 25 14:39:39 2000 From: Joerg.Baumann@stud.informatik.uni-erlangen.de (Joerg Baumann) Date: Sat, 25 Mar 2000 15:39:39 +0100 (MET) Subject: [Image-SIG] Q: resizing (smaller) with anti-aliasing In-Reply-To: <38DC0338.64FD4F95@krt.com.au> Message-ID: On Sat, 25 Mar 2000, Kingsley Turner wrote: > Is there a way to scale an image (smaller) that includes some > form of antialiasing? j=i.resize((80,100)) uses the NEAREST filter as default, like j=i.resize((80,100),Image.NEAREST) With j=i.resize((80,100),Image.BILINEAR) you get linear interpolation. With j=i.resize((80,100),Image.BICUBIC) you get cubic interpolation. bye joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Beware of bugs in the above code; I have only proved it correct, not tried it. Don Knuth From Joerg.Baumann@stud.informatik.uni-erlangen.de Sat Mar 25 14:57:59 2000 From: Joerg.Baumann@stud.informatik.uni-erlangen.de (Joerg Baumann) Date: Sat, 25 Mar 2000 15:57:59 +0100 (MET) Subject: [Image-SIG] Trying to display a BMP image In-Reply-To: Message-ID: On Fri, 24 Mar 2000, William Peloquin wrote: > Hi, >=20 > I am trying to load a BMP image and display it in a label. I am pretty ne= w > to using PIL, and I have not used Python in quite a while. I will appreci= ate > any hints! Your problems seem to be with Tkinter. Here is a working version of your fragment. import Tkinter import Image,ImageTk liveRawF=3DTkinter.Tk() img =3D Image.open('im000001.bmp') print 'mode =3D ', img.mode print 'size =3D ', img.size pi =3D ImageTk.PhotoImage(img) Tkinter.Label(liveRawF, image=3Dpi).pack(side=3DTkinter.TOP, expand=3DTkinter.YES, fill=3DTkinter.BOTH)=20 liveRawF.mainloop() Certainly you can use "from .. import .." instead of "import ..", but this way it=B4s clear where things come from. hope this is a helpful hint, bye joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ =20 Beware of bugs in the above code; I have only proved it correct,=20 not tried it. Don Knuth=20 =20 From Joerg.Baumann@stud.informatik.uni-erlangen.de Sun Mar 26 01:03:32 2000 From: Joerg.Baumann@stud.informatik.uni-erlangen.de (Joerg Baumann) Date: Sun, 26 Mar 2000 03:03:32 +0200 (MET DST) Subject: [Image-SIG] TrueType and Type 1 fonts with PIL In-Reply-To: <001901bf948f$adaa0c20$16107118@rct1.bc.wave.home.com> Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-851401618-954032612=:21719 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE After the short discussion about fonts and PIL, I wrote a small patch (attached to this mail) for Imaging-1.0. This patch uses the FreeType2 Beta library from www.freetype.org to enable ImageFont to use TrueType and Type 1 (and other) font-files. The FreeType2 Beta library does not run on all systems yet, but the development of FreeType1 is stopped, and I didn=B4t want to use a soon obsolete library. (It should run fine on most unix-boxes with gcc) In _imaging.c WITH_IMAGEFREETYPEFONT must be defined, and in Setup.in the location of the freetype-library must be adjusted. Old pil-font are loaded as it used to be: f=3DImageFont.load("courR14.pil") The new syntax to load fonts with freetype is: f=3DImageFont.load("verdana.ttf",0,30) the new options are face_index and size. Some of the now supported fontfiles support more than one face, you can select one with face_index (should be 0 in most cases) Size is the height of the font in pixels. This runs fine for me (linux 2.2.10, glibc 2.1) please try it, and if you find a bug, contact me. Regards, joerg Joerg Baumann joerg.baumann@stud.informatik.uni-erlangen.de +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ =20 Beware of bugs in the above code; I have only proved it correct,=20 not tried it. Don Knuth=20 =20 ---559023410-851401618-954032612=:21719 Content-Type: APPLICATION/octet-stream; name="PIL.diff.gz" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="PIL.diff.gz" H4sICNdd3TgAA1BJTC5kaWZmAM0aa3PaSPIz+RVtUpWSQGCBbWxMcBWxcdZ3 juOLye3d7W6phDSAYiHpJLE2m/J/v+4ZjTTi4Uc2e7sqjKWZ6fdjelq43mQC jRgap9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gpq7KN0Io6SST MtEJ7iFTeXffaB8WP3r4VuqP635nFW8pJ2zFv1N4wMtE+x8jLjSjUC0AAA== ---559023410-851401618-954032612=:21719-- From robert.klimek@grc.nasa.gov Mon Mar 27 16:29:38 2000 From: robert.klimek@grc.nasa.gov (Bob Klimek) Date: Mon, 27 Mar 2000 11:29:38 -0500 Subject: [Image-SIG] TrueType and Type 1 fonts with PIL References: Message-ID: <38DF8C72.E18C5960@grc.nasa.gov> Hello All, Just a general thought. Over the last couple of weeks there have been discussions of font enhancements. I haven't used any of them my self but I'd hate to see these nice enhancements die with time and be forgotten. The only way that this won't happen is if they are added to PIL. I must say, I use PIL all the time and it is a wonderful piece of software, many thanks to Fredrik Lundh for that. And I want to see PIL become even better and grow. Bob -- --------------------- Robert B. Klimek NASA Glenn Research Center robert.klimek@grc.nasa.gov --------------------- From fdrake@acm.org Mon Mar 27 16:38:38 2000 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 27 Mar 2000 11:38:38 -0500 (EST) Subject: [Image-SIG] TrueType and Type 1 fonts with PIL In-Reply-To: <38DF8C72.E18C5960@grc.nasa.gov> References: <38DF8C72.E18C5960@grc.nasa.gov> Message-ID: <14559.36494.649780.499675@weyr.cnri.reston.va.us> Bob Klimek writes: > Just a general thought. Over the last couple of weeks there have been > discussions of font enhancements. I haven't used any of them my self but There's also t1python, my Python bindings for Rainer Menzner's t1lib. It needs to be updated, which I'm hoping to get to before too much longer (esp. now that the doc release is out!). > I'd hate to see these nice enhancements die with time and be forgotten. > The only way that this won't happen is if they are added to PIL. I must > say, I use PIL all the time and it is a wonderful piece of software, > many thanks to Fredrik Lundh for that. And I want to see PIL become even > better and grow. Me too. 1.0.1 needs to be released, though. The weird linking problem with _tkinter is horrible, and easy enough for /F to fix. I consider it too tedious to install in the 1.0 incarnation. ;( -Fred -- Fred L. Drake, Jr. Corporation for National Research Initiatives From btribble@blueshiftinc.com Mon Mar 27 20:02:14 2000 From: btribble@blueshiftinc.com (Brett Tribble) Date: Mon, 27 Mar 2000 12:02:14 -0800 Subject: [Image-SIG] Question about adding a BOB datatype (loader/saver) Message-ID: <007901bf9827$58ef7da0$a5e501aa@blueshiftinc.com> This is a multi-part message in MIME format. ------=_NextPart_000_0076_01BF97E4.4A79D7E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm reworking one of the existing Image Plugins to load/save the BOB = image format. This format is very simple. It consists of two longs = representing Width, Height. 256 palette entries, the image data, and = that's it! It does not contain an Identifier string of any sort. Can I return None = as the _accept value, or is there another way of doing this? After I have it working, where should I submit it to make it available = for others? Please make sure my email is in your reply, as I do not subscribe to the = list... Thanks in advance, Brett Tribble ------=_NextPart_000_0076_01BF97E4.4A79D7E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm reworking one of = the existing=20 Image Plugins to load/save the BOB image format. This format is very = simple. It=20 consists of two longs representing Width, Height. 256 palette entries, = the image=20 data, and that's it!
 
It does not contain an = Identifier=20 string of any sort. Can I return None as the _accept value, or is there = another=20 way of doing this?
 
After I have it = working, where should=20 I submit it to make it available for others?
 
 
Please make sure my = email is in your=20 reply, as I do not subscribe to the list...
 
 
Thanks in = advance,
 
Brett=20 Tribble
------=_NextPart_000_0076_01BF97E4.4A79D7E0-- From rpseguin@yahoo.com Tue Mar 28 20:24:43 2000 From: rpseguin@yahoo.com (Ralph Seguin) Date: Tue, 28 Mar 2000 12:24:43 -0800 Subject: [Image-SIG] Pixmap widget with access to pixels? Message-ID: <38E1150B.21C541A7@yahoo.com> Hi. I'm looking for a widget that I could use inside of Python (Tkinter or otherwise) that gives me access to setting and retrieving individual pixels. I know that the Tkinter Canvas widget allows me to have arcs, rects, ..., but I'm talking about having a large canvas where I want to render directly to the pixels. I've got PIL working with Tkinter in terms of copying an entire pixmap over, but this is INCREDIBLY inefficient. I'd like to have something that works within the existing framework, but I'm open to patching my python installs (talking about a number of machines here...). I'm going to look at the TOGL, PyOpenGL and other things and see how they've done it. I'd love it if these were all integrated... Suggestions are greatly appreciated. Thanks. -Ralph rpseguin@yahoo.com From jack@oratrix.nl Tue Mar 28 22:15:18 2000 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 29 Mar 2000 00:15:18 +0200 Subject: [Image-SIG] Pixmap widget with access to pixels? In-Reply-To: Message by Ralph Seguin , Tue, 28 Mar 2000 12:24:43 -0800 , <38E1150B.21C541A7@yahoo.com> Message-ID: <20000328221523.9B8CBE2673@oratrix.oratrix.nl> What exactly do you mean by "direct access to pixels"? If you want to set pixels yourself from Python code there's a 99% chance that the exercise is futile: Python is simply too slow for that. (Exception are some vbery special cases: I can imagine that if you want to paint the night sky after computing it you can get away with it because there's so few pixels to paint). Whether you have direct access to slightly higher abstractions (like scanlines or rectangular areas) depends on the gui package used, indeed, but unless you give a hint of what you want to do it's dificult to answer which package is best. Your platform is also interesting: it won't help you much if I tell you that you can access the raw bitmap for any window from MacPython if you're not using a mac:-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From rpseguin@yahoo.com Tue Mar 28 23:10:05 2000 From: rpseguin@yahoo.com (Ralph Seguin) Date: Tue, 28 Mar 2000 15:10:05 -0800 (PST) Subject: [Image-SIG] Pixmap widget with access to pixels? Message-ID: <20000328231005.10021.qmail@web2105.mail.yahoo.com> > What exactly do you mean by "direct access to > pixels"? If you want to I mean being able to set a given pixel a given color. For each pixel in a canvas. Fractals, surface plots, graphics rendering, ray trace, ... I can see a number of things that I could use this for. for curY in range ( 0, 1000 ) : for curX in range ( 0, 1000 ) : # fooBar () is some time-consuming # function which will compute a color # value, possibly/probably unique per # pixel. val = fooBar( curX, curY ) myCanvas.setPixel( curX, curY, val ) In this example, fooBar() is some arbitrary, time-consuming function, so the cost of doing setPixel() is small in comparison. Doing this by generating degenerate (Canvas) rectangles or degenerate (Canvas) lines is very inefficient in both storage space and compute/render time. Currently, I can use PIL to render to an off-screen image and then assign this image to the image for a Tkinter.Label or other widget, but this is really not good either. > exercise is futile: Python is simply too slow for > that. (Exception are Setting a pixel represents a minor fraction of the amount of time for computing some things like fractals, ray traces, ... > night sky after computing it you can get away with > it because there's so few pixels to paint). ?? > Whether you have direct access to slightly higher > abstractions (like > scanlines or rectangular areas) depends on the gui Having a rectangle for each pixel is incredibly inneficient. > interesting: it won't help you much if I tell you > the raw bitmap for any window from MacPython if > you're not using a mac:-) I'd like to be platform independent. Since I do most of my work under UNIX, I could hack up some code to write pixels directly to X drawables, but this is hardly elegant or the way that I would like to do it. Thanks. -Ralph __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From KCAZA@cymbolic.com Wed Mar 29 02:06:18 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Tue, 28 Mar 2000 18:06:18 -0800 Subject: [Image-SIG] Pixmap widget with access to pixels? Message-ID: Well, in PIL, you can set an individual pixel very easily. If you want to display these pixels as they're updated, it's easy too. How about something like this: ######################### import Image, ImageTk from Tkinter import * class displayPixMap: def __init__(self, parent, imageSize): self.image = Image.new("RGB", imageSize, (0,0,0)) self.TkImage = ImageTk.PhotoImage(self.image) self.imageDisplay = Label(parent, image = self.TkImage) self.imageDisplay.pack() def putPixel(self, x, y, value): self.image.putpixel((x,y), value) self.TkImage = ImageTk.PhotoImage(self.image) self.imageDisplay.update_idletasks() test = Frame() test.pack() im = displayPixMap(test, (100,100)) for y in range(100): for x in range(100): value = FooBar(x, y) # Where FooBar returns a 3-tuple of RGB values im.putPixel(x, y, value) test.mainloop() ######################### >>> Ralph Seguin 03/28/00 03:10PM >>> > What exactly do you mean by "direct access to > pixels"? If you want to I mean being able to set a given pixel a given color. For each pixel in a canvas. Fractals, surface plots, graphics rendering, ray trace, ... I can see a number of things that I could use this for. for curY in range ( 0, 1000 ) : for curX in range ( 0, 1000 ) : # fooBar () is some time-consuming # function which will compute a color # value, possibly/probably unique per # pixel. val = fooBar( curX, curY ) myCanvas.setPixel( curX, curY, val ) In this example, fooBar() is some arbitrary, time-consuming function, so the cost of doing setPixel() is small in comparison. Doing this by generating degenerate (Canvas) rectangles or degenerate (Canvas) lines is very inefficient in both storage space and compute/render time. Currently, I can use PIL to render to an off-screen image and then assign this image to the image for a Tkinter.Label or other widget, but this is really not good either. > exercise is futile: Python is simply too slow for > that. (Exception are Setting a pixel represents a minor fraction of the amount of time for computing some things like fractals, ray traces, ... > night sky after computing it you can get away with > it because there's so few pixels to paint). ?? > Whether you have direct access to slightly higher > abstractions (like > scanlines or rectangular areas) depends on the gui Having a rectangle for each pixel is incredibly inneficient. > interesting: it won't help you much if I tell you > the raw bitmap for any window from MacPython if > you're not using a mac:-) I'd like to be platform independent. Since I do most of my work under UNIX, I could hack up some code to write pixels directly to X drawables, but this is hardly elegant or the way that I would like to do it. Thanks. -Ralph __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From rpseguin@yahoo.com Wed Mar 29 04:29:09 2000 From: rpseguin@yahoo.com (Ralph Seguin) Date: Tue, 28 Mar 2000 20:29:09 -0800 (PST) Subject: [Image-SIG] Pixmap widget with access to pixels? Message-ID: <20000329042909.12100.qmail@web2101.mail.yahoo.com> > class displayPixMap: > def __init__(self, parent, imageSize): > self.image = Image.new("RGB", imageSize, > (0,0,0)) > self.TkImage = > ImageTk.PhotoImage(self.image) > self.imageDisplay = Label(parent, image = > self.TkImage) > self.imageDisplay.pack() > > def putPixel(self, x, y, value): > self.image.putpixel((x,y), value) > self.TkImage = > ImageTk.PhotoImage(self.image) > self.imageDisplay.update_idletasks() Right. I already have something like this example, but I feel that it is very inneficient to copy an entire pixmap/image when changing a single pixel. Let's say that I've got an image that is 4000x4000 A single putPixel(), requires me to copy 16 million pixels worth of data, or worse. Am I wrong and simply missing something? If you have a label widget with a pixmap, then you already have the storage allocated for storing the pixels, it would be nice to be able to write directly into that pixmap. Granted it's a bit more work for palette stuff... Just as a quick/dirty/ugly hack, I wrote some C code that enabled me to write directly to an X Drawable. The code does work as an experiment for tweaking pixels, but I have to put in a bunch of stuff related to color matching and palettes, visuals, ... (some of the ugly side of dealing with X). Honestly, I think that this is where some of the problem lies. Basically, since Tkinter and PIL are "cross-platform", you have some of these issues to deal with on the implementation side. Thanks. -Ralph rpseguin@yahoo.com __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From fredrik@pythonware.com Wed Mar 29 10:15:59 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 29 Mar 2000 12:15:59 +0200 Subject: [Image-SIG] Pixmap widget with access to pixels? References: <38E1150B.21C541A7@yahoo.com> Message-ID: <005b01bf9968$69daf8f0$0500a8c0@secret.pythonware.com> Ralph Seguin wrote: > I'm looking for a widget that I could use inside of Python (Tkinter or > otherwise) that gives me access to setting and retrieving individual > pixels. > > I've got PIL working with Tkinter in terms of copying an entire pixmap > over, but this is INCREDIBLY inefficient. I suggest looking at the "painter" sample script. it implements a simple tiling scheme, and is fairly efficient. From loewis@informatik.hu-berlin.de Wed Mar 29 11:34:35 2000 From: loewis@informatik.hu-berlin.de (Martin von Loewis) Date: Wed, 29 Mar 2000 13:34:35 +0200 Subject: [Image-SIG] Re: [Python-Help] Pixmap widget with access to pixels? In-Reply-To: <38E1150B.21C541A7@yahoo.com> (message from Ralph Seguin on Tue, 28 Mar 2000 12:24:43 -0800) References: <38E1150B.21C541A7@yahoo.com> Message-ID: <200003291134.NAA16479@pandora> > I've got PIL working with Tkinter in terms of copying an entire pixmap > over, but this is INCREDIBLY inefficient. This is what I had suggested. In case you have a specific pixmap format in mind, you could see whether direct manipulation of the format is more feasible. E.g. if you use Tk photo images, then you could see whether direct manipulation of the photo works for you. I haven't translated this to Python, but in wish, the following sequence works for me % image create photo i -file stopp.gif # where stopp.gif is the image % i get 10 10 255 170 170 % label .l -image i .l % pack .l # now, the photo image is displayed % i put green -to 10 10 20 20 # I get a green rectangle % i put black -to 15 15 16 16 # a single pixel changes color In Tkinter, you'd start with a PhotoImage instance, and use its put and get methods. Hope this helps, Martin From wilson-k.h.cheung@motorola.com Thu Mar 30 01:09:49 2000 From: wilson-k.h.cheung@motorola.com (Wilson-K.H. Cheung) Date: Thu, 30 Mar 2000 09:09:49 +0800 Subject: [Image-SIG] installation problem Message-ID: <38E2A95C.4ADD5870@motorola.com> This is a multi-part message in MIME format. --------------CBE0429D995BF7B869EA3CFE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear Sir/Madam, We are currently installing the Python application into our Unix Station. However, there is errors occurred after the steps of typing "./configure" and "make" commands. Will you be able to help us on solving the below issues? Thank you very much! Best Regards Wilson The errors are shown as below: typing command > ./config loading cache ./config.cache checking for --without-gcc... no checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking for ranlib... (cached) : checking for ar... (cached) ar checking MACHDEP... sunos5 checking for jpeg_destroy_compress in -ljpeg... (cached) no checking for deflate in -lz... (cached) yes checking how to run the C preprocessor... (cached) gcc -E checking for ANSI C header files... (cached) no checking for inline... (cached) inline checking whether byte ordering is bigendian... (cached) yes checking size of char... (cached) 0 checking size of short... (cached) 0 checking size of int... (cached) 0 checking size of long... (cached) 0 checking size of float... (cached) 0 checking size of double... (cached) 0 checking for working const... (cached) yes checking for prototypes... yes checking for unistd.h... (cached) yes checking for getpagesize... (cached) yes checking for working mmap... (cached) no creating ./config.status creating Makefile creating ImConfig.h ImConfig.h is unchanged ****************************************************************** typing command > make gcc -O -I./. -I/usr/local/include -DHAVE_CONFIG_H -c coretest.c -o coretest.o In file included from Imaging.h:22, from coretest.c:19: ImPlatform.h:19: #error Sorry, this library assumes ANSI header files. ImPlatform.h:37: #error Cannot find required 32-bit integer type ImPlatform.h:49: #error Cannot find required 32-bit floating point type make: *** [coretest.o] Error 1 --------------CBE0429D995BF7B869EA3CFE Content-Type: text/x-vcard; charset=us-ascii; name="wilson-k.h.cheung.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Wilson-K.H. Cheung Content-Disposition: attachment; filename="wilson-k.h.cheung.vcf" begin:vcard n:Cheung;Wilson-K.H. tel;work:852-26668557 x-mozilla-html:FALSE org:Motorola Semiconductors Hong Kong Ltd. version:2.1 email;internet:wilson-k.h.cheung@motorola.com title:Test Product Engineer adr;quoted-printable:;;2 Dai King St. =0D=0ATai Po Industrial Estate;Tai Po;N.T. ;;Hong Kong x-mozilla-cpt:;-1 fn:Wilson-K.H. Cheung end:vcard --------------CBE0429D995BF7B869EA3CFE-- From cbarker@jps.net Wed Mar 29 21:44:12 2000 From: cbarker@jps.net (Christopher Barker) Date: Wed, 29 Mar 2000 21:44:12 +0000 Subject: [Image-SIG] [Plot-SIG] Pixmap widget with access to pixels? References: <20000329170042.DA6401CD92@dinsdale.python.org> Message-ID: <38E2792C.9AD26839@jps.net> I'm pretty sure you could do this with wxPython, but I've never had occasion to do so, so I'm not quite sure. One of wxPython's shortcomings in relation to tkinter is it's lack of a high level canvas widget, but that might be perfedt for your needs! http://AllDunn.com/wxPython/ A quick post to the wxPython mailing list would answer the question, or you could write to Robin Dunn, the author of wxPython (robin@AllDunn.com). As a bonus, you'd get to use wxPython for the rest of the App! -Chris -- Christopher Barker, Ph.D. cbarker@jps.net --- --- --- http://www.jps.net/cbarker -----@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Water Resources Engineering ------ @ ------ @ ------ @ Coastal and Fluvial Hydrodynamics ------- --------- -------- ------------------------------------------------------------------------ ------------------------------------------------------------------------ From fredrik@pythonware.com Thu Mar 30 08:19:34 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 30 Mar 2000 10:19:34 +0200 Subject: [Image-SIG] installation problem References: <38E2A95C.4ADD5870@motorola.com> Message-ID: <001d01bf9a20$af6c6210$0500a8c0@secret.pythonware.com> Wilson-K.H. Cheung wrote: > checking for ANSI C header files... (cached) no > checking for inline... (cached) inline > checking whether byte ordering is bigendian... (cached) yes > checking size of char... (cached) 0 > checking size of short... (cached) 0 > checking size of int... (cached) 0 > checking size of long... (cached) 0 > checking size of float... (cached) 0 > checking size of double... (cached) 0 according to autoconf, you compiler thinks that sizeof() is zero. I doubt that's true... I suggest that you do a "make distclean", and run ./configure again. if the problem persists, studying the config.log file might help you figure out what's wrong. From fredrik@pythonware.com Thu Mar 30 08:50:00 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 30 Mar 2000 10:50:00 +0200 Subject: [Image-SIG] Question about adding a BOB datatype (loader/saver) References: <007901bf9827$58ef7da0$a5e501aa@blueshiftinc.com> Message-ID: <006c01bf9a24$effc9030$0500a8c0@secret.pythonware.com> Brett Tribble wrote: > I'm reworking one of the existing Image Plugins to load/save the BOB > image format. This format is very simple. It consists of two longs > representing Width, Height. 256 palette entries, the image data, > and that's it! that's not "simple", that's braindead. image formats without any kind of magic numbers are just plain evil. > t does not contain an Identifier string of any sort. Can I return None = as > the _accept value, or is there another way of doing this? given that there's no way to properly identify a BOB file based on its contents only ("assert filesize =3D=3D width*height+256" isn't strong enough), you cannot use the automatic open facilities at all. instead, people have to explicitly call a function in your support module (see GdImageFile.py for an example). you can still register a save function as usual, but as for automatic open, you're SOL. > After I have it working, where should I submit it to make it available > for others? post it somewhere, and post a link to this list and the vaults of parnassus (see www.python.org for a pointer). if you don't have a website, post the code to this list, so it ends up in the archive. From fredrik@pythonware.com Thu Mar 30 08:58:30 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 30 Mar 2000 10:58:30 +0200 Subject: [Image-SIG] Question about adding a BOB datatype (loader/saver) References: <007901bf9827$58ef7da0$a5e501aa@blueshiftinc.com> <006c01bf9a24$effc9030$0500a8c0@secret.pythonware.com> Message-ID: <008901bf9a26$1f30a660$0500a8c0@secret.pythonware.com> > "assert filesize =3D=3D width*height+256" isn't strong enough and neither is "assert filesize =3D=3D 8+256*3+width*height", of course. From KCAZA@cymbolic.com Thu Mar 30 16:45:33 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Thu, 30 Mar 2000 08:45:33 -0800 Subject: [Image-SIG] TrueType and Type 1 fonts with PIL Message-ID: This is an ideal solution... although it doesn=27t yet work for me (I=27m = using Windows, and it doesn=27t yet build on Windows)... Thanks for the patch, I hope I can use it soon=21 It=27ll save a LOT of = storage space, as large PIL fonts take a lot of room, and you need to pre-compile them at = all the sizes you want to use. Kevin. >>> Joerg Baumann = 03/25/00 05:03PM >>> After the short discussion about fonts and PIL, I wrote a small patch (attached to this mail) for Imaging-1.0. This patch uses the FreeType2 Beta library from www.freetype.org to enable ImageFont to use TrueType and Type 1 (and other) font-files. The FreeType2 Beta library does not run on all systems yet, but the development of FreeType1 is stopped, and I didn=B4t want to use a soon obsolete library. (It should run fine on most unix-boxes with gcc) In _imaging.c WITH_IMAGEFREETYPEFONT must be defined, and in Setup.in the location of the freetype-library must be adjusted. Old pil-font are loaded as it used to be: f=3DImageFont.load(=22courR14.pil=22) The new syntax to load fonts with freetype is: f=3DImageFont.load(=22verdana.ttf=22,0,30) the new options are face_index and size. Some of the now supported fontfiles support more than one face, you can select one with face_index (should be 0 in most cases) Size is the height of the font in pixels. This runs fine for me (linux 2.2.10, glibc 2.1) please try it, and if you find a bug, contact me. Regards, joerg Joerg Baumann joerg.baumann=40stud.informatik.uni-erlangen.de=20 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ =20 Beware of bugs in the above code; I have only proved it correct,=20 not tried it. Don Knuth=20 =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 = =20 =20