ImageMagick: Command-line Tools: Compare
Author: ImageMagick Studio LLC
Description: ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (P [cell cut: 1167 characters, first 1000 kept]
Keywords: command-line, tools:, compare, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand

Use the `compare` program to mathematically and visually annotate the difference between an image and its reconstruction. See Command Line Processing for advice on how to structure your `compare` command or see below for example usages of the command. ## Example Usage We list a few examples of the `compare` command here to illustrate its usefulness and ease of use. To get started, lets compare an image to one thats been sharpened:
      convert rose.jpg -sharpen 0x1 reconstruct.jpg
      compare rose.jpg reconstruct.jpg difference.png
The red areas of the difference image show which pixels were affected by the image sharpening, whereas, white is areas that were untouched by the sharpening process In addition to the visual interpretation of the difference in an image and its reconstruction, we report a mathematical measure of the difference :
      compare -metric PSNR rose.jpg reconstruct.jpg difference.png
      29.5615 dB
You can find additional examples of using `compare` in Graphics from the Command Line. Further discussion is available in More Graphics from the Command Line and Examples of ImageMagick Usage. ## Option Summary The `compare` command recognizes these options. Click on an option to get more details about how that option works.
Option | Description
--- | ---
-authenticate value | decrypt image with this password
-channel type | apply option to select image channels
-colorspace type | set image colorspace
-debug events | display copious debugging information
-define format:option | define one or more image format options
-density geometry | horizontal and vertical density of the image
-depth value | image depth
-extract geometry | extract area from image
-fuzz distance | colors within this distance are considered equal
-help | print program options
-identify | identify the format and characteristics of the image
-interlace type | type of image interlacing scheme
-limit type value | pixel cache resource limit
-log format | format of debugging information
-matte | store matte channel if the image has one
-metric type | measure differences between images with this metric
-profile filename | add, delete, or apply an image profile
-quality value | JPEG/MIFF/PNG compression level
-quantize colorspace | reduce image colors in this colorspace
-quiet | suppress all warning messages
-sampling-factor geometry | horizontal and vertical sampling factor
-set attribute value | set an image attribute
-size geometry | width and height of image
-transparent-color color | transparent color
-verbose | print detailed information about the image
-version | print version information
-virtual-pixel method | access method for pixels outside the boundaries of the image

Discourse Server • Mailing Lists • ImageMagick Studio