[Numpy-discussion] PIL and NumPy
brady.mccary at gmail.com
Fri Jul 12 23:00:08 EDT 2013
I want to load images with PIL and then operate on them with NumPy.
According to the PIL and NumPy documentation, I would expect the
following to work, but it is not.
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import Image
>>> im = Image.open('big-0.png')
>>> ar = numpy.asarray(im)
array(<PIL.PngImagePlugin.PngImageFile image mode=LA size=2550x3300 at
By "not working" I mean that I would have expected the data to be
loaded/available in ar. PIL and NumPy/SciPy seem to be working fine
independently of each other. Any guidance?
More information about the NumPy-Discussion