python: image to 2-dimensional list
Is there a开发者_StackOverflow中文版 python lib that could make a 2-dimensional list of (R,G,B) data out of an image file?
You might want to take a look at the Python Imaging Library. It has the ability to be directly converted to a 2 by 2 by 3 numpy array:
from PIL import Image
import numpy
im = Image.open( filename )
data = numpy.asarray( im )
Or ImageMagick at http://wiki.python.org/moin/ImageMagick
精彩评论