compare â mathematically and visually annotate the difference between an image and its reconstruction.
| Use Case | Command | Description |
|---|---|---|
| Compare two images and output difference | compare image1.png image2.png diff.png | Generate a visual difference annotation image |
| Measure difference with a specific metric | compare -metric PSNR image1.png image2.png diff.png | Use PSNR, MAE, MSE, RMSE, or NCC metrics |
| Highlight differences in a color | compare -highlight-color red image1.png image2.png diff.png | Emphasize pixel differences in red |
| Search for a subimage within a larger image | compare -subimage-search large.png sub.png result.png | Locate and annotate subimage matches |
| Ignore color differences within a tolerance | compare -fuzz 5% image1.png image2.png diff.png | Treat colors within 5% as equal |
| Use a custom composite operator | compare -compose src image1.png image2.png diff.png | Set the image composite operator for the diff |
| Resize images before comparison | compare -resize 800x600 image1.png image2.png diff.png | Resize input images to a common geometry |
| Suppress warnings for quiet operation | compare -quiet image1.png image2.png diff.png | Suppress all warning messages (exit code only) |
| Get detailed information about images | compare -verbose image1.png image2.png diff.png | Print detailed info about the images and comparison |
| List supported metric types | compare -list metric | Print a list of all supported metric arguments |
compare-im6.q16 input-file input-file [options] output-file
The compare-im6.q16 program is a member of the ImageMagick-ims6.q16(1) suite of tools. Use it to mathematically and visually annotate the difference between an image and its reconstruction.
For more information about the compare command, point your browser to file:///usr/share/doc/imagemagick-6-common/html/www/compare.html (on debian system you may install the imagemagick-6 package) or http://imagemagick.org/script/compare.php.
By default, the image format of file is determined by its magic number. To specify a particular image format, precede the filename with an image format name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). Specify file as - for standard input or output.
Two images are considered similar if their difference according to the specified metric and fuzz value is 0, with the exception of the normalized cross correlation metric (NCC), where two images are considered similar when their normalized cross correlation is 1. The default metric is NCC.
-alpha option â on, activate, off, deactivate, set, opaque, copy transparent, extract, background, or shape-authenticate value â decrypt image with this password-background color â background color-channel type â apply option to select image channels-colorspace type â alternate image colorspace-compose operator â set image composite operator-compress type â type of pixel compression when writing the image-decipher filename â convert cipher pixels to plain pixels-define format:option â define one or more image format options-density geometry â horizontal and vertical density of the image-depth value â image depth-dissimilarity-threshold value â maximum distortion for (sub)image match-encipher filename â convert plain pixels to cipher pixels-extract geometry â extract area from image-format "string" â output formatted image characteristics-fuzz distance â colors within this distance are considered equal-gravity type â horizontal and vertical text placement-identify â identify the format and characteristics of the image-interlace type â type of image interlacing scheme-highlight-color color â emphasize pixel differences with this color-limit type value â pixel cache resource limit-lowlight-color color â de-emphasize pixel differences with this color-mask filename â associate a mask with the image-metric type â measure differences between images with this metric-monitor â monitor progress-passphrase filename â get the passphrase from this file-profile filename â add, delete, or apply an image profile-quality value â JPEG/MIFF/PNG compression level-quiet â suppress all warning messages-quantize colorspace â reduce colors in this colorspace-regard-warnings â pay attention to warning messages-repage geometry â size and location of an image canvas-respect-parentheses â settings remain in effect until parenthesis boundary-sampling-factor geometry â horizontal and vertical sampling factor-seed value â seed a new sequence of pseudo-random numbers-set attribute value â set an image attribute-similarity-threshold value â minimum distortion for (sub)image match-size geometry â width and height of image-subimage-search â search for subimage-synchronize â synchronize image to storage device-taint â declare the image as modified-transparent-color color â transparent color-type type â image type-verbose â print detailed information about the image-virtual-pixel method â virtual pixel access method-brightness-contrast geometry â improve brightness / contrast of the image-distort method args â distort images according to given method and args-level value â adjust the level of image contrast-resize geometry â resize the image-rotate degrees â apply Paeth rotation to the image-separate â separate an image channel into a grayscale image-trim â trim image edges-write filename â write images to this file-crop geometry â cut out a rectangular region of the image-delete indexes â delete the image from the image sequence-debug events â display copious debugging information-help â print program options-log format â format of debugging information-list type â print a list of supported option arguments-version â print version informationThe compare program returns:
Copyright (C) 1999-2020 ImageMagick Studio LLC. Additional copyrights and licenses apply to this software, see file:///usr/share/doc/imagemagick-6-common/html/www/license.html (on debian system you may install the imagemagick-6 package) or http://imagemagick.org/script/license.php.
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 17:27 @216.73.216.146
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)