开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜