From bentson at holmsjoen.com Sun Feb 5 02:57:15 2012 From: bentson at holmsjoen.com (Randolph Bentson) Date: Sat, 4 Feb 2012 17:57:15 -0800 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> Message-ID: <20120205015715.GB21082@holmsjoen.com> Oh, I guess the lambda function should be generalized by (lo,hi) = outI.getextrema() x = 256.0/(hi-lo) y = (0-lo)/256.0 outJ = outI.point(lambda i:i*x+y) -- Randolph Bentson bentson at holmsjoen.com From bentson at holmsjoen.com Sun Feb 5 02:47:23 2012 From: bentson at holmsjoen.com (Randolph Bentson) Date: Sat, 4 Feb 2012 17:47:23 -0800 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> Message-ID: <20120205014723.GA21082@holmsjoen.com> On Tue, Jan 31, 2012 at 01:38:25PM -0500, Nelson Tong wrote: > > when I use "show()", the image appears to have an all-white > background, nothing else is on it. ... > Attached is example image which I am having problem with. Can you > reproduce the same problem I'm seeing with this image, possibly due to > the png image being broken? ... > > Try this: > > > > outI = Image.open( fileOutPNGFile ) There's some faulty magic at the core of this problem. When the file you cited goes through "outI = Image.open( fileOutPNGFile )", the open method notes all the pixels are shades of gray, so the internal image is converted to a grayscale form. For example, "outI.getbands()" reports "('I',)" instead of "('R','G','B')". The command "outI.getextrema()" returns (8200,60602). So when the image is saved as a pbm file for display, the shades of gray are all rendered as white when all the pixels are being converted to the (R,G,B) value of (255,255,255). This flaw is related to the conversion of the grayscale format. If one executes "outI.save("altfile.png") the resulting file looks like the original (for some reason), but "tmpJ.getpixel((x,y))" where "tmpJ=outI.convert("RGB")" returns (255,255,255) for all x,y. If you insert the line "outI = outI.point(lambda i:i * .0039062500 + 0)" the I mode gets scaled down so the conversion to 'RGB' mode is valid. -- Randolph Bentson bentson at holmsjoen.com From tongsnelson.ise at gmail.com Wed Feb 8 19:26:40 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Wed, 8 Feb 2012 13:26:40 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: <1328440836.2011.25.camel@localhost> References: <1327862282.9555.4.camel@localhost> <1328440836.2011.25.camel@localhost> Message-ID: thanks for the replies, everyone I think I am going to try do what i need to do using jpg instead of png for now. The funny thing is this piece of code I am now trying to run used to work with those kind of gel png in the past when I have this installed in an old server: python-imaging-devel-1.1.6-3.fc7 On 2/5/12, Matthias Bock wrote: > It really is a PNG and it's 16-bit grayscale. > > $ file gcp.png > gcp.png: PNG image data, 1024 x 768, 16-bit grayscale, non-interlaced > > I can reproduce, the blank white show() output, > which clearly is a bug in PIL. > > PIL opens it in "I" mode > print im.mode > which means "integer", but I don't know whether this is correct > or not. Maybe "I;16" or so could be tried. > See http://svn.effbot.org/public/tags/pil-1.1.4/libImaging/Unpack.c > for possible modes. > > QuickFix: Make a JPG. > > ... > im = Image.open('gcp.jpg') > ... > > Have a nice day, > Matthias > > Am Samstag, den 04.02.2012, 10:58 -0500 schrieb Chris Mitchell: >> Hey Nelson, >> >> Are you sure this image isn't actually a tiff (Every gel scanner I've ever >> used outputs tiffs)? Also, is it opening as an 8 bit image or a 16 bit? >> For a gel scan, it should be a 16 bit image, so you can consider forcing >> the mode while opening it.. >> >> Chris >> >> On Tue, Jan 31, 2012 at 1:38 PM, Nelson Tong >> wrote: >> >> > thanks for reply, Matthias, >> > >> > when I use "show()", the image appears to have an all-white >> > background, nothing else is on it. The size does indeed match the png >> > size , I used the following to confirm: >> > >> > x, y = outIm.size >> > print "size of outImg: " + str(x)+" " + str(y); >> > >> > I tries to resave the png as a png image with a different name using >> > PIL and show() of the 2nd png image still appear to have all-white >> > background with nothing on it. >> > >> > but If I open the images (both the 1st and the re-saved image ) with >> > the command line command of "display", I can see the images via >> > ImageMagick. >> > >> > Attached is example image which I am having problem with. Can you >> > reproduce the same problem I'm seeing with this image, possibly due to >> > the png image being broken? >> > >> > -N. >> > >> > >> > On 1/29/12, Matthias Bock wrote: >> > > Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong: >> > > >> > >> outI = Image.open( fileOutPNGFile ) >> > >> outI.show(); >> > >> >> > >> The code run without error, but the image return via X-windows on my >> > >> linux machine is a blank image, without visible graphic on it. >> > > >> > > What color is this "blank": Grey? White? >> > > Does the size match the PNG size? >> > > >> > >> I am 100% positive that the image of fileOutPNGFile is not corrupted >> > >> because I am able to open it via the web-browser. >> > > >> > > Web browsers can open corrupted image files. >> > > >> > >> I tried the same code another to open another png file which I use >> > >> PIL to draw and save as png. The code above is able to open and >> > >> show >> > >> this png file properly. >> > > >> > > Sounds to me, as if the first PNG was broken. >> > > >> > > Try this: >> > > >> > > outI = Image.open( fileOutPNGFile ) >> > > outI.show() >> > > outI.save('test.png') >> > > out2 = Image.open('test.png') >> > > out2.show() >> > > >> > >> why might this happen? >> > > >> > > If the code doesn't help solving the issue, >> > > could you send the PNG to the list? >> > > >> > > Cheers, Matthias >> > > >> > > > > > From tongsnelson.ise at gmail.com Wed Feb 8 20:31:37 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Wed, 8 Feb 2012 14:31:37 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: <20120205015715.GB21082@holmsjoen.com> References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> Message-ID: Thanks Randolph. this solution does indeed work for me. The mapping function just manages to manipulate the pixel values enough so that png image can be opened and be pasted onto other images without become blank. lambda i:i * .0039062500 + 0 how important is the use of the generalized mapping function in here? does the scale and offset of function definitely needs to be adjusted if every image I want to process is similar to each other in terms of min and max values? On 2/4/12, Randolph Bentson wrote: > Oh, I guess the lambda function should be generalized by > > (lo,hi) = outI.getextrema() > x = 256.0/(hi-lo) > y = (0-lo)/256.0 > outJ = outI.point(lambda i:i*x+y) > > -- > Randolph Bentson > bentson at holmsjoen.com > From bentson at holmsjoen.com Thu Feb 9 01:39:03 2012 From: bentson at holmsjoen.com (Randolph Bentson) Date: Wed, 8 Feb 2012 16:39:03 -0800 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> Message-ID: <20120209003903.GA17820@holmsjoen.com> On Wed, Feb 08, 2012 at 02:31:37PM -0500, Nelson Tong wrote: > Thanks Randolph. > > this solution does indeed work for me. The mapping function just > manages to manipulate the pixel values enough so that png image can be > opened and be pasted onto other images without become blank. > > lambda i:i * .0039062500 + 0 > > how important is the use of the generalized mapping function in here? > does the scale and offset of function definitely needs to be adjusted > if every image I want to process is similar to each other in terms of > min and max values? > > On 2/4/12, Randolph Bentson wrote: > > Oh, I guess the lambda function should be generalized by > > > > (lo,hi) = outI.getextrema() > > x = 256.0/(hi-lo) > > y = (0-lo)/256.0 > > outJ = outI.point(lambda i:i*x+y) I have no experience with these type images, so I don't know if constant values are appropriate. The performance of the generalized mapping seems quick enough, so that may be safer. BUT, there's one questionable issue with this function: it turns the darkest source pixel to black and the lightest pixel to white. I hope others can provide some comments on that. -- Randolph Bentson bentson at holmsjoen.com From tongsnelson.ise at gmail.com Thu Feb 9 18:16:08 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Thu, 9 Feb 2012 12:16:08 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: <20120209003903.GA17820@holmsjoen.com> References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> <20120209003903.GA17820@holmsjoen.com> Message-ID: >> >> On 2/4/12, Randolph Bentson wrote: >> > Oh, I guess the lambda function should be generalized by >> > >> > (lo,hi) = outI.getextrema() >> > x = 256.0/(hi-lo) >> > y = (0-lo)/256.0 >> > outJ = outI.point(lambda i:i*x+y) > > I have no experience with these type images, so I don't know if > constant values are appropriate. The performance of the generalized > mapping seems quick enough, so that may be safer. BUT, there's > one questionable issue with this function: it turns the darkest > source pixel to black and the lightest pixel to white. I hope > others can provide some comments on that. I'm not an expert in image processing. I just want to learn more about this since we are talking about the mapping function here. I don't quite completely understand how this generalized mapping function work with im.point(). Given the hi and lo from getextema(), I understand that x = 256.0/(hi-lo) is a way to to adjust the scale parameter to the have a range of values from 0 to 256. but where does the offset of (y= (0-lo) /256 ) comes from ? is there any reference anyone can recommend as a tutorial about this kind of mapping function? > > -- > Randolph Bentson > bentson at holmsjoen.com > From bentson at holmsjoen.com Thu Feb 9 23:48:01 2012 From: bentson at holmsjoen.com (Randolph Bentson) Date: Thu, 9 Feb 2012 14:48:01 -0800 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> <20120209003903.GA17820@holmsjoen.com> Message-ID: <20120209224801.GA22670@holmsjoen.com> On Thu, Feb 09, 2012 at 12:40:49PM -0500, Chris Mitchell wrote: > For a linear equation, you would want do use this: > > outJ = outI.point(lambda i:(i-y)*x) I think this should be outJ = outI.point(lambda i:(i-lo)*x), but the point conversion method doesn't deal with these lambda definitions. My definition of y should have been "y = -lo*x" which brings my code to an algebraic equivalent to what I think Chris intends. This point conversion is only appropriate for use of the show method of the new image. Although outJ.show() creates a properly formed Netpbm PGM "rawbits" image, if outJ is saved, the resulting grayscale png file is black because it's a grayscale image which has been scaled down a lot. The single statement outI.point(lambda i:i*x+y).show() avoids the temptation to save the rescaled image. :-) ----------------------------------------------------- Although this design gives a non-white image, it is flawed in that the displayed image has greater contrast than the original. This is because the image under discussion doesn't use the full 16 bit "I" mode range of 0 to 65535. My code maps a lesser source range to 0 to 255 instead of 32 to 236 which would preserve the contrast. So I propose a revised solution scale = 256.0/2**16 outI.point(lambda i:i*scale+0).show() This relies on the "I" mode image having 16 bit pixels. I couldn't find a way to determine the source pixel size in PIL. The description of "I" mode in pil-handbook.pdf says it's 32 bit, which suggests other grayscale files may use other pixel sizes. -- Randolph Bentson bentson at holmsjoen.com From chris.mit7 at gmail.com Sat Feb 4 16:58:40 2012 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Sat, 4 Feb 2012 10:58:40 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> Message-ID: Hey Nelson, Are you sure this image isn't actually a tiff (Every gel scanner I've ever used outputs tiffs)? Also, is it opening as an 8 bit image or a 16 bit? For a gel scan, it should be a 16 bit image, so you can consider forcing the mode while opening it.. Chris On Tue, Jan 31, 2012 at 1:38 PM, Nelson Tong wrote: > thanks for reply, Matthias, > > when I use "show()", the image appears to have an all-white > background, nothing else is on it. The size does indeed match the png > size , I used the following to confirm: > > x, y = outIm.size > print "size of outImg: " + str(x)+" " + str(y); > > I tries to resave the png as a png image with a different name using > PIL and show() of the 2nd png image still appear to have all-white > background with nothing on it. > > but If I open the images (both the 1st and the re-saved image ) with > the command line command of "display", I can see the images via > ImageMagick. > > Attached is example image which I am having problem with. Can you > reproduce the same problem I'm seeing with this image, possibly due to > the png image being broken? > > -N. > > > On 1/29/12, Matthias Bock wrote: > > Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong: > > > >> outI = Image.open( fileOutPNGFile ) > >> outI.show(); > >> > >> The code run without error, but the image return via X-windows on my > >> linux machine is a blank image, without visible graphic on it. > > > > What color is this "blank": Grey? White? > > Does the size match the PNG size? > > > >> I am 100% positive that the image of fileOutPNGFile is not corrupted > >> because I am able to open it via the web-browser. > > > > Web browsers can open corrupted image files. > > > >> I tried the same code another to open another png file which I use > >> PIL to draw and save as png. The code above is able to open and show > >> this png file properly. > > > > Sounds to me, as if the first PNG was broken. > > > > Try this: > > > > outI = Image.open( fileOutPNGFile ) > > outI.show() > > outI.save('test.png') > > out2 = Image.open('test.png') > > out2.show() > > > >> why might this happen? > > > > If the code doesn't help solving the issue, > > could you send the PNG to the list? > > > > Cheers, Matthias > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthiasbock at users.sourceforge.net Sun Feb 5 12:20:36 2012 From: matthiasbock at users.sourceforge.net (Matthias Bock) Date: Sun, 05 Feb 2012 12:20:36 +0100 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> Message-ID: <1328440836.2011.25.camel@localhost> It really is a PNG and it's 16-bit grayscale. $ file gcp.png gcp.png: PNG image data, 1024 x 768, 16-bit grayscale, non-interlaced I can reproduce, the blank white show() output, which clearly is a bug in PIL. PIL opens it in "I" mode print im.mode which means "integer", but I don't know whether this is correct or not. Maybe "I;16" or so could be tried. See http://svn.effbot.org/public/tags/pil-1.1.4/libImaging/Unpack.c for possible modes. QuickFix: Make a JPG. $ convert gcp.png gcp.jpg ... im = Image.open('gcp.jpg') ... Have a nice day, Matthias Am Samstag, den 04.02.2012, 10:58 -0500 schrieb Chris Mitchell: > Hey Nelson, > > Are you sure this image isn't actually a tiff (Every gel scanner I've ever > used outputs tiffs)? Also, is it opening as an 8 bit image or a 16 bit? > For a gel scan, it should be a 16 bit image, so you can consider forcing > the mode while opening it.. > > Chris > > On Tue, Jan 31, 2012 at 1:38 PM, Nelson Tong wrote: > > > thanks for reply, Matthias, > > > > when I use "show()", the image appears to have an all-white > > background, nothing else is on it. The size does indeed match the png > > size , I used the following to confirm: > > > > x, y = outIm.size > > print "size of outImg: " + str(x)+" " + str(y); > > > > I tries to resave the png as a png image with a different name using > > PIL and show() of the 2nd png image still appear to have all-white > > background with nothing on it. > > > > but If I open the images (both the 1st and the re-saved image ) with > > the command line command of "display", I can see the images via > > ImageMagick. > > > > Attached is example image which I am having problem with. Can you > > reproduce the same problem I'm seeing with this image, possibly due to > > the png image being broken? > > > > -N. > > > > > > On 1/29/12, Matthias Bock wrote: > > > Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong: > > > > > >> outI = Image.open( fileOutPNGFile ) > > >> outI.show(); > > >> > > >> The code run without error, but the image return via X-windows on my > > >> linux machine is a blank image, without visible graphic on it. > > > > > > What color is this "blank": Grey? White? > > > Does the size match the PNG size? > > > > > >> I am 100% positive that the image of fileOutPNGFile is not corrupted > > >> because I am able to open it via the web-browser. > > > > > > Web browsers can open corrupted image files. > > > > > >> I tried the same code another to open another png file which I use > > >> PIL to draw and save as png. The code above is able to open and show > > >> this png file properly. > > > > > > Sounds to me, as if the first PNG was broken. > > > > > > Try this: > > > > > > outI = Image.open( fileOutPNGFile ) > > > outI.show() > > > outI.save('test.png') > > > out2 = Image.open('test.png') > > > out2.show() > > > > > >> why might this happen? > > > > > > If the code doesn't help solving the issue, > > > could you send the PNG to the list? > > > > > > Cheers, Matthias > > > > > > From chris.mit7 at gmail.com Thu Feb 9 18:40:49 2012 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Thu, 9 Feb 2012 12:40:49 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> <20120209003903.GA17820@holmsjoen.com> Message-ID: >From my understanding of what you are trying to do is remap the dynamic range of your image. So in essence you want to set your lowest intensity to 0 and the highest to 256 (given an 8 bit image). The transformation given is non-linear, if you are using this for gel quantification this is a very very very bad idea. If it's just screwing around, then it's fine. So first you say what is the range, (hi-lo), and divide 256 by this to give your effective intensity per value within your range (so taking a low of 100, a max of 250, each 'point' now represents 1.70 intensity). You also want to subtract the lowest intensity from each point to make your new effective "0 intensity". This is done dynamically by your given y equation. For a linear equation, you would want do use this: outJ = outI.point(lambda i:(i-y)*x) So all pixels which were 100 should now map to 0, a pixel of 250 would map to 255. On Thu, Feb 9, 2012 at 12:16 PM, Nelson Tong wrote: > >> > >> On 2/4/12, Randolph Bentson wrote: > >> > Oh, I guess the lambda function should be generalized by > >> > > >> > (lo,hi) = outI.getextrema() > >> > x = 256.0/(hi-lo) > >> > y = (0-lo)/256.0 > >> > outJ = outI.point(lambda i:i*x+y) > > > > I have no experience with these type images, so I don't know if > > constant values are appropriate. The performance of the generalized > > mapping seems quick enough, so that may be safer. BUT, there's > > one questionable issue with this function: it turns the darkest > > source pixel to black and the lightest pixel to white. I hope > > others can provide some comments on that. > > I'm not an expert in image processing. I just want to learn more > about this since we are talking about the mapping function here. > > I don't quite completely understand how this generalized mapping > function work with im.point(). Given the hi and lo from getextema(), > I understand that x = 256.0/(hi-lo) > is a way to to adjust the scale parameter to the have a range of > values from 0 to 256. but where does the offset of (y= (0-lo) /256 ) > comes from ? is there any reference anyone can recommend as a tutorial > about this kind of mapping function? > > > > > > > > > > > > -- > > Randolph Bentson > > bentson at holmsjoen.com > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.mit7 at gmail.com Fri Feb 10 01:07:39 2012 From: chris.mit7 at gmail.com (Chris Mitchell) Date: Thu, 9 Feb 2012 19:07:39 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: <20120209224801.GA22670@holmsjoen.com> References: <1327862282.9555.4.camel@localhost> <20120205015715.GB21082@holmsjoen.com> <20120209003903.GA17820@holmsjoen.com> <20120209224801.GA22670@holmsjoen.com> Message-ID: I did mean to subtract -lo. I used y because the initial definition used y as the lowest point. For your second comment, I don't get the difference. you still have 256 separate gradations. On Thu, Feb 9, 2012 at 5:48 PM, Randolph Bentson wrote: > On Thu, Feb 09, 2012 at 12:40:49PM -0500, Chris Mitchell wrote: > > For a linear equation, you would want do use this: > > > > outJ = outI.point(lambda i:(i-y)*x) > > I think this should be outJ = outI.point(lambda i:(i-lo)*x), but the > point conversion method doesn't deal with these lambda definitions. > My definition of y should have been "y = -lo*x" which brings my > code to an algebraic equivalent to what I think Chris intends. > > This point conversion is only appropriate for use of the show > method of the new image. Although outJ.show() creates a properly > formed Netpbm PGM "rawbits" image, if outJ is saved, the resulting > grayscale png file is black because it's a grayscale image which > has been scaled down a lot. > > The single statement > outI.point(lambda i:i*x+y).show() > avoids the temptation to save the rescaled image. :-) > > ----------------------------------------------------- > > Although this design gives a non-white image, it is flawed in that > the displayed image has greater contrast than the original. This > is because the image under discussion doesn't use the full 16 bit > "I" mode range of 0 to 65535. My code maps a lesser source range > to 0 to 255 instead of 32 to 236 which would preserve the contrast. > > So I propose a revised solution > scale = 256.0/2**16 > outI.point(lambda i:i*scale+0).show() > > This relies on the "I" mode image having 16 bit pixels. I couldn't > find a way to determine the source pixel size in PIL. The description > of "I" mode in pil-handbook.pdf says it's 32 bit, which suggests > other grayscale files may use other pixel sizes. > > -- > Randolph Bentson > bentson at holmsjoen.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yaoyansi2 at yahoo.com.cn Sat Feb 11 03:19:31 2012 From: yaoyansi2 at yahoo.com.cn (yaoyansi) Date: Sat, 11 Feb 2012 10:19:31 +0800 (CST) Subject: [Image-SIG] [PIL]Problem when I install PIL on WinXP as non-admin Message-ID: <1328926771.87520.YahooMailNeo@web15605.mail.cnb.yahoo.com> Hi all, I installed python-2.6.5.msi on my WinXP long time ago, Today I installed PIL-1.1.7.win32-py2.6.exe as non-admin. Then I make a simple test: >python >>> import Image Traceback (most recent call last): ? File "", line 1, in ImportError: No module named Image Then I logon as the admin,and run the following command >python >>> import Image It is fine, there is no any complain any more. But there must be something wrong when I install PIL as non-admin, how to install PIL as a non-admin? Regards yaoyansi From ashz at walla.co.il Wed Feb 15 21:10:05 2012 From: ashz at walla.co.il (ashz) Date: Wed, 15 Feb 2012 12:10:05 -0800 (PST) Subject: [Image-SIG] Otsu's method Message-ID: <1329336605146-4473761.post@n6.nabble.com> Hi, Does PIL have a bulit in method for Otsu's method thresholding? Thanks -- View this message in context: http://python.6.n6.nabble.com/Otsu-s-method-tp4473761p4473761.html Sent from the Python - image-sig mailing list archive at Nabble.com. From b.family at mac.com Sun Feb 19 22:08:59 2012 From: b.family at mac.com (Barry Barnett) Date: Sun, 19 Feb 2012 13:08:59 -0800 Subject: [Image-SIG] How do you install PIL? Message-ID: <5B130E73-2B05-4BBE-8BC0-FD72CCE61399@mac.com> Hi. I'm trying to install pyTivo on my Mac and it says it needs the PIL for publish photos on my TIvo. Which version do I download and how do I install it? I'm running a Macbook Pro with Intel core i7 processor. Thanks. From dcdavemail at gmail.com Sun Feb 26 14:41:00 2012 From: dcdavemail at gmail.com (David Craig) Date: Sun, 26 Feb 2012 13:41:00 +0000 Subject: [Image-SIG] Problem installing PIL Message-ID: Hi, I recently installed basemap and python imaging library on my laptop. I have an i686 machine with fedora 16 on it. I just tried some test plots and basemap seems to work fine but according to the documentation to use the bluemarble(), etopo(), shadedrelief() and warpimage() instance methods I need PIL. SO I installed it via yum, $ sudo yum install python-imaging.i686 however only the bluemarble method works. If I try any of the others I get the following error. AttributeError Traceback (most recent call last) /usr/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where) 173 else: 174 filename = fname --> 175 __builtin__.execfile(filename, *where) /home/davcra/Desktop/python_scripts/blue_marble.py in () 10 11 ---> 12 m.shadedrelief() 13 plt.show() AttributeError: 'Basemap' object has no attribute 'shadedrelief' Anyone know what I did wrong???? Thanks David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jtlz2 at astro.columbia.edu Mon Feb 27 11:04:36 2012 From: jtlz2 at astro.columbia.edu (Jonathan Zwart) Date: Mon, 27 Feb 2012 10:04:36 +0000 Subject: [Image-SIG] python ImageTk.PhotoImage - segfault In-Reply-To: References: Message-ID: Hi, I wonder if anyone can reproduce and solve the following bug: http://stackoverflow.com/questions/9142786/python-imagetk-photoimage-segfault This is for an out-of-the-box enthought python distribution installation. It's been cross-posted at http://mail.python.org/pipermail/tkinter-discuss/2012-February/003057.html and on the EPD mailing list but so far in vain. Many thanks, Jonathan Zwart -------------- next part -------------- An HTML attachment was scrubbed... URL: