RGBA Structural Similarity

This tool computes (dis)similarity between two or more PNG images using an algorithm approximating human vision.

Comparison is done using the SSIM algorithm at multiple weighed resolutions.

The value returned is 1/SSIM-1, where 0 means identical image, and >0 (unbounded) is amount of difference. Values are not directly comparable with other tools. See below on interpreting the values.

Features

Usage

dssim file-original.png file-modified.png

Will output something like "0.02341" (smaller is better) followed by a filename.

You can supply multiple filenames to compare them all with the first file:

dssim file.png modified1.png modified2.png modified3.png

You can save an image visualising the difference between the files:

dssim -o difference.png file.png file-modified.png

It's also usable as a library.

Please be careful about color profiles in the images. Different profiles, or lack of support for profiles, can make images appear different even when the pixels are the same.

Interpreting the values

The amount of difference goes from 0 to infinity. It's not a percentage.

If you're comparing two different image compression codecs, then ensure you either:

More about benchmarking image compression.

When you quote results, please include DSSIM version, since the scale has changed between versions. The version is printed when you run dssim -h.

Build or Download

You need Rust 1.48 or later.

cargo build --release

Will give you ./target/release/dssim.

Accuracy

Scores for version 2.11 measured against TID2013 database:

TID2013 | Spearman | Kendall ---------|----------|-------- Noise | -0.9336 | -0.7670 Actual | -0.9405 | -0.7803 Simple | -0.9479 | -0.7980 Exotic | -0.8510 | -0.6628 New | -0.8408 | -0.6619 Color | -0.8537 | -0.6761 Full | -0.8724 | -0.6953

License

DSSIM is dual-licensed under AGPL or commercial license.

The algorithm improvements in DSSIM