有没有一种方法可以在Python中读取不涉及使用pil的BMP文件?PIL不适用于版本3,这是我的版本。我尝试使用graphics.py中的image对象,image(anchorpoint,filename),但这似乎只适用于gif文件。
最佳答案
在python中,它可以简单地理解为:
import os
from scipy import misc
path = 'your_file_path'
image= misc.imread(os.path.join(path,'image.bmp'), flatten= 0)
## flatten=0 if image is required as it is
## flatten=1 to flatten the color layers into a single gray-scale layer
关于python - 在Python中读取bmp文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10439104/