Skip to content
A program that compares two images using a perceptually based image metric.
C++ CMake Shell
Latest commit de7e5d9 Mar 10, 2016 @myint Fix source of typo found in #9
Failed to load latest commit information.
test have run_tests script search for executable more aggressively Sep 9, 2015
.clang-format Allow more whitespace Nov 24, 2013
.clang_complete Enable "clang_complete" Feb 15, 2015
.syntastic_cpp_config Enable OpenMP Jan 10, 2014
.travis.yml Format Nov 24, 2015
CMakeLists.txt Cmake fixes for MSVC Aug 21, 2015
FindFreeImage.cmake Changed cmake to find freeimage automatically Feb 6, 2012
LICENSE Move to the correct place Nov 24, 2013
README.rst Fix typo in README.rst Mar 10, 2016
compare_args.cpp Fix source of typo found in #9 Mar 10, 2016
compare_args.h Undo a signature change of "main()" Jun 15, 2015
coverage.bash Move common code to "coverage.bash" Apr 19, 2013
coverity.bash Document Sep 7, 2014
lpyramid.cpp Add include for ptrdiff_t Aug 20, 2015
memcheck.bash Track origins of memory errors Mar 9, 2014
memcheck.supp Suppress false positive from FreeImage Mar 9, 2014
metric.cpp Clean up Oct 2, 2015
metric.h Increment copyright date Jan 18, 2015
perceptualdiff.cpp Clean up Oct 2, 2015
rgba_image.cpp Clean up Aug 20, 2015
rgba_image.h Avoid implicit conversion Jun 12, 2015



A program that compares two images using a perceptually based image metric.

Build status Static analysis status

Copyright (C) 2006-2011 Yangli Hector Yee

Copyright (C) 2011-2015 Steven Myint, Jeff Terrace

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details in the file LICENSE.

Build Instructions

  1. Download CMake from if you do not already have it on your system.

  2. Download FreeImage from
    • On OS X with MacPorts: port install freeimage
    • On OS X with Brew: brew install freeimage
    • On Ubuntu: apt-get install libfreeimage-dev
  3. Type:

    $ cmake .
  4. Type:

    $ make
  5. To specify the install directory, use:

    $ make install DESTDIR="/home/me/mydist"


Command line:

Usage: perceptualdiff image1 image2

Compares image1 and image2 using a perceptually based image metric.

  --verbose        Turn on verbose mode
  --fov deg        Field of view in degrees [0.1, 89.9] (default: 45.0)
  --threshold p    Number of pixels p below which differences are ignored
  --gamma g        Value to convert rgb into linear space (default: 2.2)
  --luminance l    White luminance (default: 100.0 cdm^-2)
  --luminanceonly  Only consider luminance; ignore chroma (color) in the
  --colorfactor    How much of color to use [0.0, 1.0] (default: 1.0)
  --downsample     How many powers of two to down sample the image
                   (default: 0)
  --scale          Scale images to match each other's dimensions
  --sum-errors     Print a sum of the luminance and color differences
  --output o       Write difference to the file o

Check that perceptualdiff is built with OpenMP support:

$ ./perceptualdiff | grep -i openmp
OpenMP status: enabled


  • Hector Yee, project administrator and originator -
  • Scott Corley, for png file IO code.
  • Tobias Sauerwein, for make install, package_source Cmake configuration.
  • Cairo Team, for bugfixes.
  • Jim Tilander, rewrote the IO to use FreeImage.
  • Steven Myint, for OpenMP support and bug fixes.
  • Jeff Terrace, for better FreeImage support and new command-line options.

Version History

  • 1.0 - Initial distribution
  • 1.0.1 - Fixed off by one convolution error and libpng interface to 1.2.8
  • 1.0.2 - [jt] Converted the loading and saving routines to use FreeImage
  • 1.1 - Added colorfactor and downsample options. Also always output difference file if requested. Always print out differing pixels even if the test passes.
  • 1.1.1 - Turn off color test in low lighting conditions.
  • 1.1.2 - Add OpenMP parallel processing support and fix bugs.
  • 1.2 - Add --sum-errors, use more standard option style, and fix bugs.


Something went wrong with that request. Please try again.