Repository navigation
Brings pixelmatch-cpp up to date with pixelmatch v8: on every fixture, it returns the same mismatch counts and diff images as JS v8. Versions now follow JS from here on.
Breaking changes
- New color metric: OKLab HyAB with toe-corrected lightness replaces YIQ, so mismatch counts change.
thresholdkeeps its 0–1 range and 0.1 default, but may need re-tuning. - Options struct: the positional
thresholdandincludeAAarguments are replaced bymapbox::Options. - Checkerboard by default: semi-transparent pixels are now blended against a checkerboard. Set
checkerboard = falsefor the old white blending. - C++17 is now required.
New options
alpha,aaColor,diffColor,diffColorAlt,diffMask: control how the diff image is drawn.checkerboard: picks the background for semi-transparent pixels.ignoreMask: skips masked pixels.windowSize: returns the max diff count over N×N windows instead of the total.
Improvements
- Better anti-aliasing detection for semi-transparent pixels.
- Faster than JS v8 on the shared benchmark (~4.2 vs ~8.9 ms per round), thanks to a per-call color cache. Calls share no state, so
pixelmatchstays thread-safe. - The overload that takes row strides is now documented and tested.
Tests and CI
- All JS fixtures and unit tests are ported.
- New tests check that the stride overload matches the tightly packed one.
- CI treats warnings as errors and runs the tests under the address and undefined-behavior sanitizers.