Free · Offline · MIT licensed · Rust CLI + MCP

visdiff — Free Open-Source Visual Regression Detector CLI for AI Agents

visdiff — Percy for AI Agents: Diff two screenshots in one command — changed regions, pixel % and SSIM as machine-readable JSON, with 8.6x fewer tokens. Offline, fast, and free.

Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/visdiff. 100% local — no network calls at all in the free build.

Screenshots only, stated up front: visdiff diffs PNG/JPEG files you or your CI supply. It has no browser, no headless Chromium, and it never takes a screenshot itself. If you need screenshots taken, use Playwright, Puppeteer, or your CI's screenshot step, then hand the files to visdiff.

One command, one verdict

Two screenshots in, a PASS/FAIL verdict out — changed pixels, % difference, mean SSIM, and changed regions with bounding boxes, as JSON. Exit codes for CI: 0 = PASS, 1 = FAIL, 2 = error. Batch mode diffs many pairs from one JSON file.

# 1. Diff two screenshots — exit 0 = PASS, 1 = FAIL, 2 = error
visdiff diff examples/before.png examples/after.png

# 2. See the same report as JSON + save the highlighted diff image
visdiff diff examples/before.png examples/after.png --json --output diff.png

# 3. CI gate: fail only when more than 0.5% of pixels changed
visdiff diff before.png after.png --max-diff-pct 0.5

# 4. Diff many pairs at once (see examples/batch.json)
visdiff batch examples/batch.json

A report your agent can actually use

The JSON report names every changed region (x, y, width, height, pixels), so the agent knows exactly where the UI moved instead of guessing from two pasted screenshots. The sample pair diffs in 11 ms and the report costs 178 tokens — vs 1,530 vision tokens for the two screenshots pasted into the chat (8.6× saving, measured — see the repo README for the full benchmark).

The sample pair tells the story: 10,579 pixels changed (2.20%) across 5 regions — the largest is a button, 121×37 = 4,477 px. The diff image dims unchanged pixels to 35% grayscale, paints changed pixels red, and draws a yellow box around each reported region, so the agent — and you — can see exactly what moved.

Install in one minute

Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:

cargo install --git https://github.com/creatorops-studio/visdiff

Prefer a ready-made binary? Download the Release v0.1.0 binary (1,444,984 B) from github.com/creatorops-studio/visdiff/releases/tag/v0.1.0.

Measured numbers, not marketing

Measured 5 December 2026 with visdiff benchmark on the release binary. The 8.6× compares the 178-token command + JSON report with 1,530 vision tokens for the two 800×600 screenshots pasted into the chat (published high-detail tile formula: 85 + 170 tokens per 512×512 tile per image, 2×2 tiles each); the description the agent would then have to write back is not counted, so 8.6× is conservative. Method and constants are in src/bench.rs; the sample pair is in examples/.

What was measuredResult
Token cost for one diff — command + JSON report178 tokens vs 1,530 vision tokens (two screenshots pasted into the chat) — 8.6× saving
Load sample pair (800×600 PNG ×2)1.3–11.4 ms
Diff sample pair (pixel + SSIM + regions)10.5–18.7 ms
Render + encode diff image (800×600 PNG)13.8–20.8 ms
Diff 1920×1080 pair end-to-end (load + diff + render + write)~70 ms
Peak RSS11,616 KB (~11.6 MB)
Sample pair — changed pixels / regions10,579 pixels (2.20%), 5 regions — largest: a button, 121×37 = 4,477 px
FormatsPNG and JPEG in — the diff image is always PNG; GIF/WebP/BMP are refused
Tests67 green (53 unit + 14 integration, debug and release, 0 warnings)
Binary size (release, stripped)1,444,984 B (1.38 MiB)

Built for AI agents first

MCP server with two tools (diff_screenshots, batch_diff). Add this to your MCP config — no Python, no browser, no cloud:

{
  "mcpServers": {
    "visdiff": {
      "command": "visdiff",
      "args": ["mcp"]
    }
  }
}

Example agent flow: diff_screenshots → read the JSON report (changed regions with bounding boxes) → fix the UI → diff_screenshots again to confirm. Compare that with the agent receiving both screenshots as vision input (1,530 tokens for the sample pair, measured) plus writing its own description of the differences — see the repo README for the full benchmark.

Built with: Rust, a single static binary, and an MCP server — clap + image + serde + serde_json.

Screenshots only — stated up front

visdiff diffs PNG/JPEG files you or your CI supply. It has no browser, no headless Chromium, and it never takes a screenshot itself. Use Playwright, Puppeteer, or your CI's screenshot step to capture, then hand the files to visdiff. Percy, Chromatic, and BackstopJS already do visual regression for humans with hosted baselines and review UIs — we say so plainly in the README. What visdiff does is the part agents get wrong by hand: pixel-exact comparison, structural similarity, and region detection, offline and in milliseconds.

SSIM is a similarity score, not a verdict: mean SSIM 0.99 on the sample pair still means 10,579 pixels changed — read diff_pct and the regions for the gate, SSIM for the "how different does it look" sense. Hard limits are fail-closed: 50 MiB per input file, 16,384 px per side, 64 MP per image.

Free, offline, MIT

Single static binary, no cloud, no account. Free core is 80% of a real visual-regression tool; Pro (coming later, $10–29/month) adds anti-flake masking, multi-browser grids, and baseline hosting + PR review UI.

Frequently asked questions

Is visdiff really free?

Yes — MIT licensed, free core forever. Pro is a separate paid tier for anti-flake, capture grids and hosted baselines.

Does it work offline?

Yes. 100% local; no network calls at all in the free build.

Which formats?

PNG and JPEG in; the diff image is always PNG. GIF/WebP/BMP are refused.

Does it take screenshots?

No — no browser, no headless Chromium. It only diffs files you supply.

How do I use it in CI?

visdiff diff before.png after.png --max-diff-pct 0.5 exits 1 when the diff is above the gate; visdiff batch batch.json diffs many pairs at once.

How do I use it with Claude Code?

Add the MCP server block from the repo README to your MCP config; the agent gets diff_screenshots and batch_diff.

What does the threshold do?

--threshold (default 10) is the per-pixel change bar: worst per-channel |delta| must exceed it to count as changed. It absorbs JPEG noise and subpixel text rendering; a real colour or layout change is far above it.

What is SSIM here?

Mean structural similarity on 8×8 luminance windows (1.0 = identical). Use diff_pct and the regions for the gate, SSIM for the "how different does it look" sense.

How do I install it?

Run cargo install --git https://github.com/creatorops-studio/visdiff (needs a Rust toolchain), or download the Release v0.1.0 binary (1,444,984 B) from the v0.1.0 release. The crate is not on crates.io yet.

Diff two screenshots in one command.

Free, offline, MIT licensed — get the source on GitHub. Screenshots only: no browser, no headless Chromium, no capture step — diff the files you or your CI already have. If you are a human with a hosted baseline and a review UI, use Percy; if you are an agent that needs a PASS/FAIL verdict and the exact regions that changed, this is the tool.