问题
Is PIL's image coordinate indexing reversed? Is it indexed as image[column, row]?
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
Can anyone clear this out?
回答1:
PIL indexes images in Cartesian co-ordinates. So it is indexed as img[col, row]
.
来源:https://stackoverflow.com/questions/44967819/indexing-a-pil-image