Coder Social home page Coder Social logo

imgdiff's Introduction

imgdiff

Faster than the fastest in the world pixel-by-pixel image difference tool.

Why?

imgdiff isn't as fast as a tool like this should be and I'm not proud of it, but it is 3X faster than the fastest in the world pixel-by-pixel image difference tool, so maybe you'll find it useful.

Features

It can do everything odiff can. Faster.

Benchmarks

I've tested it on Linux, Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz, 8 cores.

Cypress image 3446 x 10728

Command Mean [s] Min [s] Max [s] Relative
imgdiff images/cypress-1.png images/cypress-2.png output.png 1.442 ± 0.012 1.420 1.462 1.00
odiff images/cypress-1.png images/cypress-2.png output.png 6.475 ± 0.092 6.300 6.583 4.49

Water image 8400 x 4725

Command Mean [s] Min [s] Max [s] Relative
imgdiff images/water-1.png images/water-2.png output.png 1.908 ± 0.0058 1.841 2.002 1.00
odiff images/water-1.png images/water-2.png output.png 6.016 ± 0.415 5.643 7.140 3.15

Usage

Usage: imgdiff [--threshold THRESHOLD] [--diff-image] [--fail-on-layout] BASE COMPARE OUTPUT

Positional arguments:
  BASE                   Base image.
  COMPARE                Image to compare with.
  OUTPUT                 Output image path.

Options:
  --threshold THRESHOLD, -t THRESHOLD
                         Color difference threshold (from 0 to 1). Less more precise. [default: 0.1]
  --diff-image           Render image to the diff output instead of transparent background. [default: false]
  --fail-on-layout       Do not compare images and produce output if images layout is different. [default: false]
  --help, -h             display this help and exit

Download

You can find pre-built binaries here. imgdiff is written in Go, so there shouldn't be any troubles to compile it for the most of popular platforms.

imgdiff's People

Contributors

n7olkachev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imgdiff's Issues

Output text on Windows

I've compared two images to test this and I got this output

←[1;31mFailure!←[0m Images are different.
Different pixels: ←[1;31m670866←[0m

Is this supposed to look like this?

Output is a zero-byte PNG file

Version: 1.0.0

It computed the number of different pixels, but the output is empty.

Example:

curl -O https://user-images.githubusercontent.com/640840/112396875-03837d80-8ccf-11eb-8aa2-ef605eb6ab60.png
curl -O https://user-images.githubusercontent.com/640840/112396905-0da57c00-8ccf-11eb-8cd3-dab6d42cbfa1.png

./bin/imgdiff-darwin-amd64 --threshold 0.01 112396875-03837d80-8ccf-11eb-8aa2-ef605eb6ab60.png 112396905-0da57c00-8ccf-11eb-8cd3-dab6d42cbfa1.png output_diff.png

I get this output:

Failure! Images are different.
Different pixels: 3992

But the file is empty:

0B 24 Mar 18:34 output_diff.png

Any ideas? This is a fantastic tool that really boosted our end-to-end screenshots tests. I get these zero-byte files every ~1-2 in 100 diffs.

Make the module available for developers

To integrate your tool in an other projects, the module path must be changed from imgdiff to github.com/n7olkachev/imgdiff.

So one can use your project as package. It would be great, e.g. in unit tests.

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.