python-3.4 - 索引 PIL 图像

标签 python-3.4 python-imaging-library

PIL的图像坐标索引是否颠倒了?它索引为图像[列,行]吗?

我有一个使用 PIL(枕头)打开的图像

img = Image.open('picture.png').load()

当我尝试打印第一行第二列的像素值时

print(img[0,1])

获取第二行第一列的像素值

有人能解决这个问题吗?

最佳答案

太平船务 indexes images in Cartesian co-ordinates 。因此它的索引为 img[col, row]

关于python-3.4 - 索引 PIL 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44967819/

相关文章:

python - 从图像生成 bool 矩阵

python - 如何从 Python 3 中的当前目录中的文件导入?

python - 加密程序中索引的逻辑错误

python - pyodbc python 3.4 出现 cx_freeze 错误

没有额外模块的Python AES加密

python - 使用 Python Pillow 的镜头模糊效果

python - 如何从源代码构建 Python 3.4.6?

python - 转换图像灰度python错误

Python PSD 图层?

python - 将数组传递给顺序神经网络模型