#diff #pixel #image #match #visual

bin+lib pixelmatch

Pixel-level image comparison

1 unstable release

0.1.0 Jan 14, 2021

#776 in Images

Download history 17/week @ 2024-03-03 29/week @ 2024-03-10 83/week @ 2024-03-17 2/week @ 2024-03-24 47/week @ 2024-03-31 26/week @ 2024-04-07 1/week @ 2024-04-14 105/week @ 2024-05-05 36/week @ 2024-05-12 28/week @ 2024-05-19 7/week @ 2024-05-26 19/week @ 2024-06-02 12/week @ 2024-06-09 24/week @ 2024-06-16

64 downloads per month
Used in vegafusion-runtime

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

~13MB
~65K SLoC