ssimulacra

1.0.0 • Public • Published

ssimulacra-bin CircleCI

ssimulacra is a tool to compute the (dis)similarity between two or more PNG images using an algorithm approximating human vision.

Comparison is done using the SSIM algorithm (based on Rabah Mehdi's implementation) at multiple weighed resolutions.

Changes compared to Krause's SSIM implementation:

  • Convert sRGB to linear RGB and then to Lab*, to get a perceptually more accurate color space
  • Multi-scale (6 scales)
  • Extra penalty for specific kinds of artifacts:
    • local artifacts
    • grid-like artifacts (blockiness)
    • introducing edges where the original is smooth (blockiness / color banding / ringing / mosquito noise)

Install

To compile ssimulacra, opencv needs to be installed first (e.g. via apt-get install libopencv-dev on Debian/Ubuntu or via Homebrew's brew install opencv command on OS X).

$ npm install --save ssimulacra

Usage

const execFile = require('child_process').execFile;
const ssimulacra = require('ssimulacra');
 
execFile(ssimulacra, ['image1.png', 'image2.png'], (err, output) => {
  console.log('ssimilarity', output);
});

CLI

$ npm install --global ssimulacra
$ ssimulacra --help

License

MIT

Package Sidebar

Install

npm i ssimulacra

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

4.14 kB

Total Files

6

Last publish

Collaborators

  • abarre