Re: [Numpy-discussion] Applying PIL patch
Hi Izak On Tue, Apr 1, 2008 at 10:08 AM, izak marais <[EMAIL PROTECTED]> wrote: > Stéfan wrote: > "Unfortunately, RGBA images cannot be read this way. " > Apparently it does not work with 16bit greyscale tif images either. > For anyone else stumbling upon this thread, there is a work-about to get the > data into a numpy array. > > i = Image.open('16bitGreyscaleImage.tif') > a = numpy.array(i.getdata()) # a 1d numpy array > a = a.reshape(i.size) #2d numpy array > > Perhaps there is a better way of doing it (?), but this works for me. Would you do me a favour and see whether the patch from the Image-SIG mailing list fixes your problem as well? If not, please mail me an example 16-bit greyscale tiff off-list, so that I can rework the patch. Thanks Stéfan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Applying PIL patch
Stéfan wrote:"Unfortunately, RGBA images cannot be read this way. " Apparently it does not work with 16bit greyscale tif images either. For anyone else stumbling upon this thread, there is a work-about to get the data into a numpy array. i = Image.open('16bitGreyscaleImage.tif') a = numpy.array(i.getdata())# a 1d numpy array a = a.reshape(i.size) #2d numpy array Perhaps there is a better way of doing it (?), but this works for me. Izak You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Applying PIL patch
Thank you for the reply. I in fact did not have the latest PIL binary. It works beautifully now. Luckily I won't be needing RGBA support soon. Izak - Original Message From: Stéfan van der Walt <[EMAIL PROTECTED]> To: Discussion of Numerical Python Sent: Monday, March 31, 2008 11:45:52 PM Subject: Re: [Numpy-discussion] Applying PIL patch Unfortunately, RGBA images cannot be read this way. A patch that fixes the issue was posted here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg01482.html No response from the Image SIG guys. Regards Stéfan On Mon, Mar 31, 2008 at 6:29 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > izak marais wrote: > > Sorry for the beginner question. I want to apply the PIL-numpy patch > > from http://www.scipy.org/Cookbook/PIL?highlight=%28PIL%29 . I have the > > latest windows binaries of numpy, scipy and PIL installed. > > Then you have the patch already-- it was added to the latest PIL. > > http://effbot.org/zone/pil-changes-116.htm > > -Chris ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Applying PIL patch
Unfortunately, RGBA images cannot be read this way. A patch that fixes the issue was posted here: http://www.mail-archive.com/[EMAIL PROTECTED]/msg01482.html No response from the Image SIG guys. Regards Stéfan On Mon, Mar 31, 2008 at 6:29 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > izak marais wrote: > > Sorry for the beginner question. I want to apply the PIL-numpy patch > > from http://www.scipy.org/Cookbook/PIL?highlight=%28PIL%29 . I have the > > latest windows binaries of numpy, scipy and PIL installed. > > Then you have the patch already-- it was added to the latest PIL. > > http://effbot.org/zone/pil-changes-116.htm > > -Chris ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] Applying PIL patch
izak marais wrote: > Sorry for the beginner question. I want to apply the PIL-numpy patch > from http://www.scipy.org/Cookbook/PIL?highlight=%28PIL%29 . I have the > latest windows binaries of numpy, scipy and PIL installed. Then you have the patch already-- it was added to the latest PIL. http://effbot.org/zone/pil-changes-116.htm -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Applying PIL patch
Hi all, Sorry for the beginner question. I want to apply the PIL-numpy patch from http://www.scipy.org/Cookbook/PIL?highlight=%28PIL%29 . I have the latest windows binaries of numpy, scipy and PIL installed. I searched python.org, but couldn't find info on applying patches. How do I apply the patch? Detailed instructions on the cookbook page would be appreciated... perhaps I should modify it to include any lucid responses to this email? Regards Izak OMG, Sweet deal for Yahoo! users/friends:Get A Month of Blockbuster Total Access, No Cost. W00t http://tc.deals.yahoo.com/tc/blockbuster/text2.com___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion