From rhinchliff at adgholdings.co.uk Wed Dec 1 14:35:44 2010 From: rhinchliff at adgholdings.co.uk (Rob Hinchliff) Date: Wed, 1 Dec 2010 08:35:44 -0500 Subject: [Image-SIG] Image crop race condition Message-ID: <4173860DAFEC79419EEA4EE21AF30B8827AC898F8F@IAD2MBX03.mex02.mlsrvr.com> I am writing a python application that crops an image and processes it in a number of threads. The lazy loading of the cropped image is causing me exceptions, I think because of this race condition in Image.py v1.1.7 starting at line 1682: # -------------------------------------------------------------------- # Lazy operations class _ImageCrop(Image): def __init__(self, im, box): Image.__init__(self) x0, y0, x1, y1 = box if x1 < x0: x1 = x0 if y1 < y0: y1 = y0 self.mode = im.mode self.size = x1-x0, y1-y0 self.__crop = x0, y0, x1, y1 self.im = im.im def load(self): # lazy evaluation! if self.__crop: 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! The problem is in 'load' at line 1707. 'self.__crop' is checked for 'None', and enters the block. Another thread that has already entered the block sets self.__crop to None on line 1709. The original thread then calls crop with a None object, causing an exception. I've fixed the problem in my local copy by commenting out line 1709. I don't know the design reasons for setting '__crop' to None (free the memory?), but I think you should consider using double-checked locking pattern here if you wish to keep it. Otherwise, thankyou for making this excellent library available for public consumption! Best Regards, Rob This email and any files transmitted with it are intended only for the personal and confidential use of the designated recipient(s) or entity named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited and you are requested to notify the sender immediately by email and delete this email from your system. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction or as an official statement of ADG Holdings LLP or its affiliated companies. Email transmission cannot be guaranteed to be secure or free of error and comes with a risk that the email contains a virus, is not compatible with your electronic system or has been modified. ADG Holdings LLP does not represent the information contained in this email is complete or accurate and should not be relied upon as such. Therefore ADG Holdings LLP does not accept any liability for any direct or consequential loss arising from the use, or reliance on, this email or its contents. -------------- next part -------------- An HTML attachment was scrubbed... URL: From python at bdurham.com Wed Dec 1 15:38:43 2010 From: python at bdurham.com (python at bdurham.com) Date: Wed, 01 Dec 2010 09:38:43 -0500 Subject: [Image-SIG] Create a 'disabled' image effect (similar to how Windows shows disabled images) Message-ID: <1291214323.3638.1408091209@webmail.messagingengine.com> Any suggestions on a PIL receipe that will allow me to take a color image and create a grayscale version of this image that gives the image a disabled appearance similar to the effect that Windows applies to show disabled icons? My use case is to dynamically create disabled versions of my application's graphics when a specific feature is disabled or unavailable. Thank you, Malcolm -------------- next part -------------- An HTML attachment was scrubbed... URL: From edward at unicornschool.org Wed Dec 1 19:45:46 2010 From: edward at unicornschool.org (Edward Cannon) Date: Wed, 1 Dec 2010 10:45:46 -0800 Subject: [Image-SIG] Create a 'disabled' image effect (similar to how Windows shows disabled images) In-Reply-To: <1291214323.3638.1408091209@webmail.messagingengine.com> References: <1291214323.3638.1408091209@webmail.messagingengine.com> Message-ID: try using the Image.convert("L") method on you image. That will make it greyscale Edward Cannon On Wed, Dec 1, 2010 at 6:38 AM, wrote: > Any suggestions on a PIL receipe that will allow me to take a color image > and create a grayscale version of this image that gives the image a disabled > appearance similar to the effect that Windows applies to show disabled > icons? > > My use case is to dynamically create disabled versions of my application's > graphics when a specific feature is disabled or unavailable. > > Thank you, > Malcolm > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From kevin at cazabon.com Wed Dec 1 21:26:25 2010 From: kevin at cazabon.com (Kevin Cazabon) Date: Wed, 1 Dec 2010 15:26:25 -0500 Subject: [Image-SIG] Create a 'disabled' image effect (similar to how Windows shows disabled images) In-Reply-To: References: <1291214323.3638.1408091209@webmail.messagingengine.com> Message-ID: <291D8699-99C9-4737-8F63-48066DDA189B@cazabon.com> I do this in some of my work too - Making it black and white is one thing, but normally I'd suggest you also map the levels to a much narrower range (make black mid-gray, and white light-gray). I simple "point" can do that: # make the image appear "deleted" map = [] for q in range(3): for i in range(256): map.append(params.get("deletedMap")[0] + int(((params.get("deletedMap")[1] - params.get("deletedMap")[0]) * (i/256.0)) + 0.5)) image = image.point(map) In my case I leave it as a color image, and the params.get simply pulls from a parameter class where I store my preferences for the darkest and lightest I want to map to. You can always replace that line with something simple like: map.append(int(100 + (i * 0.25) + 0.5)) which will map it down to levels 100 to 164 Kevin. On Dec 1, 2010, at 1:45 PM, Edward Cannon wrote: > try using the Image.convert("L") method on you image. That will make > it greyscale > Edward Cannon > > On Wed, Dec 1, 2010 at 6:38 AM, wrote: >> Any suggestions on a PIL receipe that will allow me to take a color image >> and create a grayscale version of this image that gives the image a disabled >> appearance similar to the effect that Windows applies to show disabled >> icons? >> >> My use case is to dynamically create disabled versions of my application's >> graphics when a specific feature is disabled or unavailable. >> >> Thank you, >> Malcolm >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> >> > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From rajajothini.sureshkumar at cae.com Wed Dec 1 20:31:08 2010 From: rajajothini.sureshkumar at cae.com (Rajajothini Sureshkumar) Date: Wed, 1 Dec 2010 14:31:08 -0500 Subject: [Image-SIG] PIL Message-ID: Hello, I would like to down load pill version 1.1.7 for Python2.6 . But I have Python 2.7 on my pc. I wonder this is not a problem Any suggestion? Regards, Rajini -------------- next part -------------- An HTML attachment was scrubbed... URL: From python at bdurham.com Tue Dec 7 03:38:34 2010 From: python at bdurham.com (python at bdurham.com) Date: Mon, 06 Dec 2010 21:38:34 -0500 Subject: [Image-SIG] Possible to fade a small Tkinter image into a specific background color? Message-ID: <1291689514.15849.1409009075@webmail.messagingengine.com> Wondering if there's a PIL/Tkinter technique I can use to fade a small image into a specific background color? Use case: I have a small message area that displays both an icon and text message. I can fade my foreground text into its background container by iteratively moving my message text's rgb components towards its background rgb value until my text has the same foreground and background colors. I'm wondering if there's a similar technique I can use with PIL and its Image, ImageTk classes to do the same with an image displayed in Tkinter? I suspect I can do this by inspecting and updating every pixel individually, but this seems very inefficent. Thank you, Malcolm -------------- next part -------------- An HTML attachment was scrubbed... URL: From waynejwerner at gmail.com Tue Dec 7 14:07:30 2010 From: waynejwerner at gmail.com (Wayne Werner) Date: Tue, 7 Dec 2010 07:07:30 -0600 Subject: [Image-SIG] [Tkinter-discuss] Possible to fade a small Tkinter image into a specific background color? In-Reply-To: <1291689514.15849.1409009075@webmail.messagingengine.com> References: <1291689514.15849.1409009075@webmail.messagingengine.com> Message-ID: On Mon, Dec 6, 2010 at 8:38 PM, wrote: > Wondering if there's a PIL/Tkinter technique I can use to fade a small > image into a specific background color? > > Use case: I have a small message area that displays both an icon and text > message. I can fade my foreground text into its background container by > iteratively moving my message text's rgb components towards its background > rgb value until my text has the same foreground and background colors. > > I'm wondering if there's a similar technique I can use with PIL and its > Image, ImageTk classes to do the same with an image displayed in Tkinter? I > suspect I can do this by inspecting and updating every pixel individually, > but this seems very inefficent. > Well, if you convert the image to a numpy array then you can call some C functions on it so it's not that slow. I'm not sure if any of the other PIL structures are natively C. Any type of fade operation you could call would be doing something on a per-pixel basis (even if the operations themselves are being performed in a very low-level language) anyway. This would just require you to implement it yourself. That's about the extent of my knowledge, there may be others with better ideas (or who can contradict mine!). HTH, Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From edward at unicornschool.org Thu Dec 9 07:22:26 2010 From: edward at unicornschool.org (Edward Cannon) Date: Wed, 8 Dec 2010 22:22:26 -0800 Subject: [Image-SIG] [Tkinter-discuss] Possible to fade a small Tkinter image into a specific background color? In-Reply-To: References: <1291689514.15849.1409009075@webmail.messagingengine.com> Message-ID: using the blend function with a solid color image (bg color) and your image will work, a simple loop changing the alpha value is all you need. In my experience this is pretty fast. Check the documentation for details. Edward Cannon Unicorn School On Tue, Dec 7, 2010 at 5:07 AM, Wayne Werner wrote: > > On Mon, Dec 6, 2010 at 8:38 PM, wrote: >> >> Wondering if there's a PIL/Tkinter technique I can use to fade a small image into a specific background color? >> >> Use case: I have a small message area that displays both an icon and text message. I can fade my foreground text into its background container by iteratively moving my message text's rgb components towards its background rgb value until my text has the same foreground and background colors. >> >> I'm wondering if there's a similar technique I can use with PIL and its Image, ImageTk classes to do the same with an image displayed in Tkinter? I suspect I can do this by inspecting and updating every pixel individually, but this seems very inefficent. > > Well, if you convert the image to a numpy array then you can call some C functions on it so it's not that slow. I'm not sure if any of the other PIL structures are natively C. Any type of fade operation you could call would be doing something on a per-pixel basis (even if the operations themselves are being performed in a very low-level language) anyway. This would just require you to implement it yourself. > That's about the extent of my knowledge, there may be others with better ideas (or who can contradict mine!). > HTH, > Wayne > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From Chris.Barker at noaa.gov Thu Dec 9 18:58:09 2010 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Thu, 09 Dec 2010 09:58:09 -0800 Subject: [Image-SIG] [Tkinter-discuss] Possible to fade a small Tkinter image into a specific background color? In-Reply-To: References: <1291689514.15849.1409009075@webmail.messagingengine.com> Message-ID: <4D0118B1.4060501@noaa.gov> On 12/7/10 5:07 AM, Wayne Werner wrote: > On Mon, Dec 6, 2010 at 8:38 PM, Wondering if there's a PIL/Tkinter technique I can use to fade a > small image into a specific background color? > Well, if you convert the image to a numpy array then you can call some C > functions on it so it's not that slow. Once you've got it in a numpy array, you can use numpy to manipulate it -- you're unlikely to need C. -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 joseph.r.chadwick at mdnt.com Mon Dec 13 20:08:41 2010 From: joseph.r.chadwick at mdnt.com (Chadwick, Joseph R) Date: Mon, 13 Dec 2010 14:08:41 -0500 Subject: [Image-SIG] approximate python 3 release date ? Message-ID: <71904C86FFB1AF418496935EC47E1D4602A532FC@WDCXH00.mdnt.com> Hello - I saw on the web site: "A version of 1.1.7 for 3.X will be released later." Do you have an estimate for when that might be? An approximate date for a beta release would be fine too. Thank you very much. Joe Chadwick -------------- next part -------------- An HTML attachment was scrubbed... URL: From dardo at tenerifesystem.com Tue Dec 14 10:31:59 2010 From: dardo at tenerifesystem.com (dardo at tenerifesystem.com) Date: Tue, 14 Dec 2010 10:31:59 +0100 (CET) Subject: [Image-SIG] Problems with Imageqt/Pyqt Message-ID: <31369.213.231.87.161.1292319119.squirrel@mail.tenerifesystem.com> Dear Sirs I am using a videorecorder program that uses the imageqt.py library . This library calls the import of pyqt that i didnt have because i use pyside. I change the call for using pyside and the sintax of the init instruction (pyside qimage object uses diferent parameter list). The problem is that when i try to use it i can?t see the video i receive only a black square. Can you help me ?? i send you the two py files. Thanks Dardo -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: webcamNotebook-v0.1.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ImageQt.py URL: From yury at shurup.com Wed Dec 15 08:23:35 2010 From: yury at shurup.com (Yury V. Zaytsev) Date: Wed, 15 Dec 2010 08:23:35 +0100 Subject: [Image-SIG] Problems with Imageqt/Pyqt In-Reply-To: <31369.213.231.87.161.1292319119.squirrel@mail.tenerifesystem.com> References: <31369.213.231.87.161.1292319119.squirrel@mail.tenerifesystem.com> Message-ID: <1292397815.6788.66.camel@mypride> On Tue, 2010-12-14 at 10:31 +0100, dardo at tenerifesystem.com wrote: > > I am using a videorecorder program that uses the imageqt.py library . This > library calls the import of pyqt that i didnt have because i use pyside. I > change the call for using pyside and the sintax of the init instruction > (pyside qimage object uses diferent parameter list). The problem is that > when i try to use it i can?t see the video i receive only a black square. > Can you help me ?? i send you the two py files. Wrong list. This list is dedicated to PIL. Try the lists of the recorder program in question if any or PySide lists. -- Sincerely yours, Yury V. Zaytsev From python at bdurham.com Mon Dec 20 00:35:19 2010 From: python at bdurham.com (python at bdurham.com) Date: Sun, 19 Dec 2010 18:35:19 -0500 Subject: [Image-SIG] Does the ImageTk.PhotoImage support alpha channels? Message-ID: <1292801719.10673.1411147003@webmail.messagingengine.com> Does the ImageTk.PhotoImage support alpha channels? If not, are there any plans to add support for this feature or is the lack of this functionality a limitation of Tkinter? Thank you, Malcolm From rohanpai12 at gmail.com Sat Dec 18 16:26:27 2010 From: rohanpai12 at gmail.com (Rohan Pai) Date: Sat, 18 Dec 2010 10:26:27 -0500 Subject: [Image-SIG] PIL on Python 3? Message-ID: The current version of PIL I installed is version 1.1.7 for Python 2.6, and when I try to run it on Python 3, it doesn't work. I know the syntaxes like print "Hello World" and raw_input() are actually print ("Hello World") and input(). I don't know the other syntaxes that have changed, but if you can't figure them out either, then you should try using lib2to3 to convert PIL's Python 2 code to Python 3 code. Thank you and regards, ????? ??? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin.paulus at skynet.be Sun Dec 26 01:19:19 2010 From: kevin.paulus at skynet.be (Kevin Paulus) Date: Sun, 26 Dec 2010 01:19:19 +0100 Subject: [Image-SIG] bug in version 1.1.7 Message-ID: <4D168A07.30901@skynet.be> Hello All and Merry Christmas, I've found a bug and verified it with several of my Slackware fanatics: it seems that Pil 1.1.7 (python 2.6.4 ) when you do a Image.open('image').show() ImageShow seems to call every available viewer from _viewers on your system which on mine and a lot of other systems means it builds a separate tempfile and calls xv and display with them. It's been reported the same stuff happens on freebsd where imagemagick's display and xv is available, which i guess are all the available _viewers (did some pdb on it, but my knowledge of pdb is rudimentary at best) I'm not sure if this is a bug but the docs mentions it should start the default viewer (usually xv) and not viewer*s* it's annoying to say the least. Greetings, goarilla PS: Happy New year's and i hope i didn't offend anyone or didn't follow the net etiquette, since the only mailing list I've ever used is the one which is used at work. From manisandro at gmail.com Mon Dec 27 17:58:31 2010 From: manisandro at gmail.com (Sandro Mani) Date: Mon, 27 Dec 2010 17:58:31 +0100 Subject: [Image-SIG] [python-imaging-sane] get_devices and threading Message-ID: <4D18C5B7.4090308@gmail.com> Hi, I wanted to execute sane.get_devices in a separate thread, i.e. consider the following program: #!/usr/bin/env python # -*- coding: utf-8 -*- import threading import sane import time devices=None class GetDevicesThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.setDaemon(True) def run(self): global devices #time.sleep(10) #devices=[] devices=sane.get_devices() sane.init() GetDevicesThread().start() print "Detecting devices" while devices==None: time.sleep(1) print "." print devices The devices=sane.get_devices() call in run() for some reason pauses the main thread during it's execution - if I switch the statement with the two commented lines above, all works as expected. Is there any particular reason for this behaviour? Thanks Sandro Mani From manisandro at gmail.com Tue Dec 28 02:37:38 2010 From: manisandro at gmail.com (Sandro Mani) Date: Tue, 28 Dec 2010 02:37:38 +0100 Subject: [Image-SIG] [PATCH; python-imaging-sane] Py_*_ALLOW_THREADS for sane_get_devices and sane_open calls Message-ID: <4D193F62.1040901@gmail.com> Hi, following patch also adds Py_*_ALLOW_THREADS macros around the sane_get_devices and sane_open calls which can take a long time especially if network-scanners are accessed. --- Imaging-1.1.7.orig/Sane/_sane.c 2009-11-01 01:44:12.000000000 +0100 +++ Imaging-1.1.7/Sane/_sane.c 2010-12-28 02:17:38.626022947 +0100 @@ -1162,8 +1162,9 @@ { return NULL; } - + Py_BEGIN_ALLOW_THREADS st=sane_get_devices(&devlist, local_only); + Py_END_ALLOW_THREADS if (st) return PySane_Error(st); if (!(list = PyList_New(0))) return NULL; @@ -1191,7 +1192,9 @@ rv = newSaneDevObject(); if ( rv == NULL ) return NULL; + Py_BEGIN_ALLOW_THREADS st = sane_open(name, &(rv->h)); + Py_END_ALLOW_THREADS if (st) { Py_DECREF(rv); From marco.lechner at fossgis.de Tue Dec 28 14:44:54 2010 From: marco.lechner at fossgis.de (Marco Lechner - FOSSGIS e.V.) Date: Tue, 28 Dec 2010 14:44:54 +0100 Subject: [Image-SIG] draw underlined text Message-ID: <4D19E9D6.60403@fossgis.de> how to easily draw underlined text using Image from PIL? Marco From edward at unicornschool.org Tue Dec 28 20:21:48 2010 From: edward at unicornschool.org (Edward Cannon) Date: Tue, 28 Dec 2010 11:21:48 -0800 Subject: [Image-SIG] [python-imaging-sane] get_devices and threading In-Reply-To: <4D18C5B7.4090308@gmail.com> References: <4D18C5B7.4090308@gmail.com> Message-ID: wrong mailing list, this is for PIL and related topics only. Try a sane specific mailing list On Mon, Dec 27, 2010 at 8:58 AM, Sandro Mani wrote: > Hi, > I wanted to execute sane.get_devices in a separate thread, i.e. consider the > following program: > > #!/usr/bin/env python > # -*- coding: utf-8 -*- > > import threading > import sane > import time > > devices=None > > class GetDevicesThread(threading.Thread): > ? ?def __init__(self): > ? ? ? ?threading.Thread.__init__(self) > ? ? ? ?self.setDaemon(True) > > ? ?def run(self): > ? ? ? ?global devices > ? ? ? ?#time.sleep(10) > ? ? ? ?#devices=[] > ? ? ? ?devices=sane.get_devices() > > sane.init() > GetDevicesThread().start() > print "Detecting devices" > while devices==None: > ? ?time.sleep(1) > ? ?print "." > print devices > > The devices=sane.get_devices() call in run() for some reason pauses the main > thread during it's execution - if I switch the statement with the two > commented lines above, all works as expected. Is there any particular reason > for this behaviour? > Thanks > Sandro Mani > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From gwidion at mpc.com.br Wed Dec 29 07:18:01 2010 From: gwidion at mpc.com.br (Joao S. O. Bueno) Date: Wed, 29 Dec 2010 04:18:01 -0200 Subject: [Image-SIG] New Image Library Wrapper - Leptonica Message-ID: Hi -- I just pushed my ctypes weekend exercise a bit hard, and got something that might be usefull (I hope)- I just uploaded to the Pypi a thin ctypes wrapper for the Leptnica Library (http://www.leptonica.com) -- It parses the C source and generate Python wrappers for the library functions -- These can be much improved in the future, as currently one has to create the needed parameters by hand (C arrays, pointers, etc...) Nonetheless it seems to be working fine, and this library has a lot of functionality not present in PIL (I also wrote two utility functions to convert from and for Leptonoca images). Leptonica features extensive inline documentation of its functions in its source files, and this project transposes most of it to Python doc strings :-) The project is hosted at http://code.google.com/p/pylepthonica/ And it can be installed with: easy_install pyleptonica (Of course, one also has to install the binary leptonica library ) (I have not tested it in other OSes than Linux -- it is likely ctypes library laoding will need some tweaking) License is LGPL v3 Regards, js -><- From jest12 at gmail.com Sun Dec 26 16:46:01 2010 From: jest12 at gmail.com (zero_slo) Date: Sun, 26 Dec 2010 16:46:01 +0100 Subject: [Image-SIG] pil for py 3.1 Message-ID: Hello I saw on the web site: "A version of 1.1.7 for 3.X will be released later." Do you have an estimate for when that might be? zero, out -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgohlke at uci.edu Thu Dec 30 10:28:58 2010 From: cgohlke at uci.edu (Christoph Gohlke) Date: Thu, 30 Dec 2010 01:28:58 -0800 Subject: [Image-SIG] PIL for Python 3 Message-ID: <4D1C50DA.9050404@uci.edu> An unofficial, unsupported port of PIL 1.1.7 to Python 3 can be found at . The binaries for Windows pass all selftests. The scripts are untested. -- Christoph -------------------------------------------------------------------- PIL 1.1.7 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from .\PIL Binary modules loaded from C:\Python32\lib\site-packages\PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok --- LITTLECMS support ok -------------------------------------------------------------------- Running selftest: --- 57 tests passed. -------------------------------------------------------------------- running test_000_sanity ... running test_001_archive ... running test_contents ... running test_file_bmp ... running test_file_gif ... running test_file_jpeg ... running test_file_msp ... running test_file_pcx ... running test_file_png ... running test_file_ppm ... running test_file_tiff ... running test_file_xbm ... running test_font_bdf ... running test_font_pcf ... running test_image ... running test_image_array ... running test_image_convert ... running test_image_copy ... running test_image_crop ... running test_image_draft ... running test_image_filter ... running test_image_fromstring ... running test_image_getbands ... running test_image_getbbox ... running test_image_getcolors ... running test_image_getdata ... running test_image_getextrema ... running test_image_getim ... running test_image_getpalette ... running test_image_getpixel ... running test_image_getprojection ... running test_image_histogram ... running test_image_load ... running test_image_mode ... running test_image_offset ... running test_image_paste ... running test_image_point ... running test_image_putalpha ... running test_image_putdata ... running test_image_putpalette ... running test_image_putpixel ... running test_image_quantize ... running test_image_resize ... running test_image_rotate ... running test_image_save ... running test_image_seek ... running test_image_show ... running test_image_split ... running test_image_tell ... running test_image_thumbnail ... running test_image_tobitmap ... running test_image_tostring ... running test_image_transform ... running test_image_transpose ... running test_image_verify ... running test_imagechops ... running test_imagecms ... running test_imagecolor ... running test_imagedraw ... running test_imageenhance ... running test_imagefile ... running test_imagefileio ... running test_imagefilter ... running test_imagefont ... running test_imagegl ... --- skipped running test_imagegrab ... running test_imagemath ... running test_imagemode ... running test_imageops ... running test_imageops_usm ... running test_imagepalette ... running test_imagepath ... running test_imageqt ... --- skipped running test_imagesequence ... running test_imageshow ... running test_imagestat ... running test_imagetk ... running test_imagetransform ... running test_imagewin ... running test_lib_image ... running test_lib_pack ... running test_mode_i16 ... running test_numpy ... -------------------------------------------------------------------- --- 2 tests skipped. ['test_imagegl', 'test_imageqt'] 81 tests passed. From kpoman at hotmail.com Thu Dec 30 03:19:47 2010 From: kpoman at hotmail.com (Patricio Stegmann) Date: Thu, 30 Dec 2010 00:19:47 -0200 Subject: [Image-SIG] passing options to an image plugin encoder Message-ID: Hello all, I developped a WSQ image plugin (for fingerprint images). It works fine for encode and decode functions. However there are options one would love to pass. The options are, for example, the target bitrate of the compression, or the image comments (to be put on the image headers). I dont know how to do that. I tried to add some info keys like bitrate etc... However if I print the .info dict on the _save method, it is always empty ! >>> import Image >>> l__img = Image.open('fgp_1.wsq') >>> l__img.info['bitrate'] = 0.1 >>> l__img.save('0_1.wsq') >>> print l__img.info {} >>> And obviously the action is not performed. How can I pass options, arguments, keywords or whatever to the encoder so I can read them on the _save method ? Thank you, -------------- next part -------------- An HTML attachment was scrubbed... URL: From amadeusdemarzi at gmail.com Thu Dec 30 12:16:27 2010 From: amadeusdemarzi at gmail.com (Amadeus Demarzi) Date: Thu, 30 Dec 2010 03:16:27 -0800 Subject: [Image-SIG] PIL .paste Bug? Message-ID: Hello All, perhaps you can help me out here. Not sure if I have found a bug or if I am simply doing it wrong. Here is a link to files related to the bug to test for yourself (not sure if this ML would accept attachments or not) http://dl.dropbox.com/u/18782/PILBug.zip And a quick explanation. The script is SUPER simple. It executes 2 methods, one that pastes a semi transparent PNG onto a flat color, and the other onto an existing image, it then saves out 2 images: _works.png _broken.png If you open up both in a photo editing tool, you will noticed that the 'burn.png' that was pasted into the _broken.png has actually manipulated the transparency for the entire image, whereas the the _works.png will not have any full image transparency, and the 'blend' that takes place between test.png and burn.png works as expected. My intent is to have burn.png NOT manipulate the transparency of the entire image when being pasted onto the solid color. Am I missing something is this a bug? And if this is a bug, is there some sort of workaround for it? Thanks in advance, Amadeus -------------- next part -------------- An HTML attachment was scrubbed... URL: