From hundebolg at gmx.de Sat Mar 1 14:21:43 2008 From: hundebolg at gmx.de (Doktor Ahmed) Date: Sat, 01 Mar 2008 14:21:43 +0100 Subject: [Image-SIG] Wanted: video coders and biometry Message-ID: <20080301132143.189770@gmx.net> Hello, i'm looking for two things: -a python module for decoding/encoding sequences of bitmaps to video formats and the reverse -a python module offering biometry and face recognition algorithms Are there such things existing or in developement? Thank You, Doktor Ahmed -- Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! http://games.entertainment.web.de/de/entertainment/games/free From abhishekpathak88 at yahoo.co.in Sat Mar 1 03:20:51 2008 From: abhishekpathak88 at yahoo.co.in (Abhishek Pathak) Date: Sat, 1 Mar 2008 02:20:51 +0000 (GMT) Subject: [Image-SIG] Regarding Morphology Message-ID: <44514.61350.qm@web94011.mail.in2.yahoo.com> To all, I want to know what kind of support does the Python Imaging library have for morphological image processing, both binary and gray-scale images.I am an engineering student and have been writing Image Processing softwares for about 1 year (amateur, research oriented ones). I have started learning python, and I have previous exposure to other programming languages : C, C++ (both for Unix & Windows) and Visual Basic. What in your opinion should be the right way and material to learn python, for a learned programmer. Thanks and Bye. Abhishek Pathak. (A newbie for python) --------------------------------- Forgot the famous last words? Access your message archive online. Click here. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080301/893b2c22/attachment.htm From tiptip.barish at gmail.com Sat Mar 1 07:27:26 2008 From: tiptip.barish at gmail.com (Varsha purohit) Date: Fri, 29 Feb 2008 22:27:26 -0800 Subject: [Image-SIG] [image-SIG] Finding image statistics Message-ID: <9636adca0802292227t6ded801j2cbc5e50aa51bcbe@mail.gmail.com> Hello All, i have an application where i am comparing two images and highlighting the difference part in a separate image. I am using ImageChops subtract method. Here is the code: file1=Image.open("./pics/original.jpg") file2=Image.open(val) diff = ImageChops.subtract(file1,file2,0.3) diff.save("./pics/diff"+".jpg") But i want to find other image statistics such as finding number of pixels, getting sum of all pixels and area of pixels that are different etc. please guide me regarding this... thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080229/b09d22ae/attachment.htm From tiptip.barish at gmail.com Sat Mar 1 19:35:27 2008 From: tiptip.barish at gmail.com (tiptip barish) Date: Sat, 1 Mar 2008 10:35:27 -0800 Subject: [Image-SIG] Finding image statistics Message-ID: <9636adca0803011035t294a77d7nc90e4effe4d0f324@mail.gmail.com> Hello All, i have an application where i am comparing two images and highlighting the difference part in a separate image. I am using ImageChops subtract method. Here is the code: file1=Image.open("./pics/original.jpg") file2=Image.open(val) diff = ImageChops.subtract(file1,file2,0.3) diff.save("./pics/diff"+".jpg") But i want to find other image statistics such as finding number of pixels which exist after taking difference between two images, getting sum of all pixels and area of pixels that are in that image etc. please guide me regarding this... thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080301/e01187de/attachment.htm From ygingras at ygingras.net Sun Mar 2 21:00:47 2008 From: ygingras at ygingras.net (Yannick Gingras) Date: Sun, 02 Mar 2008 15:00:47 -0500 Subject: [Image-SIG] Reading EXIF ExposureBiasValue tag with PIL Message-ID: <87od9w3ngw.fsf@enceladus.ygingras.net> Hi, I'm using PIL to process jpeg images according to EXIF tags. It works great except that I can't access the ExposureBiasValue tag. I tried images from a Sony H9 and from a Nikon L10. I uploaded one of the offending pictures on my website: http://ygingras.net/files/dsc01970.jpg (2.2MB) Digiakam, exiv2, and EXIF.py all read the ExposureBiasValue properly: -1.0. I looked at the code in PIL/JpegImagePlugin.py but my limited understanding of the EXIF format prevents me from seeing any obvious bugs or to compare with another implementation. Anyone else have this problem? Is there a workaround? -- Yannick Gingras From cab938 at mail.usask.ca Sun Mar 2 20:25:50 2008 From: cab938 at mail.usask.ca (Christopher Brooks) Date: Sun, 02 Mar 2008 13:25:50 -0600 Subject: [Image-SIG] PIL Image.load() doesn't return pixel array Message-ID: <0fa501c87c9b$3978eae0$ac6ac0a0$@usask.ca> Hi, I've been using PIL a fair bit lately and am really liking it - it's great to have such a library available. The docs suggest that im.load() should return a pixel access object, but this doesn't actually seem to always work. Sometimes I get the object, sometimes I get a None back. In particular, it seems when I take an image, run a crop() on it, then a load() on it, I'll tend to get the None back. I can probably drum up an example of this if it is useful, but I'm wondering if there are any caveats of the load() method that are not listed in the docs? This was all done on python 2.5 on both linux/windows, without a difference in result... Regards, Chris -- Christopher Brooks PhD Student, ARIES Laboratory Email: cab938 at mail.usask.ca Web: http://www.cs.usask.ca/~cab938 Mail: Christopher Brooks, MSc Department of Computer Science 110 Science Place Saskatoon, SK S7N 5C9 From frederic.mantegazza at gbiloba.org Mon Mar 3 18:53:52 2008 From: frederic.mantegazza at gbiloba.org (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Mon, 3 Mar 2008 18:53:52 +0100 Subject: [Image-SIG] ImageCms 0.9-beta2 released Message-ID: <200803031853.52995.frederic.mantegazza@gbiloba.org> Hello, Here is the second beta version of ImageCms, a little cms-based module for PIL: http://trac.gbiloba.org/ImageCms This release integrates minor bug fixes and a few new features (like little cms flags support, thanks to Florian H?ch). Hope it will be the last beta before I release 0.9 (stable). Then, go to 1.0, by adding important new features (like loading/embedding profiles from/to images). Feedback welcome. -- Fr?d?ric http://www.gbiloba.org From Chris.Barker at noaa.gov Mon Mar 3 18:56:58 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 03 Mar 2008 09:56:58 -0800 Subject: [Image-SIG] Regarding Morphology In-Reply-To: <44514.61350.qm@web94011.mail.in2.yahoo.com> References: <44514.61350.qm@web94011.mail.in2.yahoo.com> Message-ID: <47CC3BEA.5060602@noaa.gov> Abhishek Pathak wrote: > What in your opinion should be the right way and material to > learn python, for a learned programmer. The "Dive into Python" website and book are a pretty nice intro. Also, be sure to check out numpy and scipy -- they will be useful for your kind of work. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 Chris.Barker at noaa.gov Mon Mar 3 18:58:50 2008 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 03 Mar 2008 09:58:50 -0800 Subject: [Image-SIG] Finding image statistics In-Reply-To: <9636adca0803011035t294a77d7nc90e4effe4d0f324@mail.gmail.com> References: <9636adca0803011035t294a77d7nc90e4effe4d0f324@mail.gmail.com> Message-ID: <47CC3C5A.5030102@noaa.gov> tiptip barish wrote: > But i want to find other image statistics such as finding number of > pixels which exist after taking difference between two images, getting > sum of all pixels and area of pixels that are in that image etc. > > please guide me regarding this... I'd check out numpy for doing this kind of work. You can translate PIL images to/from numpy arrays easily. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 spe.stani.be at gmail.com Mon Mar 3 20:06:16 2008 From: spe.stani.be at gmail.com (Stani) Date: Mon, 3 Mar 2008 20:06:16 +0100 Subject: [Image-SIG] Finding image statistics In-Reply-To: <9636adca0803011035t294a77d7nc90e4effe4d0f324@mail.gmail.com> References: <9636adca0803011035t294a77d7nc90e4effe4d0f324@mail.gmail.com> Message-ID: <2078a7ad0803031106g54405ab3j5990c25b6b411003@mail.gmail.com> Have a look at the ImageStat module of PIL >>> import ImageStat Stani 2008/3/1 tiptip barish : > Hello All, > i have an application where i am comparing two images and highlighting > the difference part in a separate image. I am using ImageChops subtract > method. Here is the code: > > file1=Image.open("./pics/original.jpg") > file2=Image.open(val) > diff = ImageChops.subtract(file1,file2,0.3) > diff.save("./pics/diff"+".jpg") > > But i want to find other image statistics such as finding number of pixels > which exist after taking difference between two images, getting sum of all > pixels and area of pixels that are in that image etc. > > please guide me regarding this... > > thanks, > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -- http://pythonide.stani.be From fredrik at pythonware.com Mon Mar 3 22:25:24 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 03 Mar 2008 22:25:24 +0100 Subject: [Image-SIG] PIL Image.load() doesn't return pixel array In-Reply-To: <0fa501c87c9b$3978eae0$ac6ac0a0$@usask.ca> References: <0fa501c87c9b$3978eae0$ac6ac0a0$@usask.ca> Message-ID: Christopher Brooks wrote: > I've been using PIL a fair bit lately and am really liking it - it's great > to have such a library available. The docs suggest that im.load() should > return a pixel access object, but this doesn't actually seem to always work. > Sometimes I get the object, sometimes I get a None back. > > In particular, it seems when I take an image, run a crop() on it, then a > load() on it, I'll tend to get the None back. I can probably drum up an > example of this if it is useful, but I'm wondering if there are any caveats > of the load() method that are not listed in the docs? it's a known bug in the "lazy crop" class. here's a patch: Index: PIL/Image.py =================================================================== --- PIL/Image.py (revision 3324) +++ PIL/Image.py (revision 3325) @@ -1645,6 +1645,9 @@ self.im = self.im.crop(self.__crop) self.__crop = None + if self.im: + return self.im.pixel_access(self.readonly) + # FIXME: future versions should optimize crop/paste # sequences! From maxerickson at gmail.com Mon Mar 3 23:39:25 2008 From: maxerickson at gmail.com (Max Erickson) Date: Mon, 3 Mar 2008 22:39:25 +0000 (UTC) Subject: [Image-SIG] Reading EXIF ExposureBiasValue tag with PIL References: <87od9w3ngw.fsf@enceladus.ygingras.net> Message-ID: Yannick Gingras wrote: > > Hi, > I'm using PIL to process jpeg images according to EXIF tags. > It works > great except that I can't access the ExposureBiasValue tag. I > > Anyone else have this problem? Is there a workaround? > PIL doesn't currently have support for signed exif data types. A patch has been posted: http://mail.python.org/pipermail/image-sig/2006-November/004181.html (I haven't used the patch, I just remembered it) max From juanmiguel.sanchezacosta at gmail.com Mon Mar 3 14:22:58 2008 From: juanmiguel.sanchezacosta at gmail.com (Juanmi) Date: Mon, 3 Mar 2008 14:22:58 +0100 Subject: [Image-SIG] MemoryError when i create a big image Message-ID: <446443d90803030522t63f8d59el5aa9c5e5d512d9b2@mail.gmail.com> Hi all, I need create a big bmp image (b/n) with width 64000 pixels and height:48000 pixels, but when i try it, PIL return a memory error. This image should have around 350MB so i dont understand the memory error. Someone can help me? Maybe is Windows? Code: import Image white_img = Image.new ('1', (64000,48000),(1)) white_img.save('white.bmp') Error: File "C:\Python25\Lib\site-packages\PIL\Image.py, line 1710, in new return Image()._new(core.fill(mode,size,color)) MemoryError PC: 2GB RAM 200GB HD Pentium 4 3.0 Ghz SO: Windows XP greeting and thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080303/3eee287a/attachment.htm From l.mastrodomenico at gmail.com Fri Mar 7 08:07:57 2008 From: l.mastrodomenico at gmail.com (Lino Mastrodomenico) Date: Fri, 7 Mar 2008 08:07:57 +0100 Subject: [Image-SIG] MemoryError when i create a big image In-Reply-To: <446443d90803030522t63f8d59el5aa9c5e5d512d9b2@mail.gmail.com> References: <446443d90803030522t63f8d59el5aa9c5e5d512d9b2@mail.gmail.com> Message-ID: 2008/3/3, Juanmi : > I need create a big bmp image (b/n) with width 64000 pixels and height:48000 > pixels, but when i try it, PIL return a memory error. > This image should have around 350MB so i dont understand the memory error. PIL uses one byte per pixel even for type '1' images, so this requires almost 3 GB of memory. > Someone can help me? Maybe is Windows? > > Code: > > import Image > white_img = Image.new ('1', (64000,48000),(1)) > white_img.save('white.bmp') This works fine on my AMD64 GNU/Linux laptop. You simply need a 64 bit architecture and/or a better operating system. -- Lino Mastrodomenico E-mail: l.mastrodomenico at gmail.com From juanmiguel.sanchezacosta at gmail.com Fri Mar 7 20:09:00 2008 From: juanmiguel.sanchezacosta at gmail.com (Juanmi) Date: Fri, 7 Mar 2008 20:09:00 +0100 Subject: [Image-SIG] MemoryError when i create a big image In-Reply-To: References: <446443d90803030522t63f8d59el5aa9c5e5d512d9b2@mail.gmail.com> Message-ID: <446443d90803071109p12721df7kbbc6bb0f44d97a36@mail.gmail.com> Lino thanks for you answer, you are right, I saw this in handbook: ----------- "1"1-bit bilevel, stored with the leftmost pixel in the most significant bit. 0 means black, 1 means white. ----------- I have been testing, and on saving the image on the hard disk, it stores with a bit per pixel, but loaded in memory use a byte per pixel. if the image is black/white with bmp format, should not work PIL only with a bit per pixel in memory? thanks again. On Fri, Mar 7, 2008 at 8:07 AM, Lino Mastrodomenico < l.mastrodomenico at gmail.com> wrote: > 2008/3/3, Juanmi : > > I need create a big bmp image (b/n) with width 64000 pixels and > height:48000 > > pixels, but when i try it, PIL return a memory error. > > This image should have around 350MB so i dont understand the memory > error. > > PIL uses one byte per pixel even for type '1' images, so this requires > almost 3 GB of memory. > > > Someone can help me? Maybe is Windows? > > > > Code: > > > > import Image > > white_img = Image.new ('1', (64000,48000),(1)) > > white_img.save('white.bmp') > > This works fine on my AMD64 GNU/Linux laptop. You simply need a 64 bit > architecture and/or a better operating system. > > -- > Lino Mastrodomenico > E-mail: l.mastrodomenico at gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080307/d9ee020e/attachment.htm From ckrause at meraka.org.za Mon Mar 10 10:07:02 2008 From: ckrause at meraka.org.za (C Krause) Date: Mon, 10 Mar 2008 11:07:02 +0200 Subject: [Image-SIG] Area selection marquee Message-ID: <47D4FA36.70302@meraka.org.za> I am programming a colouring book and need to identify all the distinct bound areas on an image so that i can cycle through them (and if possible convert them to separe image objects. (see the magic wand selector in any paint application) I also need a flodd fill routine - please help me as I am a newbie with Python - Thaks Chris Krause From t.zaffran at cnfilms.fr Tue Mar 11 18:41:49 2008 From: t.zaffran at cnfilms.fr (Thomas Zaffran) Date: Tue, 11 Mar 2008 18:41:49 +0100 Subject: [Image-SIG] PIL on etch using python2.5 Message-ID: <1205257309.7823.6.camel@tom-macbook> Hello, I am running a turbogears webapp using Python 2.5 and I need to use PIL. However I can't seem to figure out how to install it with JPEG support. I downloaded the Imaging-1.6.6 tar file and extracted it then ran "python setup.py install" and I get this output : running install running build running build_py running build_ext -------------------------------------------------------------------- PIL 1.1.6 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.6 platform linux2 2.4.4 (#2, Apr 5 2007, 20:11:18) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] -------------------------------------------------------------------- *** TKINTER support not available *** JPEG support not available --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. To check the build, run the selftest.py script. running build_scripts running install_lib running install_scripts changing mode of /usr/bin/pilfile.py to 755 changing mode of /usr/bin/pilfont.py to 775 changing mode of /usr/bin/pilconvert.py to 755 changing mode of /usr/bin/pilprint.py to 755 changing mode of /usr/bin/pildriver.py to 755 creating /usr/lib/python2.4/site-packages/PIL.pth I tried changing the path in the setup.py file to "/usr/lib" but that didn't change anything. What am I doing wrong ? Thank you for any help you can provide. -- Thomas Zaffran Responsable Technique CN films 11 rue Berg?re 75009 Paris Tel. : +33 (0)1 45 23 08 16 Fax : +33 (0)1 48 24 01 81 From abhishekpathak88 at yahoo.co.in Tue Mar 11 13:16:05 2008 From: abhishekpathak88 at yahoo.co.in (Abhishek Pathak) Date: Tue, 11 Mar 2008 12:16:05 +0000 (GMT) Subject: [Image-SIG] Image-SIG Digest, Vol 59, Issue 7 In-Reply-To: Message-ID: <138379.25828.qm@web94003.mail.in2.yahoo.com> image-sig-request at python.org wrote: Send Image-SIG mailing list submissions to image-sig at python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/image-sig or, via email, send a message with subject or body 'help' to image-sig-request at python.org You can reach the person managing the list at image-sig-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Image-SIG digest..." Today's Topics: 1. Area selection marquee (C Krause) From: C Krause To: image-sig at python.org Date: Mon, 10 Mar 2008 11:07:02 +0200 Subject: [Image-SIG] Area selection marquee I am programming a colouring book and need to identify all the distinct bound areas on an image so that i can cycle through them (and if possible convert them to separe image objects. (see the magic wand selector in any paint application) I also need a flodd fill routine - please help me as I am a newbie with Python - Thaks Chris Krause Hi, I can't help you with python code, but I can definitely tell you the solution in general terms. My reply is: 1. For extracting the distinct areas in the image, use either (a)segmentation approach, or (b) edge detection approach (c) Morphological boundary extraction. I will detail on (b) & (c) (b) Use either of the following convolution masks : Sobel, Prewitt, Robert-Cross (only 2x2 exists), or make your own Sobel is by far the best, as per what I have seen. You may choose a 3x3 mask for sharper edge-detection, or a 5x5 or 7x7 mask for thicker detection with heavier response. A 9x9 mask also exists, which you may try i9f Sobel doesn't work. It is Laplacian of Gaussian. (c) Step1 : represent the object/image using any set representation, (see Set Theory in case of doubts), Step 2: take the dilation of the image, Step 3 : subtract (***Set Subtraction***), from it the image, and you got the boundary. This method of morphology is for binary image only, and for grayscale/colour images, it is far more complex than this one. This is the theory of the technical stuff. I haven't done much programming in python, so can't give code for that, except for representation and basic operation on sets. Bye. --------------------------------- Get the freedom to save as many mails as you wish. Click here to know how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080311/c8ae2dd8/attachment.htm From t.zaffran at cnfilms.fr Wed Mar 12 10:05:07 2008 From: t.zaffran at cnfilms.fr (Thomas Zaffran) Date: Wed, 12 Mar 2008 10:05:07 +0100 Subject: [Image-SIG] PIL on etch using python2.5 In-Reply-To: <1dc6ddb60803111304n3a1d9bd4hd89005347406866d@mail.gmail.com> References: <1205257309.7823.6.camel@tom-macbook> <1dc6ddb60803111304n3a1d9bd4hd89005347406866d@mail.gmail.com> Message-ID: <1205312707.7929.3.camel@tom-macbook> Ok so I installed those libs and now when I run the setup.py script I can see that JPEG support is OK. However if I launch the selftest.py script here's the output I get : PIL/Image.py:53: RuntimeWarning: Python C API version mismatch for module _imaging: This Python has API version 1012, module _imaging has version 1013. import _imaging PIL/ImageMath.py:19: RuntimeWarning: Python C API version mismatch for module _imagingmath: This Python has API version 1012, module _imagingmath has version 1013. import _imagingmath ***************************************************************** Failure in example: _info(Image.open("Images/lena.jpg")) from line #24 of selftest.testimage Exception raised: Traceback (most recent call last): File "./doctest.py", line 499, in _run_examples_inner exec compile(source, "", "single") in globs File "", line 1, in ? File "./selftest.py", line 22, in _info im.load() File "PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "PIL/Image.py", line 375, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available 1 items had failures: 1 of 57 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 57 failed. I tried using a simple thumbnail generation on a gif file but I still get the error : encoder jpeg not available It seems there is a problem with the Python C API version. Thanks for the help. Tom On Tue, 2008-03-11 at 20:04 +0000, Carlos da Silva Santos wrote: > Hello, > > I guess you need libjpeg, libjpeg-dev and python-tk installed. Have > you checked that? > I believe python2.4 is is still the default in debian etch, so to > install packages with python2.5 you will need to make that explicit > (use the python2.5 command instead of python). > > I hope this helps. > > Carlos > > On Tue, Mar 11, 2008 at 5:41 PM, Thomas Zaffran wrote: > > Hello, > > I am running a turbogears webapp using Python 2.5 and I need to use PIL. > > However I can't seem to figure out how to install it with JPEG support. > > I downloaded the Imaging-1.6.6 tar file and extracted it then ran > > "python setup.py install" > > and I get this output : > > > > running install > > running build > > running build_py > > running build_ext > > -------------------------------------------------------------------- > > PIL 1.1.6 BUILD SUMMARY > > -------------------------------------------------------------------- > > version 1.1.6 > > platform linux2 2.4.4 (#2, Apr 5 2007, 20:11:18) > > [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] > > -------------------------------------------------------------------- > > *** TKINTER support not available > > *** JPEG support not available > > --- ZLIB (PNG/ZIP) support ok > > *** FREETYPE2 support not available > > -------------------------------------------------------------------- > > To add a missing option, make sure you have the required > > library, and set the corresponding ROOT variable in the > > setup.py script. > > > > To check the build, run the selftest.py script. > > running build_scripts > > running install_lib > > running install_scripts > > changing mode of /usr/bin/pilfile.py to 755 > > changing mode of /usr/bin/pilfont.py to 775 > > changing mode of /usr/bin/pilconvert.py to 755 > > changing mode of /usr/bin/pilprint.py to 755 > > changing mode of /usr/bin/pildriver.py to 755 > > creating /usr/lib/python2.4/site-packages/PIL.pth > > > > I tried changing the path in the setup.py file to "/usr/lib" but that > > didn't change anything. > > What am I doing wrong ? > > Thank you for any help you can provide. > > > > -- > > Thomas Zaffran > > Responsable Technique > > CN films > > 11 rue Berg?re > > 75009 Paris > > Tel. : +33 (0)1 45 23 08 16 > > Fax : +33 (0)1 48 24 01 81 > > > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > -- Thomas Zaffran Responsable Technique CN films 11 rue Berg?re 75009 Paris Tel. : +33 (0)1 45 23 08 16 Fax : +33 (0)1 48 24 01 81 From t.zaffran at cnfilms.fr Wed Mar 12 11:07:50 2008 From: t.zaffran at cnfilms.fr (Thomas Zaffran) Date: Wed, 12 Mar 2008 11:07:50 +0100 Subject: [Image-SIG] PIL on etch using python2.5 In-Reply-To: <1205312707.7929.3.camel@tom-macbook> References: <1205257309.7823.6.camel@tom-macbook> <1dc6ddb60803111304n3a1d9bd4hd89005347406866d@mail.gmail.com> <1205312707.7929.3.camel@tom-macbook> Message-ID: <1205316470.7929.11.camel@tom-macbook> Ok never mind I figured it out. Apparently I just needed to use the previous version of PIL. After installing 1.1.5 everything worked fine. Thanks again for all the help. Tom On Wed, 2008-03-12 at 10:05 +0100, Thomas Zaffran wrote: > Ok so I installed those libs and now when I run the setup.py script I > can see that JPEG support is OK. However if I launch the selftest.py > script here's the output I get : > > PIL/Image.py:53: RuntimeWarning: Python C API version mismatch for > module _imaging: This Python has API version 1012, module _imaging has > version 1013. > import _imaging > PIL/ImageMath.py:19: RuntimeWarning: Python C API version mismatch for > module _imagingmath: This Python has API version 1012, module > _imagingmath has version 1013. > import _imagingmath > ***************************************************************** > Failure in example: _info(Image.open("Images/lena.jpg")) > from line #24 of selftest.testimage > Exception raised: > Traceback (most recent call last): > File "./doctest.py", line 499, in _run_examples_inner > exec compile(source, "", "single") in globs > File "", line 1, in ? > File "./selftest.py", line 22, in _info > im.load() > File "PIL/ImageFile.py", line 180, in load > d = Image._getdecoder(self.mode, d, a, self.decoderconfig) > File "PIL/Image.py", line 375, in _getdecoder > raise IOError("decoder %s not available" % decoder_name) > IOError: decoder jpeg not available > 1 items had failures: > 1 of 57 in selftest.testimage > ***Test Failed*** 1 failures. > *** 1 tests of 57 failed. > > I tried using a simple thumbnail generation on a gif file but I still > get the error : > encoder jpeg not available > > It seems there is a problem with the Python C API version. > Thanks for the help. > Tom > > On Tue, 2008-03-11 at 20:04 +0000, Carlos da Silva Santos wrote: > > Hello, > > > > I guess you need libjpeg, libjpeg-dev and python-tk installed. Have > > you checked that? > > I believe python2.4 is is still the default in debian etch, so to > > install packages with python2.5 you will need to make that explicit > > (use the python2.5 command instead of python). > > > > I hope this helps. > > > > Carlos > > > > On Tue, Mar 11, 2008 at 5:41 PM, Thomas Zaffran wrote: > > > Hello, > > > I am running a turbogears webapp using Python 2.5 and I need to use PIL. > > > However I can't seem to figure out how to install it with JPEG support. > > > I downloaded the Imaging-1.6.6 tar file and extracted it then ran > > > "python setup.py install" > > > and I get this output : > > > > > > running install > > > running build > > > running build_py > > > running build_ext > > > -------------------------------------------------------------------- > > > PIL 1.1.6 BUILD SUMMARY > > > -------------------------------------------------------------------- > > > version 1.1.6 > > > platform linux2 2.4.4 (#2, Apr 5 2007, 20:11:18) > > > [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] > > > -------------------------------------------------------------------- > > > *** TKINTER support not available > > > *** JPEG support not available > > > --- ZLIB (PNG/ZIP) support ok > > > *** FREETYPE2 support not available > > > -------------------------------------------------------------------- > > > To add a missing option, make sure you have the required > > > library, and set the corresponding ROOT variable in the > > > setup.py script. > > > > > > To check the build, run the selftest.py script. > > > running build_scripts > > > running install_lib > > > running install_scripts > > > changing mode of /usr/bin/pilfile.py to 755 > > > changing mode of /usr/bin/pilfont.py to 775 > > > changing mode of /usr/bin/pilconvert.py to 755 > > > changing mode of /usr/bin/pilprint.py to 755 > > > changing mode of /usr/bin/pildriver.py to 755 > > > creating /usr/lib/python2.4/site-packages/PIL.pth > > > > > > I tried changing the path in the setup.py file to "/usr/lib" but that > > > didn't change anything. > > > What am I doing wrong ? > > > Thank you for any help you can provide. > > > > > > -- > > > Thomas Zaffran > > > Responsable Technique > > > CN films > > > 11 rue Berg?re > > > 75009 Paris > > > Tel. : +33 (0)1 45 23 08 16 > > > Fax : +33 (0)1 48 24 01 81 > > > > > > _______________________________________________ > > > Image-SIG maillist - Image-SIG at python.org > > > http://mail.python.org/mailman/listinfo/image-sig > > > > > -- Thomas Zaffran Responsable Technique CN films 11 rue Berg?re 75009 Paris Tel. : +33 (0)1 45 23 08 16 Fax : +33 (0)1 48 24 01 81 From koblas at extra.com Fri Mar 14 18:18:20 2008 From: koblas at extra.com (David Koblas) Date: Fri, 14 Mar 2008 10:18:20 -0700 Subject: [Image-SIG] Simple ICO => PNG conversion problem Message-ID: <47DAB35C.4040504@extra.com> I know I've missed something here, but the trivial problem I'm having is (I'm really doing this in a larger context, but this shows the problem): $ wget http://twitter.com/favicon.ico $ pilconvert.py favicon.ico favicon.png If I then look at the PNG image the transparency is missing from the ICO image. Strikes me as a simple known problem, but I don't see any workaround. From overbyte at earthlink.net Sun Mar 16 01:08:06 2008 From: overbyte at earthlink.net (Stanley Sokolow) Date: Sat, 15 Mar 2008 17:08:06 -0700 (PDT) Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image Message-ID: <16074034.post@talk.nabble.com> I'm stumped, and it seems it should be so simple. I've been building a GUI with Pmw and Tkinter, and I reached a point where I want to display a jpg image on a Label object. I've followed the rules and examples carefully, importing the right modules, creating, packing, etc., but no image. The code will display a text string in the label, but not an image. I get no error messages. So I tried a simple PIL test case: import Image im = Image.open("sampleImage.jpg") im.show() I'm running Python 2.5.1 on Windows Vista with PIL 1.1.6 installed (verified with Image.VERSION). I get no error messages. I should see the image in Windows Photo Gallery, but the gallery says only "There are no pictures or videos selected" when PIL runs it. Windows does display the sampleImage.jpg file when I click the file name in Windows Explorer, so it doesn't seem to be a bad photo file. It's in the same directory as the test program, so the path is correct. I tried adding a forced load: import Image im = Image.open("sampleImage.jpg") pix = im.load() im.show() But no different results. Still no image. So I added a "print im" statement, which confirms that an image object was created: What am I doing wrong? Can anyone suggest anything else to check? -- View this message in context: http://www.nabble.com/im.show-does-not-show%2C-and-Tkinter-isn%27t-displaying-my-jpg-image-tp16074034p16074034.html Sent from the Python - image-sig mailing list archive at Nabble.com. From frederic.mantegazza at gbiloba.org Sun Mar 16 10:15:07 2008 From: frederic.mantegazza at gbiloba.org (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Sun, 16 Mar 2008 10:15:07 +0100 Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <16074034.post@talk.nabble.com> References: <16074034.post@talk.nabble.com> Message-ID: <200803161015.08245.frederic.mantegazza@gbiloba.org> On dimanche 16 mars 2008, Stanley Sokolow wrote: > I'm stumped, and it seems it should be so simple. I've been building a > GUI with Pmw and Tkinter, and I reached a point where I want to display > a jpg image on a Label object. I've followed the rules and examples > carefully, importing the right modules, creating, packing, etc., but no > image. The code will display a text string in the label, but not an > image. I get no error messages. So I tried a simple PIL test case: > > import Image > im = Image.open("sampleImage.jpg") > im.show() > > I'm running Python 2.5.1 on Windows Vista with PIL 1.1.6 installed > (verified with Image.VERSION). I get no error messages. I should see > the image in Windows Photo Gallery, but the gallery says only "There are > no pictures or videos selected" when PIL runs it. Windows does display > the sampleImage.jpg file when I click the file name in Windows Explorer, > so it doesn't seem to be a bad photo file. It's in the same directory > as the test program, so the path is correct. > > I tried adding a forced load: > import Image > im = Image.open("sampleImage.jpg") > pix = im.load() > im.show() > > But no different results. Still no image. So I added a "print im" > statement, which confirms that an image object was created: > > > What am I doing wrong? Can anyone suggest anything else to check? According to the manual : "im.show() Displays an image. This method is mainly intended for debugging purposes. On Unix platforms, this method saves the image to a temporary PPM file, and calls the xv utility. On Windows, it saves the image to a temporary BMP file, and uses the standard BMP display utility to show it. This method returns None." So, be sure to have a default utility to show a BMP image, and also check that the file is really save somewhere... -- Fr?d?ric http://www.gbiloba.org From kwangyul.seo at gmail.com Wed Mar 12 06:31:35 2008 From: kwangyul.seo at gmail.com (KwangYul Seo) Date: Wed, 12 Mar 2008 14:31:35 +0900 Subject: [Image-SIG] ImageDraw questions. Message-ID: <7beb12420803112231k44b5ec3dudcefefc4468b1d1b@mail.gmail.com> Hello, I draw fonts using ImageFont module. I have two questions on ImageDraw module. 1. What is the unit of font size? ImageFont.trutype(file, size) can specify the font size as its second argument. I specified font size 10, but the output text seems to be smaller than 10. 2. What is the best way to get a list of fonts which can be passed to ImageFont.truetype(file, size)? Certainly, I can scan Windows system fonts under C:/WINDOWS/Fonts, but it does not look like a portable way. Thanks, Kwang Yul Seo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080312/af913311/attachment.htm From overbyte at earthlink.net Sun Mar 16 14:24:38 2008 From: overbyte at earthlink.net (Stanley Sokolow) Date: Sun, 16 Mar 2008 06:24:38 -0700 (PDT) Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <200803161015.08245.frederic.mantegazza@gbiloba.org> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> Message-ID: <16078877.post@talk.nabble.com> I verified that Windows Picture Gallery (the default image viewer set by Microsoft in my Vista) actually is capable of displaying .bmp files. It is. Apparently no file name was passed to it. I ran the test program from Python Shell and left the shell open so temporary files might still be preserved, but searching for all files with .bmp and today's date reveals nothing. No such file exisits. It seems that PIL did not create an output file. I wonder if there's a problem with PIL 1.1.6 or Python 2.5.1 and 2.5.2 (I've tried both) that prevents PIL from displaying images. Can anyone confirm that these versions do work together on Windows Vista and actually do display jpg or bmp images in a Tkinter GUI or by the .show() method? I'm going to try the same test again on a different computer running Windows XP today. -- View this message in context: http://www.nabble.com/im.show-does-not-show%2C-and-Tkinter-isn%27t-displaying-my-jpg-image-tp16074034p16078877.html Sent from the Python - image-sig mailing list archive at Nabble.com. From frederic.mantegazza at gbiloba.org Sun Mar 16 15:12:19 2008 From: frederic.mantegazza at gbiloba.org (=?iso-8859-15?q?Fr=E9d=E9ric_Mantegazza?=) Date: Sun, 16 Mar 2008 15:12:19 +0100 Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <16078877.post@talk.nabble.com> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> <16078877.post@talk.nabble.com> Message-ID: <200803161512.20771.frederic.mantegazza@gbiloba.org> On dimanche 16 mars 2008, Stanley Sokolow wrote: > I verified that Windows Picture Gallery (the default image viewer set by > Microsoft in my Vista) actually is capable of displaying .bmp files. ? > It is. ? Apparently no file name was passed to it. ? I ran the test > program from Python Shell and left the shell open so temporary files > might still be preserved, but searching for all files with .bmp and > today's date reveals nothing. ?No such file exisits. ? It seems that PIL > did not create an output file. Windows Picture Gallery is able to display BMP file, but is it the defaut viewer? What happens if you double-click on a BMP file? Is it openned with some program? PIL may destroy the BMP file as it may receive an error while trying to open the external program... -- Fr?d?ric http://www.gbiloba.org From overbyte at earthlink.net Sun Mar 16 15:32:40 2008 From: overbyte at earthlink.net (Stanley Sokolow) Date: Sun, 16 Mar 2008 07:32:40 -0700 (PDT) Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <16078877.post@talk.nabble.com> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> <16078877.post@talk.nabble.com> Message-ID: <16079635.post@talk.nabble.com> Yes, Windows Picture Gallery (WPG) is the default viewer for bmp and it did launch when I ran the test but there was no image, just the message that there was no file to display. Vista reports that WPG is the default program associated with bmp. WPG does display my test bmp file when I click on it. I tried the same test program on my computer running Windows XP, Python 2.5 (not yet updated), and PIL 1.1.6. It works and displays my jpg and gif test images as bmp temporary files. My Vista system is a Pentium D 3.00 GHz, 1GB, with all available updates for Vista through 3/13/2008 installed. My XP system is a Celeron 2.2 GHz, 512MB, running Windows XP (service pack 2) Home Edition. I'll update my XP machine to the latest Python release 2.5.2 and try it again to see if it is a bug introduced by the Python updates rather than by a difference between XP and Vista platforms. Conclusion: This is a bug, not something I've done wrong. Summary: On my Windows Vista (Home Premium) system, the test fails but it succeeds on Windows XP. -- View this message in context: http://www.nabble.com/im.show-does-not-show%2C-and-Tkinter-isn%27t-displaying-my-jpg-image-tp16074034p16079635.html Sent from the Python - image-sig mailing list archive at Nabble.com. From overbyte at earthlink.net Sun Mar 16 17:25:03 2008 From: overbyte at earthlink.net (Stanley Sokolow) Date: Sun, 16 Mar 2008 09:25:03 -0700 (PDT) Subject: [Image-SIG] Bug Report [PIL 1.1.6 with Python 2.5.2 on Windows Vista Home Premium]: im.show() does not work. Message-ID: <16080805.post@talk.nabble.com> I'm posting this to clarify that this is apparently a bug, which occurs on the Vista platform. The following test fails to display any image when the default bmp viewer is launched: import Image im = Image.open("sampleImage.jpg") im.show() No error messages. The default bmp viewer launches but reports that it has no file to display. This test works properly on Windows XP Home Edition with same versions of PIL and Python. PIL and Python were installed from the Windows binaries. See my posting called "im.show does not show, and Tkinter isn't displaying my jpg image" for details. -- View this message in context: http://www.nabble.com/Bug-Report--PIL-1.1.6-with-Python-2.5.2-on-Windows-Vista-Home-Premium-%3A--im.show%28%29-does-not-work.-tp16080805p16080805.html Sent from the Python - image-sig mailing list archive at Nabble.com. From G.Kloss at massey.ac.nz Sun Mar 16 19:45:30 2008 From: G.Kloss at massey.ac.nz (Guy K. Kloss) Date: Mon, 17 Mar 2008 07:45:30 +1300 Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <200803161015.08245.frederic.mantegazza@gbiloba.org> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> Message-ID: <200803170745.30937.G.Kloss@massey.ac.nz> On Sun, 16 Mar 2008 10:15:07 pm Fr?d?ric Mantegazza wrote: > On Unix platforms, this method saves the image to a temporary PPM file, and > calls the xv utility. I've been thinking already that xv is pretty much a tool of the past. I've circumnavigated this problem on my Linux box by sym-linking /usr/local/xv to /usr/bin/display (of ImageMagick). Maybe it would be more appropriate for "moder times" to replace xv with display within PIL for show() on UN*X platforms? Just a thought, Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Putaiao o Mohiohio me Pangarau Room 2.63, Quad Block A Building Massey University, Auckland, Albany Private Bag 102 904, North Shore Mail Centre voice: +64 9 414-0800 ext. 9585 ? fax: +64 9 441-8181 eMail: G.Kloss at massey.ac.nz ?http://www.massey.ac.nz/~gkloss/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. Url : http://mail.python.org/pipermail/image-sig/attachments/20080317/4c83273d/attachment.pgp From overbyte at earthlink.net Mon Mar 17 00:11:25 2008 From: overbyte at earthlink.net (Stanley Sokolow) Date: Sun, 16 Mar 2008 16:11:25 -0700 (PDT) Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <16079635.post@talk.nabble.com> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> <16078877.post@talk.nabble.com> <16079635.post@talk.nabble.com> Message-ID: <16085524.post@talk.nabble.com> I figured out my problem with my application itself, which now displays my jpg in my GUI just fine on both XP and Vista, but the question remains why the simple test case using the show() method on the image object does not display anything in Vista but does in XP. I posted a message on this sig indicating that it seems to be a bug in PIL which might not be passing the temp file name to Vista the way that Vista expects. I'll leave it for developers to track down. -- View this message in context: http://www.nabble.com/im.show-does-not-show%2C-and-Tkinter-isn%27t-displaying-my-jpg-image-tp16074034p16085524.html Sent from the Python - image-sig mailing list archive at Nabble.com. From asbach at ient.rwth-aachen.de Mon Mar 17 13:55:46 2008 From: asbach at ient.rwth-aachen.de (Mark Asbach) Date: Mon, 17 Mar 2008 13:55:46 +0100 Subject: [Image-SIG] matlab vs Python for Image Processing applications In-Reply-To: <535630.89540.qm@web55212.mail.re4.yahoo.com> References: <535630.89540.qm@web55212.mail.re4.yahoo.com> Message-ID: <6AAC9B36-D5F3-4083-AD99-FFF405A70B46@ient.rwth-aachen.de> Hi Tan, > which is more suitable software for Image Processing > applications, Matlab or Python? do you know OpenCV? It has a fairly useable Python wrapper and is one of the most complete image processing libraries in the open source world. Also, it's one of the fastest ... http://sourceforge.net/projects/opencvlibrary/ Integration with PIL and numpy makes it a strong rival for Matlab - but with PyMat you could even combine the strength of both ... Yours, Mark -- Mark Asbach Institut f?r Nachrichtentechnik, RWTH Aachen University http://www.ient.rwth-aachen.de/cms/team/m_asbach From asbach at ient.rwth-aachen.de Mon Mar 17 13:59:04 2008 From: asbach at ient.rwth-aachen.de (Mark Asbach) Date: Mon, 17 Mar 2008 13:59:04 +0100 Subject: [Image-SIG] PIL and Python 3000 In-Reply-To: <73D60778-F211-42F4-9B31-1CA0675E5FFA@rice.edu> References: <9081ED5A-B7E1-40B7-8A55-19E43BFC9A32@rice.edu> <1dc6ddb60802180314ued4df75s66cac57df7e92e0c@mail.gmail.com> <73D60778-F211-42F4-9B31-1CA0675E5FFA@rice.edu> Message-ID: <7C623107-6E90-4E5B-947D-B8CB9EC083B2@ient.rwth-aachen.de> Hi Jordan, hi Carlos, >>> I am very interested in learning Python for pixel-based image >>> manipulation for scientific applications >> >> As you are targetting in scientific applications, you will probably >> be >> interested in numpy/scipy/matplotlib which provide python with >> matlab-like features. Take a look specially in scipy.ndimage: >> http://www.scipy.org/SciPyPackages/Ndimage as already advertised in a parallel post: you should at least have a short look at OpenCV that provides loads of computer vision, image processing and also machine learning stuff and has a decent Python interface: http://sourceforge.net/projects/opencvlibrary/ Yours, Mark -- Mark Asbach Institut f?r Nachrichtentechnik, RWTH Aachen University http://www.ient.rwth-aachen.de/cms/team/m_asbach From ned at nedbatchelder.com Tue Mar 18 12:46:16 2008 From: ned at nedbatchelder.com (Ned Batchelder) Date: Tue, 18 Mar 2008 07:46:16 -0400 Subject: [Image-SIG] ImageDraw questions. In-Reply-To: <7beb12420803112231k44b5ec3dudcefefc4468b1d1b@mail.gmail.com> References: <7beb12420803112231k44b5ec3dudcefefc4468b1d1b@mail.gmail.com> Message-ID: <47DFAB88.3040608@nedbatchelder.com> 1. The unit is the number of pixels to an em. Often this doesn't correspond to any actual measurement on the letters. See http://type101.fontbureau.com/archives/36 for more information about ems. 2. PIL doesn't offer any help on finding font files. You'll have to deal with that yourself. --Ned. KwangYul Seo wrote: > Hello, > > I draw fonts using ImageFont module. I have two questions on ImageDraw > module. > > 1. What is the unit of font size? > > ImageFont.trutype(file, size) can specify the font size as its second > argument. I specified font size 10, but the output text seems to be > smaller than 10. > > > 2. What is the best way to get a list of fonts which can be passed to > ImageFont.truetype(file, size)? Certainly, I can scan Windows system > fonts under C:/WINDOWS/Fonts, but it does not look like a portable way. > > > Thanks, > Kwang Yul Seo > > ------------------------------------------------------------------------ > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Ned Batchelder, http://nedbatchelder.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080318/c0bb21e3/attachment.htm From xvel at gmx.com Sun Mar 23 21:26:55 2008 From: xvel at gmx.com (Vladimir Boiko) Date: Sun, 23 Mar 2008 22:26:55 +0200 Subject: [Image-SIG] Bitonal documents in TIFF, PDF and JBIG2 formats Message-ID: <20080323202259.C1D433186FB@home.majar.com> Good Day XVEL Software just released new version of professional batch binarization software called Binarization Image Processor. It may be of interest to you since this program dramatically saves time when preparing high-quality bitonal documents in TIFF, PDF and JBIG2 formats. Created especially for professionals involved with paper and microfilm scanning and digitization, Binarization Image Processor (BIP) use of cutting-edge techniques including dynamic thresholding, local area adaptive binarization and OCR preparation thresholding to binarize images is what sets it apart from the rest of the competition. New version (1.24) enables preprocessing of color and grey-scale images. Now you can deskew, rotate, mirror and negate colors of image before binarizing it. BIP automatically saves all changes eliminating the need to perform redundant actions like confirming image saves. Elimination of this redundancy alone generates a time savings of up to 90%. Please download the fully-functioning free tryout version of BIP now using this link: http://www.xvel.com/downloads/binarizationimageprocessor-setup.exe and visit BIP's official web-site at: http://binarize.xvel.com/ Thank you for having interest in Binarization Image Processor software! -- Best Regards, Vladimir Boiko CEO XVEL Software mailto:support at xvel.com PS: This email message is an advertisement sent to target audience list obtained from mailing list broker. If you do not wish to receive this e-mail or if you receive it by mistake, we apologize for the inconvenience. Please send any email to exclude at xvel.com and you will never receive such messages again. From gokcetaskan at gmail.com Sun Mar 30 01:28:41 2008 From: gokcetaskan at gmail.com (Gokce Taskan) Date: Sun, 30 Mar 2008 02:28:41 +0200 Subject: [Image-SIG] 3-bit color palette Message-ID: <47EEDEB9.3010300@gmail.com> I've been searching all over the internet for a method to convert an image to a 8 color (3-bit) image. I've used these: Based on brightness but not good results: palette = [] for i in range(32): palette.extend([0, 0, 0]) for i in range(32): palette.extend([0, 0, 255]) for i in range(32): palette.extend([0, 255, 0]) for i in range(32): palette.extend([0, 255, 255]) for i in range(32): palette.extend([255, 0, 0]) for i in range(32): palette.extend([255, 0, 255]) for i in range(32): palette.extend([255, 255, 0]) for i in range(32): palette.extend([255, 255, 255]) Outputs a grayscale image because it fills the rest of the palette with black, grays and whites: palette = [(0,0,0)] * 8 palette[1] = (0, 0, 255) palette[2] = (0, 255, 0) palette[3] = (0, 255, 255) palette[4] = (255, 0, 0) palette[5] = (255, 0, 255) palette[6] = (255, 255, 0) palette[7] = (255, 255, 255) I am trying find a method to output a resonable image which would look like the one in http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes#3-bit_RGB Do you have any advices? Thank you, Gokce From jcupitt at gmail.com Sun Mar 30 09:49:50 2008 From: jcupitt at gmail.com (jcupitt at gmail.com) Date: Sun, 30 Mar 2008 07:49:50 +0000 Subject: [Image-SIG] 3-bit color palette In-Reply-To: <47EEDEB9.3010300@gmail.com> References: <47EEDEB9.3010300@gmail.com> Message-ID: <522c6460803300049q75853240s47e0279e03dac485@mail.gmail.com> On 30/03/2008, Gokce Taskan wrote: > I've been searching all over the internet for a method to convert an > image to a 8 color (3-bit) image. I've used these: > I am trying find a method to output a resonable image which would look > like the one in > http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes#3-bit_RGB > > Do you have any advices? To convert a 24-bit RGB image to a 3-bit one, just take the top bit from each channel and OR them together. In C: bit3 = ((r & 128) >> 5) | ((g & 128) >> 6) | ((b & 128) >> 7) You can make it look much better with a dither. A 2D error diffusion dither is fast and works well. To convert back to 24-bit RGB (again, in C): unsigned char lut[2] = {0, 255} r = lut[(bit3 & 4) >> 2] g = lut[(bit3 & 2) >> 1] b = lut[bit3 & 1] John From fredrik at pythonware.com Sun Mar 30 14:30:45 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 30 Mar 2008 14:30:45 +0200 Subject: [Image-SIG] PIL on etch using python2.5 In-Reply-To: <1205312707.7929.3.camel@tom-macbook> References: <1205257309.7823.6.camel@tom-macbook> <1dc6ddb60803111304n3a1d9bd4hd89005347406866d@mail.gmail.com> <1205312707.7929.3.camel@tom-macbook> Message-ID: Thomas Zaffran wrote: > Ok so I installed those libs and now when I run the setup.py script I > can see that JPEG support is OK. However if I launch the selftest.py > script here's the output I get : > > PIL/Image.py:53: RuntimeWarning: Python C API version mismatch for > module _imaging: This Python has API version 1012, module _imaging has > version 1013. > import _imaging > PIL/ImageMath.py:19: RuntimeWarning: Python C API version mismatch for > module _imagingmath: This Python has API version 1012, module > _imagingmath has version 1013. > import _imagingmath this means that the "_imagingmodule.so" and "_imagingmathmodule.so" modules that your Python interpreter is picking up wasn't built for that Python version. (1013 is Python 2.5, 1012 probably 2.4 or 2.3). if you're building PIL yourself, make sure you build PIL with the same Python version as you're going to use it with. if you're getting a prebuilt version, make sure to get one that was built for the Python version you're going to use. From fredrik at pythonware.com Sun Mar 30 14:34:38 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 30 Mar 2008 14:34:38 +0200 Subject: [Image-SIG] im.show does not show, and Tkinter isn't displaying my jpg image In-Reply-To: <16085524.post@talk.nabble.com> References: <16074034.post@talk.nabble.com> <200803161015.08245.frederic.mantegazza@gbiloba.org> <16078877.post@talk.nabble.com> <16079635.post@talk.nabble.com> <16085524.post@talk.nabble.com> Message-ID: Stanley Sokolow wrote: > I figured out my problem with my application itself, which now displays my > jpg in my GUI just fine on both XP and Vista, but the question remains why > the simple test case using the show() method on the image object does not > display anything in Vista but does in XP. I posted a message on this sig > indicating that it seems to be a bug in PIL which might not be passing the > temp file name to Vista the way that Vista expects. I'll leave it for > developers to track down. I haven't tested PIL 1.1.6 on Vista myself, and don't have convenient access to a Vista machine with a development environment (exactly zero percent of my clients that use Windows have migrated to Vista, or are planning to do that in the foreseeable future). patches are welcome (preferably patches that work on both XP and Vista) From fredrik at pythonware.com Sun Mar 30 14:41:39 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 30 Mar 2008 14:41:39 +0200 Subject: [Image-SIG] 3-bit color palette In-Reply-To: <47EEDEB9.3010300@gmail.com> References: <47EEDEB9.3010300@gmail.com> Message-ID: Gokce Taskan wrote: > I am trying find a method to output a resonable image which would look > like the one in > http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes#3-bit_RGB Map each layer to 0 if it's below 128, and 255 otherwise. from PIL import Image im = Image.open("sample.jpg") out = im.point(lambda x: x >= 128 and 255) out = out.convert("P") # optional ... From fredrik at pythonware.com Sun Mar 30 14:54:56 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 30 Mar 2008 14:54:56 +0200 Subject: [Image-SIG] ImageDraw questions. In-Reply-To: <7beb12420803112231k44b5ec3dudcefefc4468b1d1b@mail.gmail.com> References: <7beb12420803112231k44b5ec3dudcefefc4468b1d1b@mail.gmail.com> Message-ID: KwangYul Seo wrote: > I draw fonts using ImageFont module. I have two questions on ImageDraw > module. > > 1. What is the unit of font size? > > ImageFont.trutype(file, size) can specify the font size as its second > argument. I specified font size 10, but the output text seems to be > smaller than 10. The relation between the font size and the text height is determined by the font designer; usually, the given size is the *smallest* line height you will want to use for the font you get back. See Ned's post for a link to a more complete discussion. > 2. What is the best way to get a list of fonts which can be passed to > ImageFont.truetype(file, size)? Certainly, I can scan Windows system > fonts under C:/WINDOWS/Fonts, but it does not look like a portable > way. There's no code for this in current PIL releases. The following module might help; it's a work-in-progress for AggDraw, but should be fairly easy to adapt to both PIL and your requirements: http://svn.effbot.org/public/stuff/sandbox/agglib/aggfont.py From fredrik at pythonware.com Sun Mar 30 18:28:27 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 30 Mar 2008 18:28:27 +0200 Subject: [Image-SIG] BUFR writer for Python Message-ID: Hi, is anyone on this list aware of a portable, 64-bit safe BUFR *writing* library with nice (or at least usable) Python bindings? GPL license ok, more permissible (Python-style) license preferred. googling for Python and BUFR mostly brings up references to PIL, which isn't very helpful ;-) From gokcetaskan at gmail.com Mon Mar 31 00:11:40 2008 From: gokcetaskan at gmail.com (Gokce Taskan) Date: Mon, 31 Mar 2008 01:11:40 +0300 Subject: [Image-SIG] 3-bit color palette In-Reply-To: References: <47EEDEB9.3010300@gmail.com> Message-ID: <47F0101C.3060309@gmail.com> >> I am trying find a method to output a resonable image which would look >> like the one in >> http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes#3-bit_RGB >> > > Map each layer to 0 if it's below 128, and 255 otherwise. > > from PIL import Image > > im = Image.open("sample.jpg") > > out = im.point(lambda x: x >= 128 and 255) > out = out.convert("P") # optional > > ... > Thank you Fredrik, it worked great. From inhahe at gmail.com Sat Mar 29 06:23:35 2008 From: inhahe at gmail.com (inhahe) Date: Sat, 29 Mar 2008 01:23:35 -0400 Subject: [Image-SIG] function for image tiling in PIL? Message-ID: I don't see a function to tile an image in PIL like there is in PHP. Is there a function for that? If not, maybe there should be? It wouldn't be hard to do it manually, just wondering if there's a function.. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080329/045bb7d3/attachment.htm From inhahe at gmail.com Sat Mar 29 12:33:56 2008 From: inhahe at gmail.com (inhahe) Date: Sat, 29 Mar 2008 07:33:56 -0400 Subject: [Image-SIG] need to specify background color for rotating an image Message-ID: in PIL, how do I rotate an image with expand=True and specify what color to fill in the added space with? there doesn't seem to be an option for that, and there should be. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080329/c4c38809/attachment.htm From inhahe at gmail.com Sat Mar 29 13:00:23 2008 From: inhahe at gmail.com (inhahe) Date: Sat, 29 Mar 2008 08:00:23 -0400 Subject: [Image-SIG] inverse function of getdata? Message-ID: the inverse of im.tostring seems to be Image.fromstring, but i don't see a corresponding function for im.getdata. im.frombuffer doesn't seem to accept the output of im.getdata. I think there should be a function that does. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080329/d5b715d2/attachment.htm From inhahe at gmail.com Sun Mar 30 03:03:18 2008 From: inhahe at gmail.com (inhahe) Date: Sat, 29 Mar 2008 21:03:18 -0400 Subject: [Image-SIG] 3-bit color palette In-Reply-To: <47EEDEB9.3010300@gmail.com> References: <47EEDEB9.3010300@gmail.com> Message-ID: i don't know if this is what you wanted, but i wrote something to do it.. --- import Image def to8bit(im): im = im.convert('RGB') data = im.tostring() s = ''.join(('\x00\xFF'[x>='\x80'] for x in data)) return Image.fromstring('RGB',im.size, s).convert('P') to8bit(Image.open('RGB_24bits_palette_color_test_chart.png')).save(' colortest.png') to8bit(Image.open('RGB_24bits_palette_sample_image.jpg')).save('parrot.png') --- reproduces the results on wikipedia exactly, as far as i can tell On Sat, Mar 29, 2008 at 8:28 PM, Gokce Taskan wrote: > I've been searching all over the internet for a method to convert an > image to a 8 color (3-bit) image. I've used these: > > Based on brightness but not good results: > palette = [] > for i in range(32): > palette.extend([0, 0, 0]) > for i in range(32): > palette.extend([0, 0, 255]) > for i in range(32): > palette.extend([0, 255, 0]) > for i in range(32): > palette.extend([0, 255, 255]) > for i in range(32): > palette.extend([255, 0, 0]) > for i in range(32): > palette.extend([255, 0, 255]) > for i in range(32): > palette.extend([255, 255, 0]) > for i in range(32): > palette.extend([255, 255, 255]) > > Outputs a grayscale image because it fills the rest of the palette with > black, grays and whites: > palette = [(0,0,0)] * 8 > palette[1] = (0, 0, 255) > palette[2] = (0, 255, 0) > palette[3] = (0, 255, 255) > palette[4] = (255, 0, 0) > palette[5] = (255, 0, 255) > palette[6] = (255, 255, 0) > palette[7] = (255, 255, 255) > > I am trying find a method to output a resonable image which would look > like the one in > http://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_palettes#3-bit_RGB > > Do you have any advices? > > Thank you, > > Gokce > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080329/5f46eb48/attachment.htm From cappy2112 at gmail.com Sun Mar 30 04:15:05 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sat, 29 Mar 2008 19:15:05 -0700 Subject: [Image-SIG] Image processing terminology- - and using PIL Message-ID: <8249c4ac0803291915w68829a07w7302815b937a8759@mail.gmail.com> I want to write the filename of some images onto the image itself (as text), so that when i view the image, I will see its filename. Is this the same as "watermarking" an image? If not, what is the name terminology used to write text to a digital image? Whatever the name of this is, what classes/methods should I use in PIL to do this? I will be working with jpgs, gifs, and bmps mostly. thanks From fredrik at pythonware.com Mon Mar 31 20:34:52 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 31 Mar 2008 20:34:52 +0200 Subject: [Image-SIG] Image processing terminology- - and using PIL In-Reply-To: <8249c4ac0803291915w68829a07w7302815b937a8759@mail.gmail.com> References: <8249c4ac0803291915w68829a07w7302815b937a8759@mail.gmail.com> Message-ID: Tony Cappellini wrote: > I want to write the filename of some images onto the image itself (as > text), so that when i view the image, I will see its filename. > > Is this the same as "watermarking" an image? If not, what is the name > terminology used to write text to a digital image? watermarking is when you add a transparent text or drawing onto an image. e.g. like this: http://en.wikipedia.org/wiki/Image:Visible_digital_watermarking.jpg here's an quite powerful watermarking function for PIL: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 if you want to just add a label to the image, use the ImageDraw module to draw opaque text on top of the image. you probably want to pick a suitable TrueType font (see ImageDraw.truetype) instead of the default font. From fredrik at pythonware.com Mon Mar 31 20:37:00 2008 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 31 Mar 2008 20:37:00 +0200 Subject: [Image-SIG] inverse function of getdata? In-Reply-To: References: Message-ID: inhahe wrote: > the inverse of im.tostring seems to be Image.fromstring, but i don't see > a corresponding function for im.getdata. im.frombuffer doesn't seem to > accept the output of im.getdata. I think there should be a function > that does. use im.putdata(seq); see http://effbot.org/tag/PIL.Image.Image.putdata for details. From inhahe at gmail.com Mon Mar 31 16:25:57 2008 From: inhahe at gmail.com (inhahe) Date: Mon, 31 Mar 2008 10:25:57 -0400 Subject: [Image-SIG] Image processing terminology- - and using PIL In-Reply-To: <8249c4ac0803291915w68829a07w7302815b937a8759@mail.gmail.com> References: <8249c4ac0803291915w68829a07w7302815b937a8759@mail.gmail.com> Message-ID: import Image, ImageDraw, ImageFont im = Image.open(somefilename) draw = ImageDraw.Draw(im) font = ImageFont.load(somefont), or font = ImageFont.truetype(somefont, size) for truetype fonts draw.text(whatever the parameters are, check out the documentation for imagedraw, font=font, fill=somecolor) im.save(somefilename) something like that. On Sat, Mar 29, 2008 at 10:15 PM, Tony Cappellini wrote: > I want to write the filename of some images onto the image itself (as > text), so that when i view the image, I will see its filename. > > Is this the same as "watermarking" an image? If not, what is the name > terminology used to write text to a digital image? > > Whatever the name of this is, what classes/methods should I use in PIL > to do this? > > I will be working with jpgs, gifs, and bmps mostly. > > > thanks > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20080331/633bab4c/attachment.htm