I've been building a simple python program that uses pyautogui on Windows. All you need to know is that I need to look at some pixels, get their rgb values and compare them to some other rgb values (e.g. if rgb == (255, 0, 0): do_something()), it works just fine. Then I decided to try the program on Raspberry Pi (running the latest Raspberry Pi OS (bullseye)). Firstly I switched back from Wayland to X11, after that I was able to use pyautogui again, but the pixel values slightly differ from those on windows: when I measure the rgb value of a red object I get (255, 0, 0), but when I move the mouse around I get (255, 0, 1) which clearly messes up my code. What is happening and how do I fix it? Continue reading...