Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected -- how to report a bug ?

2008-11-21 Thread Jim Vickroy
Christopher Barker wrote: Jim Vickroy wrote: Ned Batchelder wrote: Yes, it definitely looks like a bug in fromarray. typestr is 'in my environment, and the check against typestr[1:] seems to recognize this. The line typestr = typestr[:2] should change, perhaps to: typestr = typest

Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected -- how to report a bug ?

2008-11-21 Thread Christopher Barker
Jim Vickroy wrote: Ned Batchelder wrote: Yes, it definitely looks like a bug in fromarray. typestr is 'my environment, and the check against typestr[1:] seems to recognize this. The line typestr = typestr[:2] should change, perhaps to: typestr = typestr[-2:] --Ned. http://nedbatch

Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected

2008-11-21 Thread Ned Batchelder
Yes, it definitely looks like a bug in fromarray. typestr is 'my environment, and the check against typestr[1:] seems to recognize this. The line typestr = typestr[:2] should change, perhaps to: typestr = typestr[-2:] --Ned. http://nedbatchelder.com Jim Vickroy wrote: Ned Batchelder

Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected

2008-11-21 Thread Ned Batchelder
I'm not sure exactly what you are trying to do here, but the issue has to do with the mapping of numpy array elements into pixels. Your code uses 32-bit ints, and fromarray defaults to "L" mode, which is 8-bit grayscale pixels. fromarray uses the shape of the array to create the shape of the

Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected -- how to report a bug ?

2008-11-21 Thread Jim Vickroy
Ned Batchelder wrote: Yes, it definitely looks like a bug in fromarray. typestr is 'my environment, and the check against typestr[1:] seems to recognize this. The line typestr = typestr[:2] should change, perhaps to: typestr = typestr[-2:] --Ned. http://nedbatchelder.com OK, I have

Re: [Image-SIG] going between numpy array and PIL.Image not behaving as expected

2008-11-21 Thread Jim Vickroy
Ned Batchelder wrote: I'm not sure exactly what you are trying to do here, but the issue has to do with the mapping of numpy array elements into pixels. Thanks for your clear and detailed reply and sorry for the vagueness of my posting; you did correctly read my mind! Your code uses 32-bit int

[Image-SIG] going between numpy array and PIL.Image not behaving as expected

2008-11-20 Thread Jim Vickroy
Hello all, I am having no success getting numpy and PIL to behave as expected when starting with a numpy array (see the attached script). Here is the output on my computer: Python version: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] numpy version: 1.2.1 PIL versi