From sheila at thinkspot.net Mon Aug 4 12:06:12 2003 From: sheila at thinkspot.net (Sheila King) Date: Mon Aug 4 14:06:36 2003 Subject: [Image-SIG] PIL: Can't open saved BMP image Message-ID: <101585842.1059995172@SHEILA-LAPTOP> I am just trying out PIL since last night, and only doing the most basic of stuff. I had gotten down how to create a new image and draw lines and pixels and save as a BMP image last night, and then I would be able to open them in Ulead's PhotoImpact or other image viewing software if I so desired. Well, today I ran a script and the first time it saved the image just fine for me, but on repeated runs the script completes without error, but when I try to open the saved image in anything (including PIL), I get an error that it cannot open the image. Here is the script that is creating the image (on Win32 Python 2.2.2 under Windows 2000): -------(begin creation script)---------------- import Image, ImageDraw graph = Image.new("RGB", (660,350), "white") drw = ImageDraw.Draw(graph) drw.setink("black") ## draw axes ## horizontal axis for y in range(300,305): drw.line((50,y,650,y)) graph.show() ## vertical axis for x in range(45,50): drw.line((x,0,x,305)) graph.show() graph.save(open("graphout2.bmp", "w")) --------(end creation script)----------------- BTW, the "show" commands work just fine and open up BMP images for me in Ulead PhotoImpact. However, the saved graphic, "graphout2.bmp" cannot be opened. Here is a traceout from trying to open in PIL. Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. IDLE 0.8 -- press F1 for help >>> import Image >>> im = Image.open("graphout2.bmp") Traceback (most recent call last): File "", line 1, in ? im = Image.open("graphout2.bmp") File "E:\PYTHON22\Lib\site-packages\PIL\Image.py", line 1556, in open return factory(fp, filename) File "E:\PYTHON22\Lib\site-packages\PIL\ImageFile.py", line 78, in __init__ self._open() File "E:\PYTHON22\Lib\site-packages\PIL\BmpImagePlugin.py", line 164, in _open self._bitmap(offset=offset) File "E:\PYTHON22\Lib\site-packages\PIL\BmpImagePlugin.py", line 96, in _bitmap raise IOError("Unsupported BMP header type (%d)" % len(s)) IOError: Unsupported BMP header type (10240) >>> If I'm doing something stupid here, I'd certainly appreciate someone giving me a kick in the head and setting me straight. Thanks, -- Sheila King http://www.thinkspot.net/sheila/ http://www.k12groups.org From sheila at thinkspot.net Mon Aug 4 12:46:59 2003 From: sheila at thinkspot.net (Sheila King) Date: Mon Aug 4 14:47:23 2003 Subject: [Image-SIG] PIL: Can't open saved BMP image In-Reply-To: <101585842.1059995172@SHEILA-LAPTOP> References: <101585842.1059995172@SHEILA-LAPTOP> Message-ID: <104033452.1059997619@SHEILA-LAPTOP> --On Monday, August 04, 2003 11:06 AM -0700 Sheila King wrote: > > graph.save(open("graphout2.bmp", "w")) > OK, I appear to have found the problem: NEED TO SAVE IN BINARY MODE. should be: graph.save(open("graphout2.bmp", "wb")) Sorry for bothering y'all for something this ditzy. :/ From paul at shiningrose.co.uk Wed Aug 6 17:23:08 2003 From: paul at shiningrose.co.uk (Paul Brian) Date: Wed Aug 6 11:25:03 2003 Subject: [Image-SIG] "classical" image processing Message-ID: <009c01c35c2e$a4406340$0401a8c0@test1> Dear image-sig, Can anyone point me in the right direction for more information on analysing an image for the existence or non existence of objects in the image - such as blocks on a table or cars in a car park. I understand this is mostly about edge analysis. I am afraid this has cropped up recently and I am just interested in how difficult it really is. Thank you yours ------------------------ paul brian shiningrose.co.uk 07796 375 120 From alan.grosskurth at utoronto.ca Wed Aug 6 20:08:02 2003 From: alan.grosskurth at utoronto.ca (Alan Grosskurth) Date: Wed Aug 6 15:08:03 2003 Subject: [Image-SIG] "classical" image processing In-Reply-To: <009c01c35c2e$a4406340$0401a8c0@test1> References: <009c01c35c2e$a4406340$0401a8c0@test1> Message-ID: <20030806190758.GA20380@seawolf.cdf.toronto.edu> On Wed, Aug 06, 2003 at 04:23:08PM +0100, Paul Brian wrote: > Can anyone point me in the right direction for more information on analysing > an image for the existence or non existence of objects in the image - such > as blocks on a table or cars in a car park. I understand this is mostly > about edge analysis. I think what you are talking about falls more under the field of "computer vision" or "image understanding". I quick google search will yield quite a bit of information. There are also many textbooks written on the subject. As far as libraries go, I have not seen much in the way of computer vision for Python. The two libraries that I do know about are both written in C++: Intel's Open Source Computer Vision Library http://www.intel.com/research/mrl/research/opencv/ LTI-Lib http://ltilib.sourceforge.net/ > I am afraid this has cropped up recently and I am just interested in how > difficult it really is. I think this all depends on how much prior knowledge you have about the structure of the image, and the shapes of the things you are looking for. -- Regards, Alan From kevin at cazabon.com Thu Aug 7 00:38:31 2003 From: kevin at cazabon.com (kevin@cazabon.com) Date: Thu Aug 7 02:35:31 2003 Subject: [Image-SIG] PIL speed in single/multi threaded apps Message-ID: <001401c35ca6$23656540$320aa8c0@duallie> Hi everyone; I've been doing a lot of multi-threaded GUI apps that use PIL lately, and was looking for ways to improve performance, especially when rapidly updating images being displayed on the screen after color changes. I decided to try to enable true multi-threading in the PIL core library to see what effects it had on performance. Basically, although Python has multi-threading, unless an extension library explicitly "allows" other threads to run while it's busy doing intensive tasks, only one thread runs at a time. So, even on a multi-CPU computer (or a Pentium 4 with hyperthreading), you don't really get the benefit of true multi-threading. So, I modified the geometry.c source file to add "Py_BEGIN_ALLOW_THREADS" and "Py_END_ALLOW_THREADS" blocks around the intensive tasks within the resize mechanisms to see what would happen. I then wrote a test script that used multiple threads to simultaneously resize images, and I counted how many times I could resize an image in 30 seconds. (see the script at the end for details). Here are the results, they're very interesting! These were done with the "standard" PIL 1.1.4 binary and my modified version, both on a dual-CPU Athlon MP-1200 computer with 512MB RAM. 1 Thread: original: 805 resizes (max 60% CPU usage) 1 Thread: modified: 920 resizes (max 75% CPU usage) 2 Threads: original: 758 resizes (max 60% CPU usage) 2 Threads: modified: 1185 resizes (max 100% CPU usage) 3 Threads: original: 755 resizes (max 60% CPU usage) 3 Threads: modified: 1205 resizes (max 100% CPU usage) 4 Threads: original: 755 resizes (max 60% CPU usage) 4 Threads: modified: 1194 resizes (max 100% CPU usage) I'm not surprised that with multiple threads, the increase in speed was up to 60%. However, I WAS surprised that with only one thread, there was still a 14% speed improvement! I'm assuming this is because PIL is allowing the Python core to perform background tasks simultaneously with imaging tasks. I'd like to test this on a single-CPU Pentium 4 system that has Hyperthreading enabled too, to see if it has similar speed increases. Question: how many users would benefit from such speed increases? I can't guarantee that all "expensive" PIL tasks would be sped up similarly, but it's quite likely they would be. Do many users write multi-threaded PIL applications or run on multi-CPU/P4 computer systems? I'm quite willing to put the work into finding the right places in the core to implement the threading switches, but I would like to see it adopted in the primary distribution rather than a fork... comments? Thanks! Here's the test code I used if you're curious. It's not ideal, but it's pretty fair. Kevin. ############################### import threading import Image import time class t: def __init__(self, counter, lock, rounds, killFlag): self.counter = counter self.lock = lock self.rounds = rounds self.killFlag = killFlag self.start() def start(self): im = Image.new("RGB", (2048, 2048)) for i in range(self.rounds): if self.killFlag.isSet(): break x = im.resize((1024,1093)) self.lock.acquire() self.counter.increment() self.lock.release() class c: def __init__(self): self.counter = 0 def increment(self): self.counter = self.counter + 1 def run(threadCount = 2): threads = [] counter = c() lock = threading.Lock() killFlag = threading.Event() killFlag.clear() for Th in range(threadCount): threads.append(threading.Thread(target = t, args = (counter, lock, 10000, killFlag))) for Th in threads: Th.start() for q in range(30): print "Time: %s\nImages: %s" %(time.time(), counter.counter) time.sleep(1) killFlag.set() print "\n\ndone timing" if __name__ == "__main__": run() From managan at llnl.gov Thu Aug 7 10:43:28 2003 From: managan at llnl.gov (Rob Managan) Date: Thu Aug 7 12:44:05 2003 Subject: [Image-SIG] PIL speed in single/multi threaded apps In-Reply-To: <001401c35ca6$23656540$320aa8c0@duallie> References: <001401c35ca6$23656540$320aa8c0@duallie> Message-ID: >Hi everyone; > >I've been doing a lot of multi-threaded GUI apps that use PIL lately, and >was looking for ways to improve performance, especially when rapidly >updating images being displayed on the screen after color changes. > >I decided to try to enable true multi-threading in the PIL core library to >see what effects it had on performance. Basically, although Python has >multi-threading, unless an extension library explicitly "allows" other >threads to run while it's busy doing intensive tasks, only one thread runs >at a time. So, even on a multi-CPU computer (or a Pentium 4 with >hyperthreading), you don't really get the benefit of true multi-threading. > >So, I modified the geometry.c source file to add "Py_BEGIN_ALLOW_THREADS" >and "Py_END_ALLOW_THREADS" blocks around the intensive tasks within the >resize mechanisms to see what would happen. I then wrote a test script that >used multiple threads to simultaneously resize images, and I counted how >many times I could resize an image in 30 seconds. (see the script at the >end for details). > >Here are the results, they're very interesting! These were done with the >"standard" PIL 1.1.4 binary and my modified version, both on a dual-CPU >Athlon MP-1200 computer with 512MB RAM. > >1 Thread: original: 805 resizes (max 60% CPU usage) >1 Thread: modified: 920 resizes (max 75% CPU usage) > >2 Threads: original: 758 resizes (max 60% CPU usage) >2 Threads: modified: 1185 resizes (max 100% CPU usage) > >3 Threads: original: 755 resizes (max 60% CPU usage) >3 Threads: modified: 1205 resizes (max 100% CPU usage) > >4 Threads: original: 755 resizes (max 60% CPU usage) >4 Threads: modified: 1194 resizes (max 100% CPU usage) > The results for the standard PIL are not universal. On a Dual 450 Mhx G4 running OSX 10.2.6 I get 1 thread : 469 2 threads: 466 3 threads: 453 So I get a slight slow down with multiple threads. -- *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan email managan at llnl.gov LLNL phone: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From kevin_cazabon at hotmail.com Thu Aug 7 11:46:33 2003 From: kevin_cazabon at hotmail.com (kevin_cazabon@hotmail.com) Date: Thu Aug 7 13:50:12 2003 Subject: [Image-SIG] PIL speed in single/multi threaded apps References: <001401c35ca6$23656540$320aa8c0@duallie> Message-ID: Actually, those results match what I saw pretty well. Thanks for the comparison! With the "standard" PIL, one thread was fastest, and there was a slight slowdown with additional threads (805, 758, 755, 755). With the "modified" PIL, all tests were faster than the "standard" library, three threads was the fastest, two and four were slightly less than three. (why three was fastest I don't know... it's only a dual processor machine!) FYI, all the tests I ran were the average of 3 runs, and the 3 runs were pretty consistent in all cases. I'm going to repeat the tests with the standard/modified library on a single-CPU machine to see if there's any benefit to "normal" PIL users too. I'm hoping that the 14% improvement I saw in the single-thread test will hold true. Kevin. ----- Original Message ----- From: "Rob Managan" To: Sent: Thursday, August 07, 2003 9:43 AM Subject: Re: [Image-SIG] PIL speed in single/multi threaded apps > >Hi everyone; > > > >I've been doing a lot of multi-threaded GUI apps that use PIL lately, and > >was looking for ways to improve performance, especially when rapidly > >updating images being displayed on the screen after color changes. > > > >I decided to try to enable true multi-threading in the PIL core library to > >see what effects it had on performance. Basically, although Python has > >multi-threading, unless an extension library explicitly "allows" other > >threads to run while it's busy doing intensive tasks, only one thread runs > >at a time. So, even on a multi-CPU computer (or a Pentium 4 with > >hyperthreading), you don't really get the benefit of true multi-threading. > > > >So, I modified the geometry.c source file to add "Py_BEGIN_ALLOW_THREADS" > >and "Py_END_ALLOW_THREADS" blocks around the intensive tasks within the > >resize mechanisms to see what would happen. I then wrote a test script that > >used multiple threads to simultaneously resize images, and I counted how > >many times I could resize an image in 30 seconds. (see the script at the > >end for details). > > > >Here are the results, they're very interesting! These were done with the > >"standard" PIL 1.1.4 binary and my modified version, both on a dual-CPU > >Athlon MP-1200 computer with 512MB RAM. > > > >1 Thread: original: 805 resizes (max 60% CPU usage) > >1 Thread: modified: 920 resizes (max 75% CPU usage) > > > >2 Threads: original: 758 resizes (max 60% CPU usage) > >2 Threads: modified: 1185 resizes (max 100% CPU usage) > > > >3 Threads: original: 755 resizes (max 60% CPU usage) > >3 Threads: modified: 1205 resizes (max 100% CPU usage) > > > >4 Threads: original: 755 resizes (max 60% CPU usage) > >4 Threads: modified: 1194 resizes (max 100% CPU usage) > > > > The results for the standard PIL are not universal. > > On a Dual 450 Mhx G4 running OSX 10.2.6 I get > > 1 thread : 469 > 2 threads: 466 > 3 threads: 453 > > So I get a slight slow down with multiple threads. > -- > *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- > Rob Managan email managan at llnl.gov > LLNL phone: 925-423-0903 > P.O. Box 808, L-095 FAX: 925-422-3389 > Livermore, CA 94551-0808 > > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig > > From paul at shiningrose.co.uk Fri Aug 8 11:29:33 2003 From: paul at shiningrose.co.uk (Paul Brian) Date: Fri Aug 8 05:31:23 2003 Subject: [Image-SIG] "classical" image processing References: <009c01c35c2e$a4406340$0401a8c0@test1> <20030806190758.GA20380@seawolf.cdf.toronto.edu> Message-ID: <005e01c35d8f$937af040$0401a8c0@test1> Thank you. Both look interesting. yours ------------------------ paul brian shiningrose.co.uk 07796 375 120 ----- Original Message ----- From: "Alan Grosskurth" To: Sent: Wednesday, August 06, 2003 8:07 PM Subject: Re: [Image-SIG] "classical" image processing > On Wed, Aug 06, 2003 at 04:23:08PM +0100, Paul Brian wrote: > > Can anyone point me in the right direction for more information on analysing > > an image for the existence or non existence of objects in the image - such > > as blocks on a table or cars in a car park. I understand this is mostly > > about edge analysis. > > I think what you are talking about falls more under the field of > "computer vision" or "image understanding". I quick google search will > yield quite a bit of information. There are also many textbooks > written on the subject. > > As far as libraries go, I have not seen much in the way of computer > vision for Python. The two libraries that I do know about are both > written in C++: > > Intel's Open Source Computer Vision Library > http://www.intel.com/research/mrl/research/opencv/ > > LTI-Lib > http://ltilib.sourceforge.net/ > > > I am afraid this has cropped up recently and I am just interested in how > > difficult it really is. > > I think this all depends on how much prior knowledge you have about > the structure of the image, and the shapes of the things you are > looking for. > > -- > Regards, > Alan > > From esskayn at eth.net Fri Aug 8 22:51:13 2003 From: esskayn at eth.net (S.Kumar) Date: Fri Aug 8 12:11:27 2003 Subject: [Image-SIG] Code request Message-ID: <000801c35dc9$21a3d2e0$21b409ca@kumar> Skipped content of type multipart/alternative From fredrik at pythonware.com Mon Aug 11 14:04:05 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon Aug 11 07:04:26 2003 Subject: [Image-SIG] Re: Code request References: <000801c35dc9$21a3d2e0$21b409ca@kumar> Message-ID: S.Kumar wrote: > Ref. to your answer below, if possible kindly send the c source code > My req. is - i want to read and display TIFF images in ANSI C not sure what this is doing on the *Python* image-sig mailing list, but the libtiff source code is available here: http://www.libtiff.org http://www.remotesensing.org/libtiff/ (mirror) > X-Spam-Report: 6.20 points, 5 required; > * 0.4 -- Sent with 'X-Msmail-Priority' set to high > * 1.9 -- Sent with 'X-Priority' set to high > * 2.6 -- BODY: Contains 'Dear (something)' > * 0.7 -- BODY: Message is 30% to 40% HTML > * 0.2 -- BODY: HTML included in message > * 0.4 -- Spam tool pattern in MIME boundary From chris at cogdon.org Tue Aug 12 23:42:22 2003 From: chris at cogdon.org (Chris Cogdon) Date: Wed Aug 13 01:42:15 2003 Subject: [Image-SIG] How to generate optimal palettes ? Message-ID: <200308122242.22853.chris@cogdon.org> Hi folks! Hoping someone can help me with this problem. I did search the archives and it doesn't seem to have been covered in the past year. I'm using PIL to generate thumbnails for my (rather large) artwork site. Using the 'thumbnail' method seems to work fine except for reduced-palette GIF images, where the resultant thumbnail looks all 'blocky'. I determined that PIL is using the same low-colour palette as the input GIF, whereas regenerating the palette to use more colours would return a much-nicer-looking thumbnail. (Currently using ImageMagick, but I want to switch). I figure that I'll specialcase paletted files and write code such as the following: im1 = Image.load ( image_path ) im2 = im1.convert ( 'RGB' ) im2.thumbnail ( (128,128), Image.ANTIALIAS ) im3 = im2.convert ( 'P' ) im3.save ( thumb_path ) However, in this case, a really ugly palette is chosen and the image is visibly dithered. What I need is something that examines the image and chooses an optimal palette. (Lots of graphics applications do this already) Does anyone have any suitable code? Does it exist in PIL and I've just missed it? How does one apply a palette when converting to 'P' mode ? Is it possible to opt to NOT dither during the conversion ? Thanks kindly for considering my problem. -------------------- Background: I run a very heavily utilised community artwork site, with around 250,000 images, 3,500 artists, 4 million hits per day over two separated servers. (Lots of test-fodder there, if people are interested :) I was looking at PIL about 2.5 years ago, but found that 1.1.2 didn't support anti-aliased resizing, which is criticial to me. Instead, I used PIL for image mode detection, but ImageMagick to generate the thumbnails. This is both slow (calling an external program) and error prone (every upgrade to ImageMagick has broken something or another, and calling external scripts can play havoc with special characters in filenames). I'd LOVE to come back to PIL, but I have a few niggly problems to sort out, such as above, before I make the switch. I'm very happy to run test code over the image collection, if someone wants to feed me beta code :) PS: A hello to those also on db-sig :) -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From chris at cogdon.org Wed Aug 13 00:19:20 2003 From: chris at cogdon.org (Chris Cogdon) Date: Wed Aug 13 02:19:11 2003 Subject: [Image-SIG] Re: How to generate optimal palettes ? In-Reply-To: <200308122242.22853.chris@cogdon.org> References: <200308122242.22853.chris@cogdon.org> Message-ID: <200308122319.20312.chris@cogdon.org> Gah... this is some fine re-introduction to the list :) ... A little google searching found this item from this very mailing list that I missed... http://mail.python.org/pipermail/image-sig/2002-September/001989.html Essentially, just doing the following will work for me just fine: i3 = i2.convert('P',palette=Image.ADAPTIVE,colors=256, dither=Image.NONE) It's not in the docs or docstrings, though... so... anyone need help setting up decent, help()able docstrings? :) -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From martinxyz at gmx.ch Wed Aug 13 09:21:34 2003 From: martinxyz at gmx.ch (Martin Renold) Date: Wed Aug 13 02:21:53 2003 Subject: [Image-SIG] How to generate optimal palettes ? In-Reply-To: <200308122242.22853.chris@cogdon.org> References: <200308122242.22853.chris@cogdon.org> Message-ID: <20030813062134.GA22344@old.homeip.net> On Tue, Aug 12, 2003 at 10:42:22PM -0700, Chris Cogdon wrote: > im3 = im2.convert ( 'P' ) There is an undocumented feature (don't ask me why, I'm just another random PIL user) to do this: im3 = im2.convert('P', None, None, Image.ADAPTIVE, 227) Seems to generate an optimal palette with 227 colors. The definition in the source code: def convert(self, mode=None, data=None, dither=None, palette=WEB, colors=256): In the python shell, you can type >>> import Image; help(Image) And it will show you the path to the file where the definition is. bye, Martin From postmaster at bizrate.com Thu Aug 21 03:49:16 2003 From: postmaster at bizrate.com (postmaster@bizrate.com) Date: Fri Aug 22 08:42:17 2003 Subject: [Image-SIG] VIRUS IN YOUR MAIL TO newsletter@bizrate.com Message-ID: <200308210949.h7L9nGQ28096@lenna.bizrate.com> V I R U S A L E R T Our viruschecker found a VIRUS in your email to "newsletter@bizrate.com". We stopped delivery of this email! Now it is on you to check your system for viruses For further information about this viruschecker see: http://amavis.org/ AMaViS - A Mail Virus Scanner, licenced GPL For your reference, here are the headers from your email: ------------------------- BEGIN HEADERS ----------------------------- >From Image-SIG@python.org Thu Aug 21 02:49:14 2003 Return-Path: Received: from CSL-MONKEY (monkey.csl.uiuc.edu [130.126.139.50]) by lenna.bizrate.com (8.11.6/8.11.6) with ESMTP id h7L9nEj27944 for ; Thu, 21 Aug 2003 02:49:14 -0700 Message-Id: <200308210949.h7L9nEj27944@lenna.bizrate.com> From: To: Subject: Re: Approved Date: Thu, 21 Aug 2003 4:51:46 --0500 X-MailScanner: Found to be clean Importance: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_NextPart_000_1CC850B2" X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) -------------------------- END HEADERS ------------------------------ From bogus@does.not.exist.com Thu Aug 21 14:36:24 2003 From: bogus@does.not.exist.com () Date: Fri Aug 22 09:10:22 2003 Subject: [Image-SIG] Mail delivery failed: returning message to sender Message-ID: This message was generated automatically by mail delivery software. ATTENTION VIRUS NOTIFICATION! Scenarios/Incoming/Inccoming Email Specifically Okd/lvl 2 Sophos Check Incoming: A virus has been detected: 'W32/Sobig-F'. Scenarios/Incoming/Inccoming Email Specifically Okd/lvl 2 pif blocker: A filename matching the file mask was detected: 'document_9446.pif'. This message never reached its intended recipients. Please update your virus software and run a scan, then re-send the message if necessary. From bouncer at redhat.com Wed Aug 20 12:21:32 2003 From: bouncer at redhat.com (Mail Delivery Subsystem) Date: Fri Aug 22 11:54:40 2003 Subject: [Image-SIG] Returned mail: see transcript for details Message-ID: <200308201521.h7KFLWs16462@int-mx1.corp.redhat.com> The original message was received at Wed, 20 Aug 2003 11:21:32 -0400 from mx1.redhat.com [172.16.48.31] ----- The following addresses had permanent fatal errors ----- (reason: 550 5.1.1 ... User unknown) (expanded from: ) ----- Transcript of session follows ----- ... while talking to mx.corp.redhat.com.: >>> RCPT To: <<< 550 5.1.1 ... User unknown 550 5.1.1 ... User unknown -------------- next part -------------- Skipped content of type message/delivery-status-------------- next part -------------- An embedded message was scrubbed... From: Subject: Re: Your application Date: Wed, 20 Aug 2003 11:18:51 --0400 Size: 1096 Url: http://mail.python.org/pipermail/image-sig/attachments/20030820/5bb28795/attachment.eml From digulla at hepe.com Wed Aug 20 21:36:42 2003 From: digulla at hepe.com (Aaron Optimizer Digulla) Date: Fri Aug 22 13:21:40 2003 Subject: [Image-SIG] Bug in truetype font rendering Message-ID: <20030820183642.GA1926@sebigbos.hepe.com> Hello, When I render characters from a truetype font which "leaks" (ie. it has coordinates < 0 and > char_width), then the draw commands wrap around. I've uploaded a demonstration of the bug (27KB tar.gz) to http://www.philmann-dark.de/pil_bug.tar.gz It contains the font, the code to generate the buggy character D and what I get here when I run the code. -- ============================================== Sowatec AG, CH-8330 Pf?ffikon (ZH) Witzbergstr. 7, http://www.sowatec.com Tel: +41-(0)1-952 55 55 Fax: +41-(0)1-952 55 66 ---------------------------------------------- Aaron "Optimizer" Digulla, digulla@sowatec.com ============================================== From Maureen.Hart at axcelis.com Thu Aug 21 13:07:50 2003 From: Maureen.Hart at axcelis.com (Hart, Maureen) Date: Fri Aug 22 13:44:47 2003 Subject: [Image-SIG] Out of Office AutoReply: Approved Message-ID: I will be out of the office on vacation through Friday, August 22nd. During this time I will not have access to email. I will return your message as soon as I get back. For urgent matters: - Contact Carol David for event/fulfillment issues (x 74274) - Contact David Snyder for media related issues (x74273) Best regards. Best regards, From Rosario.Balboa at ua.es Fri Aug 22 12:43:02 2003 From: Rosario.Balboa at ua.es (charo) Date: Fri Aug 22 17:28:29 2003 Subject: [Image-SIG] quicktime movies using PIL In-Reply-To: References: <001401c35ca6$23656540$320aa8c0@duallie> Message-ID: <3F463A06.4070303@ua.es> Hi all, I need to do some simple calculations at every three frames in movies stored as quicktime. Is there any way to read quicktime movies using PIL? If it is not the case, does anybody know a way to export quicktime movies frame by frame to an uncompressed format? Thanks a lot, Rosario From dfkettle at sympatico.ca Fri Aug 22 11:03:55 2003 From: dfkettle at sympatico.ca (dfkettle@sympatico.ca) Date: Sat Aug 23 03:09:28 2003 Subject: [Image-SIG] PIL utilities Message-ID: <191690-22003852214355197@M2W034.mail2web.com> Hi! I downloaded the PIL library, v1.1.4, for Windows, and I've been playing with it a few days now. I just have a question about the utilities mentioned in the user guide (pildriver, pilconvert, etc.). Where are they? They don't seem to be in the file I downloaded (PIL-1.1.1.win32-py2.2.exe). Are they only included in the commercial version, or are they only included in the Unix version? Thanks, David. -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From r-spirit at sproxy03.hi-ho.ne.jp Fri Aug 22 19:05:10 2003 From: r-spirit at sproxy03.hi-ho.ne.jp (r-spirit@sproxy03.hi-ho.ne.jp) Date: Sat Aug 23 06:29:21 2003 Subject: [Image-SIG] Voice Message (259834292340818) Message-ID: <0HK000962JWL23@sproxy03.hi-ho.ne.jp> ------ name ------ Anonymous Friend ------ address ------ Secret ------ message ------ Add expressive voice and music to your websites and emails. Use this new marketing tool in your business or just for fun!. Click the following link to listen to your message: http://voice-email.vze.com/?id=163772745545 Local Time: 2003/8/22/18:5 From MAILER-DAEMON at ecbaldwin.net Sat Aug 23 23:58:44 2003 From: MAILER-DAEMON at ecbaldwin.net (Mail Delivery Subsystem) Date: Sun Aug 24 03:31:10 2003 Subject: [Image-SIG] Returned mail: Message to graduate@CS.ColoState.EDU Not Delivered In-Reply-To: <200308240456.h7O4ulq6018599@bach.cs.colostate.edu> References: <200308240456.h7O4ulq6018599@bach.cs.colostate.edu> Message-ID: <20030824045844.CD34AE8C91@mail.pippins.net> This is an automatic response to your email. To: From: Date: Sat, 23 Aug 2003 22:55:57 --0600 Subject: Re: That movie Try this link (make the message short): mailto:graduate@CS.ColoState.EDU?subject=Add_me_to_your_list Your email was NOT delivered. This means that the recipient has not read your message. If you are trying to send legitimate mail and you're certain that the address is correct sorry for the inconvenience. You may try this: 1 - Send a SHORT email to the recipient with "Add me to your list" in the subject exactly as you see it there. If the message is short it is guaranteed to get through. The link that you see above should work in most situations. 2 - Wait for a reply. The recipient will tell you if you are ok to resend your message. If you are still confused maybe the following Q&A will help clarify things. Q: Why didn't my email get sent? A: Your email was scanned by automatic SPAM detecting software. It determined that it is probably SPAM. There are a number of reasons that this might happen and there is a possibility that legitimate email could get detected as unwanted mail. If this is the case, sorry for the inconvenience. Follow the directions above to request permission to send email to the recipient. Q: Does the recipient know that I've tried to send him/her a message? A: No, the email was intercepted before he/she knew anything about it. Q: Why don't you just accept every message that gets emailed to you like everyone else? This is inconvenient for me. A: If you are trying to send legitimate email I'm sorry for the inconvenience. Anyone who's had an email address for more than a year or two gets unwanted mail and knows that the longer one has an email address the more time is wasted by filtering though it. In some cases the unwanted mail is something that the user may wish that he never saw such as email with immoral content. The postmaster for ecbaldwin.net decided to take the chance that someone's legitimate mail might bounce for the benefit of not having to ever see unwanted mail. Q: Where can I learn about the software that caught my message? A: See http://spamassassin.org From andrew.straw at adelaide.edu.au Sat Aug 23 23:36:53 2003 From: andrew.straw at adelaide.edu.au (Andrew Straw) Date: Sun Aug 24 12:02:56 2003 Subject: [Image-SIG] quicktime movies using PIL In-Reply-To: <3F463A06.4070303@ua.es> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 There may be a pure-Python or other, simpler way (let me know if there is), but: I've just added support for QuickTime->OpenGL to the Vision Egg. Transferring the data the way I've done it requires extraction to a raw, uncompressed format. I think this all made it into the last "bleeding edge" release I made (0.9.5b2), but if not, grab the CVS. Anyhow, the most relevant files and least OpenGL (It should be fairly easy to, for example, fill a Numeric array by modifying these files a bit): swig_src/gl_qt.c swig_src/gl_qt.h And less relevant and more OpenGL: src/QuickTime.py And showing it all in action with Python's (Carbon) QT module. (Maybe available only on Macs?): demo/quicktime.py I've so far only used this on Mac OS X. I know there's a QuickTime SDK for win32 and I'd like to port it, but I haven't found the time yet. I think the QuickTime APIs are (nearly) the same for the two platforms, but I haven't checked whether win32 Python has the Carbon.QT module. (If it doesn't, you could actually look at an older revision of the above files -- it was a later change to use Python's Carbon.Qt module.) I hope this helps. Cheers! Andrew charo wrote: > Hi all, > > I need to do some simple calculations at every three frames in movies > stored as quicktime. Is there any way to read quicktime movies using > PIL? If it is not the case, does anybody know a way to export > quicktime movies frame by frame to an uncompressed format? > > Thanks a lot, > > Rosario -----BEGIN PGP SIGNATURE----- iD8DBQE/R2bz1xWcCSPVbpgRAi6QAKDJ+IAzhXyxyALd/qx0qgeljSJULgCgsp7t c0QCfr+d6+zILiBaym5X7TM= =SvEz -----END PGP SIGNATURE----- From chris at cogdon.org Fri Aug 22 22:34:41 2003 From: chris at cogdon.org (Chris Cogdon) Date: Sun Aug 24 16:29:47 2003 Subject: [Image-SIG] quicktime movies using PIL In-Reply-To: <3F463A06.4070303@ua.es> References: <001401c35ca6$23656540$320aa8c0@duallie> <3F463A06.4070303@ua.es> Message-ID: <200308222134.41113.chris@cogdon.org> On Friday 22 August 2003 08:43, charo wrote: > Hi all, > > I need to do some simple calculations at every three frames in movies > stored as quicktime. Is there any way to read quicktime movies using > PIL? If it is not the case, does anybody know a way to export quicktime > movies frame by frame to an uncompressed format? Unless someone would like to correct me on this... I don't believe PIL handles quicktime files, as it's primarily an image processing library. (With the special exception of GIF animations :) A google search returns a number of useful options http://www.google.com/search?q=export%20quicktime%20movie%20as%20individual%20frames -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From frpythoneers-admin at lists.community.tummy.com Sun Aug 24 00:43:03 2003 From: frpythoneers-admin at lists.community.tummy.com (frpythoneers-admin@lists.community.tummy.com) Date: Sun Aug 24 18:20:01 2003 Subject: [Image-SIG] Your message to FRPythoneers awaits moderator approval Message-ID: <20030824054303.8155.56932.Mailman@community.tummy.com> Your mail to 'FRPythoneers' with the subject Your details Is being held until the list moderator can review it for approval. The reason it is being held: SpamAssassin thinks there may be spam in this message. Either the message will get posted to the list, or you will receive notification of the moderator's decision. From MAILER-DAEMON at ecbaldwin.net Sun Aug 24 22:15:53 2003 From: MAILER-DAEMON at ecbaldwin.net (Mail Delivery Subsystem) Date: Sun Aug 24 23:16:05 2003 Subject: [Image-SIG] Returned mail: Message to graduate@CS.ColoState.EDU Not Delivered In-Reply-To: <200308250314.h7P3EAq6011295@bach.cs.colostate.edu> References: <200308250314.h7P3EAq6011295@bach.cs.colostate.edu> Message-ID: <20030825031553.EF649E8C75@mail.pippins.net> This is an automatic response to your email. To: From: Date: Sun, 24 Aug 2003 21:13:19 --0600 Subject: Re: That movie Try this link (make the message short): mailto:graduate@CS.ColoState.EDU?subject=Add_me_to_your_list Your email was NOT delivered. This means that the recipient has not read your message. If you are trying to send legitimate mail and you're certain that the address is correct sorry for the inconvenience. You may try this: 1 - Send a SHORT email to the recipient with "Add me to your list" in the subject exactly as you see it there. If the message is short it is guaranteed to get through. The link that you see above should work in most situations. 2 - Wait for a reply. The recipient will tell you if you are ok to resend your message. If you are still confused maybe the following Q&A will help clarify things. Q: Why didn't my email get sent? A: Your email was scanned by automatic SPAM detecting software. It determined that it is probably SPAM. There are a number of reasons that this might happen and there is a possibility that legitimate email could get detected as unwanted mail. If this is the case, sorry for the inconvenience. Follow the directions above to request permission to send email to the recipient. Q: Does the recipient know that I've tried to send him/her a message? A: No, the email was intercepted before he/she knew anything about it. Q: Why don't you just accept every message that gets emailed to you like everyone else? This is inconvenient for me. A: If you are trying to send legitimate email I'm sorry for the inconvenience. Anyone who's had an email address for more than a year or two gets unwanted mail and knows that the longer one has an email address the more time is wasted by filtering though it. In some cases the unwanted mail is something that the user may wish that he never saw such as email with immoral content. The postmaster for ecbaldwin.net decided to take the chance that someone's legitimate mail might bounce for the benefit of not having to ever see unwanted mail. Q: Where can I learn about the software that caught my message? A: See http://spamassassin.org From SHUREM at ccf.org Tue Aug 26 16:04:57 2003 From: SHUREM at ccf.org (Mark Shure) Date: Tue Aug 26 15:09:07 2003 Subject: [Image-SIG] Question about ImageDraw.Draw function Message-ID: Hello, I'm a relative newcomer to Python and PIL, but I've been using it successfully for several months. I was stumped by the error I got when I tried using the ImageDraw.Draw(im) function. Here is what I see when I run example code straight out of the PIL 1.1.3 Overview document: >>> import Image, ImageDraw >>> im = Image.open("lena.ppm") >>> draw = ImageDraw.Draw(im) Traceback (most recent call last): File "C:/Python22/imageDraw_test2.py", line 3, in ? draw = ImageDraw.Draw(im) File "C:\Python22\lib\site-packages\PIL\ImageDraw.py", line 72, in __init__ self.draw = Image.core.draw(self.im, blend) AttributeError: 'module' object has no attribute 'draw' I'm using Python 2.2.1 under Win2k with PIL 1.1.4 (binaries installed using "PIL-1.1.4.win32-py2.2.exe"). I haven't been able to find any leads on the web or in the Image-SIG mailing list archive. Any suggestions would be appreciated. Thanks, Mark Shure ------------------------------------------------------------------------------ Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you. ============================================================================== From chris at cogdon.org Tue Aug 26 15:34:07 2003 From: chris at cogdon.org (Chris Cogdon) Date: Tue Aug 26 17:32:57 2003 Subject: [Image-SIG] Question about ImageDraw.Draw function In-Reply-To: References: Message-ID: <200308261434.07657.chris@cogdon.org> On Tuesday 26 August 2003 12:04, Mark Shure wrote: > Hello, > > I'm a relative newcomer to Python and PIL, but I've been using it successfully for several months. I was stumped by the error I got when I tried using the ImageDraw.Draw(im) function. Here is what I see when I run example code straight out of the PIL 1.1.3 Overview document: > >>> import Image, ImageDraw > >>> im = Image.open("lena.ppm") > >>> draw = ImageDraw.Draw(im) > > Traceback (most recent call last): > File "C:/Python22/imageDraw_test2.py", line 3, in ? > draw = ImageDraw.Draw(im) > File "C:\Python22\lib\site-packages\PIL\ImageDraw.py", line 72, in > __init__ self.draw = Image.core.draw(self.im, blend) > AttributeError: 'module' object has no attribute 'draw' > > I'm using Python 2.2.1 under Win2k with PIL 1.1.4 (binaries installed using > "PIL-1.1.4.win32-py2.2.exe"). > > I haven't been able to find any leads on the web or in the Image-SIG > mailing list archive. Any suggestions would be appreciated. This isn't complete help, but it might give you some pointers: - The sequence of instructions above works just fine on my system (linux) In Image.py, there's a statement that says: core = _imaging (There's code in there to put something else in place if _imaging is missing. However, since the error above refers to 'module', it means that it IS in fact a module) So... the 'draw' attribute actually comes from _imaging, which is the written-in-C module that gets installed along with the rest of the python modules. If you're seeing the error you are, it means that the module IS there, but for some reason is missing the 'draw' method. Looking at the C code there doesn't seem to be any reason that _imaging would be there, but the draw method would not. It's totally weird -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From chris at cogdon.org Tue Aug 26 15:55:24 2003 From: chris at cogdon.org (Chris Cogdon) Date: Tue Aug 26 17:54:11 2003 Subject: [Image-SIG] Question about ImageDraw.Draw function In-Reply-To: <200308261434.07657.chris@cogdon.org> References: <200308261434.07657.chris@cogdon.org> Message-ID: <200308261455.24516.chris@cogdon.org> Aha... was looking at the wrong version of PIL. From 1.1.4's Image.py version: try: # If the _imaging C module is not present, you can still use # the "open" function to identify files, but you cannot load # them. Note that other modules should not refer to _imaging # directly; import Image and use the Image.core variable instead. import _imaging core = _imaging del _imaging except ImportError, v: import string core = _imaging_not_installed() if str(v)[:20] == "Module use of python": # The _imaging C module is present, but not compiled for # the right version (windows only). Print a warning, if # possible. try: import warnings warnings.warn( "The _imaging extension was built for another version " "of Python; most PIL functions will be disabled", RuntimeWarning ) except (ImportError, NameError, AttributeError): pass # sorry This seems the likely culprit. If true, then it's likely you're using a version of python different from what the _imaging module was compiled against. If it IS true, then I'm surprised you're not seeing the warning. (It's not a very robust way of handling the warning, though ;) -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From fredrik at pythonware.com Wed Aug 27 15:29:25 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed Aug 27 08:29:36 2003 Subject: [Image-SIG] Re: Question about ImageDraw.Draw function References: Message-ID: Mark Shure wrote: > I'm a relative newcomer to Python and PIL, but I've been using > it successfully for several months. I was stumped by the error I > got when I tried using the ImageDraw.Draw(im) function. Here > is what I see when I run example code straight out of the PIL > 1.1.3 Overview document: > AttributeError: 'module' object has no attribute 'draw' > I'm using Python 2.2.1 under Win2k with PIL 1.1.4 (binaries installed > using "PIL-1.1.4.win32-py2.2.exe"). try this: >>> import Image >>> Image.core ... >>> dir(Image.core) ... and let us know what it prints. From fredrik at pythonware.com Wed Aug 27 15:32:47 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed Aug 27 08:39:35 2003 Subject: [Image-SIG] Re: PIL utilities References: <191690-22003852214355197@M2W034.mail2web.com> Message-ID: dfkettle@sympatico.ca wrote: > I downloaded the PIL library, v1.1.4, for Windows, and I've been playing > with it a few days now. I just have a question about the utilities > mentioned in the user guide (pildriver, pilconvert, etc.). Where are they? > They don't seem to be in the file I downloaded (PIL-1.1.1.win32-py2.2.exe). > Are they only included in the commercial version, or are they only included > in the Unix version? looks like they've been left out by mistake. you can find them in the source release, in the "Scripts" subdirectory. the source code is available from: http://www.pythonware.com/products/pil/ From SHUREM at ccf.org Wed Aug 27 12:26:53 2003 From: SHUREM at ccf.org (Mark Shure) Date: Wed Aug 27 11:27:41 2003 Subject: [Image-SIG] Re: Question about ImageDraw.Draw function Message-ID: Thanks for your suggestions, Chris. I used Steve Miller's Dependency Walker (www.dependencywalker.com) to check the dependencies of "_imaging.pyd". These included PYTHON22.DLL. I'm not sure how much this DLL file changes between 2.2.x sub-releases or whether this is the culprit... Here is my response to Fredrik's posting: Fredrik Lundh fredrik at pythonware.com Wed Aug 27 15:29:25 EDT 2003 wrote: > > try this: > > >>> import Image > >>> Image.core > ... > >>> dir(Image.core) > ... > > and let us know what it prints. > > Here's what I see on my system: Python 2.2.1 (#34, Apr 9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> Image.core >>> dir(Image.core) ['__doc__', '__file__', '__name__', 'bit_decoder', 'blend', 'convert', 'copy', 'crc32', 'display', 'display_mode', 'effect_mandelbrot', 'effect_noise', 'eps_encoder', 'fill', 'fli_decoder', 'font', 'getcodecstatus', 'gif_decoder', 'gif_encoder', 'hex_decoder', 'hex_encoder', 'jpeg_decoder', 'jpeg_encoder', 'linear_gradient', 'map', 'msp_decoder', 'new', 'open_ppm', 'outline', 'packbits_decoder', 'path', 'pcd_decoder', 'pcx_decoder', 'pcx_encoder', 'radial_gradient', 'raw_decoder', 'raw_encoder', 'sun_rle_decoder', 'tga_rle_decoder', 'tiff_lzw_decoder', 'wedge', 'xbm_decoder', 'xbm_encoder', 'zip_decoder', 'zip_encoder'] >>> Thanks again for all your help, guys! Regards, Mark Shure