I'm trying to speed up the screenshot function in pyautogui since I only need a small portion of the screen. The region variable is supposedly the way to this a.k.a. pyautogui.screenshot(region=(0,0,400,300))
. However after doing some testing I found that no matter the size of the region it always takes the same amount of time to take the screenshot (~250ms).
Also when saving the screenshot to a file pyautogui.screenshot('dummy.png', region=(0,0,400,300))
the region variable does not seem to matter and the whole screen is saved regardless. Any ideas on why this is not working properly?
Running this on OS X