Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.24 KB

README.md

File metadata and controls

41 lines (25 loc) · 1.24 KB

visual-differ

CLI tool for comparing PNG screenshots between two directories using pixel-perfect image comparison with HTML reports.

Image comparison powered by pixelmatch.

Usage

npx visual-differ <baseline-dir> <candidate-dir> <output-dir>

Arguments

  • <baseline-dir> - Directory containing baseline screenshots
  • <candidate-dir> - Directory containing candidate screenshots
  • <output-dir> - Directory where the HTML report will be written

Output

  • HTML Report at output-dir/index.html - Visual comparison with side-by-side images and diffs
  • Diff Images at output-dir/*.png - Visual diff overlays for changed images

Exit Codes

  • 0 - All images match
  • 1 - Differences detected or files removed

CI Integration

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.

Requirements

  • Node.js >= 24.0.0
  • PNG images only
  • 8-bit-per-channel PNGs for pixel comparison; 16-bit PNGs are detected and flagged as an unsupported bit depth in the report instead of being pixel-compared

Contributing

See CONTRIBUTING.md for development setup and guidelines.