开发者

python: image to 2-dimensional list

开发者 https://www.devze.com 2022-12-24 07:10 出处:网络
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 abilit

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

精彩评论

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

关注公众号