CLI tool for comparing screenshot directories using pixel-perfect image comparison with HTML reports
npm install visual-differCLI tool for comparing PNG screenshots between two directories using pixel-perfect image comparison with HTML reports.
Image comparison powered by pixelmatch.
``bash`
npx visual-differ
- - Directory containing baseline screenshots
- - Directory containing candidate screenshots
- - Directory where the HTML report will be written
- HTML Report at output-dir/index.html - Visual comparison with side-by-side images and diffsoutput-dir/*.png
- Diff Images at - Visual diff overlays for changed images
- 0 - All images match1` - Differences detected or files removed
-
The exit codes make this tool suitable for CI/CD pipelines. A non-zero exit code will fail your build when visual regressions are detected.
- Node.js >= 24.0.0
- PNG images only
See CONTRIBUTING.md for development setup and guidelines.