Compare two images side-by-side
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
set1 Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
set2 Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
set3 Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
.coveragerc Add smoke tests for main() and most of the rest Dec 1, 2014
.gitignore Add a tox.ini and 'make coverage' May 15, 2014
.travis.yml Claim Python 3.7 support Aug 7, 2018
CHANGES.rst Claim Python 3.7 support Aug 7, 2018
LICENSE Rename LICENCE to LICENSE Sep 22, 2016
MANIFEST.in Update MANIFEST.in Dec 19, 2017
Makefile Use release.mk from https://github.com/mgedmin/python-project-skel Dec 19, 2017
README.rst Eradicate HTTP links Dec 1, 2014
appveyor.yml Claim Python 3.7 support Aug 7, 2018
example.png Add some example output. Dec 18, 2010
example1.png Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
example1.sh Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
example2.png Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
example2.sh Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
example3.png Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
example3.sh Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
imgdiff.py Post-release version bump Sep 17, 2016
release.mk Guess who forgot to git add? Dec 19, 2017
setup.cfg Our wheels are universal Oct 30, 2017
setup.py Claim Python 3.7 support Aug 7, 2018
test1.sh Update README, add a bunch of images for testing, and more output exa… Dec 19, 2010
tests.py Oops: restore Python 2 support Dec 1, 2014
tox.ini Claim Python 3.7 support Aug 7, 2018

README.rst

imgdiff

A command-line tool that combines two pictures into a single, larger one, and opens a GUI window (provided by the Python Imaging Library) or an external image viewer.

You could use it with a version control tool, e.g.

bzr diff *.png --using=imgdiff

or

bzr diff *.png --using='imgdiff --eog -H'

Installation

pip install imgdiff or download it from PyPI.

Usage

Run imgdiff --help to see this help message:

Usage: imgdiff [options] image1 image2

Compare two images side-by-side

Options:
  -h, --help            show this help message and exit
  -o OUTFILE            write the combined image to a file
  --viewer=COMMAND      use an external image viewer (default: builtin)
  --eog                 use Eye of Gnome (same as --viewer eog)
  --grace=SECONDS       seconds to wait before removing temporary file when
                        using an external viewer (default: 1.0)
  -H, --highlight       highlight differences (EXPERIMENTAL)
  -S, --smart-highlight
                        highlight differences in a smarter way (EXPERIMENTAL)
  --opacity=OPACITY     minimum opacity for highlighting (default 64)
  --timeout=TIMEOUT     skip highlighting if it takes too long (default: 10
                        seconds)
  --auto                pick orientation automatically (default)
  --lr, --left-right    force orientation to left-and-right
  --tb, --top-bottom    force orientation to top-and-bottom
  --bgcolor=RGB         background color (default: fff)
  --sepcolor=RGB        separator line color (default: ccc)
  --spacing=N           spacing between images (default: 3 pixels)
  --border=N            border around images (default: 0 pixels)

Output Examples

First example:

imgdiff set1/42.png set3/
example #1

Here the images are wide and short, so imgdiff decided to put them one above the other.

Same example, with highlighting enabled:

imgdiff set1/42.png set3/ -H
example #2

You can see that it doesn't work very well, although it can produce nice results in simpler cases:

imgdiff set1/42.png set2/ -H
example #3

Support and Development

The source code can be found in this Git repository: https://github.com/mgedmin/imgdiff.

To check it out, use git clone https://github.com/mgedmin/imgdiff.

Report bugs at https://github.com/mgedmin/imgdiff/issues.