我正在用Python阅读PNG文件.我想要图像中每个像素的RGB值:
img = Image.open(path) pixels = img.load()
对于JPEG文件,像素是元组,但对于PNG,我得到一个整数.我应该如何使用Python读取PNG图像以获取像素值?
python png jpeg python-imaging-library
jpeg ×1
png ×1
python ×1
python-imaging-library ×1