From yury at shurup.com Fri Oct 1 09:56:56 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Fri, 01 Oct 2010 09:56:56 +0200 Subject: [Image-SIG] PIL code not working In-Reply-To: References: Message-ID: <1285919816.6872.14.camel@mypride> im.getpixel( (5, 7) ) ? On Fri, 2010-09-24 at 10:32 +0900, majoris.ursae at yahoo.co.uk wrote: > Hello everybody, Greetings! > In PIL, the following codes does not work anymore: > im.getpixel(5,7) > list(im.getdata()) > Does anyone knows what is wrong below and kindly suggest new codes? > >>> from PIL import Image > >>> im = Image.open('E://test.jpg') > >>> im.load() > >>> im.getpixel (5,7) > Traceback (most recent call last): > File "", line 1, in > im.getpixel(4,6) > TypeError: getpixel() takes exactly 2 arguments (3 given) > >>> list(im.getdata()) > no response for one day! > Thank you so much!! From edward at unicornschool.org Fri Oct 1 18:45:30 2010 From: edward at unicornschool.org (Edward Cannon) Date: Fri, 1 Oct 2010 09:45:30 -0700 Subject: [Image-SIG] Hi I have problems with tif files In-Reply-To: <1285133066.4135.5.camel@rajan-laptop> References: <1285133066.4135.5.camel@rajan-laptop> Message-ID: what os and verson are you using. show is pretty much for debugging only, and is pretty sketchy on windows. also try looking at im.mode, is it RGB or something else? Edward Cannon On Tue, Sep 21, 2010 at 10:24 PM, Rajan Gurjar wrote: > Image.open('filename') and im.info gives the following > > (640, 480) > {'resolution': (1, 1), 'compression': 'raw'} > F;32BF > TIFF > > > But when I run the im.show() it gives the following error. >>>> im.show() > Traceback (most recent call last): > ?File "", line 1, in > ? ?im.show() > ?File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in > show > ? ?_show(self, title=title, command=command) > ?File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in > _show > ? ?apply(_showxv, (image,), options) > ?File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in > _showxv > ? ?apply(ImageShow.show, (image, title), options) > ?File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in > show > ? ?if viewer.show(image, title=title, **options): > ?File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in > show > ? ?base = Image.getmodebase(image.mode) > ?File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in > getmodebase > ? ?return ImageMode.getmode(mode).basemode > ?File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in > getmode > ? ?return _modes[mode] > KeyError: 'F;32BF' > > I have no idea why this happens. > I will appreciate your response. The file opens with ImageJ and > ImageMagick. It is a 8-bit RGB file. > I have looked up Google and came across few similar queries but do not > find any resolution other than suggestions to link xv to ImageMagick. > Because the solutions are old i.e., dated in 2007, I am not sure if this > is a fix. Please help. > Thanks, > Rajan > > > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From rjngrj2010 at gmail.com Sat Oct 2 18:28:31 2010 From: rjngrj2010 at gmail.com (Rajan Gurjar) Date: Sat, 2 Oct 2010 12:28:31 -0400 Subject: [Image-SIG] Hi I have problems with tif files In-Reply-To: References: <1285133066.4135.5.camel@rajan-laptop> Message-ID: I am using Lucid - Ubuntu on an FX- Sony laptop which is ten years old but works excellent. The pictures I have tried are both RGB and grayscale tif images. Some of them do open up but not others and I am not sure what type of tifs open and why do the other tifs do not. I will try im.mode. I have listed the tiffinfo properties of one type of tif that I could not open in the postings. Thanks, gujax On Fri, Oct 1, 2010 at 12:45 PM, Edward Cannon wrote: > what os and verson are you using. show is pretty much for debugging > only, and is pretty sketchy on windows. also try looking at im.mode, > is it RGB or something else? > Edward Cannon > > On Tue, Sep 21, 2010 at 10:24 PM, Rajan Gurjar > wrote: > > Image.open('filename') and im.info gives the following > > > > (640, 480) > > {'resolution': (1, 1), 'compression': 'raw'} > > F;32BF > > TIFF > > > > > > But when I run the im.show() it gives the following error. > >>>> im.show() > > Traceback (most recent call last): > > File "", line 1, in > > im.show() > > File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in > > show > > _show(self, title=title, command=command) > > File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in > > _show > > apply(_showxv, (image,), options) > > File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in > > _showxv > > apply(ImageShow.show, (image, title), options) > > File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in > > show > > if viewer.show(image, title=title, **options): > > File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in > > show > > base = Image.getmodebase(image.mode) > > File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in > > getmodebase > > return ImageMode.getmode(mode).basemode > > File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in > > getmode > > return _modes[mode] > > KeyError: 'F;32BF' > > > > I have no idea why this happens. > > I will appreciate your response. The file opens with ImageJ and > > ImageMagick. It is a 8-bit RGB file. > > I have looked up Google and came across few similar queries but do not > > find any resolution other than suggestions to link xv to ImageMagick. > > Because the solutions are old i.e., dated in 2007, I am not sure if this > > is a fix. Please help. > > Thanks, > > Rajan > > > > > > > > _______________________________________________ > > Image-SIG maillist - Image-SIG at python.org > > http://mail.python.org/mailman/listinfo/image-sig > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nils.de.reus at ivm.vu.nl Mon Oct 4 09:48:59 2010 From: nils.de.reus at ivm.vu.nl (Nils de Reus) Date: Mon, 4 Oct 2010 09:48:59 +0200 Subject: [Image-SIG] PIL code not working In-Reply-To: References: Message-ID: <57AE160B221E6F4EA096548C7DEE199B735F768C@ivm-mail> Coordinates passed to getpixel should be in a tuple, like this: im.getpixel( (5, 7) ) ________________________________________ From: image-sig-bounces+nils.de.reus=ivm.vu.nl at python.org [image-sig-bounces+nils.de.reus=ivm.vu.nl at python.org] On Behalf Of majoris.ursae at yahoo.co.uk [majoris.ursae at yahoo.co.uk] Sent: Friday, September 24, 2010 3:32 AM To: image-sig at python.org Subject: [Image-SIG] PIL code not working Hello everybody, Greetings! In PIL, the following codes does not work anymore: im.getpixel(5,7) list(im.getdata()) Does anyone knows what is wrong below and kindly suggest new codes? >>> from PIL import Image >>> im = Image.open('E://test.jpg') >>> im.load() >>> im.getpixel (5,7) Traceback (most recent call last): File "", line 1, in im.getpixel(4,6) TypeError: getpixel() takes exactly 2 arguments (3 given) >>> list(im.getdata()) no response for one day! Thank you so much!! From shilpa.hireraddi at gmail.com Tue Oct 5 12:16:10 2010 From: shilpa.hireraddi at gmail.com (shilpa h) Date: Tue, 5 Oct 2010 15:46:10 +0530 Subject: [Image-SIG] Unable to draw compound character of a kannada lang over an image. Message-ID: Hello all, I am unable to draw kannada compound characters ???? , ??, ?? etc over an image using ImageDraw module's draw method. Below is my code, #-*- coding:utf8 -*- import sys, codecs, string import Image import ImageDraw import ImageFont txt = '???? ' font = ImageFont.truetype('Malige-n.ttf',20) im = Image.new("RGBA",(800,600),(100,155,100)) draw = ImageDraw.Draw(im) draw.text( (0,100), unicode(txt, 'UTF-8'), font=font2) del draw im.save('font.png', "PNG") im.show() And attached output image file displays '????' by splitting it, but what i want is to display ???? as it is. Please suggest me where i went wrong. Thanks & Regards Shilpa -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: font.png Type: image/png Size: 3637 bytes Desc: not available URL: From cannon.el at gmail.com Wed Oct 6 02:59:54 2010 From: cannon.el at gmail.com (Edward Cannon) Date: Tue, 5 Oct 2010 17:59:54 -0700 Subject: [Image-SIG] Unable to draw compound character of a kannada lang over an image. In-Reply-To: References: Message-ID: Have you tried another font? Do all fonts do this or just this one? On Oct 5, 2010, at 3:16 AM, shilpa h wrote: > Hello all, > > I am unable to draw kannada compound characters ???? , > ??, ?? etc > > over an image using ImageDraw module's draw method. Below is my code, > > #-*- coding:utf8 -*- > import sys, codecs, string > import Image > import ImageDraw > import ImageFont > > txt = '???? ' > font = ImageFont.truetype('Malige-n.ttf',20) > im = Image.new("RGBA",(800,600),(100,155,100)) > draw = ImageDraw.Draw(im) > draw.text( (0,100), unicode(txt, 'UTF-8'), font=font2) > del draw > im.save('font.png', "PNG") > im.show() > > > And attached output image file displays '????' by splitting > it, but what i want is to display ???? as it is. > Please suggest me where i went wrong. > > > Thanks & Regards > Shilpa > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From cannon.el at gmail.com Wed Oct 6 18:01:00 2010 From: cannon.el at gmail.com (Laura & Edward Cannon) Date: Wed, 6 Oct 2010 09:01:00 -0700 Subject: [Image-SIG] Unable to draw compound character of a kannada lang over an image. In-Reply-To: References: Message-ID: I noticed that you said font=font2, but have not declared font2, it should be font=font. Besides that I messed around a bit with your code and can't get it to work, but I don't have fonts with the right glyphs, so I just get boxes. I assume that this font renders correctly elsewhere. If that is the case, there might be something lacking in ImageFont's truetype impementation. On Wed, Oct 6, 2010 at 6:41 AM, shilpa h wrote: > Yeah, i have tried for many other fonts also but getting the same result. > > On Wed, Oct 6, 2010 at 6:29 AM, Edward Cannon wrote: >> >> Have you tried another font? Do all fonts do this or just this one? >> >> >> >> On Oct 5, 2010, at 3:16 AM, shilpa h wrote: >> >>> Hello all, >>> >>> I am unable to draw kannada compound characters ???? , ??, ?? etc >>> >>> over an image using ImageDraw module's draw method. Below is my code, >>> >>> ?#-*- coding:utf8 -*- >>> import sys, codecs, string >>> import Image >>> import ImageDraw >>> import ImageFont >>> >>> txt = '???? ' >>> font = ImageFont.truetype('Malige-n.ttf',20) >>> im = Image.new("RGBA",(800,600),(100,155,100)) >>> draw = ImageDraw.Draw(im) >>> draw.text( (0,100), unicode(txt, 'UTF-8'), font=font2) >>> del draw >>> im.save('font.png', "PNG") >>> im.show() >>> >>> >>> And attached output image file displays '????' ?by splitting it, but what >>> i want is to display ???? ?as it is. >>> Please suggest me where i went wrong. >>> >>> >>> Thanks & Regards >>> Shilpa >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Image-SIG maillist ?- ?Image-SIG at python.org >>> http://mail.python.org/mailman/listinfo/image-sig > > From anders.sandvig at gmail.com Thu Oct 7 00:01:14 2010 From: anders.sandvig at gmail.com (Anders Sandvig) Date: Thu, 7 Oct 2010 00:01:14 +0200 Subject: [Image-SIG] TrueType/OpenType rendering bug in PIL 1.1.7? Message-ID: I ran the following code in Python 2.6.1 with PIL 1.1.7 on Mac OS X 10.6.4: #!/usr/bin/python from PIL import Image, ImageDraw, ImageFont image = Image.new("RGB", (800, 600), (127, 127, 127)) drawer = ImageDraw.Draw(image) fonts = ("Verdana Bold.ttf", "Verdana Bold Italic.ttf", "Arial Bold.ttf", "Arial Bold Italic.ttf", "AGaramondPro-Bold.otf", "AGaramondPro-BoldItalic.otf", "Zapfino.ttf") x = 100 y = 20 for name in fonts: font = ImageFont.truetype("/Library/Fonts/" + name, 32) text = "fish & chips (%s)" % (name) (w, h) = font.getsize(text) drawer.rectangle([x, y, x + w, y + h], fill=(0, 170, 0)) drawer.text((x, y), text, font=font, fill=(255, 255, 255)) y += h + 20 image.save("fontbug.png", "PNG") The result can be found here: http://files.looplabel.net/pil/fontbug.png As you can see, the last two fonts are rendered outside the expected box (as returned by ImageFont.getsize()). It's also odd how the ending first 'f' of the Garamond Bold Italic rendering is clipped to the left (compared to the second 'f' in the sentence), as is the ending parenthesis of the Arial Bold Italic rendering (clipped on the right, seemingly on the edge of the box calculated by ImageFont.getsize()). I am not sure which version of FreeType2 PIL is compiled against (PIL was compiled from source), but it's the version installed in /usr/X11/lib and /usr/X11/include on my system (i.e. whatever came with Mac OS X, I haven't installed any custom versions). I may be wrong, but as a naive user, I would expect ImageDraw.text() to draw inside the same area as returned by ImageFont.getsize(). I've also tried substituting ImageFont.getsize() for ImageDraw.textsize(), but the results are the same. So anyone have any clue on what's causing this and/or how to fix it? ... or maybe I'm just using the functions the wrong way? BTW: I get the same (unexpected) result when running on a Windows XP/Cygwin system (same versions of Python and PIL), compiled against whatever is the latest version of FreeType2 for Cygwin -- I can check when I access the Windows machine tomorrow. Regards, Anders From edward at unicornschool.org Thu Oct 7 21:05:33 2010 From: edward at unicornschool.org (Edward Cannon) Date: Thu, 7 Oct 2010 12:05:33 -0700 Subject: [Image-SIG] TrueType/OpenType rendering bug in PIL 1.1.7? In-Reply-To: References: Message-ID: I ran you code on my machine (win 7 Python 2.6.4, PIL 1.1.6) and after changing the font names (they are different on my system) I got similar problems, but not the same. I did notice that your image has "fish & fhips" whereas mine says "fish & chips" Something seems to be slightly off. Hope that helps. Edward Cannon On Wed, Oct 6, 2010 at 3:01 PM, Anders Sandvig wrote: > I ran the following code in Python 2.6.1 with PIL 1.1.7 on Mac OS X 10.6.4: > > #!/usr/bin/python > from PIL import Image, ImageDraw, ImageFont > > image = Image.new("RGB", (800, 600), (127, 127, 127)) > drawer = ImageDraw.Draw(image) > > fonts = ("Verdana Bold.ttf", "Verdana Bold Italic.ttf", > ? ? ? ? "Arial Bold.ttf", "Arial Bold Italic.ttf", > ? ? ? ? "AGaramondPro-Bold.otf", "AGaramondPro-BoldItalic.otf", > ? ? ? ? "Zapfino.ttf") > > x = 100 > y = 20 > for name in fonts: > ? ?font = ImageFont.truetype("/Library/Fonts/" + name, 32) > ? ?text = "fish & chips (%s)" % (name) > ? ?(w, h) = font.getsize(text) > ? ?drawer.rectangle([x, y, x + w, y + h], fill=(0, 170, 0)) > ? ?drawer.text((x, y), text, font=font, fill=(255, 255, 255)) > ? ?y += h + 20 > > image.save("fontbug.png", "PNG") > > The result can be found here: > http://files.looplabel.net/pil/fontbug.png > > As you can see, the last two fonts are rendered outside the expected > box (as returned by ImageFont.getsize()). > > It's also odd how the ending first 'f' of the Garamond Bold Italic > rendering is clipped to the left (compared to the second 'f' in the > sentence), as is the ending parenthesis of the Arial Bold Italic > rendering (clipped on the right, seemingly on the edge of the box > calculated by ImageFont.getsize()). > > I am not sure which version of FreeType2 PIL is compiled against (PIL > was compiled from source), but it's the version installed in > /usr/X11/lib and /usr/X11/include on my system (i.e. whatever came > with Mac OS X, I haven't installed any custom versions). > > I may be wrong, but as a naive user, I would expect ImageDraw.text() > to draw inside the same area as returned by ImageFont.getsize(). I've > also tried substituting ImageFont.getsize() for ImageDraw.textsize(), > but the results are the same. > > So anyone have any clue on what's causing this and/or how to fix it? > > ... or maybe I'm just using the functions the wrong way? > > BTW: I get the same (unexpected) result when running on a Windows > XP/Cygwin system (same versions of Python and PIL), compiled against > whatever is the latest version of FreeType2 for Cygwin -- I can check > when I access the Windows machine tomorrow. > > > Regards, > > Anders > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From rowen at uw.edu Thu Oct 7 21:26:15 2010 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 07 Oct 2010 12:26:15 -0700 Subject: [Image-SIG] TrueType/OpenType rendering bug in PIL 1.1.7? References: Message-ID: In article , Anders Sandvig wrote: Not much help, I fear, but I tried it on my system and I don't have the fonts that were causing you the problem. The results on the fonts I have look about like yours. I created a binary installer for PIL 1.1.7 that is built against freetype 2.3.12 (which I believe is the latest) here: but I used all the default build options for freetype; it has a lot of options to configure the build and you may wish to look into them. -- Russell From anders.sandvig at gmail.com Thu Oct 7 23:52:17 2010 From: anders.sandvig at gmail.com (Anders Sandvig) Date: Thu, 7 Oct 2010 23:52:17 +0200 Subject: [Image-SIG] TrueType/OpenType rendering bug in PIL 1.1.7? In-Reply-To: References: Message-ID: On Thu, Oct 7, 2010 at 9:05 PM, Edward Cannon wrote: > I ran you code on my machine (win 7 Python 2.6.4, PIL 1.1.6) and after > changing the font names (they are different on my system) I got > similar problems, but not the same. I did notice that your image has > "fish & fhips" whereas mine says "fish & chips" Something seems to be > slightly off. Sorry about that. I changed the 'c' to an 'f' in the last minute before I rendered the image to illustrate the cut-off of the first 'f' (the second 'f' is for comparison). I forgot to update the source code in the e-mail... Anders From anders.sandvig at gmail.com Fri Oct 8 00:11:49 2010 From: anders.sandvig at gmail.com (Anders Sandvig) Date: Fri, 8 Oct 2010 00:11:49 +0200 Subject: [Image-SIG] TrueType/OpenType rendering bug in PIL 1.1.7? In-Reply-To: References: Message-ID: On Thu, Oct 7, 2010 at 9:26 PM, Russell E. Owen wrote: > I created a binary installer for PIL 1.1.7 that is built against > freetype 2.3.12 (which I believe is the latest) here: > > but I used all the default build options for freetype; it has a lot of > options to configure the build and you may wish to look into them. I see. I tried installing FreeType2 via fink, but couldn't get it to work. Fink says the install was successful, but I can't find the files in /sw/lib or /sw/include (and neither can PIL's setup.py). I think a useful first step would be to find out if the issue is caused by FreeType2 or PIL, so building FreeType2 from source and tweaking some options might help with that. I have also noticed a similar problem when drawing italic or "skewed" fonts in PhotoShop. When I select the text for editing, the text renders outside the selection box, just like in my PIL example, so maybe this is a known issue with TrueType/OpenType fonts? I'm not sure if the odd rendering affects centering in PS or if it's just a visual quirk when editing, but in my code it's causing problems because I want to use the width returned from getsize() to center the text. Anders From coles.david at gmail.com Fri Oct 8 06:51:49 2010 From: coles.david at gmail.com (David Coles) Date: Fri, 08 Oct 2010 15:51:49 +1100 Subject: [Image-SIG] PIL Image array interface has the wrong size for YCbCr Message-ID: <1286513509.2785.71.camel@krikkit> PIL's Image class has incorrect dimension specified for YCbCr images. This causes issues when converting to or from NumPy arrays. According to http://www.pythonware.com/library/pil/handbook/concepts.htm YCbCr should be "3x8-bit pixels, colour video format". Instead it appears to be converted to a 4x8-bit format. The incorrect definition is at line 206 of http://svn.effbot.python-hosting.com/pil/PIL/Image.py. Example: Load up any image and convert to YCbCr. >>> import numpy >>> import Image as im >>> image = im.open('bush640x360.png') >>> ycbcr = image.convert('YCbCr') Using the Array interface produces a HxWx4 array, which is the wrong dimensions for YCbCr. Thus when selecting a single channel it displays incorrectly: >>> A = numpy.asarray(ycbcr) >>> print A.shape (360, 640, 4) >>> im.fromarray(A[:,:,0], "L").show() Here's an example decoding the image byte string ourselves gives the correct result: >>> B = numpy.ndarray((image.size[1], image.size[0], 3), 'u1', ycbcr.tostring()) >>> print B.shape (360, 640, 3) >>> im.fromarray(B[:,:,0], "L").show() Attached is a patch against the 1.1.7-2 (python-imaging) package in Ubuntu as I can't find the development repository for 1.1.7. See https://bugs.edge.launchpad.net/ubuntu/+source/python-imaging/+bug/656666 for details. Cheers, David -------------- next part -------------- A non-text attachment was scrubbed... Name: PIL-ycbcr.patch Type: text/x-patch Size: 325 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From werwilldaswissen at chello.at Fri Oct 8 18:59:52 2010 From: werwilldaswissen at chello.at (Sebastian Koblinger) Date: Fri, 8 Oct 2010 18:59:52 +0200 Subject: [Image-SIG] Read SVG files - extracting the path Message-ID: <32268588.1286557192780.JavaMail.root@viefep18> Hi everybody! I'm new to Python as well as to this mailing list and this is my question: Is it possible to read a path provided by an SVG file, and based on that path, make a selection of an image? (Further I'd like to invert the selection and fill it with black.) Is that doable with PIL? AFAIK ImagePath can create a path object, but is there a function, a module, or anything else that reads the path of the SVG directly? I rawly could imagine to read the SVG as a text file, scan it for the "path" argument, read the subsequent tuples and make them a path object. The plan B I'm working on is to do it with GIMP, which is a bit tricky because GIMP procedures are only accessible via the gimp-python console as far as I have experienced. The hard facts: Python 2.6.5 with IDLE PIL 1.1.7 on Win XP Any hints are welcome. Sebastian From eventh at gmail.com Thu Oct 7 20:08:35 2010 From: eventh at gmail.com (Even) Date: Thu, 7 Oct 2010 20:08:35 +0200 Subject: [Image-SIG] Bug: ImageFilter.py GaussianBlur radius not set Message-ID: The constructor for GaussianBlur class accepts the argument radius, with default value 2, but it does nothing with this argument, and instead hardcodes the radius to 2. Below is the code found in PIL 1.1.7: class GaussianBlur(Filter): name = "GaussianBlur" def __init__(self, radius=2): self.radius = 2 def filter(self, image): return image.gaussian_blur(self.radius) I believe it should be "self.radius = radius" instead. -- Even eventh at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From eli_cohen at bezeqint.net Thu Oct 7 21:23:03 2010 From: eli_cohen at bezeqint.net (=?windows-1255?B?4Ozp?=) Date: Thu, 7 Oct 2010 21:23:03 +0200 Subject: [Image-SIG] A question Message-ID: Hello, I wrote the python script below usind word editor. 1. How can I run it as a python script? It seems to be opened as a word document! 2. Where do I find the xbmc and xbmcgui libraries. import xbmc, xbmcgui #After that we create a class including some functions (defined by def) class MyClass(xbmcgui.Window): print 'hello world' #So after that we initialize the class object and doModal() allows to always display the graphical window until we exit it. The del is here to have a #clean code and delete the class instance. mydisplay = MyClass() mydisplay .doModal() Regards, Eli Cohen ?????, ??? ??? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dev.chh at gmail.com Tue Oct 12 13:31:30 2010 From: dev.chh at gmail.com (=?ISO-8859-1?Q?D=E9vji_Chh=E3ng=E3?=) Date: Tue, 12 Oct 2010 17:01:30 +0530 Subject: [Image-SIG] How to change size of PIL fonts? Message-ID: Hello Image-SIG, I am a newbie to PIL, I have following code def __setFont (self, filename): pilfont = ImageFont.load(filename) return pilfont def drawImage (self): cg = CaptchaString(4) myString = cg.getString() #Some other object to get string from myFont = self.__setFont('E:\\pilfonts\\timB12.pil') img = Image.new('RGB', (220,90), '#FFFFFF') drawText = ImageDraw.Draw(img) drawText.text((6, 0), myCaptchaString, font=myFont, fill=(255, 100, 25)) img.save('myFile.png', 'PNG') I don't know how to set font size so that it appear larger Devji Chhanga -------------- next part -------------- An HTML attachment was scrubbed... URL: From norbidur at gmail.com Fri Oct 15 09:53:34 2010 From: norbidur at gmail.com (Norbert Cauderan) Date: Fri, 15 Oct 2010 09:53:34 +0200 Subject: [Image-SIG] textsize Inconsistency between windows and linux Message-ID: textsize for the same font and text gives different results on windows and linux with PIL 1.1.6 from PIL import Image,ImageDraw, ImageFont font = ImageFont.truetype("KOMTXT__.ttf", 18,encoding="unic") im = Image.new("1", (1,1)) draw = ImageDraw.Draw(im) draw.setfont(font) textsize = draw.textsize(u'test me !',font=font) print textsize[0] on windows I have : 68 on linux (ubuntu 10.04) : 69 (the komika font can be get at http://www.fonts4free.net/komika-text-font.html, same result can be achieved with stock windows arial font) Is there a way to be sure to have the same result on both platforms ? I guess this has something to do with freetype and I could recompile linux version with the exact same version used for the windows build, but how could I know this version ? Thank you for your help ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From donn.ingle at gmail.com Fri Oct 15 17:02:31 2010 From: donn.ingle at gmail.com (donn) Date: Fri, 15 Oct 2010 17:02:31 +0200 Subject: [Image-SIG] A question In-Reply-To: References: Message-ID: <4CB86D07.7010505@gmail.com> On 07/10/2010 21:23, ??? wrote: > *I wrote the python script below usind word editor.* Just use a plain text editor like Notepad or Notepad++ (on windows). > *1. How can I run it as a python script? It seems to be opened as a word > document!* Save it as a plain text file and give it a .py extension. Open a command line and run it with: python yourapp.py > *2. Where do I find the xbmc and xbmcgui libraries.* No idea. What's this got to do with PIL? \d From zt at live.cn Tue Oct 19 12:13:18 2010 From: zt at live.cn (=?gb2312?B?1cXNpg==?=) Date: Tue, 19 Oct 2010 10:13:18 +0000 Subject: [Image-SIG] An patch to support semi-transparent PNG8 Message-ID: according to PNG Specification, png8 images(with type 3) should support semi transparent images, with tRNS chunk, but current version of PIL does not handle it correctly two simple patch can make PIL read this type of file correctly. I've attached the patch file. more efforts are needed to support saving png of this type. PS: is there a bug tracing system for PIL? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Image.py.patch Type: application/octet-stream Size: 403 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PngImagePlugin.py.patch Type: application/octet-stream Size: 313 bytes Desc: not available URL: From rowen at uw.edu Wed Oct 20 22:41:10 2010 From: rowen at uw.edu (Russell E. Owen) Date: Wed, 20 Oct 2010 13:41:10 -0700 Subject: [Image-SIG] Mac binary installers are available Message-ID: I have made two Mac binary installers available for PIL 1.1.7: one for Python 2.6 and one for 32-bit Python 2.7. Both require the python.org python and both are compatible with Mac OS X 10.3.9 and later. Right now they are served here: but that is only intended for temporary use. I would prefer they were served at the official PIL site. Any hope of that, Fredrik? For several years there was a central repository for Mac binary installers of python packages, and you could get Mac binaries for PIL from that. But that fell into disuse. Now I don't know of any sensible alternative for PIL. -- Russell From python at bdurham.com Mon Oct 25 20:11:21 2010 From: python at bdurham.com (python at bdurham.com) Date: Mon, 25 Oct 2010 14:11:21 -0400 Subject: [Image-SIG] [Py2exe-users] General questions about using PIL in a Py2exe project In-Reply-To: References: <1288024409.2905.1401846153@webmail.messagingengine.com> Message-ID: <1288030281.31484.1401864979@webmail.messagingengine.com> Werner, Thank you very much for your reply. You answered all my questions. Best regards, Malcolm From werner.bruhin at free.fr Mon Oct 25 20:04:13 2010 From: werner.bruhin at free.fr (Werner F. Bruhin) Date: Mon, 25 Oct 2010 20:04:13 +0200 Subject: [Image-SIG] General questions about using PIL in a Py2exe project In-Reply-To: <1288024409.2905.1401846153@webmail.messagingengine.com> References: <1288024409.2905.1401846153@webmail.messagingengine.com> Message-ID: Hi Malcolm, On 25/10/2010 18:33, python at bdurham.com wrote: > We're thinking about using PIL (Python Imaging Library) in a project. > Before we start down this path, I'm wondering if anyone can give me a > rough estimate how much disk space the PIL package adds to a > distribution and how difficult is it to distribute PIL as part of py2exe > project? > Background: We're using Python 2.7 32-bit for Windows). We're very > familiar with py2exe. We are new to the PIL library. I use it for some time with Py 2.5 and Py 2.6 on Windows, haven't moved to Py 2.7 yet. Do not recall any problems when using it in relation to py2exe. I use the "zipfile" option in py2exe, so the additional size is about 500kb un-compressed with my usage(i.e. what I see in in zipfile/pil, see below for the "import's" I use). Looking at PIL in site-packages this could go up to about 1.6 Mb. In the setup.py I don't do anything special but in my code using PIL I have the following lines: import PIL.Image as Image import PIL.PngImagePlugin import PIL.GifImagePlugin import PIL.JpegImagePlugin import PIL.BmpImagePlugin Image._initialized=2 See also here: http://www.py2exe.org/index.cgi/py2exeAndPIL Hope this helps Werner From python at bdurham.com Mon Oct 25 18:33:29 2010 From: python at bdurham.com (python at bdurham.com) Date: Mon, 25 Oct 2010 12:33:29 -0400 Subject: [Image-SIG] General questions about using PIL in a Py2exe project Message-ID: <1288024409.2905.1401846153@webmail.messagingengine.com> We're thinking about using PIL (Python Imaging Library) in a project. Before we start down this path, I'm wondering if anyone can give me a rough estimate how much disk space the PIL package adds to a distribution and how difficult is it to distribute PIL as part of py2exe project? Background: We're using Python 2.7 32-bit for Windows). We're very familiar with py2exe. We are new to the PIL library. Thank you, Malcolm -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.yurick at primefocusworld.com Tue Oct 26 16:34:45 2010 From: mike.yurick at primefocusworld.com (Mike Yurick) Date: Tue, 26 Oct 2010 09:34:45 -0500 Subject: [Image-SIG] DPX decoder support Message-ID: <4CC6E705.5050208@primefocusworld.com> Hi there, I'd like to write a DPX decoder for the PIL library. I'm looking at the "Writing Your Own File Decoder" section, and I've written an image plugin which happily reads in all the necessary header data in the _open function. The DPXs I'm currently working with have 10bit unsigned RGB channels (although the DPX spec allows for a lot of flexibility). I'm looking at the 'bit' decoder provided, but it' doesn't appear to have the flexibility to specify that each 32bit element of the DPX data would be read as 3 unsigned 10bit RGB channels. The docs indicate a parameter for the number of bits per pixel, and padding per line, but I'm not seeing how this would allow for the spec mentioned above. This of course doesn't account for the log to lin conversion typicaly applied, either. Also, looking at decode.c, the BIT decoder appears to only support "F" image mode. Are there additional python functions in this framework that I can implement in order to support such flexibility in reading the 10 bits per channel data? Or am I going to have to implement appropriate c code? Thanks, -mike __________ Information from ESET NOD32 Antivirus, version of virus signature database 5564 (20101026) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com From janssen at parc.com Wed Oct 27 07:16:52 2010 From: janssen at parc.com (Bill Janssen) Date: Tue, 26 Oct 2010 22:16:52 PDT Subject: [Image-SIG] General questions about using PIL in a Py2exe project In-Reply-To: <1288024409.2905.1401846153@webmail.messagingengine.com> References: <1288024409.2905.1401846153@webmail.messagingengine.com> Message-ID: <72131.1288156612@parc.com> python at bdurham.com wrote: > We're thinking about using PIL (Python Imaging Library) in a > project. Before we start down this path, I'm wondering if anyone > can give me a rough estimate how much disk space the PIL package > adds to a distribution and how difficult is it to distribute PIL > as part of py2exe project? I build it on Windows and distribute it as part of a Windows MSI installer (built using Python's msilib), not via py2exe. No problems. It takes about 2MB uncompressed, built with PNG and TIFF and JPEG support. Bill From arunragini at gmail.com Wed Oct 27 08:09:50 2010 From: arunragini at gmail.com (Arun ragini) Date: Wed, 27 Oct 2010 11:39:50 +0530 Subject: [Image-SIG] how extract/read text from image files Message-ID: Hi, I want to know how to extract/read text from image files. Any references/examples will help me to achieve the goal. Thanks Arun -- ----- Fight back spam! Download the Blue Frog. http://www.bluesecurity.com/register/s?user=YXJ1bnJhZ2luaQ%3D%3D From python at bdurham.com Wed Oct 27 15:40:10 2010 From: python at bdurham.com (python at bdurham.com) Date: Wed, 27 Oct 2010 09:40:10 -0400 Subject: [Image-SIG] how extract/read text from image files In-Reply-To: References: Message-ID: <1288186810.8990.1402217271@webmail.messagingengine.com> Resending from email registered with mailing list. Arun, Have you checked out PIL (Python Imaging Library)? http://www.pythonware.com/products/pil/ Malcolm From edward at unicornschool.org Wed Oct 27 22:41:46 2010 From: edward at unicornschool.org (Edward Cannon) Date: Wed, 27 Oct 2010 13:41:46 -0700 Subject: [Image-SIG] how extract/read text from image files In-Reply-To: <1288186810.8990.1402217271@webmail.messagingengine.com> References: <1288186810.8990.1402217271@webmail.messagingengine.com> Message-ID: extracting text from images falls into the optical character recognition problem, which is not simple. AFIK PIL doesn't support that feature, try looking for specialized OCR libraries. On Wed, Oct 27, 2010 at 6:40 AM, wrote: > > Resending from email registered with mailing list. > > Arun, > > Have you checked out PIL (Python Imaging Library)? > http://www.pythonware.com/products/pil/ > > Malcolm > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From gerocampo at gmail.com Thu Oct 28 10:36:55 2010 From: gerocampo at gmail.com (German Ocampo) Date: Thu, 28 Oct 2010 09:36:55 +0100 Subject: [Image-SIG] Reading a 8bit Tif image from ArcMAP doesnt read well Message-ID: Good morning Im reading an 8bit image generated by ArcMap using PIL in windows, the image load well without error messages but, when I try to extract the values to a numpy array I got some lines of the image with value of pixel 127 (greyscale) or rgb(0,0,0). When I open the image using GIMP or arcmap I could see that the image is complete. Any idea of what is happening?? the code that I'm using for read the image is: from PIL import Image from PIL import TiffImagePlugin import numpy as np import sys im = Image.open(file_tif) values=np.zeros((size_y,size_x)) mode=im.mode temp=list(im.getdata()) cont=-1 list_colors=[] for i in range(0,size_y): for j in range(0,size_x): cont+=1 if mode=="RGB": color=temp[cont] print cont,temp[cont] if color in list_colors: index=list_colors.index(color) values[i][j]=index+1 else: list_colors.append(color) values[i][j]=len(list_colors) else: values[i][j]=temp[cont] Best regards German From anders.sandvig at gmail.com Thu Oct 28 11:52:35 2010 From: anders.sandvig at gmail.com (Anders Sandvig) Date: Thu, 28 Oct 2010 11:52:35 +0200 Subject: [Image-SIG] how extract/read text from image files In-Reply-To: References: Message-ID: On Wed, Oct 27, 2010 at 8:09 AM, Arun ragini wrote: > Hi, > > I want to know how to extract/read text from image files. Any > references/examples will help me to achieve the goal. You could have a look at PyTesser: http://code.google.com/p/pytesser/ It depends on PIL to decode images and Google's Tesseract OCR engine (run as an externl process), but apparently works quite well. Anders From chris.mit7 at gmail.com Thu Oct 28 17:26:35 2010 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Thu, 28 Oct 2010 11:26:35 -0400 Subject: [Image-SIG] Reading a 8bit Tif image from ArcMAP doesnt read well In-Reply-To: References: Message-ID: Why would the image go between greyscale and rgb? In anycase, perhaps the easiest solution is use np.resize on temp instead of the for loops. Then if you have tuples of rgb versus ints you can use np.where() On Thu, Oct 28, 2010 at 4:36 AM, German Ocampo wrote: > Good morning > > Im reading an 8bit image generated by ArcMap using PIL in windows, the > image load well without error messages but, when I try to extract the > values to a numpy array I got some lines of the image with value of > pixel 127 (greyscale) or rgb(0,0,0). When I open the image using GIMP > or arcmap ?I could see that the image is complete. > > Any idea of what is happening?? > > the code that I'm using for read the image is: > > ? ? from PIL import Image > ? ? from PIL import TiffImagePlugin > ? ?import numpy as np > ? ?import sys > ? ?im = Image.open(file_tif) > ? ?values=np.zeros((size_y,size_x)) > ? ?mode=im.mode > ? ?temp=list(im.getdata()) > ? ?cont=-1 > ? ?list_colors=[] > ? ?for i in range(0,size_y): > ? ? ? ?for j in range(0,size_x): > ? ? ? ? ? ?cont+=1 > ? ? ? ? ? ?if mode=="RGB": > ? ? ? ? ? ? ? ?color=temp[cont] > ? ? ? ? ? ? ? ?print cont,temp[cont] > ? ? ? ? ? ? ? ?if color in list_colors: > ? ? ? ? ? ? ? ? ? ?index=list_colors.index(color) > ? ? ? ? ? ? ? ? ? ?values[i][j]=index+1 > ? ? ? ? ? ? ? ?else: > ? ? ? ? ? ? ? ? ? ?list_colors.append(color) > ? ? ? ? ? ? ? ? ? ?values[i][j]=len(list_colors) > ? ? ? ? ? ?else: > ? ? ? ? ? ? ? ?values[i][j]=temp[cont] > > Best regards > > German > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From gerocampo at gmail.com Thu Oct 28 18:56:13 2010 From: gerocampo at gmail.com (German Ocampo) Date: Thu, 28 Oct 2010 17:56:13 +0100 Subject: [Image-SIG] Reading a 8bit Tif image from ArcMAP doesnt read well In-Reply-To: References: Message-ID: Chris Many thanks for your email.I want to read values from images in grayscale or rgb, because the product that is coming from Arcmap could be either. The issue is that using PIL I get pixel values in the greyscale of 127 or rgb(0,0,0), where really I could see in Gimp that these pixels have a different value. Looks like PIL can decode part of the picture and another part of the picture not. Also I tried today to read the pixel values of the picture using temp=np.array(im) but still I got some cells with a value of 127 where really the image has different values. The only way to decode the picture was using freeImagepy, opening the image with freeImagepy, saving and then open again with PIL to get the values. It works but not in the way that supose to be. I want to do all with PIL :-) (Attached is the code) Many thanks German from PIL import Image from PIL import TiffImagePlugin import numpy as np import sys import FreeImagePy FIPY = FreeImagePy.freeimage() image = FIPY.genericLoader(file_tif) FIPY.Save(FreeImagePy.FIF_TIFF, image, "temp.tif") im = Image.open("temp.tif") values=np.zeros((size_y,size_x)) mode=im.mode temp=list(im.getdata()) cont=-1 list_colors=[] for i in range(0,size_y): for j in range(0,size_x): cont+=1 if mode=="RGB": color=temp[cont] print cont,temp[cont] if color in list_colors: index=list_colors.index(color) values[i][j]=index+1 else: list_colors.append(color) values[i][j]=len(list_colors) else: values[i][j]=temp[cont] On Thu, Oct 28, 2010 at 4:26 PM, Chris Mitchell wrote: > Why would the image go between greyscale and rgb? ?In anycase, perhaps > the easiest solution is use np.resize on temp instead of the for > loops. ?Then if you have tuples of rgb versus ints you can use > np.where() > > On Thu, Oct 28, 2010 at 4:36 AM, German Ocampo wrote: >> Good morning >> >> Im reading an 8bit image generated by ArcMap using PIL in windows, the >> image load well without error messages but, when I try to extract the >> values to a numpy array I got some lines of the image with value of >> pixel 127 (greyscale) or rgb(0,0,0). When I open the image using GIMP >> or arcmap ?I could see that the image is complete. >> >> Any idea of what is happening?? >> >> the code that I'm using for read the image is: >> >> ? ? from PIL import Image >> ? ? from PIL import TiffImagePlugin >> ? ?import numpy as np >> ? ?import sys >> ? ?im = Image.open(file_tif) >> ? ?values=np.zeros((size_y,size_x)) >> ? ?mode=im.mode >> ? ?temp=list(im.getdata()) >> ? ?cont=-1 >> ? ?list_colors=[] >> ? ?for i in range(0,size_y): >> ? ? ? ?for j in range(0,size_x): >> ? ? ? ? ? ?cont+=1 >> ? ? ? ? ? ?if mode=="RGB": >> ? ? ? ? ? ? ? ?color=temp[cont] >> ? ? ? ? ? ? ? ?print cont,temp[cont] >> ? ? ? ? ? ? ? ?if color in list_colors: >> ? ? ? ? ? ? ? ? ? ?index=list_colors.index(color) >> ? ? ? ? ? ? ? ? ? ?values[i][j]=index+1 >> ? ? ? ? ? ? ? ?else: >> ? ? ? ? ? ? ? ? ? ?list_colors.append(color) >> ? ? ? ? ? ? ? ? ? ?values[i][j]=len(list_colors) >> ? ? ? ? ? ?else: >> ? ? ? ? ? ? ? ?values[i][j]=temp[cont] >> >> Best regards >> >> German >> _______________________________________________ >> Image-SIG maillist ?- ?Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> > From chris.mit7 at gmail.com Thu Oct 28 20:00:32 2010 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Thu, 28 Oct 2010 14:00:32 -0400 Subject: [Image-SIG] Reading a 8bit Tif image from ArcMAP doesnt read well In-Reply-To: References: Message-ID: Check the inverse of the numbers, there are a ton of inconsistencies of x,y and matrix representation. Basically an image's x axis progresses left to right, whereas a matrix's x is top to bottom (x,y versus row,column). So check 2,3 and 3,2 on GIMP, etc. On Thu, Oct 28, 2010 at 12:56 PM, German Ocampo wrote: > Chris > > Many thanks for your email.I want to read values from images in > grayscale or rgb, because the product that is coming from Arcmap could > be either. > > The issue is that using PIL I get pixel values in the greyscale of 127 > or rgb(0,0,0), where really I could see in Gimp that these pixels have > a different value. Looks like PIL can decode part of the picture and > another part of the picture not. > > Also I tried today to read the pixel values of the picture using > temp=np.array(im) but still I got ?some cells with a value of 127 > where really the image has different values. > > The only way to decode the picture was using freeImagepy, opening the > image with freeImagepy, saving and then open again with PIL to get the > values. It works but not in the way that supose to be. I want to do > all with PIL :-) > ?(Attached is the code) > > Many thanks > > German > > ? ?from PIL import Image > ? ?from PIL import TiffImagePlugin > ? ?import numpy as np > ? ?import sys > ? ?import FreeImagePy > ? ?FIPY = FreeImagePy.freeimage() > ? ?image = FIPY.genericLoader(file_tif) > ? ?FIPY.Save(FreeImagePy.FIF_TIFF, image, "temp.tif") > > ? im = Image.open("temp.tif") > ? values=np.zeros((size_y,size_x)) > ? mode=im.mode > ? temp=list(im.getdata()) > ? cont=-1 > ? list_colors=[] > ? for i in range(0,size_y): > ? ? ? for j in range(0,size_x): > ? ? ? ? ? cont+=1 > ? ? ? ? ? if mode=="RGB": > ? ? ? ? ? ? ? color=temp[cont] > ? ? ? ? ? ? ? print cont,temp[cont] > ? ? ? ? ? ? ? if color in list_colors: > ? ? ? ? ? ? ? ? ? index=list_colors.index(color) > ? ? ? ? ? ? ? ? ? values[i][j]=index+1 > ? ? ? ? ? ? ? else: > ? ? ? ? ? ? ? ? ? list_colors.append(color) > ? ? ? ? ? ? ? ? ? values[i][j]=len(list_colors) > ? ? ? ? ? else: > ? ? ? ? ? ? ? values[i][j]=temp[cont] > > On Thu, Oct 28, 2010 at 4:26 PM, Chris Mitchell wrote: >> Why would the image go between greyscale and rgb? ?In anycase, perhaps >> the easiest solution is use np.resize on temp instead of the for >> loops. ?Then if you have tuples of rgb versus ints you can use >> np.where() >> >> On Thu, Oct 28, 2010 at 4:36 AM, German Ocampo wrote: >>> Good morning >>> >>> Im reading an 8bit image generated by ArcMap using PIL in windows, the >>> image load well without error messages but, when I try to extract the >>> values to a numpy array I got some lines of the image with value of >>> pixel 127 (greyscale) or rgb(0,0,0). When I open the image using GIMP >>> or arcmap ?I could see that the image is complete. >>> >>> Any idea of what is happening?? >>> >>> the code that I'm using for read the image is: >>> >>> ? ? from PIL import Image >>> ? ? from PIL import TiffImagePlugin >>> ? ?import numpy as np >>> ? ?import sys >>> ? ?im = Image.open(file_tif) >>> ? ?values=np.zeros((size_y,size_x)) >>> ? ?mode=im.mode >>> ? ?temp=list(im.getdata()) >>> ? ?cont=-1 >>> ? ?list_colors=[] >>> ? ?for i in range(0,size_y): >>> ? ? ? ?for j in range(0,size_x): >>> ? ? ? ? ? ?cont+=1 >>> ? ? ? ? ? ?if mode=="RGB": >>> ? ? ? ? ? ? ? ?color=temp[cont] >>> ? ? ? ? ? ? ? ?print cont,temp[cont] >>> ? ? ? ? ? ? ? ?if color in list_colors: >>> ? ? ? ? ? ? ? ? ? ?index=list_colors.index(color) >>> ? ? ? ? ? ? ? ? ? ?values[i][j]=index+1 >>> ? ? ? ? ? ? ? ?else: >>> ? ? ? ? ? ? ? ? ? ?list_colors.append(color) >>> ? ? ? ? ? ? ? ? ? ?values[i][j]=len(list_colors) >>> ? ? ? ? ? ?else: >>> ? ? ? ? ? ? ? ?values[i][j]=temp[cont] >>> >>> Best regards >>> >>> German >>> _______________________________________________ >>> Image-SIG maillist ?- ?Image-SIG at python.org >>> http://mail.python.org/mailman/listinfo/image-sig >>> >> > From atossava at cc.helsinki.fi Wed Oct 27 09:41:56 2010 From: atossava at cc.helsinki.fi (Atro Tossavainen) Date: Wed, 27 Oct 2010 10:41:56 +0300 (EEST) Subject: [Image-SIG] Building Imaging 1.1.7 on CentOS 4 x86_64 Message-ID: <201010270741.o9R7fugn024394@ruuvi.it.helsinki.fi> Hello, I've got libjpeg-devel installed, but doing a python setup.py build with a Python 2.6.6 install that I made myself, against Imaging 1.1.7, results in no JPEG support. The same process works just fine on i386 CentOS 4 (also with a custom Python 2.6.6), but not on this x86_64. The JpegEncode.o and JpegDecode.o files in build/temp.SOMETHING/libImaging get created in the process, but contain no symbols. The compilation command $ gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBZ -IlibImaging -I/[PYTHON INSTALL]/include -I/usr/local/include -I/usr/include -I/[PYTHON INSTALL]/include/python2.6 -c libImaging/JpegDecode.c -o build/temp.linux-x86_64-2.6/libImaging/JpegDecode.o goes through without errors. I'm completely puzzled. I would appreciate any help, and explicit personal cc's of any replies as I am at present not a member of this mailing list. Best regards, -- Atro Tossavainen (Mr.) / The Institute of Biotechnology at Systems Analyst, Techno-Amish & / the University of Helsinki, Finland, +358-9-19158939 UNIX Dinosaur / employs me, but my opinions are my own. < URL : http : / / www . helsinki . fi / %7E atossava / > NO FILE ATTACHMENTS From mgreene at bdurham.com Wed Oct 27 15:39:00 2010 From: mgreene at bdurham.com (Malcolm Greene) Date: Wed, 27 Oct 2010 09:39:00 -0400 Subject: [Image-SIG] how extract/read text from image files In-Reply-To: References: Message-ID: <1288186740.8644.1402217177@webmail.messagingengine.com> Arun, Have you checked out PIL (Python Imaging Library)? http://www.pythonware.com/products/pil/ Malcolm From wrybread at gmail.com Thu Oct 28 12:25:08 2010 From: wrybread at gmail.com (Alec Bennett) Date: Thu, 28 Oct 2010 03:25:08 -0700 Subject: [Image-SIG] how extract/read text from image files In-Reply-To: References: Message-ID: Wow, thanks for posting that, works very very well. -------------- next part -------------- An HTML attachment was scrubbed... URL: