To get the RGB values from a pixel of the screen with coordinates (x,y) in Python, I do:
import PIL.ImageGrab
rgb = PIL.ImageGrab.grab().load()[x,y]
It was working as I expected until I did:
rgb = PIL.ImageGrab.grab().load()[1673,0]
Instead of the RGB values of the pixel, I received:
IndexError: image index out of range
I don't understand why because my screen has 1920x1080 resolution.
How can I fix this?