PIL-object to NumPy

Travis Oliphant olipt at mayo.edu
Tue May 4 16:35:26 CEST 1999


> Hi,
> 
> I'm using Python Image Library (PIL) and NumPy.
> 
> I would like to open a image and make som imageprocessing on it. I would
> like to do the imageprocessing i NumPy, but I can't find out how to open af
> Image in NumPy??
> 
> Q1: How do I open a image so I can use it with NumPy??

I have had the same questions in the past.  It would be really nice to
have some way to access the underlying data as both a PIL object and a
NumPy array object.  

But, as it stands now you must use the tostring method of the PIL object
and the fromstring function in the Numeric module.

Best,

Travis






More information about the Python-list mailing list