Coder Social home page Coder Social logo

saminigod / dssim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kornelski/dssim

0.0 2.0 0.0 294 KB

DSSIM C implementation (with a Rust API)

Home Page: https://kornel.ski/dssim

License: GNU Affero General Public License v3.0

Makefile 1.30% Shell 0.27% Rust 13.73% C 81.83% Objective-C 2.86%

dssim's Introduction

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 (based on Rabah Mehdi's implementation) 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

  • Comparison is done in in L*a*b* color space (D65 white point, sRGB gamma) with chroma subsampling. Other implementations use "RGB" or grayscale without gamma correction.
  • Supports alpha channel.
  • Only needs C (C99) and libpng or Cocoa on OS X. No OpenCV or MATLAB needed.

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

The dssim.c file is also usable as a C library.

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:

  • compress images to the same file size, and then use DSSIM to compare which one is closests to the original, or
  • compress images to the same DSSIM value, and compare file sizes to see how much file size gain each option gives.

More about benchmarking image compression.

Build or Download

You need libpng, zlib, pkg-config and make

make

Will give you dssim. On OS X make USE_COCOA=1 will compile without libpng.

You'll find downloads on GitHub releases page.

Debian packages for i386/amd64 can be installed for ubuntu (14.04 LTS) from ppa:

$ sudo apt-add-repository ppa:lkwg82/dssim
$ sudo apt-get update
$ sudo apt-get install dssim

(other versions on request)

Plain download from here: https://launchpad.net/~lkwg82/+archive/ubuntu/dssim/+packages

Accuracy

Scores for version 1.3 measured against TID2008 database:

TID2008 Category Spearman correlation
Noise -0.872
Noise2 -0.888
Safe -0.889
Hard -0.903
Simple -0.922
Exotic -0.484
Exotic2 -0.651
Full -0.818

dssim's People

Contributors

fvanboven avatar hdanes avatar kornelski avatar lkwg82 avatar lu-zero avatar mathieuduponchelle avatar waynegerard avatar wcgallego avatar yoavweiss avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.