Image to numeric array

Diez B. Roggisch deets at nospam.web.de
Mon Feb 13 11:43:35 EST 2006


> Is there a difference between the 'Numeric' and 'numeric' module?
> I have on my system only Numeric... And this has no function like
> 'from_image'.

I actually didn't check that - I just wanted to point the OP to the
numeric-module(s) available, as he suggested that 

>The usual way of doing such things is to use PIL (Python Image Library) 
>to load the image from file, then export it from PIL to a Python string 
>in order to import from this string to an array of the targeted 
>numerical module.

I'd go for the getdata() method instead.

>Really curious if there is a direct way in any of the numerical 
>packages, as it would save the time and effort of unnecessary 
>conversions from PIL, ImageMagick or from other image libraries.

Whatever module is capable of converting needs to know how to read images -
either by itself, or by means of another module. 


I know for sure that pygame supports retrieving pixel-data as array.

Diez



More information about the Python-list mailing list