Recommended Free Tools
Use the xcap crate to capture a monitor, a bounded rectangle, or an application window, then save the returned image as PNG, JPEG, or another format supported by the image crate. The current documented release is xcap 0.9.8 (Rust edition 2024, Apache-2.0). The basic pattern is enumerate the target, call capture_image() (or capture_region()), and call save() on the resulting image.
This guide covers complete Rust programs, Linux build dependencies, platform caveats, coordinate validation, window selection, troubleshooting, and an API alternative when you do not need to run a browser locally.
What xcap captures and what it returns
Xcap is a cross-platform screen-capture library written in Rust. It exposes separate APIs for monitors and windows. A capture returns an image::RgbaImage, so you can save it directly, process pixels in memory, or encode it in another format.
| Capture type | Entry point | How you choose the target | Typical failure |
|---|---|---|---|
| Full monitor | Monitor::capture_image() |
Enumerate monitors or select the primary display | No monitor or platform capture error |
| Rectangle | Monitor::capture_region(x, y, width, height) |
Coordinates relative to the selected monitor | InvalidCaptureRegion when the rectangle exceeds bounds |
| Window | Window::capture_image() |
Window title, app name, focus, or process metadata | Window is minimized, unavailable, or not found |
The project marks screen and window capture as available on Linux X11, macOS, and Windows. Linux Wayland is available but has unsupported special scenarios; test with the compositor and desktop environment used by your application. Window recording is a separate, less mature feature and is not covered here.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Install xcap in a Rust project
Create or open a Cargo project and add the documented version:
[dependencies]
xcap = "0.9.8"
Pin the version selected by your project rather than assuming that every future release has identical behavior. The crate uses edition 2024 and is licensed under Apache-2.0. Its optional features include image and Windows Graphics Capture (wgc); enable features only when your chosen version and target require them.
Capture every monitor and save PNG files
Monitor::all() returns the displays visible to the current session. The following program captures each one and writes monitor-0.png, monitor-1.png, and so on in the current directory.
use std::error::Error;
use xcap::Monitor;
fn main() -> Result<(), Box<dyn Error>> {
let monitors = Monitor::all()?;
for (index, monitor) in monitors.into_iter().enumerate() {
let image = monitor.capture_image()?;
image.save(format!("monitor-{index}.png"))?;
}
Ok(())
}
Run it with cargo run --release. A successful run creates one PNG per enumerated monitor. The output path is relative to the process working directory, so use an absolute path or create the destination directory if your application runs as a service.
Select only the primary monitor
Monitor metadata includes is_primary(). Treat a missing primary display as an error instead of unwrapping an optional value:
use std::error::Error;
use xcap::Monitor;
fn main() -> Result<(), Box<dyn Error>> {
let monitor = Monitor::all()?
.into_iter()
.find(|m| m.is_primary().unwrap_or(false))
.ok_or("no primary monitor found")?;
monitor.capture_image()?.save("primary.png")?;
Ok(())
}
Capture a region of a monitor
Use capture_region(x, y, width, height) for a rectangle relative to the selected monitor. Coordinates start at that monitor’s capture surface, not at a global desktop coordinate system.
use std::error::Error;
use xcap::Monitor;
fn main() -> Result<(), Box<dyn Error>> {
let monitor = Monitor::all()?
.into_iter()
.find(|m| m.is_primary().unwrap_or(false))
.ok_or("no primary monitor found")?;
let image = monitor.capture_region(0, 0, 400, 300)?;
image.save("region.png")?;
Ok(())
}
Xcap validates the rectangle. If x + width or y + height extends beyond the monitor dimensions, the call returns an InvalidCaptureRegion error. When values come from a user interface, validate them before invoking xcap and report the monitor’s actual dimensions so the user can correct the selection.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Validate user input before capturing
Keep dimensions in a signed or checked numeric type while validating, then convert to the parameter type expected by the crate. Reject negative coordinates, zero dimensions if your interface does not support them, and arithmetic overflow. Also re-enumerate monitors when display configuration can change; a monitor may be disconnected between selection and capture.
Capture a specific application window
Use Window::all(), inspect metadata, skip minimized entries, and then call capture_image(). Titles can change, so a production utility should offer a stable app-name, process-ID, or window-ID choice when possible.
use std::error::Error;
use xcap::Window;
fn main() -> Result<(), Box<dyn Error>> {
let window = Window::all()?
.into_iter()
.find(|w| {
!w.is_minimized().unwrap_or(true)
&& w.title().map(|t| t.contains("Editor")).unwrap_or(false)
})
.ok_or("window not found")?;
let image = window.capture_image()?;
image.save("editor.png")?;
Ok(())
}
The window API exposes id, pid, app_name, title, current_monitor, x, y, z, width, height, is_minimized, is_maximized, is_focused, and capture_image. A focused-window tool can filter for is_focused(), but still handle the case where no window is focused or the focus changes before capture.
Why minimized windows should be skipped
The documented example excludes minimized windows. A minimized application may have no composited surface available to capture, depending on the operating system. Either skip it, restore it through your own window-management code, or return a clear “window is minimized” result rather than writing an empty file.
Linux packages and platform permissions
Debian and Ubuntu
Install the native development packages before compiling:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchapt-get install pkg-config libclang-dev libxcb1-dev libxrandr-dev
libdbus-1-dev libpipewire-0.3-dev libwayland-dev libegl-dev
These are compile-time and native-integration dependencies, not special capture hardware. Equivalent package commands are documented for Alpine and Arch by the project; use the names appropriate to your distribution and enabled desktop stack.
Linux display backends
Linux X11 is marked as supporting screen and window capture. Wayland support is marked with caveats for special scenarios, so a program that works under X11 may still need compositor-specific testing under Wayland. Include the session type and desktop environment in bug reports.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
macOS privacy controls
macOS may block screen capture until the application has the relevant Screen Recording privacy permission. If captures fail, review the application’s Screen Recording setting in macOS Privacy & Security settings. There is no single prompt sequence that applies to every macOS version or launch method, so check the setting for the exact binary you run (for example, your terminal, IDE, or packaged application).
Choosing full-screen, region, or window capture
- Use a full monitor for desktop snapshots, presentations, and multi-window state.
- Use a region when you need a stable, smaller image and can control coordinates and monitor bounds.
- Use a window when surrounding desktop content must be excluded and the application exposes a selectable window.
Capture size affects encoding time and file size, but no authoritative xcap benchmark establishes fixed timings. Treat performance as environment-dependent: display resolution, pixel density, compositor, encoder, disk speed, and whether you enumerate targets for every shot all matter.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Saving formats and handling files safely
image.save("name.png") chooses the encoder from the filename extension. PNG is lossless and convenient for UI text. JPEG can reduce file size but introduces lossy artifacts; WebP availability depends on the image crate’s enabled codecs and version. Check the returned Result for both capture and save failures.
For repeated captures, avoid overwriting user files accidentally: generate names with a timestamp or sequence, write to a temporary path, and rename after a successful save. Keep capture and encoding errors distinct in logs so a permissions problem is not mistaken for a display problem. If you need to process pixels, retain the returned image in memory and perform the transformation before saving.
Troubleshooting xcap captures
“Failed to compile” on Linux
Cause: missing development libraries or pkg-config metadata.
Fix: install the Debian/Ubuntu package list above (or the equivalent packages for your distribution), then run cargo clean and rebuild. Confirm that your compiler targets the same architecture as the installed native libraries.
InvalidCaptureRegion
Cause: the requested rectangle extends past the selected monitor, often because a UI supplied stale dimensions.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Fix: re-read monitor dimensions, use checked arithmetic, require x + width <= monitor_width and y + height <= monitor_height, and retry only after the values are valid.
No monitor is returned
Cause: the process has no usable graphical session, the display backend is unsupported, or capture permissions are missing.
Fix: run inside the intended desktop session, verify macOS Screen Recording permission where applicable, and test whether the same machine is using X11 or Wayland. Do not assume a headless server can provide a desktop monitor.
Free tools Windows power users keep installed
One-click scans. No signup required.
The selected window cannot be captured
Cause: the title changed, the window disappeared, it is minimized, or the platform does not expose its surface.
Fix: enumerate again immediately before capture, match on more stable metadata when available, skip minimized windows, and return a useful not-found error. For focused capture, check is_focused() at capture time rather than caching an old window list.
The file is missing or unreadable
Cause: the destination directory does not exist, the process lacks write permission, or the extension selects an unavailable encoder.
Fix: use a known writable absolute directory, create it before saving, inspect the save error, and start with PNG before adding other formats.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsBest Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
If your goal is a webpage image rather than the local desktop, ScreenshotNeo provides a single HTTP request that returns PNG, JPEG, WebP, or PDF. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. It also provides an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools.
See the parameter reference in the ScreenshotNeo documentation. A minimal cURL call is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in 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)
And in 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}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', data));
ScreenshotNeo includes full-page and element capture, device presets, custom viewports, retina scale, PDF controls, HTML/CSS rendering, custom JavaScript and CSS, waits, request blocking, headers, cookies, user agents, timezone and geolocation, resizing, configurable caching, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Every feature is on every plan: 1,000 shots per month are free with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Does xcap capture video?
This guide targets still screenshots. The project’s implementation table marks window recording as work to be developed, so do not treat the still-image APIs as a recording solution.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Can I capture outside a monitor’s rectangle?
No. Region coordinates must remain within the selected monitor; out-of-bounds values produce InvalidCaptureRegion.
Which license does xcap use?
The current documented xcap 0.9.8 package uses the Apache-2.0 license.
Frequently Asked Questions
Does xcap work on Wayland?
Linux Wayland is listed as available, but special scenarios are not fully supported. Test on the compositor and desktop environment your application targets.
What image type does capture_image return?
The capture APIs return an image::RgbaImage, which can be saved through the image crate’s supported encoders.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Why does a minimized window fail?
Minimized windows may not have a composited surface available. Skip them or report that the window must be restored before capture.
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.




