kornelski/dssim

Image similarity comparison simulating human perception (multiscale SSIM in Rust)

What it solves

This tool calculates the visual difference between two or more images by approximating how human eyes perceive distortions. Unlike simple pixel-by-pixel comparisons, it identifies differences in brightness, color, and structure, making it ideal for benchmarking image compression quality.

How it works

It uses a specialized version of the Structural Similarity (SSIM) algorithm. It compares images at multiple resolutions, processes them in the Lab* color space, and performs scaling in linear-light RGB to ensure accurate detection of distortions like chroma subsampling. The tool outputs a numerical score where 0 indicates identical images, and higher values represent greater differences.

Who it’s for

It is designed for developers and researchers who need to objectively measure image quality, such as comparing the output of different image compression codecs or optimizing file sizes without sacrificing visual fidelity.

Highlights

  • Supports PNG and JPEG formats, including alpha channels and color profiles.
  • Generates visual difference maps to highlight exactly where images differ.
  • Multi-core optimized for faster processing of large image sets.
  • Available as a standalone command-line tool or as a library for C, Rust, and WASM projects.
  • Does not require heavy dependencies like OpenCV or MATLAB.

Related

  • Project
  • Project
  • Project
  • Project