#diff #pixel #image #match #visual

bin+lib pixelmatch

Pixel-level image comparison

1 unstable release

0.1.0 Jan 14, 2021

#710 in Images

Download history 65/week @ 2024-07-22 70/week @ 2024-07-29 114/week @ 2024-08-05 86/week @ 2024-08-12 4/week @ 2024-09-09 9/week @ 2024-09-16 83/week @ 2024-09-23 127/week @ 2024-09-30 90/week @ 2024-10-07 216/week @ 2024-10-14 9/week @ 2024-10-21 116/week @ 2024-10-28 167/week @ 2024-11-04

510 downloads per month
Used in 2 crates

MIT license

1.5MB
340 lines

pixelmatch-rs

Pixel-level image comparison

Completely based on pixelmatch.

let num_diff_pixels = pixelmatch(
    im1,
    img2,
    diff,
    None,
    None,
    Some(Options {
        threshold: 0.1,
        ..Default::default()
    }),
);

Implements ideas from the following papers:

Example output

expected actual diff
1diff
1diff
1diff

Command line

Pixelmatch comes with a binary that works with PNG images:

pixelmatch --threshold 0.1 image1.png image2.png output.png

Dependencies

~5.5MB
~70K SLoC