索引PIL图像

Anj*_*ali 5 python-imaging-library pillow python-3.4

PIL的图像坐标索引是否颠倒了?它被索引为image [column,row]吗?

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

img = Image.open('picture.png').load()
Run Code Online (Sandbox Code Playgroud)

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

print(img[0,1])
Run Code Online (Sandbox Code Playgroud)

我得到第二行第一列的像素值

谁能解决这个问题?

Anj*_*ali 6

PIL 在笛卡尔坐标中索引图像。因此它被索引为img[col, row]