BlogScreenshots on your device
How to Choose and Use a Command-Line Screenshot Tool
Compare Flameshot and Scrot, choose the right capture workflow, and automate screenshots from Linux, Windows, macOS, or a headless server.
Direct answer: use Flameshot when you need interactive desktop capture, screen or region selection, delays, clipboard output, or a cross-platform project. Use Scrot when a small command-line utility, window or rectangular selection, image quality controls, and scripting matter most. For unattended screenshots of public webpages on a server, use a browser capture API such as ScreenshotNeo instead of configuring a display server.
This guide covers selection, installation checks, runnable commands, automation, output handling, troubleshooting, and the point where a local desktop tool stops being the right fit.
1. Choose by capture environment and workflow
| Requirement | Best starting point | Reason |
|---|---|---|
| Interactive region selection | Flameshot | Its CLI includes GUI capture and documented region options. |
| Full desktop or all screens | Flameshot | The full command supports full-screen capture and output controls. |
| Simple scripted desktop capture | Scrot | Its manual describes scripting, window capture, rectangular areas, formats, and quality. |
| Headless server or webpage URL | ScreenshotNeo | A GET request captures a webpage without a local display session. |
| AI agent capture | ScreenshotNeo | Its MCP server exposes take_screenshot, get_page_info, and capture_pdf. |
Check the actual environment before automating. The supplied sources do not establish exhaustive compatibility across every desktop protocol, compositor, display server, or system configuration. Test the intended mode on the target machine.
2. Check the display session before running a CLI capture
Local screenshot commands capture what a desktop session can see. On Linux, verify that you are running inside the intended graphical session and that the process has permission to access it. A command launched from SSH, a system service, a container, or a CI runner may have no usable display.
echo "$XDG_SESSION_TYPE"
echo "$DISPLAY"
echo "$WAYLAND_DISPLAY"
which flameshot
which flameshot-cli
which scrot
An empty display variable does not prove that capture is impossible, but it is a strong signal to test interactively first. Do not assume that a command working on one desktop protocol will work identically on another.
3. Use Flameshot from the command line
Flameshot describes itself as free, open source, and cross-platform, with Linux, Windows, and macOS distribution options. Its documented examples are:
flameshot gui
flameshot full --path ~/Pictures
flameshot full --delay 5000
Interactive selection
# Select an area interactively
flameshot gui
# Select an area and save it through the interactive workflow
flameshot gui --path ~/Pictures
# Copy or save according to the options supported by your installed release
flameshot gui --help
Use flameshot gui when a person should choose the region and optionally annotate it. Review flameshot gui --help because flags can vary by installed release.
Full-screen capture
# Save a full capture to a directory
flameshot full --path ~/Pictures
# Wait before capturing, useful when a menu or dialog must be opened first
flameshot full --delay 5000
# Inspect all options in the installed version
flameshot full --help
The command-line documentation lists options for a save path, clipboard output, delay, region specification, raw PNG output, and upload. Use the local help output as the final authority for exact syntax.
Windows console use
Flameshot’s command-line documentation says to use flameshot-cli rather than flameshot when console output is required on Windows.
flameshot-cli --help
4. Use Scrot for compact scripts
Scrot is a command-line-oriented capture utility. Its manual documents multiple image formats, configurable quality, rectangular-area and window capture, and scripting use. Start by reading the manual installed on the target system:
man scrot
scrot --help
Because option sets can differ by version, copy the exact flags from that local help when you build automation. Confirm the output filename and format before a batch job depends on them.
Script pattern
#!/usr/bin/env sh
set -eu
out_dir="${1:-$HOME/Pictures/captures}"
mkdir -p "$out_dir"
# Replace this command with the flags shown by `scrot --help` on your system.
scrot "$out_dir/capture-$(date +%Y%m%d-%H%M%S).png"
The script creates a predictable directory and timestamped filename. Add the documented window or rectangular-selection options only after testing them interactively.
5. Decide how to select an area, window, screen, or page
- Region: choose an interactive rectangle with Flameshot, or use Scrot’s documented rectangular-area mode.
- Window: use Scrot’s window-selection capability when you need one application window.
- All screens: use Flameshot’s
fullcommand and confirm how the installed release treats multiple monitors. - Webpage: local tools capture the rendered desktop. They do not reliably provide a clean, browser-level page capture on a headless machine; use a browser automation stack or ScreenshotNeo.
6. Control output, timing, and post-processing
For repeatable captures, decide these values before writing a script:
- Destination directory and filename pattern.
- Image format and quality.
- Whether output goes to a file, clipboard, raw stream, or upload target.
- Delay required for menus, animations, or state changes.
- Whether a person must confirm a region.
Flameshot documents path, clipboard, delay, region, raw PNG, and upload options. Scrot documents format and quality controls. Run the installed command’s help for the exact spelling and supported combinations.
7. Automate safely
A reliable capture job should fail clearly, keep artifacts, and avoid overwriting earlier screenshots.
#!/usr/bin/env bash
set -euo pipefail
out_dir="${OUT_DIR:-$HOME/Pictures/automated-captures}"
mkdir -p "$out_dir"
file="$out_dir/shot-$(date -u +%Y%m%dT%H%M%SZ).png"
if ! command -v scrot >/dev/null 2>&1; then
echo "scrot is not installed or is not on PATH" >&2
exit 127
fi
scrot "$file"
printf 'saved %s\n' "$file"
Run the job under the same user and graphical session that succeeded during manual testing. A desktop login, SSH shell, cron job, and system service can have different display access and environment variables.
8. When a local CLI is the wrong tool
Flameshot and Scrot depend on a reachable desktop display. They are a poor fit when you need any of the following:
- Capture a URL from a headless server.
- Wait for page rendering, a selector, network idle, or lazy-loaded images.
- Hide cookie banners, newsletter popups, or chat widgets before capture.
- Set browser cookies, headers, user agent, timezone, geolocation, or authorization.
- Capture one DOM element by CSS selector, produce a PDF, or run bulk URL jobs.
For those workflows, use a browser capture service or maintain your own browser automation stack.
9. Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF. Before capture it accepts the cookie or consent banner and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response reports the result with X-Page-Verdict and X-Billed headers.
See the ScreenshotNeo API documentation for the complete option list, including full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets, custom viewports, retina scale, PDF paper and margin settings, custom CSS and JavaScript, clicks, waits, blocking rules, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, cache TTL, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage data, and the OpenAPI specification.
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://stripe.com \
-o shot.webp
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)
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 fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. An MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.
Sign up for ScreenshotNeo to get 1,000 screenshots a month free with no card.
10. Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
command not found |
The utility is not installed or is missing from PATH. |
Install it for the target operating system, then verify with which flameshot, which flameshot-cli, or which scrot. |
| Cannot open display | The process has no access to a graphical session. | Run it inside the logged-in session; inspect DISPLAY, WAYLAND_DISPLAY, and session permissions. |
| Interactive command hangs | The command is waiting for a region selection or confirmation. | Use a non-interactive full capture for automation, or run the job where a desktop user can respond. |
| Wrong screen or incomplete monitor capture | Multi-monitor behavior differs by environment or release. | Test full locally and verify the resulting dimensions before relying on it. |
| Flag rejected | Examples target a different installed version. | Run --help or man scrot and update the script to the local option names. |
| Screenshot contains a popup | A desktop or webpage overlay appeared before capture. | Use a delay and close the overlay locally; for webpage consent banners and widgets, use ScreenshotNeo’s cleanup options. |
| API response is not an image | The request failed or returned an error payload. | Check the HTTP status, preserve response headers, verify the access key and URL, and inspect X-Page-Verdict and X-Billed. |
11. Performance, reliability, and cost
- Local speed: Flameshot and Scrot avoid network transfer, so they are usually appropriate for immediate desktop grabs. Rendering, disk speed, image dimensions, and compression still affect completion time.
- Automation reliability: Interactive selection is inherently dependent on a user and display state. For unattended jobs, use deterministic filenames, explicit checks, and a tested display session.
- Remote page capture: Browser rendering, waits, assets, and network conditions affect API latency. Set a client timeout long enough for the page while still handling failures.
- Cost: Local tools have no service usage charge. ScreenshotNeo bills only clean shots; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Its free plan includes 1,000 shots monthly, with paid plans from $5 for 3,000.
- Caching: ScreenshotNeo lets you choose a cache TTL. Use it for repeated URLs when freshness requirements allow it.
12. Practical decision checklist
- Is a human selecting a region? Choose Flameshot.
- Is a small script capturing a desktop window or rectangle? Evaluate Scrot first.
- Is the job running without a logged-in display? Use a browser automation service or ScreenshotNeo.
- Do you need clean webpage shots without consent banners and widgets? Use ScreenshotNeo.
- Do you need PDFs, element capture, custom headers, cookies, waits, bulk URLs, or MCP tools? Use ScreenshotNeo.
- Have you tested the exact command and flags on the target OS, display protocol, compositor, and installed version?
13. FAQ
Can I use Flameshot from a terminal?
Yes. Its documented commands include gui for interactive capture and full for full-screen capture. On Windows console workflows, use flameshot-cli.
Is Scrot only for full-screen screenshots?
No. Its manual describes window capture, rectangular-area capture, multiple formats, quality settings, and scripting.
Which tool should run in CI?
A local CLI requires a working graphical display and permissions. For webpage URLs in headless CI, use a browser capture API such as ScreenshotNeo or configure browser automation with an appropriate virtual display.
Should I script flags copied from a blog post?
Verify them against the installed release with --help or man scrot. Option names and combinations can differ by version.
Can ScreenshotNeo capture only part of a webpage?
Yes. It supports capturing one element by CSS selector as well as full-page capture.


