From tony at tcapp.com Fri Oct 1 22:10:46 2004 From: tony at tcapp.com (Tony Cappellini) Date: Fri Oct 1 22:07:54 2004 Subject: [Image-SIG] Adding a URL (text) to an image In-Reply-To: References: Message-ID: <20041001130657.H58387@yamato.yamato.com> Are there any examples of python scripts doing basic image editing like resizing a directory of files, or adding some text to an image, online ? I'd like to overlay a url(text only) onto some images. Depending on the image background color, I would need to change the color of the text. Is this technique of adding text to a graphic image called, watermarking, merging, or ??? in the graphics editing world? thanks From smurf at smurf.noris.de Sat Oct 2 17:57:45 2004 From: smurf at smurf.noris.de (Matthias Urlichs) Date: Sat Oct 2 17:58:29 2004 Subject: [Image-SIG] Fwd: Bug#274541: Wrong import order of ImagePlugins Message-ID: <20041002155745.GB6655@kiste> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.python.org/pipermail/image-sig/attachments/20041002/b25fdcb4/attachment.pgp From kent at springfed.com Sun Oct 3 22:17:25 2004 From: kent at springfed.com (Kent Tenney) Date: Sun Oct 3 22:17:34 2004 Subject: [Image-SIG] writing tEXt and zTXt chunks in png files Message-ID: <41605E55.20505@springfed.com> Howdy, I am interested in writing some routines to support this thumbnail managing standard; http://triq.net/~jens/thumbnail-spec/ Can I use PIL to write data to png files? Any examples available? Thanks, Kent From mcleod.norman at sympatico.ca Mon Oct 4 16:02:22 2004 From: mcleod.norman at sympatico.ca (Norman) Date: Mon Oct 4 16:00:36 2004 Subject: [Image-SIG] Re: PIL Message-ID: <1096898542.2051.5.camel@localhost> Hello, Question: Do I need to install PIl In Gramps Genealogy Software? Gramps operates okay, But before Gramps loads I get a pop up window stating, I cannot few thumbnails please install PIL I delete window and Gramps loads is PIL just an option? Thanks Norman From fredrik at pythonware.com Mon Oct 4 16:10:24 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Oct 4 16:08:22 2004 Subject: [Image-SIG] Re: PIL References: <1096898542.2051.5.camel@localhost> Message-ID: "Norman" wrote: > Question: Do I need to install PIl In Gramps Genealogy Software? Gramps > operates okay, But before Gramps loads I get a pop up window stating, I > cannot few thumbnails please install PIL I delete window and Gramps > loads is PIL just an option? you should probably ask this question in a Gramps forum; it's just one of many applications using PIL, and we cannot really provide support for all of them... from the look of it, the gramps-user list is what you're looking for: http://gramps.sourceforge.net/contact.html From fredrik at pythonware.com Mon Oct 4 16:15:30 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Oct 4 16:13:30 2004 Subject: [Image-SIG] ANN: PIL 1.1.5 beta 1 (october 3, 2004) Message-ID: PIL 1.1.5 beta 1 is now available from effbot.org: http://effbot.org/downloads#imaging (look for Imaging-1.1.5b1.tar.gz. if you're using Windows, get PIL-1.1.5b1 for your Python version) Changes in this release includes + Added new Sane release (from Ralph Heinkel). See the Sane/README and Sane/CHANGES files for more information. + Added experimental PngInfo chunk container to the PngImageFile module. This can be used to add arbitrary chunks to a PNG file. Create a PngInfo instance, use "add" or "add_text" to add chunks, and pass the instance as the "pnginfo" option when saving the file. + Added "getpalette" method. This returns the palette as a list, or None if the image has no palette. To modify the palette, use "getpalette" to fetch the current palette, modify the list, and put it back using "putpalette". + Added optional flattening to the ImagePath "tolist" method. tolist() or tolist(0) returns a list of 2-tuples, as before. tolist(1) returns a flattened list instead. + Some more (minor) build tweaks. For a list of other changes in 1.1.5, see this page: http://effbot.org/zone/pil-changes-115.htm Report bugs to this list or directly to me, as usual. enjoy /F From fredrik at pythonware.com Mon Oct 4 16:12:11 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Oct 4 16:20:32 2004 Subject: [Image-SIG] Re: writing tEXt and zTXt chunks in png files References: <41605E55.20505@springfed.com> Message-ID: Kent Tenney wrote: > I am interested in writing some routines to > support this thumbnail managing standard; > http://triq.net/~jens/thumbnail-spec/ > > Can I use PIL to write data to png files? in 1.1.5b1, you can do: import PngImagePlugin info = PngImagePlugin.PngInfo() info.add_text("KEY", "VALUE") # adds tEXt chunk ... image.save("somefile.png", pnginfo=info) you can get the latest beta here: http://effbot.org/downloads/#Imaging From tobe at quantentunnel.de Mon Oct 4 17:12:49 2004 From: tobe at quantentunnel.de (Tobias Herp) Date: Mon Oct 4 17:12:51 2004 Subject: [Image-SIG] Problem setting up PIL 1.1.4: setup.py bug? () Message-ID: <11341.1096902769@www51.gmx.net> Hi, everyone, I'm currently trying to install PIL 1.1.4 on my vServer running SuSE 9.0. The compilation of libImaging worked just fine, but "python setup.py build" yields: Traceback (most recent call last): File "setup.py", line 287, in ? extra_compile_args=EXTRA_COMPILE_ARGS, NameError: name 'EXTRA_COMPILE_ARGS' is not defined So, what would be the correct value for EXTRA_COMPILE_ARGS? Python version: Python 2.3.4 (#1, Aug 6 2004, 23:04:41) [GCC 3.3.1 (SuSE Linux)] on linux2 Any ideas? Thanks in advance, Tobias -- Mit freundlichen Gr??en Tobias Herp Fon 069 / 97 94 47 84 Mobil 0173 / 380 17 60 Schlo?stra?e 22 60486 Frankfurt From fredrik at pythonware.com Mon Oct 4 17:58:58 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Oct 4 17:56:57 2004 Subject: [Image-SIG] Re: Problem setting up PIL 1.1.4: setup.py bug? () References: <11341.1096902769@www51.gmx.net> Message-ID: Tobias Herp wrote: > I'm currently trying to install PIL 1.1.4 on my vServer running SuSE 9.0. > The compilation of libImaging worked just fine, but "python setup.py build" > yields: > > Traceback (most recent call last): > File "setup.py", line 287, in ? > extra_compile_args=EXTRA_COMPILE_ARGS, > NameError: name 'EXTRA_COMPILE_ARGS' is not defined > > So, what would be the correct value for EXTRA_COMPILE_ARGS? googling for the error message brings you to this page: http://effbot.org/zone/pil-errata-114.htm#PIL124 cheers /F From tobias.herp at gmx.de Mon Oct 4 22:22:49 2004 From: tobias.herp at gmx.de (Tobias Herp) Date: Mon Oct 4 22:22:54 2004 Subject: [Image-SIG] Re: Problem setting up PIL 1.1.4: setup.py bug? () In-Reply-To: References: <11341.1096902769@www51.gmx.net> Message-ID: <4161B119.6040007@gmx.de> Fredrik Lundh schrieb: > Tobias Herp wrote: >>I'm currently trying to install PIL 1.1.4 on my vServer running SuSE 9.0. >>The compilation of libImaging worked just fine, but "python setup.py build" >>yields: >> >>Traceback (most recent call last): >>File "setup.py", line 287, in ? >> extra_compile_args=EXTRA_COMPILE_ARGS, >>NameError: name 'EXTRA_COMPILE_ARGS' is not defined > > googling for the error message brings you to this page: > > http://effbot.org/zone/pil-errata-114.htm#PIL124 Ah, thanks. Somehow I overlooked this one. Installation of v1.1.5b1 seems to have worked. Tobias From kent at springfed.com Mon Oct 4 23:56:17 2004 From: kent at springfed.com (Kent Tenney) Date: Mon Oct 4 23:56:53 2004 Subject: [Image-SIG] Re: writing tEXt and zTXt chunks in png files In-Reply-To: References: <41605E55.20505@springfed.com> Message-ID: <4161C701.407@springfed.com> Wonderful! Initial tests indicate it works perfectly. Thanks, Kent Fredrik Lundh wrote: > Kent Tenney wrote: > > >>I am interested in writing some routines to >>support this thumbnail managing standard; >>http://triq.net/~jens/thumbnail-spec/ >> >>Can I use PIL to write data to png files? > > > in 1.1.5b1, you can do: > > import PngImagePlugin > info = PngImagePlugin.PngInfo() > info.add_text("KEY", "VALUE") # adds tEXt chunk > ... > image.save("somefile.png", pnginfo=info) > > you can get the latest beta here: > > http://effbot.org/downloads/#Imaging > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig > > From andre.kuehne at gmx.net Thu Oct 7 14:30:00 2004 From: andre.kuehne at gmx.net (Andre Kuehne) Date: Thu Oct 7 14:38:50 2004 Subject: [Image-SIG] draw.text problem Message-ID: <20041007123000.GA5352@aku> Hello. My problem is that draw.text() seems to cut the lowest row of a font. You can see that with the chars "gjQ{}[]" for example. I tried several TrueType fonts with the same result. There is a small test script attached, which shows the problem. You can look at its output here: http://hcoop.net/~aku/pil/text.png And here is an image which shows how "gjQ{}[]" should look like: http://hcoop.net/~aku/pil/text_ref.png I made this also with pil a while ago. But i don't know what changed since then. Do you get the same output with the script? Thanks in advance for any help. Regards -- _ _ _/\_| |_( )_ Andre Kuehne -------------- next part -------------- #!/usr/bin/python import Image, ImageDraw, ImageFont fontPath = "/usr/X11R6/lib/X11/fonts/truetype/verdanab.ttf" fontSize = 15 text = "efghijkOPQR{}[]!_()" fnt=ImageFont.truetype(fontPath, fontSize) image = Image.new("1",(200,40)) draw = ImageDraw.Draw(image) draw.text((0,0), text, font=fnt, fill=1) image.save('text.png') From P.C.M.Chiu at rl.ac.uk Wed Oct 6 19:02:50 2004 From: P.C.M.Chiu at rl.ac.uk (Chiu, PCM (Peter) ) Date: Thu Oct 7 15:39:53 2004 Subject: [Image-SIG] PIL 1.1.4 build problem on RedHat ES AS 3 Update 3 Message-ID: <49F73BEED865D3119F8700902773C9F904773403@exchange09.rl.ac.uk> Dear All, I am trying to build PIL 1.1.4 on a RedHat Enterprise AS 3 Update 3 box, but it fails at the process: python setup.py build in that it complains: _imagingtk.c:20:16: tk.h: No such file or directory and then crashed out. There were no errors reported when I followed the installation README file until this step. I have attached an extract of the error here. I then tried to copy a tk.h file from a RedHat 9 system, and repeated the build process. It gives more tk.h syntax errors unfortunately. Anyone has got any idea how to fix this? By the way, the system has the following installed: freetype-2.1.4-4.0 gnome-python2-1.99.14-5 gnome-python2-bonobo-1.99.14-5 gnome-python2-canvas-1.99.14-5 gnome-python2-gtkhtml2-1.99.14-5 libjpeg-6b-30 libxml2-python-2.5.10-6 mod_python-3.0.3-3.ent MySQL-python-0.9.1-6 python-2.2.3-5 python-devel-2.2.3-5 python-optik-1.4.1-2 rh-postgresql-python-7.3.6-7 rpm-python-4.2.3-10 zlib-1.1.4-8.1 zlib-devel-1.1.4-8.1 I have noticed that most of the libraries are residine under /usr/lib rather than /usr/local/lib as expected in Setup. Thank you. Regards, Peter Chiu CCLRC Rutherford Appleton Laboratory Space Science & Technology Department Building R25, Room 1.27 Chilton Didcot Oxfordshire OX11 0QX UK Phone: +44-(0)1235-446699 Fax: +44-(0)1235-445848 Email: P.Chiu@rl.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20041006/bd3e8687/attachment.htm From P.C.M.Chiu at rl.ac.uk Wed Oct 6 19:33:03 2004 From: P.C.M.Chiu at rl.ac.uk (Chiu, PCM (Peter) ) Date: Thu Oct 7 15:39:54 2004 Subject: [Image-SIG] PIL 1.1.4 build problem on RedHat ES AS 3 Update 3 - 2 Message-ID: <49F73BEED865D3119F8700902773C9F904773409@exchange09.rl.ac.uk> I have later found out tk.h comes in tk-devel kit. I have loaded the rpm onto the RedHat AS 3U3 box, cleaned up the whole Extensions tree, and started from fresh. This time, I still hit a problem on python setup.py build. It complains: _imagingtk.c:23: syntax error before '*' token and finaly erro: command `gcc` failed with exit status 1 So I would appreciate some help in mounting PIL 1.1.4 on RedHat Enterprise 3U3. Peter > -----Original Message----- > From: Chiu, PCM (Peter) > Sent: 06 October 2004 18:03 > To: 'image-sig@python.org' > Cc: Chiu, PCM (Peter) > Subject: PIL 1.1.4 build problem on RedHat ES AS 3 Update 3 > > Dear All, > > I am trying to build PIL 1.1.4 on a RedHat Enterprise AS 3 Update 3 box, > but it fails at the process: > > python setup.py build > > in that it complains: > > _imagingtk.c:20:16: tk.h: No such file or directory > > and then crashed out. > There were no errors reported when I followed the installation README file > until this step. > > I have attached an extract of the error here. > > I then tried to copy a tk.h file from a RedHat 9 system, and repeated the > build process. > It gives more tk.h syntax errors unfortunately. > > Anyone has got any idea how to fix this? > > By the way, the system has the following installed: > > freetype-2.1.4-4.0 > gnome-python2-1.99.14-5 > gnome-python2-bonobo-1.99.14-5 > gnome-python2-canvas-1.99.14-5 > gnome-python2-gtkhtml2-1.99.14-5 > libjpeg-6b-30 > libxml2-python-2.5.10-6 > mod_python-3.0.3-3.ent > MySQL-python-0.9.1-6 > python-2.2.3-5 > python-devel-2.2.3-5 > python-optik-1.4.1-2 > rh-postgresql-python-7.3.6-7 > rpm-python-4.2.3-10 > zlib-1.1.4-8.1 > zlib-devel-1.1.4-8.1 > > I have noticed that most of the libraries are residine under /usr/lib > rather than /usr/local/lib as expected in Setup. > > Thank you. > > Regards, > Peter Chiu > > CCLRC Rutherford Appleton Laboratory > Space Science & Technology Department > Building R25, Room 1.27 > Chilton > Didcot > Oxfordshire > OX11 0QX > UK > > Phone: +44-(0)1235-446699 > Fax: +44-(0)1235-445848 > Email: P.Chiu@rl.ac.uk > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20041006/f5c5c596/attachment.html From P.C.M.Chiu at rl.ac.uk Wed Oct 6 19:34:11 2004 From: P.C.M.Chiu at rl.ac.uk (Chiu, PCM (Peter) ) Date: Thu Oct 7 15:39:54 2004 Subject: [Image-SIG] RE: PIL 1.1.4 build problem on RedHat ES AS 3 Update 3 - 2 Message-ID: <49F73BEED865D3119F8700902773C9F90477340A@exchange09.rl.ac.uk> Skipped content of type multipart/alternative-------------- next part -------------- An embedded message was scrubbed... From: root Subject: Date: Wed, 6 Oct 2004 18:27:10 +0100 Size: 44482 Url: http://mail.python.org/pipermail/image-sig/attachments/20041006/403c3796/attachment-0001.mht From P.C.M.Chiu at rl.ac.uk Thu Oct 7 10:53:46 2004 From: P.C.M.Chiu at rl.ac.uk (Chiu, PCM (Peter) ) Date: Thu Oct 7 15:39:55 2004 Subject: [Image-SIG] PIL 1.1.4 build problem on RedHat ES AS 3 Update 3 - now ok Message-ID: <49F73BEED865D3119F8700902773C9F90477341D@exchange09.rl.ac.uk> Dear all, I dropped a few postings last night regarding the building on PIL 1.1.4 on a RedHat Enterprise AS 3 U3 system. (I have not seen any of my posts back though since the posting last night). This is just a quick note to say that I have managed to work out where the problem was, and get the sources to compile. Apparently under RH Enterprise, the header files for tcl and tk are no longer bundled with their kits, but placed under the development RPM. They in turn require quite a bit of dependent packages to be loaded. But once done, the python build script works ok. I can get our users to try out the newly built PIL. Regards, Peter Chiu CCLRC Rutherford Appleton Laboratory Space Science & Technology Department Building R25, Room 1.27 Chilton Didcot Oxfordshire OX11 0QX UK Phone: +44-(0)1235-446699 Fax: +44-(0)1235-445848 Email: P.Chiu@rl.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20041007/2a3749d5/attachment.htm From fredrik at pythonware.com Thu Oct 7 17:01:03 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu Oct 7 16:59:00 2004 Subject: [Image-SIG] Re: draw.text problem References: <20041007123000.GA5352@aku> Message-ID: Andre Kuehne wrote: > I made this also with pil a while ago. But i don't know what changed > since then. Do you get the same output with the script? have you updated PIL and/or the freetype2 libraries? I get better results on my machine (using verdanab.ttf from Windows XP and freetype 2.1.8), but I can see similar problems at some font sizes. freetype isn't exactly the most stable and well-documented API you can find, so I'm probably using and old API which they have broken since then. I'll take a look when I find the time (patches are welcome, if some freetype expert has more time to spare than I have...) From noreply at python.org Thu Oct 7 19:11:05 2004 From: noreply at python.org (The Post Office) Date: Thu Oct 7 19:12:58 2004 Subject: [Image-SIG] MDaemon Warning - virus found: image-sig@python.org Message-ID: <20041007171256.6F5861E4002@bag.python.org> ******************************* WARNING ****************************** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. Attachment Virus name Action taken ---------------------------------------------------------------------- document.exe I-Worm.Mydoom.m Removed ********************************************************************** Your message was not delivered due to the following reason: Your message could not be delivered because the destination computer was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 8 days: Host 147.84.183.51 is not responding. The following recipients could not receive this message: Please reply to postmaster@python.org if you feel this message to be in error. From Chris.Barker at noaa.gov Wed Oct 6 19:22:37 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Thu Oct 7 19:22:46 2004 Subject: [Image-SIG] Re: draw.text problem In-Reply-To: References: <20041007123000.GA5352@aku> Message-ID: <416429DD.1000505@noaa.gov> Fredrik Lundh wrote: > freetype isn't exactly the most stable and well-documented API you can > find, so I'm probably using and old API which they have broken since then. > > I'll take a look when I find the time (patches are welcome, if some freetype > expert has more time to spare than I have...) This reminds me of a question that I've been meaning to ask: Have you considered using Antigrain Graphics as the drawing engine for PIL? It produces very nice anti-aliased graphics and text. There have been numerous discussions on various mailing lists about how nice it would be to have a general purpose Python wrapper for AGG. It's being used in SciPy/Chaco and matplotlib, but they've only wrapped up the specific functionality that they need. Maybe PIL would be a good place to put it. http://www.antigrain.com/ -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From andre.kuehne at gmx.net Fri Oct 8 10:46:06 2004 From: andre.kuehne at gmx.net (Andre Kuehne) Date: Fri Oct 8 10:55:23 2004 Subject: [Image-SIG] draw.text problem In-Reply-To: <20041007123000.GA5352@aku> References: <20041007123000.GA5352@aku> Message-ID: <20041008084606.GA4516@aku> Don't know if it helps, but i'm using the latest versions of freetype and PIL currently available in gentoo linux, which are dev-python/imaging-1.1.4 media-libs/freetype-2.1.5-r1 > freetype-config --version 9.4.3 I also unmasked and installed freetype 2.1.7 and 2.1.9, but then PIL doesn't compile (which is why they are masked obviously). Also earlier versions of PIL do not compile against freetype 2.1.5. -- _ _ _/\_| |_( )_ Andre Kuehne From frederikfix at eml.cc Fri Oct 8 17:49:58 2004 From: frederikfix at eml.cc (Frederik Fix) Date: Fri Oct 8 17:49:59 2004 Subject: [Image-SIG] System Error: unknown raw mode Message-ID: <1097250598.16521.206064092@webmail.messagingengine.com> Hi, I have a problem with the Image.tostring() method. When I call it on an Image create with Image.new() and mode "RGBX" I receive a System Error: unknown raw mode. When I call it with the "RGB" mode it works. Images loaded with Image.load() work without a problem. See below for a transcript. Am I missing something? Thanks in advance, Frederik Fix Python 2.3.4 (#1, Sep 22 2004, 20:43:21) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> i1 = Image.open("f.jpg") >>> s1 = i1.tostring("raw", "RGBX", 0, -1) >>> i2 = Image.new("RGBA", (10,10)) >>> s2 = i2.tostring("raw", "RGB", 0, -1) >>> s2 = i2.tostring("raw", "RGBX", 0, -1) Traceback (most recent call last): File "", line 1, in ? File "/sw/lib/python2.3/site-packages/PIL/Image.py", line 439, in tostring e = _getencoder(self.mode, encoder_name, args) File "/sw/lib/python2.3/site-packages/PIL/Image.py", line 323, in _getencoder return apply(encoder, (mode,) + args + extra) SystemError: unknown raw mode >>> From fredrik at pythonware.com Fri Oct 8 22:41:03 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Oct 8 22:38:59 2004 Subject: [Image-SIG] Re: System Error: unknown raw mode References: <1097250598.16521.206064092@webmail.messagingengine.com> Message-ID: Frederik Fix wrote: > I have a problem with the Image.tostring() method. When I call it on an > Image create with Image.new() and mode "RGBX" I receive a System Error: > unknown raw mode. When I call it with the "RGB" mode it works. Images > loaded with Image.load() work without a problem. See below for a > transcript. >>>> i2 = Image.new("RGBA", (10,10)) >>>> s2 = i2.tostring("raw", "RGBX", 0, -1) > Traceback (most recent call last): > File "", line 1, in ? > File "/sw/lib/python2.3/site-packages/PIL/Image.py", line 439, in > tostring > e = _getencoder(self.mode, encoder_name, args) > File "/sw/lib/python2.3/site-packages/PIL/Image.py", line 323, in > _getencoder > return apply(encoder, (mode,) + args + extra) > SystemError: unknown raw mode what do you expect that line to do? there's no tostring packer defined for RGBA->RGBX. if you want to store the pixels as 32-bit entities, just store them as is (RGBA instead of RGBX). if you want to get rid of the alpha, convert to RGB before storing as RGBX. From fredrik at pythonware.com Fri Oct 8 22:49:25 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Oct 8 22:47:22 2004 Subject: [Image-SIG] Re: draw.text problem References: <20041007123000.GA5352@aku> <416429DD.1000505@noaa.gov> Message-ID: Chris Barker wrote: > Have you considered using Antigrain Graphics as the drawing engine for PIL? http://effbot.org/zone/draw-agg.htm more later. From Chris.Barker at noaa.gov Fri Oct 8 23:13:53 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri Oct 8 23:13:55 2004 Subject: [Image-SIG] Re: draw.text problem In-Reply-To: References: <20041007123000.GA5352@aku> <416429DD.1000505@noaa.gov> Message-ID: <41670311.8050709@noaa.gov> Fredrik Lundh wrote: > http://effbot.org/zone/draw-agg.htm > > more later. Very cool! thanks Fredrik. -CHB -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From andre.kuehne at gmx.net Sun Oct 10 14:19:11 2004 From: andre.kuehne at gmx.net (Andre Kuehne) Date: Sun Oct 10 14:27:52 2004 Subject: [Image-SIG] draw.text problem In-Reply-To: <20041007123000.GA5352@aku> References: <20041007123000.GA5352@aku> Message-ID: <20041010121911.GA4553@aku> In the hope that a later freetype version solves the problem, i installed freetype-2.1.9 into my home dir. Now how can i configure PIL to use this freetype version instead of the one installed under /usr ? I looked at ./configure --help and the docs but didn't find information on it. Regards -- _ _ _/\_| |_( )_ Andre Kuehne From postmaster at python.org Mon Oct 11 09:13:00 2004 From: postmaster at python.org (Bounced mail) Date: Mon Oct 11 09:03:03 2004 Subject: [Image-SIG] Delivery reports about your e-mail Message-ID: <20041011070302.A2E551E4002@bag.python.org> Dear user of python.org, Your e-mail account was used to send a large amount of spam messages during the recent week. Most likely your computer was compromised and now runs a hidden proxy server. We recommend that you follow instruction in order to keep your computer safe. Have a nice day, python.org support team. From s4046441 at student.uq.edu.au Thu Oct 14 14:23:27 2004 From: s4046441 at student.uq.edu.au (Ms Soo Chong) Date: Thu Oct 14 14:23:32 2004 Subject: [Image-SIG] Uploading and image file from a form (Newbie) Message-ID: <879ff9876264.876264879ff9@uq.edu.au> Hi all, I have a form where users can use it to upload images into a file and save it into a directory. I have installed PIL and Image module and do a fair bit of reading on these module. But I don't know how can I use python to get the uploaded image file from the form. Can I use something like that: ###################################################### im_file = form["userfile"] ###################################################### im = Image.open(im_file) im.show() #################################################### Can someone help? Many thanks.... Shufen From s4046441 at student.uq.edu.au Fri Oct 15 04:11:27 2004 From: s4046441 at student.uq.edu.au (Ms Soo Chong) Date: Fri Oct 15 04:11:33 2004 Subject: [Image-SIG] t Uploading and image file from a form (Newbie) Message-ID: <8780748770cf.8770cf878074@uq.edu.au> Hi all, I have a form where users can use it to upload images into a file and save it into a directory. I have installed PIL and Image module and do a fair bit of reading on these module. But I don't know how can I use python to get the uploaded image file from the form. Can I use something like that: ###################################################### im_file = form["userfile"] ###################################################### im = Image.open(im_file) im.show() #################################################### Can someone help? Many thanks.... Shufen From nadavh at visionsense.com Mon Oct 11 17:06:18 2004 From: nadavh at visionsense.com (Nadav Horesh) Date: Sat Oct 16 14:32:51 2004 Subject: [Image-SIG] Using MESH method of Image.transform Message-ID: <07C6A61102C94148B8104D42DE95F7E86DEE23@exchange2k.envision.co.il> Does someone can give me an example of using Image.transform to deform an image via the MESH method? Tanks, Nadav. From k.yokoi at aist.go.jp Mon Oct 18 09:29:51 2004 From: k.yokoi at aist.go.jp (Kenji YOKOI) Date: Mon Oct 18 09:29:58 2004 Subject: [Image-SIG] Speed of Image.crop Message-ID: <7F9F09B0-20D7-11D9-A550-000A95DA753E@aist.go.jp> Hi all, I am trying to draw a cropped image from a larger image smoothly every frame. Essentially there is no problem to crop a image (image.crop) every frame even at 140Hz (about 7ms). But, when the cropping size exceeds 512x512, the cropping performance suddenly drops to 50ms or more. This situation was confirmed under Windows2000 and Mac OSX 10.3. Is this a PIL problem or a hardware problem (such as a video card or AGP bus speed) ? Anyone has any idea? Thanks in advance, Kenji Yokoi From david.crabb at ntu.ac.uk Mon Oct 18 12:44:24 2004 From: david.crabb at ntu.ac.uk (Crabb, David) Date: Mon Oct 18 12:44:25 2004 Subject: [Image-SIG] QUERY: metric for the 'quality' of aligning an image Message-ID: Dear all, I hope someone might be able to help with what might be a *very* simple question. We have some clinical images (normally a sequence of 3) that we are trying to 'align'. We would hope that these grey scale images (256 by 256) are identical and we are trying to come up with a way of quantifying the 'agreement'. We have been simply using the mean standard deviation of the pixel heights (MSDPH). Could someone provide me with a reference for alternative similarity metrics? In particular some images have more features (edges) than others, so my intuition tells me we need to correct for this in out metric, hence the unsuitability of MSDPH). Thanks for your patience! ----------------------------------------------- Dr. David Crabb School of Science, The Nottingham Trent University, Clifton Campus, Nottingham. NG11 8NS Tel: 0115 848 3275 Fax: 0115 848 6690 DISCLAIMER: This email is intended solely for the addressee. It may contain private and confidential information. If you are not the intended addressee, please take no action based on it nor show a copy to anyone. In this case, please reply to this email to highlight the error. Opinions and information in this email that do not relate to the official business of Nottingham Trent University shall be understood as neither given nor endorsed by the University. Nottingham Trent University has taken steps to ensure that this email and any attachments are virus-free, but we do advise that the recipient should check that the email and its attachments are actually virus free. This is in keeping with good computing practice. From fredrik at pythonware.com Mon Oct 18 20:32:06 2004 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Oct 18 20:29:59 2004 Subject: [Image-SIG] Re: Speed of Image.crop References: <7F9F09B0-20D7-11D9-A550-000A95DA753E@aist.go.jp> Message-ID: Kenji YOKOI wrote > I am trying to draw a cropped image from a larger image smoothly every frame. Essentially there is > no problem to crop a image (image.crop) every frame even at 140Hz (about 7ms). But, when the > cropping size exceeds 512x512, the cropping performance suddenly drops to 50ms or more. This > situation was confirmed under Windows2000 and Mac OSX 10.3. Is this a PIL problem or a hardware > problem (such as a video card or AGP bus speed) ? are we talking about color images? if so, you're actually hitting a limit in PIL: the internal storage module switches allocation strategy for images that need more than 1 mega- byte of storage. It's unlikely that the alternate storage strategy can explain a 7x performance drop, but one never knows... to see if this is the problem, you have to edit the libImaging/Storage.c file. change #define THRESHOLD 1048576L to, say, #define THRESHOLD 4*1048576L and rebuild. (I should probably increase the threshold in 1.1.5 final; PIL's almost 10 years old, so parameters like this could need some tuning...) From janssen at parc.com Mon Oct 18 21:10:29 2004 From: janssen at parc.com (Bill Janssen) Date: Mon Oct 18 21:11:01 2004 Subject: [Image-SIG] Re: Speed of Image.crop In-Reply-To: Your message of "Mon, 18 Oct 2004 11:32:06 PDT." Message-ID: <04Oct18.121030pdt."58617"@synergy1.parc.xerox.com> > (I should probably increase the threshold in 1.1.5 final; PIL's almost > 10 years old, so parameters like this could need some tuning...) Why not make it a variable, and add a function to allow it to be dynamically set? It's only used in that one call. Bill From jepler at unpythonic.net Tue Oct 19 01:56:43 2004 From: jepler at unpythonic.net (Jeff Epler) Date: Tue Oct 19 01:56:46 2004 Subject: [Image-SIG] Speeding up image.resize() Message-ID: <20041018235643.GA26950@unpythonic.net> After seeing how slow image.resize() is, especially ANTIALIAS, I looked at the underlying code in libImaging. I examined the object code produced for Antialias.c. On my system (linux on intel) not only is there a function call for XXX_filter, but antialias_filter has more function calls inside as well (including a call to libm's sin()) To improve the speed, I made all the XXX_filter functions (including sinc_filter) 'static inline', and moved most of the body of ImagingStretch into an include file, which is included once for each filter. ImagingStretch now dispatches to one of the 4 _XXX_filter functions, instead of merely setting some function pointers. I also set some extra_compile_args appropriate for my system and compiler: exts = [(Extension( "_imaging", files, libraries=libs, define_macros=defs, extra_compile_args=['-O3', '-march=pentium4', '-mfpmath=sse', '-msse2', '-ffast-math', '-mno-ieee-fp'] ))] In their current form, I doubt these changes are suitable for inclusion in Imaging (because of the use of the "inline" extension and specialized gcc compiler flags). However, I thought this might be helpful to someone. If there's interest, I can produce a patch. How much difference? I used 'timeit' on Imaging-1.1.5b1 and my modified version of it. I tested on a laptop with a 1.5GHz Pentium-M CPU, with SpeedStep disabled. The script: import Image i=Image.open('test.jpg') i.thumbnail((1024,768), Image.ANTIALIAS) i.load() test.jpg is a 3072x2048 digital camera image, which (I assume) is loaded as 1532x1024 and resized to 1024x682. 1.1.5b1 gives: 10 loops, best of 3: 1.24e+06 usec per loop (1240 msec) My version gives: 10 loops, best of 3: 6.99e+05 usec per loop (699 msec) That's a 43% speedup. Here's data for all filters: (times in msec) Filter Vanilla Patched Speedup ANTIALIAS 1240 699 43% BICUBIC 783 626 20% BILINEAR 576 439 23% NEAREST 411 517 -26% (!) Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20041018/5c5d5b68/attachment.pgp From nadavh at visionsense.com Wed Oct 20 15:12:44 2004 From: nadavh at visionsense.com (Nadav Horesh) Date: Wed Oct 20 15:12:56 2004 Subject: [Image-SIG] Using MESH method of Image.transform Message-ID: <07C6A61102C94148B8104D42DE95F7E86DEE2C@exchange2k.envision.co.il> Atteched here a function that generates a quadratic distortion mesh for an image. Its doc string docuiments how to use it. The Image.trasform->MESH method uses repetitive calls to Image.transform->QUAD method. Thus, as documented, MESH data, is just a list of QUAD data. You should pay attention to to following: 1. There is a spedific order of the rectangle and the quadrilateral vertices. 2. Two adjacent quadrilaterals in the mesh have a common edge. You should provide this edge twice --- once for each quadrilateral. I hope that the attached function would help to clarify. Nadav. -----Original Message----- From: Kent Tenney [mailto:kent@springfed.com] Sent: Wed 20-Oct-04 03:36 To: Nadav Horesh Cc: Subject: Re: [Image-SIG] Using MESH method of Image.transform Nadav, I would be very interested in seeing a bit of your code. Thanks, Kent Nadav Horesh wrote: > Eventually I figured it by my self. It looks OK mostly on photo images, but I am not absolutely sure that whatI did is 100% correct. > The other possibility is to use numarray.nd_image.map_coordinates method. However there is a basic differnece between the two approches (of numarray's and Image packages), you can find somae basic tutorial on mesh-grids in IBM's opendx library. > > If you are willing to take the risk, I can provide you with an explanation of what I did. > > Nadav. > > -----Original Message----- > From: Kent Tenney [mailto:kent@springfed.com] > Sent: Tue 19-Oct-04 11:47 > To: Nadav Horesh > Cc: > Subject: Re: [Image-SIG] Using MESH method of Image.transform > Nadav, > > Did you ever get any help on this? > I am also interested in the answer > to your question. > > Thanks, > Kent > > Nadav Horesh wrote: > >>Does someone can give me an example of using Image.transform to deform an image via the MESH method? >> >> Tanks, >> Nadav. >>_______________________________________________ >>Image-SIG maillist - Image-SIG@python.org >>http://mail.python.org/mailman/listinfo/image-sig >> >> > > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: barrel.py Type: application/octet-stream Size: 1688 bytes Desc: barrel.py Url : http://mail.python.org/pipermail/image-sig/attachments/20041020/98107db6/barrel.obj From k.yokoi at aist.go.jp Fri Oct 22 08:41:21 2004 From: k.yokoi at aist.go.jp (Kenji YOKOI) Date: Fri Oct 22 08:41:28 2004 Subject: [Image-SIG] Re: Speed of Image.crop In-Reply-To: <20041019100138.E9A481E4005@bag.python.org> References: <20041019100138.E9A481E4005@bag.python.org> Message-ID: <627C7C46-23F5-11D9-9085-000A95DA753E@aist.go.jp> Fredrik Lundh wrote > > are we talking about color images? > > if so, you're actually hitting a limit in PIL: the internal storage > module > switches allocation strategy for images that need more than 1 mega- > byte of storage. It's unlikely that the alternate storage strategy can > explain a 7x performance drop, but one never knows... > > to see if this is the problem, you have to edit the > libImaging/Storage.c > file. change > > #define THRESHOLD 1048576L > > to, say, > > #define THRESHOLD 4*1048576L > > > and rebuild. > > (I should probably increase the threshold in 1.1.5 final; PIL's almost > 10 years old, so parameters like this could need some tuning...) > Thanks for your reply. I tried and tried to rebuild the library as suggested, but unfortunately I could not. It is hard, since I am unfamiliar with compiling C especially in Windows, and I do not have the MS Visual C compiler. So could you anyone send me the customized version of PIL ? Kenji Yokoi From fredrik.johansson at gmail.com Fri Oct 22 20:23:20 2004 From: fredrik.johansson at gmail.com (Fredrik Johansson) Date: Fri Oct 22 20:23:23 2004 Subject: [Image-SIG] Applying a palette to an image Message-ID: <3d0cebfb041022112343638524@mail.gmail.com> Hi, Is there a way to apply a custom palette to an RGB-mode image using PIL? I've looked at .putpalette and .convert and it seems there is only support for either converting to the special web-safe palette or generating a new palette based on the colors in the image. I am writing a game editing application that is able to load images from conventional files and convert them into a specialized format, mapping colors to the game's pre-defined palette. Going from file to raw bytes via PIL, and then through a routine that shuffles pixels around to the specialized format, is fast enough even though the last step is coded in Python. However, matching colors from a palette with Python when starting from a 24-bit image is a serious bottleneck. If there is any way this can be done with PIL that I've missed (I wouldn't be surprised), information would be much appreciated. In case there isn't, I might have to put the palette lookup code in a C extension, which would be somewhat inconvenient. In that case, I'd also take the opportunity to request humbly that this feature be included in future versions of PIL. Thanks, Fredrik Johansson From patrickspierce at yahoo.com Fri Oct 22 20:53:15 2004 From: patrickspierce at yahoo.com (Scott Pierce) Date: Fri Oct 22 20:53:38 2004 Subject: [Image-SIG] TIFF and units Message-ID: <4179571B.4060308@yahoo.com> Can anyone tell me how to set the resolution unit when saving a tiff? I set the dpi but it is unitless so doesn't register the dpi properly. I am using the 1.5 alpha release as I couldn't set dpi at all prior to 1.5. I set the dpi like so: orig.save('/tmp/orig.tif',dpi=(300,300)) but haven't figured out how to get the unit correct. Here is the original files info: TIFF Directory at offset 0x8 Subfile Type: (0 = 0x0) Image Width: 1359 Image Length: 1355 *Resolution: 300, 300 pixels/inch* Bits/Sample: 8 Compression Scheme: None Photometric Interpretation: min-is-black Samples/Pixel: 1 Rows/Strip: 753 Planar Configuration: single image plane and the saved one: TIFF Directory at offset 0x8 Image Width: 1359 Image Length: 1355 * Resolution: 300, 300 (unitless)* Bits/Sample: 8 Compression Scheme: None Photometric Interpretation: min-is-black Rows/Strip: 1355 Planar Configuration: single image plane Scott Pierce From dvarrazzo at virgilio.it Mon Oct 25 01:42:37 2004 From: dvarrazzo at virgilio.it (Daniele Varrazzo) Date: Mon Oct 25 01:42:56 2004 Subject: [Image-SIG] Questions about a 16bpp TIFF Message-ID: Hi everybody, i am trying to use PIL for a 2d electrophoresis gel images database. Those images are TIFFs obtained from a densitometer, so lower values are interpreted as white. The precision is 16bpp. This combination yelds a key (0, 1, (16,), ()) for OPEN_INFO, but there is not such entry, so the opening fails. Can those images be opened through PIL by simply adding a new key to OPEN_INFO or the workaround is more complex? What values? By now i tried duplicating the values for (1, 1, (16,), ()) and inverting the image. I need to convert the image into something suitable for the web, i.e. downsize it and store into an 8 bit jpeg. It looks like Image.convert('L') simply crops what's more than 255, so i should multiply each pixel for 1/256 before converting. How can i do it? The only way looks like ImageChops.add(img, ImageChops.constant(img, 0), 1.0/256) but it can't be like that! Both because creating and adding zeros looks like a waste of time and because it doesn't work for 16bpp images. How can i convert a 16bpp grayscale image into an 8bpp without a level rescale instead of a cropping? Some hardware return a 12 bpp image, so only 8192 from 65536 gray levels are actually used. Thus the multiplying factor should take into account the max gray level. But getextrema returns None, even if the manual states it works for single plane images. Is it a bug "or a feature"? Is PIL the right package for my needs? Is there any easy way to obtain a numeric or numarray matrix from the image to freely work over it? To get a copy of the image i am talking about, you can download and install the demo version of the ImageMaster program at http://promo.amershambiosciences.com/INTL/imagemaster_demo/ and play with the file C:\Program Files\Amersham Biosciences\ImageMaster 2D Platinum Trial\Gels\ECOLI.mel (it is a TIFF image with some extra tags) or ask me for some image (if you don't want to download the 12MB package). Any help would be appreciated. Thank you in advance. Daniele From stan at saticed.me.uk Wed Oct 27 11:53:08 2004 From: stan at saticed.me.uk (Tristan Hill) Date: Wed Oct 27 11:53:26 2004 Subject: [Image-SIG] python version compatibility Message-ID: <20041027095307.GA30716@marge.cehill.co.uk> >From the readme with 1.1.5b1 the library is stated to run under python 1.5.2. Does this mean that any contributed code is required to be compatible with python 1.5.2 (i.e use no python2 features)? I'm needing to make changes to the sane module if that is of any relevance. Thanks From rodsenra at gpr.com.br Wed Oct 27 20:04:34 2004 From: rodsenra at gpr.com.br (Rodrigo Dias Arruda Senra) Date: Wed Oct 27 20:04:37 2004 Subject: [Image-SIG] Cookbook for making transparent indexed png images ? In-Reply-To: References: Message-ID: <20041027160434.00003efd@Fenix> Hi, I'm trying to generate a Transparent PNG image, supported by both Mozilla and IE6.0. The code below gets the job done for Mozilla, but fails for IE. When I generate indexed PNG images, I get a black background instead of a transparent one. Moreover, I saw references in the mailing list to the .info['transparency'], but I do not know how to used it or even if this is still supported ? I would appreciate any hint or documentation pointers on the subject. best regards, Senra def make_label(label, fontsize, fg=(0,0,0), bg=(0,0,0)): font = ImageFont.truetype("FUNKY.TTF", fontsize) fontMask = Image.new("RGBA", (10,10), None) draw = ImageDraw.Draw(fontMask) sizex,sizey = draw.textsize(label, font=font) fontMask = fontMask.resize((sizex, sizey)) draw = ImageDraw.Draw(fontMask) bimsize = (sizex, sizey) width, height = bimsize xoff = yoff = 0 draw.text((xoff,yoff), label,fill=fg,font=font) # My ultimate goal was to generate transparent indexed images #fontMask = fontMask.convert('P', dither=Image.NONE, # palette=Image.ANTIALIAS) # saw references to that in the mailing list # #fontMask.info['transparency']=(0,0,0) fontMask.save('x.png','PNG') From rodsenra at gpr.com.br Wed Oct 27 21:53:59 2004 From: rodsenra at gpr.com.br (Rodrigo Dias Arruda Senra) Date: Wed Oct 27 21:54:02 2004 Subject: [Image-SIG] Cookbook for making transparent indexed png images ? In-Reply-To: <20041027160434.00003efd@Fenix> References: <20041027160434.00003efd@Fenix> Message-ID: <20041027175359.00001390@Fenix> [ Rodrigo Dias Arruda Senra ]: -------------------------------------------------------- | > Hi, > > I would appreciate any hint or documentation pointers on the subject. Answering my own dumb question ;o), I found up-to-date info that solved the problem here: http://effbot.org/zone/pil-format-png.htm By the way, I'd like to thank all that controbuted to this wonderful tool (specially Fredrik). cheers, Rod Senra From thomasn at jps.net Thu Oct 28 09:58:26 2004 From: thomasn at jps.net (thomasn@jps.net) Date: Thu Oct 28 09:59:53 2004 Subject: [Image-SIG] MDaemon Warning - virus found: Hi Message-ID: <20041028075951.DDC731E4003@bag.python.org> ******************************* WARNING ****************************** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. Attachment Virus name Action taken ---------------------------------------------------------------------- loi.zip I-Worm.Mydoom.m Removed ********************************************************************** The original message was received at Thu, 28 Oct 2004 09:58:26 +0200 from jps.net [7.47.151.219] ----- The following addresses had permanent fatal errors ----- image-sig@python.org ----- Transcript of session follows ----- ... while talking to mail server 223.77.151.177: >>> DATA <<< 400-aturner; %MAIL-E-OPENOUT, error opening !AS as output <<< 400-aturner; -SYSTEM-F-EXDISKQUOTA, disk quota exceeded <<< 400 From postmaster at python.org Thu Oct 28 15:53:48 2004 From: postmaster at python.org (Mail Delivery Subsystem) Date: Thu Oct 28 15:55:22 2004 Subject: [Image-SIG] MDaemon Warning - virus found: Returned mail: Data format error Message-ID: <20041028135514.423571E400B@bag.python.org> ******************************* WARNING ****************************** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. Attachment Virus name Action taken ---------------------------------------------------------------------- text.exe I-Worm.Mydoom.m Removed ********************************************************************** Your message was not delivered due to the following reason(s): Your message was not delivered because the destination server was unreachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message was not delivered within 8 days: Host 185.109.141.36 is not responding. The following recipients did not receive this message: Please reply to postmaster@python.org if you feel this message to be in error. From olli.s.rajala at tut.fi Thu Oct 28 16:52:44 2004 From: olli.s.rajala at tut.fi (Olli Rajala) Date: Thu Oct 28 16:52:46 2004 Subject: [Image-SIG] a bug in PIL? Message-ID: <20041028145244.GB29451@students.cc.tut.fi> Hi! I tried to install PIL, but it gave some errors. I asked about these errors in Python tutor-mailing list and they said to ask here. So, here I am now. :) If you need some additional info, just ask. Some guy said "After a quick look at setup.py I think this is a bug. EXTRA_COMPILE_ARGS is only defined if Tkinter is present but it is used outside the test for Tkinter." So, is this a bug or only an (un)documented feature? ;) Oh, I don't have root-account in that machine (it's in my school) so is it possible to install/use PIL there? ************************************************** [mozart 2] ~/python > tar zcvf Imaging-1.1.4.tar.gz [mozart 3] ~/python > cd Imaging-1.1.4/libImaging/ [mozart 4] ~/python/Imaging-1.1.4/libImaging > [mozart 5] ~/python/Imaging-1.1.4/libImaging > ./configure creating cache ./config.cache checking for --without-gcc... no checking for gcc... 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... yes checking whether gcc accepts -g... yes checking for ranlib... ranlib checking for ar... ar checking MACHDEP... linux2 checking for jpeg_destroy_compress in -ljpeg... yes checking for deflate in -lz... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for inline... inline checking whether byte ordering is bigendian... no checking size of char... 1 checking size of short... 2 checking size of int... 4 checking size of long... 4 checking size of float... 4 checking size of double... 8 checking for working const... yes checking for prototypes... yes checking for unistd.h... yes checking for getpagesize... yes checking for working mmap... yes updating cache ./config.cache creating ./config.status creating Makefile creating ImConfig.h [mozart 6] ~/python/Imaging-1.1.4/libImaging > make [mozart 7] ~/python/Imaging-1.1.4/libImaging > cd .. [mozart 8] ~/python/Imaging-1.1.4 > python setup.py build Traceback (most recent call last): File "setup.py", line 287, in ? extra_compile_args=EXTRA_COMPILE_ARGS, NameError: name 'EXTRA_COMPILE_ARGS' is not defined [mozart 9] ~/python/Imaging-1.1.4 > python setup.py install Traceback (most recent call last): File "setup.py", line 287, in ? extra_compile_args=EXTRA_COMPILE_ARGS, NameError: name 'EXTRA_COMPILE_ARGS' is not defined [mozart 9] ~/python/Imaging-1.1.4 > python Python 2.2.2 (#1, Feb 24 2003, 19:13:11) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 >>> ************************************************** Sincerely, -- <>< "Quite normal guy" Olli Rajala From steve at holdenweb.com Sat Oct 30 08:55:19 2004 From: steve at holdenweb.com (Steve Holden) Date: Sat Oct 30 09:00:57 2004 Subject: [Image-SIG] Re: PIL JPEG Windows Problem In-Reply-To: References: <6U5gd.19857$SW3.18915@fed1read01> Message-ID: <41833AD7.50502@holdenweb.com> Ann wrote: > "Steve Holden" wrote in message > news:6U5gd.19857$SW3.18915@fed1read01... > >>If nobody has a quick answer I'll go to the PIL list, but I'm having >>problems with PIL JPEG support on Windows, and figured someone on c.l.py >>might have solved this problem. >> >>I built the Cygwin PIL from source, and that works a treat. >>Unfortunately the Windows version (1.1.4 and 1.1.5b1) loaded using >>binary installers is giving > File "/c/steve/website/hpgraphics.py", line 23, in ? File "C:\Python23\Lib\site-packages\PIL\ImageFont.py", line 115, in ? class FreeTypeFont: File "C:\Python23\Lib\site-packages\PIL\ImageFont.py", line 132, in FreeTypeFont def getmask(self, text, mode="", fill=Image.core.fill): File "C:\Python23\Lib\site-packages\PIL\Image.py", line 45, in __getattr__ raise ImportError("The _imaging C module is not installed") ImportError: The _imaging C module is not installed > > I am a newbie, but I installed python about 2 months ago, from binaries > and added PIL maybe a month ago with no problems on Win XP Pro. I refuse > to compile anything. > The python log file has no 'jpg' or 'jpeg' files, but the > PIL log file has these two: > 200 File Copy: C:\Python23\Lib\site-packages\PIL\JpegImagePlugin.py > 200 File Copy: C:\Python23\Lib\site-packages\PIL\JpegImagePlugin.pyc > I do not have libjpeg.dll > HTH > > >>When I import the _imaging module directly a dialog box informs me that >>libjpeg.dll can't be found, and I have confirmed that it isn't anywhere >>on the disk - I have a libjpeg.dll.a as part of cygwin, but I can't >>persuade myself this can be munged into suitable form. It would be nice >>if I were wrong ... >> >>The PIL docs do say something about having to add JPEG support, but >>unfortunately I can't find any information about adding *Windows* JPEG >>support. >> Thanks for the input, but it doesn't, unfortunately, help - I have those files too. I presume you are using PIL 1.1.4? I thought it might be a 1.1.5b1-specific thing, but sadly a de-install followed by a re-install of 1.1.4 gives me the same error - a dialog box appears telling me that libjpeg.dll can't be found in any of an umber of directories (not surprising, since there is no such file on my disk). I thought I'd fixed the problem by copying jpeg62.dll from GTK 2.0 and renaming it as libjpeg.dll, but unfortunately Windows then started complaining about the absence of libz.dll (and a copy of libz.pyd definitely won;t do the trick). So I'll copy this to the PIL support list and see what the gurus have to say. I'm wondering if there could possibly be any interaction between the Cygwin and Windows versions, since both are now loaded on the same machine. Bit stumped here ... I don't remember PIL being so temperamental before, and it's working beautifully under Cygwin. regards Steve -- http://www.holdenweb.com http://pydish.holdenweb.com Holden Web LLC +1 800 494 3119 From jwt at OnJapan.net Sat Oct 30 10:18:33 2004 From: jwt at OnJapan.net (Jim Tittsler) Date: Sat Oct 30 10:17:05 2004 Subject: [Image-SIG] a bug in PIL? In-Reply-To: <20041028145244.GB29451@students.cc.tut.fi> References: <20041028145244.GB29451@students.cc.tut.fi> Message-ID: <20041030081833.GB28474@server.onjapan.net> On Thu, Oct 28, 2004 at 05:52:44PM +0300, Olli Rajala wrote: > ask. Some guy said "After a quick look at setup.py I think this is a > bug. EXTRA_COMPILE_ARGS is only defined if Tkinter is present but it > is used outside the test for Tkinter." So, is this a bug or only an > (un)documented feature? ;) It is a known bug. You can find a patch on the PIL 1.1.4 errata page: http://effbot.org/zone/pil-errata-114.htm > Oh, I don't have root-account in that machine (it's in my school) so > is it possible to install/use PIL there? I haven't tried it with PIL, but I would expect you can use the --prefix=$HOME/lib switch for setup.py. (And then adjust your PYTHONPATH to include that directory.) You might want to try PIL version 1.1.5 which is currently being beta tested. It has a new setup.py that streamlines the build process. http://effbot.org/downloads/#Imaging -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/ Ringo MUG Tokyo http://www.ringo.net/rss.html From Matthew.Warren at Powergen.co.uk Fri Oct 29 10:54:20 2004 From: Matthew.Warren at Powergen.co.uk (Warren, Matthew (Retail)) Date: Wed Nov 3 11:12:00 2004 Subject: [Image-SIG] Compiling and Installing under AIX Message-ID: <33C3DEE7361D394290F8CC76E38666380CE0D6@CORPHNXSEXV01.corp.pg.eon.net> Hello, I am trying to find a way of generating graphics directly to files, and found the python imaging library. Trying to compile it under AIX 5.2.0.0 I get, 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) ranlib checking for ar... (cached) ar checking MACHDEP... aix2 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) yes checking for inline... (cached) inline checking whether byte ordering is bigendian... (cached) yes checking size of char... (cached) 1 checking size of short... (cached) 2 checking size of int... (cached) 4 checking size of long... (cached) 4 checking size of float... (cached) 4 checking size of double... (cached) 8 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 root@carsington:/home/m10247/Imaging-1.1.4.tar/Imaging-1.1.4/libImaging# make gcc -O -I./. -I/usr/local/include -DHAVE_CONFIG_H -c Antialias.c Antialias.c:46: error: conflicting types for `nearest' /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/math.h:954: error: previous declaration of `nearest' make: 1254-004 The error code from the last command is 1. Stop. This kind of thing quickly becomes dark and murky to me, as I have steadfastly avoided the world of C and C++ for many years. Any help would be much appreciated! For the JPEG libraries I have succesfully compiled and installed jpegsrc.v6b.tar Thankyou for any help, Matthew Warren. _-'-_ -|- ___________________________ Disclaimer Notice __________________________ This message and any attachments are confidential and should only be read by those to whom they are addressed. If you are not the intended recipient, please contact us, delete the message from your computer and destroy any copies. Any distribution or copying without our prior permission is prohibited. Internet communications are not always secure and therefore Powergen Retail Limited does not accept legal responsibility for this message. The recipient is responsible for verifying its authenticity before acting on the contents. Any views or opinions presented are solely those of the author and do not necessarily represent those of Powergen Retail Limited. Registered addresses: Powergen Retail Limited, Westwood Way, Westwood Business Park, Coventry, CV4 8LG. Registered in England and Wales No: 3407430 Telephone +44 (0) 2476 42 4000 Fax +44 (0) 2476 42 5432 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20041029/53f3d3fc/attachment.htm From Claudia.Freimuth at t-online.de Sun Oct 31 23:22:00 2004 From: Claudia.Freimuth at t-online.de (Claudia Freimuth) Date: Wed Nov 3 11:12:18 2004 Subject: [Image-SIG] Problems riunning the image library module Message-ID: <000001c4bf98$0ae8a710$fe78a8c0@claudia> Dear Sir/Madam, I've installed python 2.3.2 and installed PIL-1.1.4.win32-py2.3.exe;which is the python image library module. However, if I run the simple test program below: import Image im = Image.open("Images/lena.gif") print im.format, im.size, im.mode im.show() It come up with this error: ImportError: The _imaging C module is not installed Also I checked the paths and it seems ok: sys.path ['C:\\Python23\\Lib\\idlelib', 'C:\\WINDOWS\\System32\\python23.zip', 'C:\\Python23', 'C:\\Python23\\DLLs', 'C:\\Python23\\lib', 'C:\\Python23\\lib\\plat-win', 'C:\\Python23\\lib\\lib-tk', 'C:\\Python23\\lib\\site-packages', 'C:\\Python23\\lib\\site-packages\\PIL'] Also, tried executing import _imaging and this is fine as well!! Can you see if you could shed some light on this problem please Best Regards Chris Sidiropoulos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20041031/41b11704/attachment.html