image-diff-cli
v0.0.3
Published
Fast screenshot versioning and visual diffs for UI work. 📸
Readme
image-diff-cli
Fast screenshot versioning and visual diffs for UI work. 📸
image-diff-cli watches a folder for new screenshots, auto-versions each capture, and lets you compare the latest changes instantly.
Why it helps
- No manual renaming: screenshots become
session_V1,session_V2, ... - Immediate visual history: side-by-side output is rebuilt automatically
- Quick diff inspection: open horizontal or vertical slider views from the keyboard
- Great for rapid UI iteration loops
Quick start ⚡
Run directly with npx:
npx image-diff-cliTypical run for Desktop screenshots:
npx image-diff-cli -d ~/DesktopBrowser viewer mode (auto-updating):
npx image-diff-cli -d ~/Desktop --webWhat happens next:
- New screenshots (
.png,.jpg,.jpeg) are detected - Files are moved into your session output folder
- Versioned files are saved as
<session>_V{n}.png <session>_iterations.pngis regenerated- You can open diff views with keyboard shortcuts
Command options ⚙️
-d, --dir <path>: directory to watch (default:.)-o, --output <path>: output root directory (default:./output)-n, --name <sessionName>: session name for folder/files (prompts if omitted in interactive mode)--on-exists <policy>: behavior when session directory exists (prompt,fail,reuse,increment)--no-interactive: disable prompts and key controls--web: start local browser viewer with live updates--web-port <port>: browser viewer port (default:4738)--debug: print startup/debug information-h, --help: show help
Live web viewer
When --web is enabled, the CLI starts a local viewer (for example http://127.0.0.1:4738) and opens it in your browser.
- Horizontal mode: compares latest 2 screenshots
- Vertical mode: compares latest 2 screenshots
- Pixel diff mode: highlights changed pixels between latest 2 screenshots
- Side-by-side mode: shows all screenshots in the session (horizontal scroll)
- New screenshots appear automatically without manual reload
Interactive keys ⌨️
h: open horizontal slider diff (last 2 images)v: open vertical slider diff (last 2 images)p: generate and open pixel diff image (last 2 images)b: open side-by-side image (<session>_iterations.png)qorCtrl+C: quit
Typical workflow
- Start one session per task or feature (
-n checkout,-n auth, etc.) - Make a UI change
- Take a screenshot
- Press
h/v/p/bto inspect changes - Repeat until done
Notes
- Built for local development, not CI image regression baselining
- Most useful when screenshots are captured with a consistent viewport/area
