LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

magick-compare

compares two images and outputs their differences

TLDR

Compare two images
$ magick compare [image1.png] [image2.png] [diff.png]
copy
Calculate difference metric
$ magick compare -metric AE [image1.png] [image2.png] null:
copy
Use specific comparison method
$ magick compare -metric RMSE [image1.png] [image2.png] null:
copy
Highlight differences in red
$ magick compare -highlight-color red [image1.png] [image2.png] [diff.png]
copy
Search for a subimage within a larger image
$ magick compare -subimage-search [haystack.png] [needle.png] [result.png]
copy
Print detailed per-channel distortion stats
$ magick compare -verbose -metric AE [image1.png] [image2.png] null:
copy

SYNOPSIS

magick compare [options] image1 image2 [diff]

DESCRIPTION

magick compare compares two images and outputs their differences. Part of ImageMagick. Produces a difference image and/or calculates numerical metrics. Useful for regression testing and quality assurance.

PARAMETERS

-metric type

Comparison metric (AE, RMSE, PSNR, MAE, MSE, NCC, PHASH, DSSIM). Default: RMSE.
-highlight-color color
Color used to mark differing pixels.
-lowlight-color color
Color used for matching pixels.
-fuzz percent
Color tolerance for comparison.
-subimage-search
Search for the smaller image inside the larger.
-dissimilarity-threshold value
Maximum permitted distortion for a match (default: 0.2).
-similarity-threshold value
Minimum distortion considered similar (default: 0.0).
-channel type
Restrict comparison to specified channels.
-verbose
Print per-channel distortion metrics.

INSTALL

sudo pacman -S imagemagick
copy
sudo apk add imagemagick
copy
brew install imagemagick
copy
nix profile install nixpkgs#imagemagick
copy

SEE ALSO

Copied to clipboard
Kai