From bbarkow at 24on.cc Sun Feb 5 11:01:14 2006 From: bbarkow at 24on.cc (Bernhard Barkow) Date: Sun, 5 Feb 2006 11:01:14 +0100 Subject: [Image-SIG] (no subject) Message-ID: <1E396BDD-CC5F-42E4-AFED-50E99CCFBECB@24on.cc> Hi, I'm having a serious problem with the Python Image Library: it compiles fine with JPEG support, and passes the selftest.py (55 tests), but whenever I try to open a JPEG file, I receive an error (AttributeError: 'module' object has no attribute '_safe_read'; see below). I use Python 2.3.5 and libjpeg62 (Debian 3.1), PIL 1.1.5 (no Freetype2). Do you have any hints how I can overcome this? Thanks, Bernhard Barkow --- ...# pilfile.py -v logo2.jpg logo2.jpg failed: unexpected error Traceback (most recent call last): File "/usr/bin/pilfile.py", line 75, in ? im = Image.open(file) File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 1556, in open return factory(fp, filename) File "/usr/lib/python2.3/site-packages/PIL/ImageFile.py", line 78, in __init__ self._open() File "/usr/lib/python2.3/site-packages/PIL/JpegImagePlugin.py", line 270, in _open handler(self, i) File "/usr/lib/python2.3/site-packages/PIL/JpegImagePlugin.py", line 56, in APP s = ImageFile._safe_read(self.fp, n) AttributeError: 'module' object has no attribute '_safe_read' From fredrik at pythonware.com Sun Feb 5 11:16:41 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 5 Feb 2006 11:16:41 +0100 Subject: [Image-SIG] AttributeError: 'module' object has no attribute '_safe_read' References: <1E396BDD-CC5F-42E4-AFED-50E99CCFBECB@24on.cc> Message-ID: Bernhard Barkow wrote: > I'm having a serious problem with the Python Image Library: it > compiles fine with JPEG support, and passes the selftest.py (55 > tests), but whenever I try to open a JPEG file, I receive an error > (AttributeError: 'module' object has no attribute '_safe_read'; see > below). > I use Python 2.3.5 and libjpeg62 (Debian 3.1), PIL 1.1.5 (no Freetype2). > Do you have any hints how I can overcome this? looks like a version mixup. make sure you don't have older ImageFile modules lying around... > ...# pilfile.py -v logo2.jpg > logo2.jpg failed: unexpected error > Traceback (most recent call last): > File "/usr/bin/pilfile.py", line 75, in ? > im = Image.open(file) > File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 1556, > in open > return factory(fp, filename) > File "/usr/lib/python2.3/site-packages/PIL/ImageFile.py", line 78, > in __init__ > self._open() > File "/usr/lib/python2.3/site-packages/PIL/JpegImagePlugin.py", > line 270, in _open > handler(self, i) > File "/usr/lib/python2.3/site-packages/PIL/JpegImagePlugin.py", > line 56, in APP > s = ImageFile._safe_read(self.fp, n) > AttributeError: 'module' object has no attribute '_safe_read' From peter.mosley at north.org Tue Feb 7 15:28:58 2006 From: peter.mosley at north.org (Peter Mosley) Date: Tue, 7 Feb 2006 06:28:58 -0800 (PST) Subject: [Image-SIG] Unable to get PIL to load jpeg images Message-ID: <20060207062859.23A2C624@dm22.mta.everyone.net> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://mail.python.org/pipermail/image-sig/attachments/20060207/328665eb/attachment.pot From Peter.Mosley at sentencing-guidelines.gsi.gov.uk Tue Feb 7 15:38:37 2006 From: Peter.Mosley at sentencing-guidelines.gsi.gov.uk (Mosley Peter) Date: Tue, 7 Feb 2006 14:38:37 -0000 Subject: [Image-SIG] Unable to get PIL to load jpeg images Message-ID: <9971F1281E554644A3956222CE93324104CD6F6C@fdcem005> Something went wrong with my previous post - try again. I posted this query on comp.lang.python and received a reply suggesting I try this mailing list. I'm still wrestling with Python / Tkinter / PIL. ?I have almost got it to work - on a Fedora Core 1 system I can now display images in a Tkinter window. ?But I also run a Fedora Core 3 system, and when I tried the same procedures I get the following errors:- [kpeter at localhost jpgTest]$ python pil_jpg.py Exception in Tkinter callback Traceback (most recent call last): ? File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__ ? ? return self.func(*args) ? File "pil_jpg.py", line 26, in do_something ? ? a.thumbnail((200,150)) ? File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 1422, in thumbnail ? ? self.load() ? File "/usr/lib/python2.3/site-packages/PIL/ImageFile.py", line 180, in load ? ? d = Image._getdecoder(self.mode, d, a, self.decoderconfig) ? File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 328, in _getdecoder ? ? raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available I am running Python 2.3.4, PIL 1.1.5 on a Fedora Core 3 system. ?I know the code is ok, as it runs quite happily under FC1 and Windows. ?I've searched around for clues, and found a few references to this error message, but quite frankly don't understand what they are saying. Searching around for files that look as if they may be the jpeg libraries I can find /usr/lib/libjpeg.so.62.0.0, and a symbolic link /usr/lib/libjpeg.so.62. I think I somehow have to configure PIL to recognise these, but I am not sure and anyway don't know how to do this. Can anyone help? Peter The original of this email was scanned for viruses by the Government Secure Intranet (GSi) virus scanning service supplied exclusively by Cable & Wireless in partnership with MessageLabs. On leaving the GSi this email was certified virus-free From fredrik at pythonware.com Tue Feb 7 21:55:58 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 7 Feb 2006 21:55:58 +0100 Subject: [Image-SIG] Unable to get PIL to load jpeg images References: <20060207062859.23A2C624@dm22.mta.everyone.net> Message-ID: Peter Mosley wrote: > I am running Python 2.3.4, PIL 1.1.5 on a Fedora Core 3 system. I know > the code is ok, as it runs quite happily under FC1 and Windows. I've > searched around for clues, and found a few references to this error > message, but quite frankly don't understand what they are saying. maybe you could explain what it is that you don't understand ? (after all, if you've trouble understanding the explanations you've already seen, posting more of the same will probably not help you...) From peter.mosley at dsl.pipex.com Tue Feb 7 23:06:23 2006 From: peter.mosley at dsl.pipex.com (peter.mosley at dsl.pipex.com) Date: Tue, 07 Feb 2006 22:06:23 +0000 Subject: [Image-SIG] Unable to get PIL to load jpeg images (2) Message-ID: <1139349983.43e919df43f01@netmail.pipex.net> Fair point. I didn't understand what I was looking for in the way of JPEG libraries and was reluctant to risk damaging some unrelated files. I have found a reference in http://effbot.org/zone/pil-decoder-jpeg-not-available.htm. Here it says that for PIL 1.1.5 I should change the setup.py file so that JPEG_ROOT points to the directory where the libjpeg library is installed. In setup.py there is a comment:- # Use None to look for the libraries in well-known library locations. I'm not sure where the jpeg libraries are (or what to look for). As I said in before, the only files I can find which look likely are /usr/lib/libjpeg.so.62.0.0, and a symbolic link /usr/lib/libjpeg.so.62 I would have though that /usr/lib is a well known library location. Nevertheless I tried changing the line JPEG_ROOT = None to JPEG_ROOT = "/usr/lib" and reran setup.py. The output was [root at localhost Imaging-1.1.5]# python setup.py install running install running build running build_py running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform linux2 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] -------------------------------------------------------------------- --- TKINTER support ok *** JPEG support not available --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. I must have jpeg libraries somewhere, as other appliations (eg GIMP and gThumb) will show jpeg images. But if they're not in /usr/lib, and the locate command doesn't show any other likely candidates, how do I go about finding them? And if I do find them, is it literally just a case of setting the JPEG_ROOT variable? Peter -- From fredrik at pythonware.com Wed Feb 8 00:12:00 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 8 Feb 2006 00:12:00 +0100 Subject: [Image-SIG] Unable to get PIL to load jpeg images (2) References: <1139349983.43e919df43f01@netmail.pipex.net> Message-ID: peter.mosley at dsl.pipex.com wrote: > I must have jpeg libraries somewhere, as other appliations (eg GIMP and gThumb) > will show jpeg images. But if they're not in /usr/lib, and the locate command > doesn't show any other likely candidates, how do I go about finding them? chances are that you only have runtime libraries, and no developer files. this would mean that applications that are linked against libjpeg will work, but that you cannot link new applications (like PIL) against them... try installing the "libjpeg62-dev" package (or whatever that's called on fedora). From peter.mosley at dsl.pipex.com Wed Feb 8 01:06:32 2006 From: peter.mosley at dsl.pipex.com (peter.mosley at dsl.pipex.com) Date: Wed, 08 Feb 2006 00:06:32 +0000 Subject: [Image-SIG] Unable to get PIL to load jpeg images (3) Message-ID: <1139357192.43e93608989e9@netmail.pipex.net> I found a file libjpeg-devel-6b-33.i386.rpm on the FC3 discs, so installed that. It appeared to create the file /usr/lib/libjpeg.so Running setup.py install then gave [kpeter at localhost Imaging-1.1.5]$ python setup.py install running install running build running build_py running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform linux2 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] -------------------------------------------------------------------- --- TKINTER support ok --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok -------------------------------------------------------------------- so I thought I was there - JPEG support ok! But running my test code gave the same error message as before. It's midnight in London now, so I'm off to bed. Try again tomorrow. Peter -- From fredrik at pythonware.com Wed Feb 8 12:02:56 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 8 Feb 2006 12:02:56 +0100 Subject: [Image-SIG] Unable to get PIL to load jpeg images (3) References: <1139357192.43e93608989e9@netmail.pipex.net> Message-ID: peter.mosley at dsl.pipex.com wrote: > so I thought I was there - JPEG support ok! > > But running my test code gave the same error message as before. > > It's midnight in London now, so I'm off to bed. Try again tomorrow. The tests might pick up your old, broken build. Try installing the new library before running the tests, or remove any traces of _imaging*.so from the Python install and see if that fixes things. (unfortuntely, there's no "uninstall" command in distutils...) From peter.mosley at dsl.pipex.com Wed Feb 8 22:42:31 2006 From: peter.mosley at dsl.pipex.com (peter.mosley at dsl.pipex.com) Date: Wed, 08 Feb 2006 21:42:31 +0000 Subject: [Image-SIG] Unable to get PIL to load jpeg images - Success Message-ID: <1139434951.43ea65c73abc6@netmail.pipex.net> Success! Though not without some drama along the way I deleted the _imaging*.so files and reinstalled PIL - no change. So I next backed up and removed the entire PIL directory and reinstalled - still no change. Then I thought that maybe the files are created first in the setup directory and copied across. So I deleted all the setup files and reinstalled from the original tarball. This time it looked like disaster - Python didn't even get as far as Imaging, but fell over somewhere in Tkinter with a message about Tclerror(?). I went back to the install and ran the setup test which seemed to complete ok - I think it said 55 tests passed. I reran my jpg test script, and this time it worked! I can't recall the exact Tcl error message, and it's scrolled off screen by now, so I just hope that it doesn't recur. It looks as if everything is working. Thanks for all the guidance. Peter -- From Chris.Barker at noaa.gov Wed Feb 8 23:02:14 2006 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 08 Feb 2006 14:02:14 -0800 Subject: [Image-SIG] Unable to get PIL to load jpeg images (3) In-Reply-To: References: <1139357192.43e93608989e9@netmail.pipex.net> Message-ID: <43EA6A66.9060508@noaa.gov> Fredrik Lundh wrote: > (unfortuntely, there's no "uninstall" command in distutils...) Since you've mentioned this, are you looking into using setuptools and eggs? uninstall is one of their features. -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 at noaa.gov From abernard at purdue.edu Thu Feb 9 02:56:39 2006 From: abernard at purdue.edu (abernard at purdue.edu) Date: Wed, 8 Feb 2006 20:56:39 -0500 Subject: [Image-SIG] question about import image Message-ID: <1139450199.43eaa157e20eb@webmail.purdue.edu> To whom it may concern: When trying to do the tutorial after installing the imaging library it gives me this error: >>> import image Traceback (most recent call last): File "", line 1, in -toplevel- import image ImportError: No module named image >>> Could you please help??? Is it possible how and where I downloaded the library? Thanks so much. From smartpawn at gmail.com Thu Feb 9 11:59:28 2006 From: smartpawn at gmail.com (Deepak Rokade) Date: Thu, 9 Feb 2006 16:29:28 +0530 Subject: [Image-SIG] help needed for d3des algorithm source code Message-ID: <48224a820602090259v2f9be4b2h96d6519be1bb217e@mail.gmail.com> Hi all Can u help me for a source code of d3des encryption algorithm in python I need it for my program. I could find out a build which converts a source of c code into python external module. But it didnt give me a source code. Can u also tell me how to retrieve a source code from external module i.e. " .pyd " files.... Attaching herewith "pyd3des.pyd" Thanx & regards. -- Deepak Rokade Garware MCS2005u -------------- next part -------------- A non-text attachment was scrubbed... Name: PyD3DES.zip Type: application/zip Size: 3300 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060209/8eaa42ff/attachment.zip From kishkin at gmail.com Thu Feb 9 12:09:53 2006 From: kishkin at gmail.com (Michael Smirnov) Date: Thu, 9 Feb 2006 14:09:53 +0300 Subject: [Image-SIG] Is there any documentation on PERSPECTIVE method of transform? Message-ID: Hello all!! Did anyone found this documentation? -- Sincerely yours. Mario Kishkin. From fredrik at pythonware.com Thu Feb 9 22:40:41 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 9 Feb 2006 22:40:41 +0100 Subject: [Image-SIG] question about import image References: <1139450199.43eaa157e20eb@webmail.purdue.edu> Message-ID: abernard at purdue.edu wrote: > To whom it may concern: > > When trying to do the tutorial after installing the imaging library it gives > me this error: > >>> import image > > Traceback (most recent call last): > File "", line 1, in -toplevel- > import image > ImportError: No module named image > >>> > > Could you please help??? Is it possible how and where I downloaded the > library? Python is case-sensitive. "Image" and "image" are two different things. From bernd at prager.ws Fri Feb 10 19:05:59 2006 From: bernd at prager.ws (Bernd Prager) Date: Fri, 10 Feb 2006 13:05:59 -0500 (EST) Subject: [Image-SIG] OverflowError: long int to large to convert to int Message-ID: <49133.198.45.19.20.1139594759.squirrel@mail.prager.ws> I'm running ActiveState Python 2.4.2 on Windows XP with Python 2.4 PIL-1.1.5. When I try to open an OLE file I get the error message: File "C:\bin\eclipse\workspace\email\email.py", line 7, in main ole = PIL.OleFileIO.OleFileIO(filename) File "C:\bin\Python24\Lib\site-packages\PIL\OleFileIO.py", line 260, in __init__ self.open(filename) File "C:\bin\Python24\Lib\site-packages\PIL\OleFileIO.py", line 293, in open self.loaddirectory(i32(header, 48)) File "C:\bin\Python24\Lib\site-packages\PIL\OleFileIO.py", line 339, in loaddirectory fp = self._open(sect) File "C:\bin\Python24\Lib\site-packages\PIL\OleFileIO.py", line 405, in _open self.sectorsize, self.fat) File "C:\bin\Python24\Lib\site-packages\PIL\OleFileIO.py", line 106, in __init__ sect = fat[sect] OverflowError: long int too large to convert to int The same script on Debian Linux with the Debian packages python2.3 (2.3.5-9) and python2.3-imaging (1.1.5-4) runs fine. My problem is even when I develop on Linux the target system has to be Windows. So I need a way to make that work. Is there a way for me to fix this? Thanks for any help or suggestions, -- Bernd From bernd at prager.ws Fri Feb 10 23:28:29 2006 From: bernd at prager.ws (Bernd Prager) Date: Fri, 10 Feb 2006 17:28:29 -0500 (EST) Subject: [Image-SIG] OverflowError: long int to large to convert to int In-Reply-To: <49133.198.45.19.20.1139594759.squirrel@mail.prager.ws> References: <49133.198.45.19.20.1139594759.squirrel@mail.prager.ws> Message-ID: <28913.198.45.19.20.1139610509.squirrel@mail.prager.ws> Ok, trying to nail the issue down I changed the Python version under Linux. Here's the program: ------ snip ------------------- import sys import PIL.OleFileIO filename = "outl.msg" ole = PIL.OleFileIO.OleFileIO(filename) for entry in ole.listdir(): print entry[1:2] sys.exit() ------ snip ------------------- When I run this program with python2.3 I get following output: /usr/lib/python2.3/site-packages/PIL/OleFileIO.py:46: FutureWarning: x< crash on Windows? Message-ID: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com> I have observed following on Windows XP: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from PIL import Image >>> Image.VERSION '1.1.5' >>> import aggdraw >>> aggdraw.__version__ '1.2a2' >>> image = Image.new('RGB', (600, 430), 'white') >>> draw = aggdraw.Draw(image) >>> help(draw) -->PYTHON CRASH<-- Can anyone else confirm it? My machine started to act funny recently so maybe it is time to rebuild it. Waldemar From rzantow at gmail.com Sat Feb 11 22:34:29 2006 From: rzantow at gmail.com (Dick Zantow) Date: Sat, 11 Feb 2006 16:34:29 -0500 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? In-Reply-To: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com> References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com> Message-ID: <43EE5865.5000108@gmail.com> Waldemar Osuch wrote: > I have observed following on Windows XP: > > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>> from PIL import Image >>>> Image.VERSION >>>> > '1.1.5' > >>>> import aggdraw >>>> aggdraw.__version__ >>>> > '1.2a2' > >>>> image = Image.new('RGB', (600, 430), 'white') >>>> draw = aggdraw.Draw(image) >>>> help(draw) >>>> > -->PYTHON CRASH<-- > > Can anyone else confirm it? > My machine started to act funny recently so maybe it is time to rebuild it. > > Same thing happens to me, too, on WinXP. From fredrik at pythonware.com Sun Feb 12 13:14:48 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 12 Feb 2006 13:14:48 +0100 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com> <43EE5865.5000108@gmail.com> Message-ID: Dick Zantow wrote: > >>>> image = Image.new('RGB', (600, 430), 'white') > >>>> draw = aggdraw.Draw(image) > >>>> help(draw) > >>>> > > -->PYTHON CRASH<-- > > > > Can anyone else confirm it? > > My machine started to act funny recently so maybe it is time to rebuild it. > > Same thing happens to me, too, on WinXP. looks like help(aggdraw.Draw("RGB", (1, 1))) is enough to cause a crash. From fredrik at pythonware.com Sun Feb 12 13:37:57 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 12 Feb 2006 13:37:57 +0100 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com><43EE5865.5000108@gmail.com> Message-ID: Fredrik Lundh wrote: > looks like > > help(aggdraw.Draw("RGB", (1, 1))) > > is enough to cause a crash. it's type(Draw(...)) that doesn't work as it should. here's a patch: @@ -1903,12 +1904,12 @@ {NULL, NULL} }; -extern "C" void -#ifdef WIN32 -__declspec(dllexport) -#endif +DL_EXPORT(void) initaggdraw(void) { + DrawType.ob_type = PathType.ob_type = &PyType_Type; + PenType.ob_type = BrushType.ob_type = FontType.ob_type = &PyType_Type; + Py_InitModule("aggdraw", aggdraw_functions); PyObject* g = PyDict_New(); From fredrik at pythonware.com Sun Feb 12 15:49:39 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 12 Feb 2006 15:49:39 +0100 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com><43EE5865.5000108@gmail.com> Message-ID: > it's type(Draw(...)) that doesn't work as it should. here's a patch: I've released a new source kit which fixes this issue and a couple of other alpha bugs. ZIP and TAR archives are available here: http://effbot.org/downloads/#aggdraw From waldemar.osuch at gmail.com Mon Feb 13 03:41:39 2006 From: waldemar.osuch at gmail.com (Waldemar Osuch) Date: Sun, 12 Feb 2006 19:41:39 -0700 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? In-Reply-To: References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com> <43EE5865.5000108@gmail.com> Message-ID: <6fae95540602121841j2a3d6709m28d179dd1995b0c4@mail.gmail.com> > I've released a new source kit which fixes this issue and a couple of > other alpha bugs. ZIP and TAR archives are available here: > > http://effbot.org/downloads/#aggdraw > > Oh boy, that was quick From fredrik at pythonware.com Mon Feb 13 20:40:31 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 13 Feb 2006 20:40:31 +0100 Subject: [Image-SIG] help(aggdraw.Draw instance) -> crash on Windows? References: <6fae95540602111116w780eb882n42f81c4eb3e42478@mail.gmail.com><43EE5865.5000108@gmail.com> <6fae95540602121841j2a3d6709m28d179dd1995b0c4@mail.gmail.com> Message-ID: Waldemar Osuch wrote: > > I've released a new source kit which fixes this issue and a couple of > > other alpha bugs. ZIP and TAR archives are available here: > > > > http://effbot.org/downloads/#aggdraw > > Oh boy, that was quick just doing our best ;-) I've posted windows binaries for Python 2.3 and 2.4 to the same location. cheers /F From dieter.vanderelst at gmail.com Wed Feb 15 11:48:02 2006 From: dieter.vanderelst at gmail.com (Dieter Vanderelst) Date: Wed, 15 Feb 2006 11:48:02 +0100 Subject: [Image-SIG] using filters dll in Python? Message-ID: <43F306E2.3030900@gmail.com> Hello, I'm trying to access the Filters-Dll provided by the filters-project (http://filters.sourceforge.net/index.htm). Following the advice I got from the Python mailing list, I do this using ctypes (http://starship.python.net/crew/theller/ctypes/index.html). I can seem to access the image filters now provided by the Dll because I can instantiate "filter-objects". But reading and writing of images is still a problem: I don't know how I should read and write files because the project is not very well documented. So, I was wondering whether there are people on this list that have some experience in using the filters Dll. Maybe they could sent me some examples of the use of the Dll with Python? Or maybe some of you have other suggestions as to which filter library to use? Kind regards, Dieter From baas at ira.uka.de Wed Feb 15 14:30:00 2006 From: baas at ira.uka.de (Matthias Baas) Date: Wed, 15 Feb 2006 14:30:00 +0100 Subject: [Image-SIG] PIL & TIFF using "deflate" algorithm Message-ID: Hi, I have some TIFF images that use the "deflate" compression algorithm which unfortunately PIL (1.1.5) doesn't support. So I'd just like to ask if there are any plans to add support for deflate in the foreseeable future? Should there be test images required, I have put two examples (one rgb and one rgba image) over here: http://i31www.ira.uka.de/~baas/pil/out_deflate_rgb.tif http://i31www.ira.uka.de/~baas/pil/out_deflate_rgba.tif Cheers, - Matthias - From dieter.vanderelst at gmail.com Wed Feb 15 18:02:00 2006 From: dieter.vanderelst at gmail.com (Dieter Vanderelst) Date: Wed, 15 Feb 2006 18:02:00 +0100 Subject: [Image-SIG] Some advice on a Filters Library? Message-ID: <43F35E88.2010608@gmail.com> Hi, I'm looking for a library of image filters to use in course assignment on computer vision. I've considered the Filter Project (http://filters.sourceforge.net/index.htm) and the openCV project (http://www.intel.com/technology/computing/opencv/). But I found the first lacking in documentation and the second hard to install. Does anybody has other suggestions about which filter library I could use with Python? Did anybody use the first two suggestions? Or Maybe there is some computer vision application that I can access trough the command line, so that I can use Python to control it? Any suggestions are very welcome, Dieter From Amanda.Waltman at noaa.gov Wed Feb 15 17:30:01 2006 From: Amanda.Waltman at noaa.gov (Amanda.Waltman) Date: Wed, 15 Feb 2006 10:30:01 -0600 Subject: [Image-SIG] Request MD5 checksum for PIL 1.1.5 Message-ID: <43F35709.7050004@noaa.gov> Hello. Can someone please send me a MD5 checksum (digital signature) on the follow file: PIL-1.1.5.win32-py2.4.exe One of our Python users is requesting to use PIL with her Python 2.4 on her Windows2K platform. Due to security reasons, I am required to obtain a digital signature on s/w prior to installation on downloads via Internet. Thank you for your time. Amanda -- Warm Regards, Amanda C. Waltman Systems Administrator, Anteon Corporation NOAA/NCDDC Stennis Space Center, MS 39529 Voice: 228.688.3722 Email: Amanda.Waltman at noaa.gov "..In the tropics, it's located somewhere between the port of indecision & southwest of disorder.." From meesters at uni-mainz.de Wed Feb 15 18:18:24 2006 From: meesters at uni-mainz.de (Christian Meesters) Date: Wed, 15 Feb 2006 18:18:24 +0100 Subject: [Image-SIG] Some advice on a Filters Library? In-Reply-To: <43F35E88.2010608@gmail.com> References: <43F35E88.2010608@gmail.com> Message-ID: <200602151818.25397.meesters@uni-mainz.de> Hoi, Not knowing what you are exactly looking for, you might want to check out SciPy: www.scipy.org (see the filter options in the 'old' pdf version of the scipy tutorial at www.scipy.org/Documentation for an overview). SciPy provides various filter options on arrays. Images can be imported, provided PIL is installed (which I presume anyway ;-) ). Cheers Christian On Wednesday 15 February 2006 18:02, Dieter Vanderelst wrote: > Hi, > > I'm looking for a library of image filters to use in course assignment > on computer vision. > > I've considered the Filter Project > (http://filters.sourceforge.net/index.htm) and the openCV project > (http://www.intel.com/technology/computing/opencv/). But I found the > first lacking in documentation and the second hard to install. > > Does anybody has other suggestions about which filter library I could > use with Python? Did anybody use the first two suggestions? > > Or Maybe there is some computer vision application that I can access > trough the command line, so that I can use Python to control it? > > Any suggestions are very welcome, > > Dieter > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From michele.petrazzo at unipex.it Thu Feb 16 09:46:10 2006 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Thu, 16 Feb 2006 09:46:10 +0100 Subject: [Image-SIG] using filters dll in Python? In-Reply-To: <43F306E2.3030900@gmail.com> References: <43F306E2.3030900@gmail.com> Message-ID: <43F43BD2.4000207@unipex.it> Dieter Vanderelst wrote: > Hello, > > I'm trying to access the Filters-Dll provided by the filters-project > (http://filters.sourceforge.net/index.htm). > > Following the advice I got from the Python mailing list, I do this > using ctypes > (http://starship.python.net/crew/theller/ctypes/index.html). > > I can seem to access the image filters now provided by the Dll > because I can instantiate "filter-objects". > > But reading and writing of images is still a problem: I don't know > how I should read and write files because the project is not very > well documented. > The documentation isn't a "real" project... You have the sources, that are the better documentation! Try to load the library and use the library with ctypes. Post the problems on ctypes ml, and if you want, share your python code with the community, like I do with freeimagepy! Michele From michele.petrazzo at unipex.it Thu Feb 16 09:50:17 2006 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Thu, 16 Feb 2006 09:50:17 +0100 Subject: [Image-SIG] PIL & TIFF using "deflate" algorithm In-Reply-To: References: Message-ID: <43F43CC9.9040602@unipex.it> Matthias Baas wrote: > Hi, > > I have some TIFF images that use the "deflate" compression algorithm > which unfortunately PIL (1.1.5) doesn't support. So I'd just like to > ask if there are any plans to add support for deflate in the > foreseeable future? > I don't know if PIL will add that feature, but into the new freeimagepy version (1.2.2), I add the convertToPil feature, so, if you want, you can load your images with freeimagepy and convert them to PIL form make your work. I have already tried your images and all work well.. freeimagepy.sf.net > Cheers, > > - Matthias - > Hope can help, Michele From michele.petrazzo at unipex.it Thu Feb 16 09:56:07 2006 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Thu, 16 Feb 2006 09:56:07 +0100 Subject: [Image-SIG] ANN: FreeImagePy 1.2.2 Message-ID: <43F43E27.7030405@unipex.it> FreeImagePy 1.2.2 is available at freeimagepy.sf.net What is? It' a python wrapper for FreeImage, Open Source library for developers who would like to support popular graphics image formats. How work? It use a binary freeimage library present on the system and ctypes. Major changes from 1.2.0: New convertToPil function: i = FreeImagePy.Image("myImage.ext") pil = i.convetToPil() Some bugs solved Michele Petrazzo From ke7fxl at gmail.com Thu Feb 16 22:31:24 2006 From: ke7fxl at gmail.com (Tod Haren) Date: Thu, 16 Feb 2006 13:31:24 -0800 Subject: [Image-SIG] Capturing higher resolution images Message-ID: <6f5b2c4e0602161331v18c0d6d7r3ca23e72c7bb3956@mail.gmail.com> I've got a web cam, your basic run-of-the-mill variety, that purports to be capable of VGA 640x480 still images, but only lower resolution for video. However, I can not figure out how to capture a VGA quality image. Using VideoCapture.py only enables the lower resolution images. My assumption is that the driver being used for the web cam is only providing the video options. Can anybody clue me in to how I can capture these VGA snapshots? I've seen the TWAIN module for Windows, but I'd prefer a portable option. I've Google around but haven't come up with anything concrete yet. FYI, I'm just getting into Python. Thanks From andy47 at halfcooked.com Sat Feb 18 03:14:44 2006 From: andy47 at halfcooked.com (Andy Todd) Date: Sat, 18 Feb 2006 13:14:44 +1100 Subject: [Image-SIG] Problems with JPEG support with PIL 1.1.5 on Mac OSX 10.4 Message-ID: <43F68314.5070204@halfcooked.com> Back in December I wrote to the list [1] asking for help getting JPEG support to work with PIL on my Mac. Well I finally got it working and thought I would share my solution with the list for posterity's sake. Essentially because I'd installed libjpeg using fink it wasn't in any of the 'usual' library locations that PIL's setup.py was expecting. So after unpacking the PIL source distribution I edited the setup.py file, changing line 32 from; JPEG_ROOT = None to; JPEG_ROOT = "/sw/lib" And the usual python setup.py install worked like a dream. [1] http://mail.python.org/pipermail/image-sig/2005-December/003710.html Regards, Andy -- -------------------------------------------------------------------------------- From the desk of Andrew J Todd esq - http://www.halfcooked.com/ From bialix at ukr.net Mon Feb 20 11:31:07 2006 From: bialix at ukr.net (Alexander Belchenko) Date: Mon, 20 Feb 2006 12:31:07 +0200 Subject: [Image-SIG] How to store image as black&white bmp (1-bit color scheme)? Message-ID: I try to convert with PIL some of my black&white images from 24-bit bmp format to 1-bit bmp format. But anyway PIL save converted image as 24-bit bmp. How to save it as 1-bit? Is PIL support saving bmp as 1-bit? Here my code example: import Image im = Image.open('file-24bit.bmp') im.convert('1') im.save('file-1bit.bmp') But saved file anyway have 24-bit color. Please, help. -- Alexander From fredrik at pythonware.com Mon Feb 20 12:43:25 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 20 Feb 2006 12:43:25 +0100 Subject: [Image-SIG] How to store image as black&white bmp (1-bit colorscheme)? References: Message-ID: Alexander Belchenko wrote: >I try to convert with PIL some of my black&white images from 24-bit bmp > format to 1-bit bmp format. But anyway PIL save converted image as > 24-bit bmp. How to save it as 1-bit? Is PIL support saving bmp as 1-bit? > > Here my code example: > > import Image > > im = Image.open('file-24bit.bmp') > im.convert('1') > im.save('file-1bit.bmp') > > But saved file anyway have 24-bit color. like most PIL methods, convert returns the converted image. try changing your code to: im = im.convert('1') im.save('file-1bit.bmp') From bialix at ukr.net Mon Feb 20 13:14:18 2006 From: bialix at ukr.net (Alexander Belchenko) Date: Mon, 20 Feb 2006 14:14:18 +0200 Subject: [Image-SIG] How to store image as black&white bmp (1-bit colorscheme)? In-Reply-To: References: Message-ID: Fredrik Lundh ?????: > like most PIL methods, convert returns the converted image. try changing > your code to: > > im = im.convert('1') > im.save('file-1bit.bmp') Oh. My fault. Thank you. It's works as expected. -- Alexander From procmail-bounces at lists.RWTH-Aachen.DE Fri Feb 24 09:34:41 2006 From: procmail-bounces at lists.RWTH-Aachen.DE (procmail-bounces at lists.RWTH-Aachen.DE) Date: Fri, 24 Feb 2006 09:34:41 +0100 Subject: [Image-SIG] =?iso-8859-15?q?Your_message_to_procmail_awaits_moder?= =?iso-8859-15?q?ator_approval?= Message-ID: Your mail to 'procmail' with the subject *****SPAM***** status Is being held until the list moderator can review it for approval. The reason it is being held: The message headers matched a filter rule (Sophos deleted virus from mail) Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://MailMan.RWTH-Aachen.DE/mailman/confirm/procmail/e64b33b912eff52c42d412a66d29ffe7812c12f5 From angelol at easyconnect.fr Fri Feb 24 23:18:10 2006 From: angelol at easyconnect.fr (Angelo) Date: Fri, 24 Feb 2006 23:18:10 +0100 Subject: [Image-SIG] Put alpha on a color Message-ID: <1140819490.7095.5.camel@glux1.dux.home> Hi, I'm new with PIL, and I want to know how to put alpha channel on a color (not simply a band) . putalpha(band) works only with one band at the same time, it is that? . I would like to make a trick of the style ==> putalpha((108, 128, 199)), that is it possible (?), and how to make? . Thanks in advance . monsitt From fredrik at pythonware.com Tue Feb 28 12:22:44 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 28 Feb 2006 12:22:44 +0100 Subject: [Image-SIG] Problems with JPEG support with PIL 1.1.5 on MacOSX 10.4 References: <43F68314.5070204@halfcooked.com> Message-ID: Andy Todd wrote: > Back in December I wrote to the list [1] asking for help getting JPEG > support to work with PIL on my Mac. > > Well I finally got it working and thought I would share my solution with > the list for posterity's sake. > > Essentially because I'd installed libjpeg using fink it wasn't in any of > the 'usual' library locations that PIL's setup.py was expecting. So > after unpacking the PIL source distribution I edited the setup.py file, > changing line 32 from; > > JPEG_ROOT = None > > to; > > JPEG_ROOT = "/sw/lib" > > And the usual python setup.py install worked like a dream. footnote: the fink directories have been added to the list of known darwin locations in PIL 1.1.6: ... elif sys.platform == "darwin": # attempt to make sure we pick freetype2 over other versions add_directory(include_dirs, "/sw/include/freetype2") add_directory(include_dirs, "/sw/lib/freetype2/include") # fink installation directories add_directory(library_dirs, "/sw/lib") add_directory(include_dirs, "/sw/include") # darwin ports installation directories add_directory(library_dirs, "/opt/local/lib") add_directory(include_dirs, "/opt/local/include") ... From janssen at parc.com Tue Feb 28 22:43:48 2006 From: janssen at parc.com (Bill Janssen) Date: Tue, 28 Feb 2006 13:43:48 PST Subject: [Image-SIG] bug in pildriver.py PASTE operation (1.1.5) In-Reply-To: Your message of "Tue, 28 Feb 2006 03:22:44 PST." Message-ID: <06Feb28.134349pst."58633"@synergy1.parc.xerox.com> The code for the pildriver.py "paste" operation currently looks like this: def do_paste(self): """usage: paste Paste figure image into ground with upper left at given offsets. """ figure = self.do_pop() xoff = int(self.do_pop()) yoff = int(self.do_pop()) ground = self.do_pop() if figure.mode == "RGBA": self.push(ground.paste(figure, (xoff, yoff), figure)) else: self.push(ground.paste(figure, (xoff, yoff))) This seems somewhat useless -- a None value gets pushed on the stack. More useful would be: def do_paste(self): """usage: paste Paste figure image into ground with upper left at given offsets. """ figure = self.do_pop() xoff = int(self.do_pop()) yoff = int(self.do_pop()) ground = self.do_pop() if figure.mode == "RGBA": ground.paste(figure, (xoff, yoff), figure) else: ground.paste(figure, (xoff, yoff)) self.push(ground) Otherwise you need an extraneous dup (to make a copy of the ground) and pop (to get rid of the None) in there. Bill From janssen at parc.com Tue Feb 28 22:46:35 2006 From: janssen at parc.com (Bill Janssen) Date: Tue, 28 Feb 2006 13:46:35 PST Subject: [Image-SIG] pildriver.py can't resize image Message-ID: <06Feb28.134644pst."58633"@synergy1.parc.xerox.com> I get the following error when I attempt to put a 300-pixel gray border around a 640x480 image: % pildriver.py show resize 640 480 pop paste open /tmp/snap.png 300 300 dup new 1240 1080 128 verbose 1 Stack: ['128'] Stack: ['1080', '128'] Stack: ['1240', '1080', '128'] Stack: ['new', '1240', '1080', '128'] Stack: ['dup', ] Stack: ['300', , ] Stack: ['300', '300', , ] Stack: ['/tmp/snap.png', '300', '300', , ] Stack: ['open', '/tmp/snap.png', '300', '300', , ] Stack: ['paste', , '300', '300', , ] Stack: ['pop', None, ] Stack: ['480', ] Stack: ['640', '480', ] Stack: ['resize', '640', '480', ] Traceback (most recent call last): File "/usr/local/bin/pildriver.py", line 507, in ? driver.execute(sys.argv[1:]) File "/usr/local/bin/pildriver.py", line 493, in execute func() File "/usr/local/bin/pildriver.py", line 264, in do_resize self.push(image.resize(xsize, ysize)) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL/Image.py", line 1186, in resize raise ValueError("unknown resampling filter") ValueError: unknown resampling filter % This is PIL 1.1.5 with Python 2.3.5. Bill From marcin.szkudlarek at gmail.com Thu Feb 9 14:03:56 2006 From: marcin.szkudlarek at gmail.com (Marcin Szkudlarek) Date: Thu, 09 Feb 2006 13:03:56 -0000 Subject: [Image-SIG] read image into an array Message-ID: Hello everyone, I'm doing image processing on 8-bit gray color images. This code loads the data into array: self.im = Image.open("example.bmp") self.image = zeros([self.im.size[0], self.im.size[1]], Int) i = 0 while(i < self.im.size[0]): j = 0 while(j < self.im.size[1]): self.image[i,j] = self.im.getpixel((i, j)) j=j+1 i=i+1 Is there a faster way to do it? For example using getdata() method of Image class? And later how I can convert above array into Image without using slow putpixel method? Marcin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060209/3bab19cf/attachment-0001.html From juergenkemeter at gmx.de Tue Feb 14 04:22:09 2006 From: juergenkemeter at gmx.de (=?ISO-8859-1?Q?=22J=FCrgen_Kemeter=22?=) Date: Tue, 14 Feb 2006 03:22:09 -0000 Subject: [Image-SIG] hair follicle gene expression display Message-ID: <28300.1139885728@www072.gmx.net> Hi, my job at the moment is to provide a Python Script to display the different live cycle stages of hair follicle gene expression. Right now I try to google for this in the internet, without much success so far. Has anyone encountered a forum thread, etc. which involves this problem already, or has made experiences with this already? Cheers Juergen -- J?rgen Kemeter --------------------------------------------- C/O Robert Scurr 605 Riverside Road RDI Outram Otago 9055, New Zealand home: 0064 3 486 1022 --------------------------------------------- Invermay Agricultural Centre Puddle Alley Private Bag 50034 Mosgiel 9032, New Zealand work: 0064 3 489 9042 --------------------------------------------- Ziegelh?tte 4 92331 Parsberg, Germany phone: +49 9492 269 --------------------------------------------- ex nihilonihil fit (von nix kommt nix) From swapp0 at yahoo.com Thu Feb 16 12:29:52 2006 From: swapp0 at yahoo.com (Allen Huang) Date: Thu, 16 Feb 2006 11:29:52 -0000 Subject: [Image-SIG] Installing PIL into windows ZOPE Message-ID: <20060216112309.15066.qmail@web30210.mail.mud.yahoo.com> I want to install PIL into zope but I couldn't use the installation package since python that came with zope isn't register on windows. so I installed python 2.3 seperately and I found some artical on the zope website and it said to - decompress and PIL package and move - Copy the PIL folder and the pil.pth file from your Python folder into: YourZopeFolder/lib/python - Copy _imaging.pyd, _imagingtk.pyd, tk83.dll and tcl83.dll into YourZopeFolder/bin/DLLs - Copy PIL folder in Zope\lib\python\PIL I did all that but I'm not sure if PIL now work with zope or not... I started importing External Script using PIL but all I get is -- 'module' object has no attribute 'Image' Can someone tell me how I can check if PIL works? Does anyone have a simple PIL coding I could use? --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060216/c768a3ce/attachment-0001.htm From juergenkemeter at gmx.de Mon Feb 20 00:02:50 2006 From: juergenkemeter at gmx.de (=?ISO-8859-1?Q?=22J=FCrgen_Kemeter=22?=) Date: Sun, 19 Feb 2006 23:02:50 -0000 Subject: [Image-SIG] Highlight Graphic according to data Message-ID: <20080.1140388489@www015.gmx.net> Hi, I am thinking about using the Python Imaging Library to display the life cycle of a hair follicle gene. This life cycle is divided into four main stages: 1. Anagen 2. Catagen 3. Telogen 4. Exogen Gene name and corresponding life cycle stage will be stored in a csv ? file or Excel Spreadsheet column. In a picture of this life cycle, the corresponding gene stage should be highlighted in some way. The enclosed picture is a rough draft, but should give an idea how the life cycle will look like. Is it possible to do this with a Python script? Will I have to store different 'versions' of the life cylce, each one highlighting another stage? As I am merely learning Python at the moment, it would be great to receive tips regarding my project, thanks! Cheers Juergen -------------- next part -------------- A non-text attachment was scrubbed... Name: LifeCycle.jpg Type: image/pjpeg Size: 9291 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060219/3603d158/attachment-0001.bin From pyprog at easyconnect.fr Mon Feb 20 13:36:18 2006 From: pyprog at easyconnect.fr (pyprog) Date: Mon, 20 Feb 2006 12:36:18 -0000 Subject: [Image-SIG] Putalpha on a color (r, v, b) Message-ID: <1140436439.8957.7.camel@glux1.dux.home> Hello, I present myself: I'm a professor of visual arts and I live in Caen in Normandy (France) . I'm new with PIL, and I want to know how to put alpha channel on a color (not simply a band) . putalpha(band) works only with one band at the same time, it is that? . I would like to make a trick of the style ==> putalpha((108, 128, 199)), that is it possible (?), and how to make? . Thank you in advance . monsitt -- Venez faire un tour ici : http://monsitt.irruption.net