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

Jim Vickroy Jim.Vickroy at noaa.gov
Thu Nov 20 23:15:47 CET 2008


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:

<output>
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 version:    1.1.6
numpy source array:
[[ 0  1  2  3]
 [ 4  5  6  7]
 [ 8  9 10 11]]
numpy source array shape: (3, 4)
PIL image size: (4, 3)
Traceback (most recent call last):
  File "C:\Documents and Settings\jim.vickroy\My 
Documents\Projects\GOES\SXI\__trials__\numpy-PIL.py", line 30, in <module>
    ''' % (extrema, image.getextrema())
AssertionError:
   numpy image extrema (minimum,maximum): (0, 11)
   PIL   image extrema (minimum,maximum): (0, 2)
</output>


I would appreciate pointers on what I'm doing incorrectly.

Thanks,
-- jv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy-PIL.py
Type: application/x-python
Size: 1194 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20081120/27c3af89/attachment.bin>


More information about the Image-SIG mailing list