Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Use pyautogui.screenshot() to capture the primary screen. Pass a filename to save the image immediately, or save the returned Pillow image later. To capture only part of the screen, pass region=(left, top, width, height).
Install PyAutoGUI and its screenshot dependencies
Install PyAutoGUI in the same Python environment that will run your script. The project’s installation guide gives these commands:
- Windows:
py -m pip install pyautogui - macOS and Linux:
python3 -m pip install pyautogui
PyAutoGUI’s screenshot documentation says screenshot support requires Pillow. It also identifies macOS’s built-in screencapture command and Linux’s scrot command; its installation guide lists scrot, python3-tk, and python3-dev as Linux packages. These are the requirements named in the documentation; package availability and setup can vary with your operating system and environment, so check your current platform if installation fails.
Capture and save the full screen
This runnable example captures the screen, writes a PNG file, and keeps the returned image available for later processing:
#1 Best Overall
- code memory, no need to set, replace the battery without losing the code, use it directly
- and
- The keys are sensitive, sturdy and and easy to operate. Sturdy and fall-resistant, long-term use. Good toughness, high strength, beautiful appearance and not easy to change color
- Long-distance and all-round free remote control, and comfortable. An analog cursor makes the positioning clearer
- 2.4G radio frequency technology, 360° remote control, USB plug and for play, 2 keys for learning
import pyautogui
# Capture the screen and save it as a PNG.
image = pyautogui.screenshot("screenshot.png")
print(f"Saved screenshot.png ({image.width} × {image.height})")
The returned value is a Pillow image object. You can instead capture first and save it afterward:
import pyautogui
image = pyautogui.screenshot()
image.save("screenshot.png")
Passing the filename directly is convenient for a capture-and-save operation. Use the separate .save() step when you need to inspect or transform the image before writing it. Use an extension that matches the image format you want, such as .png.
Capture a rectangular region
Pass region as four integers in this order: (left, top, width, height). The final two values are width and height—not the right and bottom coordinates.
import pyautogui
# Capture a 300 × 400 rectangle starting at the screen's top-left corner.
region_image = pyautogui.screenshot(region=(0, 0, 300, 400))
region_image.save("region.png")
Change the first two values to move the rectangle from the screen’s top-left origin, and the last two to set its dimensions. This is a rectangular screen capture, not a request to target a particular application window; the documented screenshot call describes full-screen and region capture.
Rank #2
- DUAL-MODE CONNECTIVITY: Supports BT wireless & USB cable wired connectivity with Bluetooth maximum receiving open distance of 10 meters. Equipped with a built-in lithium battery, 3.7v600ma that can last up to 8 hours
- DUAL MOTOR VIBRATION: The switch game console controller has RGB LED lights & supports dual-point capacitive sensing touchpad and double motor vibration function so you can enjoy various games with a more authentic gaming experience
- FOR SWITCH CONSOLE: This gaming controller is compatible with Switch console. Professional cooperation with Switch game processing chip, stable and reliable performance. Comes with USB cable for easy connection and operation
- UPGRADED VERSION: Features a built-in three-axis gyroscope and three-axis accelerator and reacts to slightest pressure for improved accuracy. It also features turbo speed adjustment with 3 gears speed
- ERGONOMIC DESIGN: This handheld remote joystick has a professional ergonomic design with optimized gamepad button layout and surface diversification color matching treatment to facilitate comfort even during long hours of game play
What the capture covers, and how fast it is
PyAutoGUI’s quickstart describes support for Windows, macOS, and Linux. Its FAQ says it currently handles only the primary monitor. If your workflow depends on another display, verify the behavior in your own environment before relying on the result.
The screenshot reference gives roughly 100 milliseconds as an example for a 1920 × 1080 capture. Treat that as an approximate documentation figure, not a performance guarantee: actual time can differ with hardware, operating system, display size, and environment.
Troubleshooting common problems
ImportError or “No module named pyautogui”
The package may have been installed into a different Python environment from the one running the script. Install it with the command for your platform using that environment’s Python, then run the script there.
Screenshot capture fails because a dependency is missing
Confirm that Pillow is installed. On Linux, check the platform packages named in PyAutoGUI’s installation documentation, including scrot, python3-tk, and python3-dev. On macOS, the screenshot documentation identifies the built-in screencapture command. If your distribution or environment differs, consult its current package instructions.
Rank #3
- Premium Image Quality: Capture every detail with an impressive 1/2" sensor, balanced, true-to-life 4K visuals with HDR and exceptional low light performance for quality videos in any light.
- Professional Audio: Experience best-in-class audio with advanced AI noise-canceling algorithms. Filter out unwanted background noise for clear communication, even in busy environments.
- True Focus: Keep your audience engaged with faster, more accurate Phase Detection Auto Focus (PDAF). No more blurry shots, just fast focusing and crisp video.
- Natural Bokeh: Get a professional look by replicating a DSLR-like depth of field. Provides a realistic and natural bokeh effect, straight from Link Controller.
- Auto Framing: Insta360 Link 2C automatically zooms and adjusts to keep everyone clearly in sight, whether it's one person or a group.
The saved rectangle is not the area you expected
Check that the tuple is (left, top, width, height). A common mistake is to supply right and bottom coordinates as the last two values.
The script does not capture another monitor or just one window
The FAQ describes PyAutoGUI as handling only the primary monitor, and the documented region argument selects a rectangle rather than an application window. Verify your exact display setup before building a workflow around it; do not assume this call targets a particular window.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
PyAutoGUI captures your computer’s screen. If what you need is an image of a web page rather than your local desktop, ScreenshotNeo captures a URL through a website screenshot API:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Sign up for ScreenshotNeo’s free plan.
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.




