Recommended Free Tools
Use PyAutoGUI for the simplest desktop screenshot: install it, call pyautogui.screenshot(), and save the returned Pillow image. The same library can capture a rectangle. Pillow’s ImageGrab is useful when your program already uses Pillow, while MSS is a good choice for monitor selection and direct pixel data.
Capture and save the entire desktop with PyAutoGUI
Install PyAutoGUI in the Python environment that will run the script:
python -m pip install pyautogui
PyAutoGUI documents Pillow as a screenshot dependency. On Linux, follow its current operating-system instructions for capture packages such as scrot and Tkinter; the exact packages depend on your distribution and installed version.
This complete example captures the visible desktop and writes a PNG:
#1 Best Overall
- [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
- [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
- [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
- [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
- [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)
import pyautogui
image = pyautogui.screenshot()
image.save("screenshot.png")
print(f"Saved {image.width}x{image.height} image to screenshot.png")
screenshot() returns a Pillow image, so you can inspect, crop, annotate, or convert it before saving. If you do not need the intermediate variable, the documented shorthand is:
import pyautogui
pyautogui.screenshot("screenshot.png")
The file format is inferred from the filename. Use a .png extension for lossless output, .jpg for JPEG, or another format supported by Pillow.
Capture only part of the screen
PyAutoGUI: width-and-height region
Pass region=(left, top, width, height). Coordinates are measured from the desktop’s top-left origin:
import pyautogui
image = pyautogui.screenshot(region=(100, 100, 640, 480))
image.save("region.png")
This captures a 640-by-480 rectangle whose upper-left corner is at (100, 100). A negative coordinate may be meaningful on a multi-monitor desktop, but support depends on the platform and capture backend; verify the result on the target setup.
Pillow ImageGrab: endpoint bounding box
Pillow’s ImageGrab.grab() captures the screen as a Pillow image. Its bbox uses endpoints: (left, top, right, bottom), not width and height.
Rank #2
- Model: Dell OptiPlex 7050 Small Form Factor (SFF)
- Processor: Intel Core i7-7700 3.60 GHz
- Memory: 32GB DDR4 Ram
- Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
- Operating System: Windows 11 Pro (64-bit)
from PIL import ImageGrab
image = ImageGrab.grab(bbox=(100, 100, 740, 580))
image.save("region.png")
The two examples describe the same rectangle: 100 + 640 = 740 and 100 + 480 = 580. This difference is a common source of incorrectly sized images.
Choose the right Python capture library
| Approach | Best fit | Result | Selection syntax | Important dependencies or limits |
|---|---|---|---|---|
| PyAutoGUI | A beginner script or a program that also controls the mouse and keyboard | Pillow image | region=(left, top, width, height) |
Requires Pillow; platform-specific capture setup applies |
Pillow ImageGrab |
Code already built around Pillow, or documented bounding-box, window, or multi-screen options | Pillow image | bbox=(left, top, right, bottom) |
Behavior differs by operating system; Linux may use gnome-screenshot, grim, or spectacle fallback tools |
| MSS | Choosing a monitor or region and working with raw pixels | MSS screenshot data; convert with to_pil() |
Monitor or region mapping supplied to grab() |
Check the current examples for the installed MSS version and display backend |
There is no reliable universal speed winner from these documented descriptions. If throughput matters, measure the library on your operating system, display session, resolution, and workload rather than treating an old illustrative timing as a current benchmark.
Use Pillow directly
Install Pillow when it is not already present:
python -m pip install Pillow
Then capture the full desktop:
from PIL import ImageGrab
image = ImageGrab.grab()
image.save("desktop.png")
ImageGrab’s documentation also covers platform-specific multi-screen and window capture behavior. Keep those options conditional on the operating system and Pillow version you deploy.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteSelect a monitor or access pixels with MSS
Install MSS and Pillow for the conversion shown below:
python -m pip install mss Pillow
from mss import MSS
with MSS() as sct:
# monitors[1] is commonly the first physical monitor; inspect the
# current MSS documentation and your environment for the exact layout.
image_data = sct.grab(sct.monitors[1])
image = image_data.to_pil()
image.save("monitor.png")
MSS is also suitable when you want to process pixel buffers directly instead of immediately creating a Pillow image. For a region, pass a monitor-like dictionary containing the region coordinates to grab(), using the syntax documented by your installed version.
Rank #3
- IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
- POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
- GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
- ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
- ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.
Make screenshots predictable in real scripts
Create unique, dated filenames
from datetime import datetime
from pathlib import Path
import pyautogui
folder = Path("screenshots")
folder.mkdir(exist_ok=True)
name = datetime.now().strftime("desktop-%Y%m%d-%H%M%S.png")
path = folder / name
pyautogui.screenshot().save(path)
print(path.resolve())
Using a directory and timestamp avoids silently overwriting the previous capture.
Verify dimensions and mode
import pyautogui
image = pyautogui.screenshot()
print("size:", image.size, "mode:", image.mode)
image.save("checked.png")
On macOS, Pillow documents Retina captures at 2× size by default and a scale_down=True option for 1× output. macOS captures may be RGBA, while other platforms commonly return RGB. Check the returned dimensions before translating desktop coordinates into image pixels.
Capture after a UI change
For a deterministic automation sequence, perform the action, wait for the application to update, then capture. A fixed delay is simple but environment-dependent; when possible, wait for an application-specific condition before taking the image. Screenshot libraries do not guarantee that a remote window, animation, or compositor has finished rendering.
Platform and session considerations
- Windows: Use the current installation guidance for the selected package and ensure the script runs in an interactive desktop session.
- macOS: Privacy controls can deny screen recording. If the result is blank or an exception reports denied access, review the current Screen Recording permission for the terminal, IDE, or Python launcher that actually runs the script.
- Linux: Capture behavior depends on X11 or Wayland, the desktop environment, and the library’s backend. PyAutoGUI documents Linux-specific requirements; Pillow documents fallback programs including
gnome-screenshot,grim, andspectaclefor cases where its default X11 path does not return an image. - Headless or remote sessions: A process without an available graphical display may have nothing to capture. Provide an appropriate virtual or forwarded display, or use an application-rendering method instead of assuming a physical desktop exists.
Troubleshoot blank, wrong, or missing screenshots
ModuleNotFoundError
Install the package into the same interpreter that runs the script: python -m pip install pyautogui, python -m pip install Pillow, or python -m pip install mss Pillow. In an IDE, check its selected interpreter rather than a separate system Python.
Linux reports a missing capture utility
Read the current instructions for your distribution and chosen library. Do not assume a package required by PyAutoGUI is also required by Pillow or MSS; each backend has different dependencies.
Rank #4
- This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
- Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
- Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
- Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
- Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
The image is black, blank, or permission-denied
Confirm that an interactive desktop is available, the application is not running in a restricted service account, and the OS has granted screen-capture permission to the actual launcher. On Linux, identify whether the session is X11 or Wayland and follow the selected library’s guidance.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The crop is shifted or the size is wrong
Check the argument convention. PyAutoGUI uses left, top, width, height; ImageGrab uses left, top, right, bottom. On a Retina Mac, returned pixels can be twice the logical coordinate size.
Only one monitor appears
Use ImageGrab’s documented multi-screen options where supported, or inspect sct.monitors with MSS and select the intended monitor. Multi-monitor coordinates and negative origins vary by operating system.
The script is slower than expected
Large full-screen images, repeated disk writes, image conversion, and remote desktops all add cost. Capture a smaller region, avoid unnecessary format conversion, and benchmark the complete workload on the deployment machine. Published example timings for one library are not a current cross-library guarantee.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If what you actually need is a screenshot of a web page rather than the physical desktop, ScreenshotNeo takes it through one HTTP request. It accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before the capture; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing result.
Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
See the ScreenshotNeo API documentation for all 63 options, including full-page and element captures, dark mode, device presets, retina scale, PDF output, custom CSS and JavaScript, clicks, waits, blocking rules, headers, cookies, user agents, geolocation, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture, usage data, and the OpenAPI specification.
Best Value
- Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
- Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
- Storage: Combines 500GB SSD and 1TB HDD for ample storage space
- Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
- Design: Sleek desktop tower with black color and slim profile for modern look
Equivalent requests:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Can Python take a screenshot without saving it first?
Yes. PyAutoGUI and Pillow return an in-memory image object, and MSS returns screenshot data that you can process before writing a file.
Which coordinate convention should I use?
Use the convention of the API in your code: PyAutoGUI regions contain width and height, while Pillow ImageGrab bounding boxes contain right and bottom endpoints.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Can these libraries capture a browser page’s full scrollable length?
A desktop screenshot captures only the pixels currently displayed. Full-page web capture requires page-aware browser tooling or a web screenshot service; scrolling and stitching are separate automation tasks.
Frequently Asked Questions
Can Python take a screenshot without saving it first?
Yes. PyAutoGUI and Pillow return an in-memory image object, and MSS returns screenshot data that you can process before writing a file.
Which coordinate convention should I use?
Use the convention of the API in your code: PyAutoGUI regions contain width and height, while Pillow ImageGrab bounding boxes contain right and bottom endpoints.
Can these libraries capture a browser page’s full scrollable length?
A desktop screenshot captures only the pixels currently displayed. Full-page web capture requires page-aware browser tooling or a web screenshot service.
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.

