#diff #pixel #image #match #visual

bin+lib pixelmatch

Pixel-level image comparison

1 unstable release

0.1.0 Jan 14, 2021

#761 in Images

Download history 28/week @ 2024-03-11 84/week @ 2024-03-18 50/week @ 2024-04-01 24/week @ 2024-04-08 105/week @ 2024-05-06 38/week @ 2024-05-13 27/week @ 2024-05-20 8/week @ 2024-05-27 17/week @ 2024-06-03 16/week @ 2024-06-10 28/week @ 2024-06-17 42/week @ 2024-06-24

105 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