xtract.bot
POST /api/image-diff

Visual diff between two PNGs. Returns the diff image (regions of change highlighted on a faded copy of the first input) plus a 0–1 similarity score and the count of differing pixels.

Compares two PNG images pixel-by-pixel and returns: - `diffPng`: a base64-encoded PNG showing changed pixels in bright red on a faded greyscale copy of the first input. - `diffPixels`: the count of pixels that differ. - `similarity`: `1 - diffPixels / totalPixels` (1.0 = identical). Tunable: - `threshold` (default 0.1): 0–1 colour-difference threshold. Smaller = more sensitive. - `ignoreAntialiasing` (default true): skip anti-aliased pixels. Useful when comparing the same UI rendered by different engines. Use cases: visual regression testing, A/B page-snapshot comparison, CI verification of generated thumbnails / OG images. Both images must have identical dimensions.

Inputs

NameTypeDefaultDescription
imageA*fileReference / baseline PNG.
imageB*fileComparison PNG (must match imageA's dimensions).
thresholdnumber (0…1)0.1Colour-difference threshold. Smaller = more sensitive.
ignoreAntialiasingbooleantrueSkip anti-aliased pixels when counting differences.

Response

Modes: json, binary. Cache: yes (24h TTL).