compare
image difference detection and comparison
TLDR
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.-verbose
Display detailed comparison information and computed metrics.
METRICS
AE: Absolute Error (count of differing pixels)RMSE: Root Mean Square Error (0 = identical)MAE: Mean Absolute Error (0 = identical)MSE: Mean Squared ErrorPSNR: Peak Signal to Noise Ratio (higher = more similar)SSIM: Structural Similarity Index (1 = identical)NCC: Normalized Cross Correlation (default metric)PHASH: Perceptual Hash
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.
