索引PIL图像 [英] Indexing a PIL image
本文介绍了索引PIL图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PIL的图像坐标索引是否颠倒了?它被索引为image [column,row]吗?
Is PIL's image coordinate indexing reversed? Is it indexed as image[column, row]?
我有一个使用PIL(枕头)打开的图像
I have an image which I open using PIL (pillow)
img = Image.open('picture.png').load()
当我尝试打印第一行第二列的像素值
and when I try to print the pixel value of the first row, second column
print(img[0,1])
我得到第二行第一列的像素值
I get the pixel value of the 2nd row's first column
任何人都可以清除吗?
推荐答案
PIL 为笛卡尔坐标中的图像编制索引.因此它被索引为img[col, row]
.
PIL indexes images in Cartesian co-ordinates. So it is indexed as img[col, row]
.
这篇关于索引PIL图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文