Re: help for conversion of NUMARRAY to PIL object

2005-09-16 Thread A. L.
Sorry, I make the mistakes.  I have known how to use to/fromstring
method to interface between  PIL and Numarray.
And your code does work.

Another question. Just like the code you provide, is it possible to
directly load image data from PIL to Numarray array without use of
to/fromstring method? 

Thank you very much for your kindly help.

A.L.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help for conversion of NUMARRAY to PIL object

2005-09-15 Thread A. L.
Thanks. But some problems remain.

I have known using Image.tostring/fromstring and
numarray.tostring/fromstring can do the job. But when confronting
multi-spectral images, e.g., RGB color images, I don't know how to do
it. Could you give some advices on that?

You wrote In [14]: img = Image.frombuffer('RGBA', (256,256), a) , but
it seems that a cannot work in frombuffer.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: help for conversion of NUMARRAY to PIL object

2005-09-15 Thread Robert Kern
A. L. wrote:
 Thanks. But some problems remain.
 
 I have known using Image.tostring/fromstring and
 numarray.tostring/fromstring can do the job. But when confronting
 multi-spectral images, e.g., RGB color images, I don't know how to do
 it. Could you give some advices on that?

What's not working for you?

 You wrote In [14]: img = Image.frombuffer('RGBA', (256,256), a) , but
 it seems that a cannot work in frombuffer.

What do you mean that a cannot work in frombuffer? It certainly does
on my machine. Is it raising an exception on yours? If so, please post
the code that is causing the error and the exception that is raised and
the versions of PIL and numarray that you are using.

-- 
Robert Kern
[EMAIL PROTECTED]

In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die.
  -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list