compare
image difference detection and comparison
TLDR
Compare two images
SYNOPSIS
compare [options] image1 image2 [difference]
DESCRIPTION
compare is an ImageMagick utility that compares two images and highlights the differences. It can output a visual difference image and/or calculate numeric difference metrics.
The tool is useful for visual regression testing, detecting changes in rendered output, and quality assurance workflows. Various metrics quantify the difference between images.
PARAMETERS
-metric type
Output difference metric (AE, RMSE, MAE, PSNR, etc.).-fuzz percent
Allow color tolerance for comparison.-highlight-color color
Color to use for highlighting differences.-lowlight-color color
Color for matching areas.-compose method
Composition method for difference output.-channel type
Compare specific color channel.-subimage-search
Search for subimage in larger image.-dissimilarity-threshold value
Threshold for subimage matching.
METRICS
AE: Absolute Error (pixel count)
RMSE: Root Mean Square Error
MAE: Mean Absolute Error
PSNR: Peak Signal to Noise Ratio
SSIM: Structural Similarity Index
CAVEATS
Images must be same dimensions unless using subimage search. Large images can be slow to compare. Lossy formats may show differences from compression.
HISTORY
compare is part of ImageMagick, created by John Cristy in 1987. ImageMagick has been continuously developed for image manipulation and conversion. The compare tool became essential for automated visual testing in software development.
