# man > compare(1)

---
type: CommandReference
command: compare-im6.q16
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `compare-im6.q16 input1 input2 output` — compare two images and output difference annotation
- `compare-im6.q16 -metric mae input1 input2 output` — use a specific metric (e.g., MAE)
- `compare-im6.q16 -subimage-search input1 input2 output` — search for subimage
- `compare-im6.q16 -fuzz 10% input1 input2 output` — tolerate color differences within distance
- `compare-im6.q16 -highlight-color red input1 input2 output` — emphasize pixel differences with red
- `compare-im6.q16 -lowlight-color none input1 input2 output` — de-emphasize pixel differences
- `compare-im6.q16 -dissimilarity-threshold 0.1 input1 input2 output` — set maximum distortion for (sub)image match
- `compare-im6.q16 -similarity-threshold 0.9 input1 input2 output` — set minimum distortion for (sub)image match
- This command is an alias of `magick compare`. View documentation for the original command: [tldr magick compare](https://tldr.sh)

## Name

**compare** - mathematically and visually annotate the difference between an image and its reconstruction.

## Synopsis

`compare-im6.q16` _input-file_ _input-file_ [_options_] _output-file_

## Options

### Image Settings
- `-alpha on|activate|off|deactivate|set|opaque|copy|transparent|extract|background|shape` — set alpha channel mode
- `-authenticate value` — decrypt image with 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` — pixel compression type when writing
- `-decipher filename` — convert cipher pixels to plain pixels
- `-define format:option` — define one or more image format options
- `-density geometry` — horizontal and vertical density
- `-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 format and characteristics
- `-interlace type` — 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
- `-mask filename` — associate a mask with the image
- `-metric type` — measure differences between images (e.g., MAE, MSE, NCC)
- `-monitor` — monitor progress
- `-passphrase filename` — get passphrase from 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 warnings
- `-repage geometry` — size and location of image canvas
- `-respect-parentheses` — settings remain until parenthesis boundary
- `-sampling-factor geometry` — horizontal and vertical sampling factor
- `-seed value` — seed pseudo-random number sequence
- `-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 to storage device
- `-taint` — declare image as modified
- `-transparent-color color` — transparent color
- `-type type` — image type
- `-verbose` — print detailed information
- `-virtual-pixel method` — virtual pixel access method

### Image Operators
- `-brightness-contrast geometry` — adjust brightness/contrast
- `-distort method args` — distort image by method and args
- `-level value` — adjust image contrast level
- `-resize geometry` — resize the image
- `-rotate degrees` — apply Paeth rotation
- `-separate` — separate channel into grayscale image
- `-trim` — trim image edges
- `-write filename` — write images to this file

### Image Sequence Operators
- `-crop geometry` — cut out a rectangular region

### Image Stack Operators
- `-delete indexes` — delete image from image sequence

### Miscellaneous Options
- `-debug events` — display debugging information
- `-help` — print program options
- `-log format` — format debugging information
- `-list type` — print list of supported option arguments
- `-version` — print version information

## Examples

Basic comparison:
shell
compare-im6.q16 image1.png image2.png diff.png
Compare with a specific metric and fuzz value:
shell
compare-im6.q16 -metric AE -fuzz 5% original.png modified.png diff.png
Search for a subimage within a larger image:
shell
compare-im6.q16 -subimage-search large.png small.png result.png
## See Also

[ImageMagick-im6.q16(1)](https://www.chedong.com/phpMan.php/man/ImageMagick-im6.q16/1/markdown)

## Exit Codes

- **0** — images are similar (difference ≤ fuzz, metric = 0 except NCC where correlation = 1)
- **2** — error occurred
- Value between 0 and 1 — images are not similar (distortion measure)