From what I understand, pyautogui doesn't work properly when trying to get screenshots of my screen because I'm running Ubuntu 22.04 wayland. I saw somewhere that you could enable Xorg again and it should work fine... however, this solution is not ideal for me. Anyone knows any workaround for pyautogui to be able to capture proper screenshot? Below my code to get the screenshot, but when I check the "test.png" file, it's all black. import pyautogui as pg x1,y1 = 1525,312 x2,y2 = 1655,370 img = pg.screenshot(region=(x1,y1,x2,y2)) img.save("test.png") Continue reading...