Visual diff and baselines
Compare two captures pixel by pixel, keep baselines, and export a before/after slider or GIF.
Compare two captures#
- In the Library, right-click the older capture and choose Select for Compare.
- Right-click the newer one and choose Compare with “…”.
The diff window shows the two images four ways:
| View | Shows |
|---|---|
| Side by side | Before and after next to each other |
| Diff | The changed pixels highlighted |
| Onion skin | One over the other, with an Opacity slider and a Blend choice (Normal or Difference) |
| Slider | A divider you drag across |
Small antialiasing differences are ignored. When the captures were taken at different scales (Retina and not), both are compared at the lower one.
Baselines#
A baseline is a reference image you approve and compare against later.
- Right-click a capture and choose Save as Baseline. The baseline takes the capture’s name.
- Later, right-click it and choose Compare with Baseline. The diff window shows Matches, Changed or New baseline. Click Approve change to make the current image the new baseline (the old one is kept in the baseline’s history), or Reject. HTML report… saves the comparison as a page.
Baselines are matched by the capture’s name, so Compare with Baseline is for checking a capture against an earlier approved version of itself. To compare a fresh screenshot of your app against a reference image, use Select for Compare, or the command line:
glimmer diff reference.png --window --bundle-id com.example.app --mask 0,0,200,40 --threshold 0.5
diff exits with code 7 when the change is over --threshold, so it works as a test in CI. See Command reference.
Before and after#
After Select for Compare on the “before” capture, right-click the “after” capture:
- Before/After with “…” (HTML)… saves a single web page with a slider. It’s one self-contained file with no outside requests, and the slider works with the keyboard.
- Before/After with “…” (GIF)… saves an animated GIF that wipes from one to the other and back.
Onion skin over the screen#
To compare a capture with what’s on screen right now, pin it as an onion skin.
Next#
Something missing or unclear? Write to [email protected].