From fredrik at pythonware.com Tue Jun 6 12:45:33 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 06 Jun 2006 12:45:33 +0200 Subject: [Image-SIG] FYI: "Basic Motion Graphics with Python" Message-ID: just stumbled upon a very nice tutorial by Simon Yuill: http://yourmachines.org/tutorials/mgpy.html this uses PIL, ffmpeg, aggdraw, PyGame, and a bunch of other tools to do various kinds of motion graphics in Python, including animated graphics and video processing. From triple_ace at hotmail.com Tue Jun 6 15:37:05 2006 From: triple_ace at hotmail.com (Ahmad Affzan Abdullah) Date: Tue, 06 Jun 2006 13:37:05 +0000 Subject: [Image-SIG] Upsample an image Message-ID: Hi all When I tried downsample an image using im.resize and then upsampled it to get to the original size, it looked a bit blurry and lost a lot of details. How am I suppose to upsample it back to its original size without losing details? Will im.transform work? Thanks a lot From fredrik at pythonware.com Tue Jun 6 16:02:56 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 06 Jun 2006 16:02:56 +0200 Subject: [Image-SIG] Upsample an image In-Reply-To: References: Message-ID: Ahmad Affzan Abdullah wrote: > When I tried downsample an image using im.resize and then upsampled it to > get to the original size, it looked a bit blurry and lost a lot of details. that's expected: if you downsample an image, you lose information. once lost, there's no way to get it back. (if this wasn't the case, image compression would be a lot easier than it is...) From fredrik at pythonware.com Fri Jun 9 15:06:23 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 09 Jun 2006 15:06:23 +0200 Subject: [Image-SIG] Upsample an image In-Reply-To: References: Message-ID: Fredrik Lundh wrote: >> When I tried downsample an image using im.resize and then upsampled it to >> get to the original size, it looked a bit blurry and lost a lot of details. > > that's expected: if you downsample an image, you lose information. once > lost, there's no way to get it back. footnote: if you're e.g. implementing an image display tool, the right solution is to keep resampling/transforming from the same source image: original = Image.open(...) # (re)draw display_im = original.resize(display_size) render_to_screen(display_im) instead of resizing the same image over and over again: image = Image.open(...) # (re)draw image = image.resize(display_size) render_to_screen(image) From Geyu.Ji at iitb.fraunhofer.de Fri Jun 9 15:33:08 2006 From: Geyu.Ji at iitb.fraunhofer.de (Geyu Ji) Date: Fri, 9 Jun 2006 15:33:08 +0200 Subject: [Image-SIG] problem of the setup program Message-ID: <2D3131291B9ECA4D95C687463409067A0238A30D@ms2exchange.ms2.iitb.fraunhofer.de> Hi, the set-up program of 'python imaging library 1.15 for python 2.4(windows only)' is invalid or damaged. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060609/f0613ef2/attachment.htm From fredrik at pythonware.com Sat Jun 10 12:45:33 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 10 Jun 2006 12:45:33 +0200 Subject: [Image-SIG] problem of the setup program In-Reply-To: <2D3131291B9ECA4D95C687463409067A0238A30D@ms2exchange.ms2.iitb.fraunhofer.de> References: <2D3131291B9ECA4D95C687463409067A0238A30D@ms2exchange.ms2.iitb.fraunhofer.de> Message-ID: Geyu Ji wrote: > the set-up program of ?python imaging library 1.15 for python > 2.4(windows only)? is invalid or damaged. in what sense? it works just fine from here. From triple_ace at hotmail.com Mon Jun 12 13:24:29 2006 From: triple_ace at hotmail.com (Ahmad Affzan Abdullah) Date: Mon, 12 Jun 2006 11:24:29 +0000 Subject: [Image-SIG] Second Derivative Test Message-ID: Hi I'm trying to do a second derivative test to an image for the purpose of finding extrema. I just want to make sure whether these are true or not: Dxx = D(x+1,y) + D(x-1,y) - 2D(x,y) Dyy = D(x,y+1) + D(x,y-1) - 2D(x,y) Dxy = D(x+1,y+1) + D(x+1,y-1) + D(x-1,y-1) + D(x-1,y+1) - 4D(x,y) Secondly, I'm trying to store all the extrema detected in a Nx2 array where N is the number of extrema, and 2 being the x and y coordinates of them. Since I don't know how many extrema will be detected, can we create an empty array in python without specifying the size, and later append the data to that array Thanks a lot From fredrik at pythonware.com Thu Jun 15 14:18:25 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 15 Jun 2006 14:18:25 +0200 Subject: [Image-SIG] Second Derivative Test References: Message-ID: Ahmad Affzan Abdullah wrote: > I'm trying to do a second derivative test to an image for the purpose of > finding extrema. I just want to make sure whether these are true or not: > > Dxx = D(x+1,y) + D(x-1,y) - 2D(x,y) > Dyy = D(x,y+1) + D(x,y-1) - 2D(x,y) > Dxy = D(x+1,y+1) + D(x+1,y-1) + D(x-1,y-1) + D(x-1,y+1) - 4D(x,y) looks reasonable. > Secondly, I'm trying to store all the extrema detected in a Nx2 array where > N is the number of extrema, and 2 being the x and y coordinates of them. > Since I don't know how many extrema will be detected, can we create an empty > array in python without specifying the size, and later append the data to > that array any reason you cannot use a Python list for this ? From rune.strand at gmail.com Thu Jun 15 23:33:16 2006 From: rune.strand at gmail.com (Rune Strand) Date: Thu, 15 Jun 2006 23:33:16 +0200 Subject: [Image-SIG] Image.putdata, Python crash Message-ID: <4491D21C.8010408@gmail.com> Hi, Because of my lousy code/PIL newbieness or something completely different, Windows Python 2.4.3 crashes (in _imaging.pyd) after a call to Image.putdata(a_list_of_ints). Python gives no errors messages. The image, a BMP file is written by PIL itself. I have thousands of them. I've tested several of them of them with same result. Saving a copy of the file from Paint.exe etc. does not change anything. The files are created by saving only the R band after Image.split(). They contain only two colours, 0 and 255. The file(s) _does not_ verify. Image.verify() gives AttributeError, but Image.load() and .show() and all other methods works. Simplyfied repro code below. UUE of the insulting BMP file included below. I'll happily send a copy of the BMP. Rune ---------------- Script import Image bmp_file = '9_86955_(1).bmp' img = Image.open(bmp_file) #img.verify() # gives AttributeError, see traceback below #img.load() # no errors, and does not affect crashing # 476 int elements, 0s and 255s img_data = list(img.getdata()) # process data (ie. change some 0's to 255) #img_data = process(img_data) # crashes Python (module _imaging.pyd) img.putdata(img_data) # # .verify() traceback """ Traceback (most recent call last): File "K:\ocr\chars\fix\bug_repro.py", line 14, in ? img_data = list(img.getdata()) File "C:\dev\Python\Lib\site-packages\PIL\Image.py", line 796, in getdata self.load() File "C:\dev\Python\Lib\site-packages\PIL\ImageFile.py", line 161, in load read = self.fp.read AttributeError: 'NoneType' object has no attribute 'read' """ ---------------- ----------- UUE begin 666 9_86955_(1).bmp M0DUF!@ #8$ H $0 !P ! @ # " ! 0 M ! 0 $! 0$" @(" P,# P0$! 0%!04%!@8&!@<'!P<(" @( M"0D)"0H*"@H+"PL+# P,# T-#0T.#@X.#P\/#Q 0$! 1$1$1$A(2$A,3$Q,4 M%!04%145%186%A87%Q<7&!@8&!D9&1D:&AH:&QL;&QP<'!P='1T='AX>'A\? M'Q\@(" @(2$A(2(B(B(C(R,C)"0D)"4E)24F)B8F)R'EY M>7EZ>GIZ>WM[>WQ\?'Q]?7U]?GY^?G]_?W^ @(" @8&!@8*"@H*#@X.#A(2$ MA(6%A86&AH:&AX>'AXB(B(B)B8F)BHJ*BHN+BXN,C(R,C8V-C8Z.CHZ/CX^/ MD)"0D)&1D9&2DI*2DY.3DY24E)25E965EI:6EI>7EY>8F)B8F9F9F9J:FIJ; MFYN;G)RGIZ>GY^?GZ"@H*"AH:&AHJ*BHJ.CHZ.DI*2DI:6EI::F MIJ:GIZ>GJ*BHJ*FIJ:FJJJJJJZNKJZRLK*RMK:VMKJZNKJ^OKZ^PL+"PL;&Q ML;*RLK*SL[.SM+2TM+6UM;6VMK:VM[>WM[BXN+BYN;FYNKJZNKN[N[N\O+R\ MO;V]O;Z^OKZ_O[^_P,# P,'!P<'"PL+"P\/#P\3$Q,3%Q<7%QL;&QL?'Q\?( MR,C(R+BXN+CX^/CY.3DY.7EY>7FYN;FY^?GY^CHZ.CIZ>GI MZNKJZNOKZ^OL[.SL[>WM[>[N[N[O[^_O\/#P\/'Q\?'R\O+R\_/S\_3T]/3U M]?7U]O;V]O?W]_?X^/CX^?GY^?KZ^OK[^_O[_/S\_/W]_?W^_O[^_____P M /\ _____P _________________P #_________ M__________\ /_______P#___________\ ________________ M______\ #______________________P /________\ #_________ M ________ /________\ #______P _________P M #___\ /__ _____P#___\ ____ M_____________P ____________________ /______________ M______\ #______________________P /______________________ M /_______P /________\ #_________ _________P /__ M_____P #_________ _________P /________\ #_________ M _________P /________\ #__P ____ ________________ M_P#___\ #_____________________ #_____ /____\ _____P M _P#_ #_ #___\ 2 end From fredrik at pythonware.com Fri Jun 16 00:00:29 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 16 Jun 2006 00:00:29 +0200 Subject: [Image-SIG] Image.putdata, Python crash In-Reply-To: <4491D21C.8010408@gmail.com> References: <4491D21C.8010408@gmail.com> Message-ID: Rune Strand wrote: > Simplyfied repro code below. UUE of the insulting BMP file included > below. I'll happily send a copy of the BMP. I get "Warning: Trailing garbage" and a truncated BMP file, so an attached copy would be nice, I think. From steve at holdenweb.com Fri Jun 16 01:13:52 2006 From: steve at holdenweb.com (Steve Holden) Date: Fri, 16 Jun 2006 00:13:52 +0100 Subject: [Image-SIG] Image.putdata, Python crash In-Reply-To: References: <4491D21C.8010408@gmail.com> Message-ID: <4491E9B0.9040403@holdenweb.com> Fredrik Lundh wrote: > Rune Strand wrote: > > >>Simplyfied repro code below. UUE of the insulting BMP file included >>below. I'll happily send a copy of the BMP. > > > I get "Warning: Trailing garbage" and a truncated BMP file, so an > attached copy would be nice, I think. > Damn that effbot, always wanting hard information. Why can't we just make problems up and have it solve *them*? ;-) an-effbot-is-immeasurably-valuab-ly y'rs - steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden From fredrik at pythonware.com Fri Jun 16 08:50:19 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 16 Jun 2006 08:50:19 +0200 Subject: [Image-SIG] Image.putdata, Python crash In-Reply-To: <4491D21C.8010408@gmail.com> References: <4491D21C.8010408@gmail.com> Message-ID: Rune Strand wrote: > Because of my lousy code/PIL newbieness or something completely > different, Windows Python 2.4.3 crashes (in _imaging.pyd) after a call > to Image.putdata(a_list_of_ints). after some digging, this appears to be a bug in how putdata behaves on memory-mapped images. the simplest way to work around this is to do: img = Image.open(bmp_file) img = img.copy() # make sure we have a writable copy if you want to be a bit more careful, you can do: # make sure putdata can write to the image memory img.load() if img.readonly: img = img.copy() img.putdata(...) hope this helps! From maik.troemel at weather-consult.com Fri Jun 16 13:31:36 2006 From: maik.troemel at weather-consult.com (=?ISO-8859-1?Q?Maik_Tr=F6mel?=) Date: Fri, 16 Jun 2006 13:31:36 +0200 Subject: [Image-SIG] Creating gif-sequences Message-ID: <44929698.2090900@weather-consult.com> Hello list, I've got a question concerning gif-sequences. In the manuel i've found how to load a gif-sequence. but how can i create one? Thanks for help. Greetings Maik From michele.petrazzo at unipex.it Fri Jun 16 13:49:19 2006 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Fri, 16 Jun 2006 13:49:19 +0200 Subject: [Image-SIG] Creating gif-sequences In-Reply-To: <44929698.2090900@weather-consult.com> References: <44929698.2090900@weather-consult.com> Message-ID: <44929ABF.4050907@unipex.it> Maik Tr?mel wrote: > Hello list, > > I've got a question concerning gif-sequences. In the manuel i've > found how to load a gif-sequence. but how can i create one? > > Thanks for help. > See this: http://mail.python.org/pipermail/image-sig/2005-December/003691.html > Greetings Maik Michele From fredrik at pythonware.com Fri Jun 16 14:00:50 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 16 Jun 2006 14:00:50 +0200 Subject: [Image-SIG] Creating gif-sequences References: <44929698.2090900@weather-consult.com> Message-ID: Maik Trömel wrote: > I've got a question concerning gif-sequences. In the manuel i've found > how to load a gif-sequence. but how can i create one? there's an example in the Scripts directory in the PIL source distribution. look for a module/script called "gifmaker.py". From list.adam at twardoch.com Sat Jun 17 10:12:38 2006 From: list.adam at twardoch.com (Adam Twardoch) Date: Sat, 17 Jun 2006 10:12:38 +0200 Subject: [Image-SIG] Python crashes on FreeType bindings -- replicable Message-ID: <4493B976.4060705@twardoch.com> I'm getting many crashes when using the FreeType bindings in PIL with Python on Windows XP. The crashes are consistant, on certain glyphs in certain fonts. At http://www.twardoch.com/tmp/crashPilFont.zip there is a small archive that contains a Python script, the binary libraries, some fonts of which one causes a crash (the italic), and an out.txt file that shows the output of the script (showing when it crashed). I'm always getting the same crash: AppName: python.exe AppVer: 0.0.0.0 ModName: ntdll.dll ModVer: 5.1.2600.2180 Offset: 00010f29 I tried this on two different Windows XP machines (one having a normal clean install of Windows, Python and PIL, the other being a developer's machine with many different things installed). I've tried Python 2.4.3 with PIL 1.1.5, I've tried Python 2.5a2 with the pre-built PIL 1.1.6a0. I even tried the _imaging and _imagingft copies from Reportlab (http://www.reportlab.org/ftp/win32-dlls/2.4/). All the same. But many other fonts work just fine. In my code, I'm calling _imaging and _imagingft directly. That's just to nail the problem down. I've used the "official" way over PIL.Image and PIL.ImageFont, it's all the same. It appears that the crash occurs at the line im = _imaging.fill(self.mode, self.size, 0) which is quite strange. Do you know why this may be happening? Adam Twardoch From fredrik at pythonware.com Sun Jun 18 18:53:50 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sun, 18 Jun 2006 18:53:50 +0200 Subject: [Image-SIG] Python crashes on FreeType bindings -- replicable In-Reply-To: <4493B976.4060705@twardoch.com> References: <4493B976.4060705@twardoch.com> Message-ID: Adam Twardoch wrote: > I'm getting many crashes when using the FreeType bindings in PIL with > Python on Windows XP. > > The crashes are consistant, on certain glyphs in certain fonts. At > http://www.twardoch.com/tmp/crashPilFont.zip there is a small archive > that contains a Python script, the binary libraries, some fonts of which > one causes a crash (the italic) this is a bug in PIL's font rendering code; see http://effbot.python-hosting.com/ticket/49 and also http://effbot.python-hosting.com/ticket/43 From maik.troemel at maitro.net Mon Jun 19 13:58:21 2006 From: maik.troemel at maitro.net (=?ISO-8859-1?Q?Maik_Tr=F6mel?=) Date: Mon, 19 Jun 2006 13:58:21 +0200 Subject: [Image-SIG] Creating gif-sequences In-Reply-To: References: <44929698.2090900@weather-consult.com> Message-ID: <4496915D.6010805@maitro.net> Thanks for support. I did it this way: sequence = [] for s in range(steps): im = scipy.misc.toimage(arr, cmin=0, cmax=255, high = 255, low = 0, pal=colorMap(), mode='P') im = im.transpose(Image.FLIP_TOP_BOTTOM) sequence.append(im) fp = open(sys.argv[4], "wb") gifmaker.makedelta(fp, sequence) fp.close() Greetings Maik Fredrik Lundh wrote: >Maik Tr?mel wrote: > > > >>I've got a question concerning gif-sequences. In the manuel i've found >>how to load a gif-sequence. but how can i create one? >> >> > >there's an example in the Scripts directory in the PIL source distribution. look >for a module/script called "gifmaker.py". > > > > > > > >------------------------------------------------------------------------ > >_______________________________________________ >Image-SIG maillist - Image-SIG at python.org >http://mail.python.org/mailman/listinfo/image-sig > > From granted14 at yahoo.com Mon Jun 19 21:54:29 2006 From: granted14 at yahoo.com (Etienne Robillard) Date: Mon, 19 Jun 2006 15:54:29 -0400 (EDT) Subject: [Image-SIG] IndexError Message-ID: <20060619195429.56202.qmail@web55604.mail.re4.yahoo.com> Hi all, I'm trying to compose a image with transparency in mode RGBA. But first I changed some pixels values by retrieving the palette with getpalette(). Things were doing ok until I decoupled a function similar to getcolor() that inherits somewhat from ImagePalette... Now I get a 'IndexError: tuple index out of range' error whenever I'm trying to mix-up palette entries and filtering a (converted) RGBA single-color band. :/ Is their something I missed about using ImagePalette instances with Image.putpalette() ? Thanks, Etienne PS, This is PIL version 1.1.5 -- Etienne Robillard JID: incidah AT njs.netlab.cz YMS/MSN: granted14 AT yahoo.com TEL: +1 514.962.7703 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- A non-text attachment was scrubbed... Name: test_canvas.py Type: application/octet-stream Size: 2592 bytes Desc: 2235893009-test_canvas.py Url : http://mail.python.org/pipermail/image-sig/attachments/20060619/aea735e8/attachment.obj From kevin at cazabon.com Mon Jun 19 22:31:43 2006 From: kevin at cazabon.com (kevin at cazabon.com) Date: Mon, 19 Jun 2006 22:31:43 +0200 Subject: [Image-SIG] ImageTk and threading - warning Message-ID: <059f01c693df$60d527d0$650aa8c0@duallie> I'm not sure how many people out there are doing multi-threading and Tk, but I just wanted to post a warning after spending a few months trying to track down a nasty (and very rare) crashing bug in one of my programs. I wish I had been more skeptical from the start. :) I know that Tkinter isn't thread safe - so only use one thread to touch any Tkinter objects or their properties. However, I didn't think twice about creating an ImageTk.PhotoImage(of_my_image) in a secondary thread, and passing it to the GUI thread for display. For some reason, doing this works in 99.99% of the time, but occasionally crashes with an access violation error, pointing to the Tk DLL. So - until Tk is thread-safe (I'm not holding my breath, it wouldn't be a trivial task), just use the same thread that creates the Tk widgets to convert your images to PhotoImages. Kevin. From andrea_gavana at tin.it Mon Jun 19 12:56:39 2006 From: andrea_gavana at tin.it (andrea_gavana at tin.it) Date: Mon, 19 Jun 2006 11:56:39 +0100 (GMT+01:00) Subject: [Image-SIG] Image size in runtime Message-ID: <10bebef56be.andrea_gavana@tin.it> Hello NG, I am using PIL to load and display some pictures (via wxPython) in a GUI. I have added the ability for the user to change the linear dimensions of the image (in pixels) and the quality of the image in order for the image to be saved in another file. I was wondering if is there a way to know in advance, based on the pixel dimensions specified by the user and by the image quality, which file size (in bytes) I will obtain for the new image (approximatively). Is there a way to obtain such result without actually saving the image? Thanks for any hint. Andrea. From andrea_gavana at tin.it Tue Jun 20 10:42:11 2006 From: andrea_gavana at tin.it (andrea_gavana at tin.it) Date: Tue, 20 Jun 2006 09:42:11 +0100 (GMT+01:00) Subject: [Image-SIG] Finding image dimension Message-ID: <10bf09a98c0.andrea_gavana@tin.it> Hello NG, I am using PIL to load and display some pictures (via wxPython) in a GUI. I have added the ability for the user to change the linear dimensions of the image (in pixels) and the quality of the image in order for the image to be saved in another file. I was wondering if is there a way to know in advance, based on the pixel dimensions specified by the user and by the image quality, which file size (in bytes) I will obtain for the new image (approximatively). Is there a way to obtain such result without actually saving the image? Thanks for any hint. Andrea. From fredrik at pythonware.com Wed Jun 21 10:30:51 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 21 Jun 2006 10:30:51 +0200 Subject: [Image-SIG] ANN: PIL 1.1.6 beta 1 (june 20, 2006) Message-ID: The first PIL 1.1.6 beta is now available from effbot.org: http://effbot.org/downloads/#Imaging (source) http://effbot.org/downloads/#PIL (windows binaries) Changes from 1.1.5 include: - new ImageQt module provides image support for PyQt4 - numerous improvements to the TrueType rendering, including proper (and crash-free) handling of fonts with negative bearings, and support for kerning. - new ImageMath module for applying arbitrary expressions to images - faster pixel access via separate "access" objects As usual, PIL 1.1.6 supports all Python versions from 1.5.2 and onwards, including the upcoming 2.5 beta. For a more complete list of changes, see: http://effbot.org/zone/pil-changes-116.htm Report bugs to this list as usual. (bugs in the alpha/beta releases can also be reported directly to me, if you prefer) enjoy /F From fredrik at pythonware.com Wed Jun 21 12:18:34 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 21 Jun 2006 12:18:34 +0200 Subject: [Image-SIG] Finding image dimension References: <10bf09a98c0.andrea_gavana@tin.it> Message-ID: andrea_gavana at tin.it wrote: > I am using PIL to load and display some pictures (via > wxPython) in a GUI. I have added the ability for the user to change > the linear dimensions of the image (in pixels) and the quality of the > image in order for the image to be saved in another file. I was > wondering if is there a way to know in advance, based on the > pixel dimensions specified by the user and by the image quality, > which file size (in bytes) I will obtain for the new image if we're talking about formats like JPEG and PNG, the compression ratio depends on the image content, so the short answer is "no", and the some- what longer answer is "it depends". if you want *very* rough estimates, you can use something like: def getroughsize(im, format): pixels = im.size[0] * im.size[1] if im.mode == "RGB": pixels *= 3 if format == "PNG": return pixels / 1.5 # photographic content if format == "JPEG": if im.mode == "RGB": return bytes / 20 return bytes / 10 return bytes # assume uncompressed format the scale factors used above is for typical photographic content; drawings and other graphics can often be compressed a lot more, while very noisy pictures result in lower compression ratios. tweak as necessary. to get an exact value, you have to compress the file. the following snippet uses a stub byte counter class where possible, and falls back on a full in- memory compression (via StringIO) for encoders that need random access to the file: import Image import cStringIO class Counter: bytes = 0 def write(self, data): self.bytes += len(data) def getsize(im, format, **options): try: out = Counter() im.save(out, format, **options) return out.bytes except AttributeError: # fall back on full in-memory compression out = cStringIO.StringIO() im.save(out, format, **options) return len(out.getvalue()) a third approach would be a turn this into a statistics problem, and calculate some global stats (such as RMS etc.) on the image, and compare that to the achieved compression ratio for a reasonably large set of typical images. I'm sure someone has done this already, but I have no time for a literature search today... From scott_nelson86 at hotmail.com Thu Jun 22 19:55:32 2006 From: scott_nelson86 at hotmail.com (Scott Nelson) Date: Thu, 22 Jun 2006 13:55:32 -0400 Subject: [Image-SIG] PIL-1.1.5 jpeg decoder Message-ID: I'm installing Imaging-1.1.5 on rhel 4.3. selftest.py fails bcs "decoder jpeg not available". I have tried going through the steps on Fredrik Lundh's zone.effbot.org page for "decoder jpeg not available" at http://effbot.org/zone/pil-decoder-jpeg-not-available.htm. The first step is to run ./configure in the libImaging directory. I don't have a configure script in there. Am I missing something? I have Imaging-1.1.5 running on a CentOS-4.3 box. There is no configure in libImaging/ there either. I tried changing setup.py to point to the libjpeg directory but it still doesn't find the decoder. What can I try? python -vv -c "import _imaging" gives the following: # trying /zope/python/lib/python2.3/site-packages/_imagingmodule.so^M # trying /zope/python/lib/python2.3/site-packages/_imaging.py^M # trying /zope/python/lib/python2.3/site-packages/_imaging.pyc^M Traceback (most recent call last):^M File "", line 1, in ?^M ImportError: No module named _imaging^M # clear __builtin__._^M # clear sys.path^M Thanks From fredrik at pythonware.com Thu Jun 22 20:40:57 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 22 Jun 2006 20:40:57 +0200 Subject: [Image-SIG] PIL-1.1.5 jpeg decoder In-Reply-To: References: Message-ID: Scott Nelson wrote: > I'm installing Imaging-1.1.5 on rhel 4.3. selftest.py fails bcs "decoder > jpeg not available". I have tried going through the steps on Fredrik Lundh's > zone.effbot.org page for "decoder jpeg not available" at > http://effbot.org/zone/pil-decoder-jpeg-not-available.htm. The first step > is to run ./configure in the libImaging directory. I don't have a configure > script in there. Am I missing something? the big blurb at the top of that page that says "This applies to PIL 1.1.4 and earlier." and goes on to explain what do for 1.1.5, perhaps ? (do you have the jpeg library on your machine, btw? you need both the library and the developer files; installing the "jpeg-devel" package is usually the easiest way to fix this. with this in place, the setup script should take care of the rest, all my itself.) (you could also look for python-imaging in your favourite redhat repository. ) From fredrik at pythonware.com Thu Jun 22 20:49:45 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 22 Jun 2006 20:49:45 +0200 Subject: [Image-SIG] PIL-1.1.5 jpeg decoder In-Reply-To: References: Message-ID: Fredrik Lundh wrote: > (do you have the jpeg library on your machine, btw? you need both the > library and the developer files; installing the "jpeg-devel" package is > usually the easiest way to fix this. that should probably be "libjpeg-devel" for RHEL, though. From ryu.alex at gmail.com Fri Jun 23 05:16:41 2006 From: ryu.alex at gmail.com (Alex Ryu) Date: Thu, 22 Jun 2006 20:16:41 -0700 Subject: [Image-SIG] Problem reading image Message-ID: Hi everyone, I'm having some problems with basic PIL functions. First, when I try to call the size() method, I get a typeerror (tuple object is not callable). And similar errors for other methods. Also, when I try to use getdata(), I get an error message that says "ImagingCore object at ". However, some methods, like getpixel(), do work. I'm using the newest distro of Python and the newest binary build of PIL, on Win2k. The image I'm working with is a TIFF file: here is the output of tiffinfo: TIFF Directory at offset 0x10 (16) Subfile Type: (0 = 0x0) Image Width: 288 Image Length: 192 Resolution: 72, 72 pixels/inch Bits/Sample: 8 Compression Scheme: None Photometric Interpretation: RGB color Orientation: row 0 top, col 0 lhs Samples/Pixel: 3 Rows/Strip: 192 Planar Configuration: single image plane Make: Canon Model: Canon EOS-1DS DateTime: 2006:04:27 15:37:04 EXIFIFDOffset: 4582 TIFF Directory at offset 0x11e6 (4582) ExposureTime: 0.000625 FNumber: 8.000000 ExposureProgram: 4 ISOSpeedRatings: 400 DateTimeOriginal: 2006:04:27 15:37:04 DateTimeDigitized: 2006:04:27 15:37:04 ShutterSpeedValue: 10.625000 ApertureValue: 6.000000 ExposureBiasValue: 0.666667 MeteringMode: 5 Flash: 0 FocalLength: 400.000000 MakeNote: /*a bunch of hex*/ UserComment: /*a bunch of hex*/ Tag 40961: 1 PixelXDimension: 4064 PixelYDimension: 2704 FocalPlaneXResolution: 2886.363525 FocalPlaneYResolution: 2885.805664 FocalPlaneResolutionUnit: 2 CustomRendered: 0 ExposureMode: 0 WhiteBalance: 1 SceneCaptureType: 0 TIFF Directory at offset 0x2ae00 (175616) Image Width: 168 Image Length: 112 Resolution: 72, 72 pixels/inch Bits/Sample: 16 Compression Scheme: None Photometric Interpretation: RGB color Samples/Pixel: 3 Rows/Strip: 112 Planar Configuration: single image plane Thanks for your help -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060622/b513061b/attachment.html From fredrik at pythonware.com Fri Jun 23 10:28:12 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 23 Jun 2006 10:28:12 +0200 Subject: [Image-SIG] Problem reading image In-Reply-To: References: Message-ID: Alex Ryu wrote: > Hi everyone, I'm having some problems with basic PIL functions. First, > when I try to call the size() method, I get a typeerror (tuple object is > not callable). And similar errors for other methods. size is an attribute, not a method: http://effbot.org/imagingbook/image.htm#Image.size > Also, when I try to use getdata(), I get an error message that says > "ImagingCore object at ". that's not an error message, that's the standard string representation of the sequence-like object returned by getdata(). as explained here: http://effbot.org/imagingbook/image.htm#Image.getdata you can use list() to convert it to an ordinary list. you can also iterate over it, or pass it to any function that expects a sequence object or iterator. see your favourite python tutorial for more information on things like attributes, sequences, iterators, exceptions and tracebacks, etc. From bestdomdom at neuf.fr Fri Jun 23 18:55:26 2006 From: bestdomdom at neuf.fr (bestdomdom) Date: Fri, 23 Jun 2006 18:55:26 +0200 Subject: [Image-SIG] Help on accessing pixels values Message-ID: <008d01c696e5$d37d9de0$b049fea9@domino> Hello Everybody, First please forgive me for asking such a basic question but I am a newbie to Python, to programming and I am alone with my IT worries. I would like to access pixels values in order to make some computations but with the 1.1.6 PIL, I don't understand. As an example, here is what I do: import Image im = Image.open("myimage.jpg") pixel=im.load() print pixel [0,0] # to see the value of pixel[0,0] x=(0,0,0) #black in RGB pixel[0,0]=x # to set the first pixel in black This gives me an error : "TypeError: unsubscriptable object". I believe I am doing something wrong ;( May someone just explain me with such an example what I should do. Thanks in advance for your help Dom From dblank at brynmawr.edu Fri Jun 23 20:06:21 2006 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri, 23 Jun 2006 14:06:21 -0400 Subject: [Image-SIG] Help on accessing pixels values In-Reply-To: <008d01c696e5$d37d9de0$b049fea9@domino> References: <008d01c696e5$d37d9de0$b049fea9@domino> Message-ID: <1151085981.3451.62.camel@mightymouse.brynmawr.edu> Dom, You should consult the very good on-line documentation (search for "python image library"). Here is a hint: import Image im = Image.open("myimage.jpg") im.getpixel((0,0)) # position (0,0) im.putpixel((0,0), (0,0,0) ) # black -Doug On Fri, 2006-06-23 at 18:55 +0200, bestdomdom wrote: > Hello Everybody, > > First please forgive me for asking such a basic question but I am a newbie > to Python, to programming and I am alone with my IT worries. > I would like to access pixels values in order to make some computations but > with the 1.1.6 PIL, I don't understand. > As an example, here is what I do: > > import Image > im = Image.open("myimage.jpg") > pixel=im.load() > print pixel [0,0] # to see the value of pixel[0,0] > x=(0,0,0) #black in RGB > pixel[0,0]=x # to set the first pixel in black > > This gives me an error : "TypeError: unsubscriptable object". > I believe I am doing something wrong ;( > > May someone just explain me with such an example what I should do. > Thanks in advance for your help > > Dom > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From fredrik at pythonware.com Sat Jun 24 17:14:59 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat, 24 Jun 2006 17:14:59 +0200 Subject: [Image-SIG] Help on accessing pixels values In-Reply-To: <008d01c696e5$d37d9de0$b049fea9@domino> References: <008d01c696e5$d37d9de0$b049fea9@domino> Message-ID: bestdomdom wrote: > First please forgive me for asking such a basic question but I am a newbie > to Python, to programming and I am alone with my IT worries. > I would like to access pixels values in order to make some computations but > with the 1.1.6 PIL, I don't understand. > As an example, here is what I do: > > import Image > im = Image.open("myimage.jpg") > pixel=im.load() > print pixel [0,0] # to see the value of pixel[0,0] > x=(0,0,0) #black in RGB > pixel[0,0]=x # to set the first pixel in black > > This gives me an error : "TypeError: unsubscriptable object". > I believe I am doing something wrong ;( are you sure you have PIL 1.1.6 ? what does >>> import Image >>> Image.VERSION print ? From bestdomdom at neuf.fr Mon Jun 26 16:36:37 2006 From: bestdomdom at neuf.fr (bestdomdom) Date: Mon, 26 Jun 2006 16:36:37 +0200 Subject: [Image-SIG] Help on accessing pixels values References: <008d01c696e5$d37d9de0$b049fea9@domino> Message-ID: <005c01c6992d$ef147070$b049fea9@domino> Fredrick, Douglas, All, I have Pil : Image.VERSION: '1.1.6a0-20051002'. I finally managed to have this useful pixel function work fine. I don't understand why it did not work before. Maybe I was still in Python 2.4 and PIL 1.1.5 ??? (I have 2 python and 2 PIL on my PC). The important thing is that it now works. Thank you Fredrick and also many thanks to Douglas S. Blank for your swift replies. Dom ----- Original Message ----- From: "Fredrik Lundh" To: Sent: Saturday, June 24, 2006 5:14 PM Subject: Re: [Image-SIG] Help on accessing pixels values > bestdomdom wrote: > >> First please forgive me for asking such a basic question but I am a >> newbie >> to Python, to programming and I am alone with my IT worries. >> I would like to access pixels values in order to make some computations >> but >> with the 1.1.6 PIL, I don't understand. >> As an example, here is what I do: >> >> import Image >> im = Image.open("myimage.jpg") >> pixel=im.load() >> print pixel [0,0] # to see the value of pixel[0,0] >> x=(0,0,0) #black in RGB >> pixel[0,0]=x # to set the first pixel in black >> >> This gives me an error : "TypeError: unsubscriptable object". >> I believe I am doing something wrong ;( > > are you sure you have PIL 1.1.6 ? what does > > >>> import Image > >>> Image.VERSION > > print ? > > > > > From djmuhlestein at gmail.com Wed Jun 28 03:03:11 2006 From: djmuhlestein at gmail.com (Dennis Muhlestein) Date: Tue, 27 Jun 2006 19:03:11 -0600 Subject: [Image-SIG] PIL in the wild Message-ID: I've developed an application that uses PIL+aggdraw on the server side to render and save what clients draw on the client side. I just wanted to mention how easy it was to get up and running with PIL and how small the learning curve was. I found the documentation to be very adequate. I considered posting to this list once or twice, but found that I was able to resolve issues without extra help. So anyway, I thought I'd just say thanks to all the people making PIL into what it is! If you're interested, you can check out http://mydrawings.com to see what we've come up with. A couple things I encountered in the process: 1) w/ aggdraw, I didn't find a documented way to change the default line ending and line caps so I changed the default in the source and recompiled. I'm sure there was a way to do that but I never ran accross it. 2) when I size images (using ANTIALIAS) smaller, the white space from the original image is somewhat distorted and not completely white. Anyway, these were small issues and overall, I'm quite happy with the way PIL is working for me. Thanks Dennis Muhlestein -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060627/e103644b/attachment.htm From triple_ace at hotmail.com Wed Jun 28 17:38:56 2006 From: triple_ace at hotmail.com (Ahmad Affzan Abdullah) Date: Wed, 28 Jun 2006 15:38:56 +0000 Subject: [Image-SIG] Storing instance of a class in an array Message-ID: Hi Is there any way to store instances of a class in a 2-dimensional array? How do you declare the array? I was thinking something like this a = ClassName(arg1, arg2,arg3) so that a.arg1 = arg1, a.arg2 = arg2, a.arg3 = arg3 if I've got 9 of a, how do I store them in a 3x3 array I tried to initialize the array as having a 0 value first by typing array = zeros((3,3)) but when I assign array[0][0] = a, it just return an error of bad value type If I can store those instances in an array, how do I initialize the array? Thanks a lot From fredrik at pythonware.com Wed Jun 28 17:47:58 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 28 Jun 2006 17:47:58 +0200 Subject: [Image-SIG] Storing instance of a class in an array References: Message-ID: Ahmad Affzan Abdullah wrote: > Is there any way to store instances of a class in a 2-dimensional array? How > do you declare the array? I was thinking something like this > > a = ClassName(arg1, arg2,arg3) > > so that a.arg1 = arg1, a.arg2 = arg2, a.arg3 = arg3 > > if I've got 9 of a, how do I store them in a 3x3 array > > I tried to initialize the array as having a 0 value first by typing > > array = zeros((3,3)) > > but when I assign array[0][0] = a, it just return an error of bad value type > > If I can store those instances in an array, how do I initialize the array? if "array" refers to Python list, this question should really have been sent to a general python forum, and the answer is found here: http://pyfaq.infogami.com/how-do-i-create-a-multidimensional-list if "array" refers to a Numpy array, you may have better luck by asking on a Numpy support forum. if "array" refers to a PIL image memory, the answer is "you cannot do that". From python at klaff.org Thu Jun 29 20:11:30 2006 From: python at klaff.org (Dave) Date: Thu, 29 Jun 2006 11:11:30 -0700 Subject: [Image-SIG] 16-bit ppm or psd support in PIL? Message-ID: <44A417D2.6070501@klaff.org> Hi, I would like to play with some 16-bit ppm or psd files in PIL. These files are created from digital camera raw files (Nikon .NEFs actually) using dcraw to create either .ppm or .psd format files, for example: dcraw -3 DSC_1234.NEF or dcraw -4 DSC_1234.NEF I'm using PIL 1.1.5 on Windows XP w/ Python 2.4.2. PIL will open the ppm file, but the pixel values returned appear to be 8-bit and im.show() gives a malformed image, so I think the plugin doesn't understand the 16-bit format. The psd plugin doesn't seem to recognize the .psd version of the file. Has anyone tried to do this? If a plugin were written to handle one of the 16-bit formats can the rest of PIL work with 16-bit data or is this a deep difficult problem? Thanks, Dave From granted14 at yahoo.com Thu Jun 29 22:18:46 2006 From: granted14 at yahoo.com (Etienne Robillard) Date: Thu, 29 Jun 2006 16:18:46 -0400 (EDT) Subject: [Image-SIG] AttributeError: pixel_access Message-ID: <20060629201846.22659.qmail@web55604.mail.re4.yahoo.com> Hi all, I've ran into this problem while upgrading from 1.1.5 to 1.1.6. >>> import Image >>> Image.VERSION() '1.1.6a2-20060303' Here's the debug output, while running selftest.py: ***************************************************************** Failure in example: _info(im) from line #4 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.new("L", (128, 128))) # grayscale (luminance) from line #6 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.new("P", (128, 128))) # palette from line #8 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.new("RGB", (128, 128))) # truecolor from line #10 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.new("I", (128, 128))) # 32-bit integer from line #12 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.new("F", (128, 128))) # 32-bit floating point from line #14 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/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im) from line #20 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 155, in load self.load_prepare() File "PIL/ImageFile.py", line 226, in load_prepare Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(Image.open("Images/lena.ppm")) from line #22 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 217, in load return Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** 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 217, in load return Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: a = im.load() from line #33 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 "PIL/ImageFile.py", line 217, in load return Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.convert("L")) from line #41 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 "PIL/Image.py", line 615, in convert self.load() File "PIL/ImageFile.py", line 217, in load return Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.copy()) from line #43 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 "PIL/Image.py", line 679, in copy self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.crop((32, 32, 96, 96))) from line #45 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 "PIL/Image.py", line 699, in crop self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.filter(ImageFilter.BLUR)) from line #47 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 "PIL/Image.py", line 741, in filter self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: im.getbbox() from line #51 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 "PIL/Image.py", line 777, in getbbox self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: len(im.getdata()) from line #53 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 "PIL/Image.py", line 822, in getdata self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: im.getextrema() from line #55 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 "PIL/Image.py", line 838, in getextrema self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #57 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: len(im.getprojection()) from line #59 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 "PIL/Image.py", line 896, in getprojection self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: len(im.histogram()) from line #61 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 "PIL/Image.py", line 922, in histogram self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.point(range(256)*3)) from line #63 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 "PIL/Image.py", line 1057, in point self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.resize((64, 64))) from line #65 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 "PIL/Image.py", line 1214, in resize self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.rotate(45)) from line #67 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 "PIL/Image.py", line 1251, in rotate self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: map(_info, im.split()) from line #69 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 "PIL/Image.py", line 1390, in split self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: len(im.convert("1").tobitmap()) from line #71 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 "PIL/Image.py", line 615, in convert self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: len(im.tostring()) from line #73 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 "PIL/Image.py", line 475, in tostring self.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.transform((512, 512), Image.AFFINE, (1,0,0,0,1,0))) from line #75 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 "PIL/Image.py", line 1502, in transform im.__transformer((0, 0)+size, self, method, data, resample, fill) File "PIL/Image.py", line 1545, in __transformer image.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: _info(im.transform((512, 512), Image.EXTENT, (32,32,96,96))) from line #77 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 "PIL/Image.py", line 1502, in transform im.__transformer((0, 0)+size, self, method, data, resample, fill) File "PIL/Image.py", line 1545, in __transformer image.load() File "PIL/ImageFile.py", line 118, in load Image.Image.load(self) File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d = ImageDraw.ImageDraw(im) from line #83 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 "PIL/ImageDraw.py", line 58, in __init__ im.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.line((0, 0, 128, 128), fill=128) from line #84 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: d.line((0, 128, 128, 0), fill=128) from line #85 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getextrema() from line #86 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 "PIL/Image.py", line 838, in getextrema self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d = ImageDraw.ImageDraw(im) from line #93 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 "PIL/ImageDraw.py", line 58, in __init__ im.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "#f00") from line #94 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #95 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "#ff0000") from line #97 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #98 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "rgb(255,0,0)") from line #100 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #101 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "rgb(100%,0%,0%)") from line #103 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #104 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "hsl(0, 100%, 50%)") from line #106 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #107 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: d.rectangle(xy, "red") from line #109 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 ? NameError: name 'd' is not defined ***************************************************************** Failure in example: im.getpixel((0, 0)) from line #110 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 "PIL/Image.py", line 884, in getpixel self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: im = ImageMath.eval("float(im + 20)", im=im.convert("L")) from line #116 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 "PIL/Image.py", line 615, in convert self.load() File "PIL/Image.py", line 561, in load return self.im.pixel_access(self.readonly) AttributeError: pixel_access ***************************************************************** Failure in example: im.mode, im.size from line #117 of selftest.testimage Expected: ('F', (128, 128)) Got: ('RGB', (128, 128)) 1 items had failures: 47 of 57 in selftest.testimage ***Test Failed*** 47 failures. *** 47 tests of 57 failed. Any hints on how to work-around this issue with pixel_access ? Thanks, Etienne -- Etienne Robillard JID: incidah AT njs.netlab.cz YMS/MSN: granted14 AT yahoo.com TEL: +1 514.962.7703 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From granted14 at yahoo.com Thu Jun 29 22:28:45 2006 From: granted14 at yahoo.com (Etienne Robillard) Date: Thu, 29 Jun 2006 16:28:45 -0400 (EDT) Subject: [Image-SIG] AttributeError: pixel_access In-Reply-To: <20060629201846.22659.qmail@web55604.mail.re4.yahoo.com> Message-ID: <20060629202845.62440.qmail@web55614.mail.re4.yahoo.com> Oops, have to remove 1.1.5 first, otherwise it would not work cleanly =) Cheers, Etienne --- Etienne Robillard wrote: > Hi all, > > I've ran into this problem while upgrading from > 1.1.5 > to 1.1.6. > > >>> import Image > >>> Image.VERSION() > '1.1.6a2-20060303' > > Here's the debug output, while running selftest.py: > > ***************************************************************** > Failure in example: _info(im) > from line #4 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(Image.new("L", (128, > 128))) > # grayscale (luminance) > from line #6 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(Image.new("P", (128, > 128))) > # palette > from line #8 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(Image.new("RGB", (128, > 128))) # truecolor > from line #10 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(Image.new("I", (128, > 128))) > # 32-bit integer > from line #12 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(Image.new("F", (128, > 128))) > # 32-bit floating point > from line #14 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/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im) > from line #20 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 155, in load > self.load_prepare() > File "PIL/ImageFile.py", line 226, in load_prepare > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: > _info(Image.open("Images/lena.ppm")) > from line #22 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 217, in load > return Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > 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 217, in load > return Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: a = im.load() > from line #33 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 "PIL/ImageFile.py", line 217, in load > return Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.convert("L")) > from line #41 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 "PIL/Image.py", line 615, in convert > self.load() > File "PIL/ImageFile.py", line 217, in load > return Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.copy()) > from line #43 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 "PIL/Image.py", line 679, in copy > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.crop((32, 32, 96, 96))) > from line #45 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 "PIL/Image.py", line 699, in crop > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: > _info(im.filter(ImageFilter.BLUR)) > from line #47 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 "PIL/Image.py", line 741, in filter > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: im.getbbox() > from line #51 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 "PIL/Image.py", line 777, in getbbox > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: len(im.getdata()) > from line #53 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 "PIL/Image.py", line 822, in getdata > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: im.getextrema() > from line #55 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 "PIL/Image.py", line 838, in getextrema > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #57 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: len(im.getprojection()) > from line #59 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 "PIL/Image.py", line 896, in getprojection > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: len(im.histogram()) > from line #61 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 "PIL/Image.py", line 922, in histogram > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.point(range(256)*3)) > from line #63 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 "PIL/Image.py", line 1057, in point > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.resize((64, 64))) > from line #65 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 "PIL/Image.py", line 1214, in resize > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: _info(im.rotate(45)) > from line #67 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 "PIL/Image.py", line 1251, in rotate > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: map(_info, im.split()) > from line #69 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 "PIL/Image.py", line 1390, in split > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: len(im.convert("1").tobitmap()) > from line #71 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 "PIL/Image.py", line 615, in convert > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: len(im.tostring()) > from line #73 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 "PIL/Image.py", line 475, in tostring > self.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: > _info(im.transform((512, 512), Image.AFFINE, > (1,0,0,0,1,0))) > from line #75 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 "PIL/Image.py", line 1502, in transform > im.__transformer((0, 0)+size, self, method, > data, > resample, fill) > File "PIL/Image.py", line 1545, in __transformer > image.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: > _info(im.transform((512, 512), Image.EXTENT, > (32,32,96,96))) > from line #77 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 "PIL/Image.py", line 1502, in transform > im.__transformer((0, 0)+size, self, method, > data, > resample, fill) > File "PIL/Image.py", line 1545, in __transformer > image.load() > File "PIL/ImageFile.py", line 118, in load > Image.Image.load(self) > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d = ImageDraw.ImageDraw(im) > from line #83 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 "PIL/ImageDraw.py", line 58, in __init__ > im.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.line((0, 0, 128, 128), > fill=128) > from line #84 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: d.line((0, 128, 128, 0), > fill=128) > from line #85 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getextrema() > from line #86 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 "PIL/Image.py", line 838, in getextrema > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d = ImageDraw.ImageDraw(im) > from line #93 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 "PIL/ImageDraw.py", line 58, in __init__ > im.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, "#f00") > from line #94 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #95 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, "#ff0000") > from line #97 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #98 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, "rgb(255,0,0)") > from line #100 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #101 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, > "rgb(100%,0%,0%)") > from line #103 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #104 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, "hsl(0, 100%, > 50%)") > from line #106 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #107 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: d.rectangle(xy, "red") > from line #109 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 ? > NameError: name 'd' is not defined > ***************************************************************** > Failure in example: im.getpixel((0, 0)) > from line #110 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 "PIL/Image.py", line 884, in getpixel > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: im = ImageMath.eval("float(im + > 20)", im=im.convert("L")) > from line #116 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 "PIL/Image.py", line 615, in convert > self.load() > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access > ***************************************************************** > Failure in example: im.mode, im.size > from line #117 of selftest.testimage > Expected: ('F', (128, 128)) > Got: ('RGB', (128, 128)) > 1 items had failures: > 47 of 57 in selftest.testimage > ***Test Failed*** 47 failures. > *** 47 tests of 57 failed. > > Any hints on how to work-around this issue with > pixel_access ? > > Thanks, > Etienne > > > > > > -- > Etienne Robillard > JID: incidah AT njs.netlab.cz > YMS/MSN: granted14 AT yahoo.com > TEL: +1 514.962.7703 > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -- Etienne Robillard JID: incidah AT njs.netlab.cz YMS/MSN: granted14 AT yahoo.com TEL: +1 514.962.7703 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From fredrik at pythonware.com Thu Jun 29 22:55:05 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 29 Jun 2006 22:55:05 +0200 Subject: [Image-SIG] AttributeError: pixel_access In-Reply-To: <20060629201846.22659.qmail@web55604.mail.re4.yahoo.com> References: <20060629201846.22659.qmail@web55604.mail.re4.yahoo.com> Message-ID: Etienne Robillard wrote: > I've ran into this problem while upgrading from 1.1.5 > to 1.1.6. > >>>> import Image >>>> Image.VERSION() > '1.1.6a2-20060303' > > Here's the debug output, while running selftest.py: > > File "PIL/Image.py", line 561, in load > return self.im.pixel_access(self.readonly) > AttributeError: pixel_access looks like a botched or incomplete install; the selftest script picks up the Python files for 1.1.6, but the _imaging.so module for 1.1.5. (note that you cannot use a plain "build" followed by selftest; you need to either do a "build_ext -i", or do a full install). (using 1.1.6b1 instead of 1.1.6a2 is also a good idea). From granted14 at yahoo.com Thu Jun 29 23:43:34 2006 From: granted14 at yahoo.com (Etienne Robillard) Date: Thu, 29 Jun 2006 17:43:34 -0400 (EDT) Subject: [Image-SIG] AttributeError: pixel_access In-Reply-To: Message-ID: <20060629214334.54638.qmail@web55604.mail.re4.yahoo.com> --- Fredrik Lundh wrote: > Etienne Robillard wrote: > > > I've ran into this problem while upgrading from > 1.1.5 > > to 1.1.6. > > > >>>> import Image > >>>> Image.VERSION() > > '1.1.6a2-20060303' > > > > Here's the debug output, while running > selftest.py: > > > > File "PIL/Image.py", line 561, in load > > return self.im.pixel_access(self.readonly) > > AttributeError: pixel_access > > looks like a botched or incomplete install; the > selftest script picks up > the Python files for 1.1.6, but the _imaging.so > module for 1.1.5. Yup, thats was definitly a botched installation. :-) > (using 1.1.6b1 instead of 1.1.6a2 is also a good > idea). Okie! > Cheers, Etienne -- Etienne Robillard JID: incidah AT njs.netlab.cz YMS/MSN: granted14 AT yahoo.com TEL: +1 514.962.7703 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com