[Numpy-discussion] asarray() and PIL

cp lubensch.proletariat.inc at gmail.com
Wed May 27 11:50:13 EDT 2009


> > arr=asarray(img)
> > arr.shape
> > (1600,1900,3)

> No, it means that you have 1600 rows, 1900 columns and 3 colour channels.

According to scipy documentation at
http://pages.physics.cornell.edu/~myers/teaching/ComputationalMethods/python/arrays.html
you are right.

In this case I import numpy where according to
http://www.scipy.org/Tentative_NumPy_Tutorial and the Printing Arrays paragraph
(also in http://www.scipy.org/Numpy_Example_List#reshape reshape example) the
first number is the layer, the second the rows and the last the columns.

Are all the above valid or am I missing something?

Thanks 






More information about the NumPy-Discussion mailing list