What the bbox numbers mean

bbox=(left, top, right, bottom) is measured in screen pixels from the top-left corner of the primary monitor. Right and bottom are exclusive, so the capture is right - left pixels wide, the same rule as Image.crop(). Pick your real resolution above so the numbers match your screen.

Why captures come out small or shifted on Windows

With display scaling at 125% or 150%, Windows reports scaled coordinates to programs that have not declared themselves DPI-aware, so a bbox measured in real pixels captures the wrong area. The three lines under if sys.platform == "win32" declare per-monitor awareness before the first capture; they must run before any other window code.

Platform notes

WindowsmacOSLinux
grab()yesyes, after granting Screen Recording permission (Pillow runs screencapture)X11; otherwise gnome-screenshot, grim or spectacle
bbox unitspixels (with the DPI fix)points: Retina captures are 2× unless scale_down=True (Pillow 12.3+)pixels
all_screens=Trueyesnono
grabclipboard()yesyesneeds wl-paste or xclip

These details come from Pillow 13's own ImageGrab source, not from older guides. grabclipboard() returns an image, a list of file paths (when files were copied in a file manager), or None; the script handles all three.