diff
Compare two screenshots and output difference metrics.
No Bridge Required
This command operates on local image files — no bridge or running Tauri app needed.
Usage
Options
| Option | Description | Default |
|---|---|---|
<image1> |
First image path | (required) |
<image2> |
Second image path | (required) |
-o, --output <path> |
Write a visual diff image to this path | — |
--threshold <percent> |
Fail (exit code 1) if difference exceeds this percentage | — |
--json |
Output structured JSON | — |
Examples
Basic comparison
Generate a diff image
Threshold gating (CI use)
# Fail if more than 1% of pixels differ
tauri-agent-tools diff /tmp/expected.png /tmp/actual.png --threshold 1
echo $? # 0 = pass, 1 = threshold exceeded
JSON output
Requirements
Requires ImageMagick installed on the system. Both v6 (compare, identify) and v7 (magick compare, magick identify) are supported automatically. The --threshold option requires identify to compute image dimensions.