First identify what “miss input” means. Pillow’s ImageGrab.grab() takes a screen image; it does not record keyboard or mouse events, and its documentation does not promise that the mouse pointer appears in the pixels. A click can also land correctly while your crop uses the wrong monitor coordinates, or the application may not have redrawn before the capture. The fix therefore depends on whether the problem is input delivery, timing, pointer visibility, a wrong region, or a platform capture limitation.
Start by separating input, redraw, and capture
After sending a click or keystroke, look at the desktop before saving the screenshot. If the application did not visibly change, debug focus, permissions, event delivery, or application timing outside ImageGrab. If the change is visible but missing from the file, continue with the capture checks below.
Use a short, reproducible test and record the operating system, desktop session, Python version, Pillow version, monitor arrangement, scaling settings, and the exact bbox. Those details determine which coordinate space and backend are involved.
Use a full-screen capture as the baseline
Remove cropping first. The documented default copies the entire screen:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Compatible with Nintendo Switch 2’s new GameChat mode
- Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
- Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
- Built-In Mic: The built-in microphone lets others hear you clearly during video calls
- Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
from PIL import ImageGrab
image = ImageGrab.grab()
image.save("full-screen.png")
print(image.size)
If the expected visual state appears in this file, the application and capture backend are working; your rectangle is wrong or expressed in a different coordinate system. If it is absent, investigate redraw timing, permissions, the desktop backend, layered windows, or the pointer-specific limitation.
Make bbox coordinates match the captured desktop
bbox=(left, top, right, bottom) selects a pixel rectangle. The points must be in the same screen-coordinate system as the image being captured. A common failure is mixing coordinates from a mouse API (virtual desktop coordinates) with a capture that represents only the primary monitor.
Normalize two points before creating the rectangle
from PIL import ImageGrab
def normalized_bbox(p1, p2):
x1, y1 = p1
x2, y2 = p2
left, right = sorted((x1, x2))
top, bottom = sorted((y1, y2))
if left == right or top == bottom:
raise ValueError("The selected rectangle has zero width or height")
return (left, top, right, bottom)
# Replace these with points from the same screen-coordinate API you use for clicks.
start = (100, 120)
end = (900, 700)
bbox = normalized_bbox(start, end)
image = ImageGrab.grab(bbox=bbox)
image.save("region.png")
Normalizing matters when the user drags from bottom-right to top-left. It does not, however, convert between monitor coordinate systems or DPI scaling; those must be handled by the platform and API you use to obtain the points.
Windows with more than one monitor
Try the Windows-only virtual-desktop option:
from PIL import ImageGrab
image = ImageGrab.grab(all_screens=True)
image.save("all-monitors.png")
print(image.size)
Pillow warns that the virtual desktop’s top-left can be negative. Its Windows implementation obtains an offset and crops a requested bbox relative to that offset. Consequently, points from GetCursorPos() or a click recorder, the two corners, and the bbox must all use the same virtual screen coordinates. Check the monitor layout in Display Settings, including monitors positioned left or above the primary display, and log the raw points before capture.
Rank #2
- Compatible with Nintendo Switch 2’s new GameChat mode
- Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
- The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
- C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
- The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
The practical symptom reported in Pillow issue #7898 was an inaccurate bounding box on a Windows 11 system with an external monitor (Python 3.12, Pillow 10.2.0; issue opened March 23, 2024). It shows that display and coordinate configuration can matter; it does not establish a universal defect in current Pillow. See the issue report for the original reproduction.
Windows layered windows
For a visual element supplied by a layered Windows window, try the narrowly targeted flag:
from PIL import ImageGrab
image = ImageGrab.grab(include_layered_windows=True)
image.save("layered.png")
include_layered_windows=True is specifically documented for layered windows. It is not a fix for missing keystrokes, a late repaint, a wrong monitor, or a missing pointer.
Wait for the visible result, not merely the input event
Automation libraries can return as soon as an event is posted, while the application paints later. Prefer a state-based wait (for example, poll for a known pixel or application-specific condition) over an arbitrary long sleep. For a minimal timing test:
Rank #3
- 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
- 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
- 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
- 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
import time
from PIL import ImageGrab
# send_click() is supplied by your automation library.
send_click()
time.sleep(0.2) # diagnostic only; tune for the application
shot = ImageGrab.grab()
shot.save("after-click.png")
If increasing the delay makes the result reliable, replace the fixed delay with a wait for the UI state and keep the capture on the same thread or synchronization path as the automation. A screenshot cannot contain a visual change that had not been painted when the pixels were read.
macOS: Retina scaling and Pillow version
Pillow documents Retina captures at 2× by default. A crop can therefore have twice the pixel dimensions you expected even when its logical coordinates are correct. Pillow 12.3.0 adds the keyword-only scale_down=True for bbox captures:
from PIL import ImageGrab
image = ImageGrab.grab(bbox=(100, 100, 900, 700), scale_down=True)
image.save("retina-crop.png")
Confirm the installed version before using that parameter. Window capture support was added on macOS in Pillow 12.1.0 and on Windows in 11.2.1, so code using window= also requires a sufficiently new Pillow release. Upgrade deliberately in a virtual environment and rerun the full-screen baseline after upgrading.
Linux: identify the display session and backend
Pillow supports Linux from version 7.1.0. With xdisplay=None, if the default X11 screen does not return a snapshot, Pillow may fall back to an installed gnome-screenshot, grim, or spectacle. Passing an empty display disables that fallback:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #4
- 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
- Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
- Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
- Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
- High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
from PIL import ImageGrab, features
print("XCB support:", features.check_feature("xcb"))
image = ImageGrab.grab(xdisplay=None)
image.save("linux-screen.png")
# Diagnostic: force no external fallback
image_no_fallback = ImageGrab.grab(xdisplay="")
image_no_fallback.save("linux-no-fallback.png")
Verify whether the process is running under X11 or Wayland, that the display environment is available to the process, and that any fallback utility is installed and permitted to capture the session. The documented path and fallbacks do not guarantee identical behavior for every Wayland desktop or application.
When the “missing input” is the mouse pointer
The ImageGrab documentation describes screen and clipboard image capture; it does not promise pointer inclusion. Do not treat all_screens, include_layered_windows, or scale_down as cursor-capture switches. First ask whether the pointer is actually required in the deliverable. If it is, collect the OS, desktop/session, Pillow version, capture mode, and a minimal reproduction, then select a platform-specific pointer-capable capture method. A full-screen image that contains the application but not the cursor is different from a crop that misses the application entirely.
A practical diagnostic checklist
- Confirm the click or keystroke changes the live display before capture.
- Save
ImageGrab.grab()with nobbox. - Log both selection points and normalize them so
left < rightandtop < bottom. - On multi-monitor Windows, test
all_screens=Trueand account for negative virtual coordinates. - Use
include_layered_windows=Trueonly for a layered Windows-window symptom. - On macOS, check Retina dimensions and whether Pillow is at least 12.3.0 for
scale_down. - On Linux, identify X11 versus Wayland, check XCB support, and test fallback utilities.
- For a pointer complaint, treat inclusion as an unresolved platform-specific requirement rather than assuming a flag exists.
Common failures and targeted fixes
| Symptom | Likely cause | Next action |
|---|---|---|
| The full screen is correct; the crop is shifted or empty. | bbox is in another monitor or scaling coordinate space. |
Capture all screens, log coordinates, normalize corners, and align the point and capture APIs. |
| Only the post-click state is missing. | The application has not repainted when the screenshot runs. | Wait for a visible state change, then capture; investigate focus if no change appears live. |
| A translucent or overlay window is absent on Windows. | It is a layered window. | Try include_layered_windows=True. |
| macOS crop dimensions are unexpectedly doubled. | Retina’s documented 2× capture scale. | Use logical-versus-pixel coordinates consistently; on Pillow 12.3.0 or newer test scale_down=True. |
| Linux capture works on one machine but not another. | Different display sessions, XCB support, or fallback utilities. | Check the session, features.check_feature("xcb"), display variables, and installed tools. |
| The application appears but the pointer does not. | Pointer inclusion is not promised by ImageGrab. | Use a capture method selected for your OS and pointer requirement. |
Performance, reliability, and repeatability
- Use the smallest correct
bboxonly after the full-screen baseline works; it reduces image memory and disk I/O. - For deterministic tests, fix the monitor arrangement, display scale, window position, theme, and browser zoom.
- Record Pillow and Python versions with every failure. New keyword arguments and window support are version-dependent.
- Save a diagnostic full-screen image and the coordinate log when a failure occurs; this distinguishes a bad rectangle from a bad backend.
- Do not infer capture success from an HTTP-style status or an input API return value: inspect the pixels you saved.
Or skip the browser setup
If your real goal is a dependable website image rather than a local desktop screenshot, ScreenshotNeo captures a URL through one request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the result in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
See the ScreenshotNeo API documentation for all 63 options, including full-page lazy-image loading, CSS-selector element capture, device and viewport controls, dark mode, Retina scale, PDF paper and page controls, custom CSS and JavaScript, click-before-capture, waits, request blocking, headers/cookies/user agent/Authorization, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed image links, async webhooks, bulk capture of up to 100 URLs per call, usage reporting, and the OpenAPI specification.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The Free plan includes 1,000 shots each month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to try it.
Best Value
- Compatible with Nintendo Switch 2’s new GameChat mode
- HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
- Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
- Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
- Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
FAQ
Does ImageGrab capture keyboard or mouse events?
No. It captures pixels. Use a separate input-automation tool and verify that the resulting visual state is painted before calling grab().
Why can a negative coordinate be valid?
On a Windows virtual desktop, a monitor placed left or above the primary display can make the virtual desktop’s origin negative. That is expected when all monitors are captured.
Should I always pass all_screens=True?
No. Use it when your rectangle or target window can be on another Windows monitor. For a primary-monitor-only workflow, first keep the coordinate space simple and validate a full-screen capture.
Free tools Windows power users keep installed
One-click scans. No signup required.
Is scale_down=True available on every Pillow release?
No. It is documented as a keyword-only option in Pillow 12.3.0. Check the installed version before using it.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

