← 返回命令列表

Linux command

magick-compare 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Compare two images

magick compare [image1.png] [image2.png] [diff.png]

Calculate difference metric

magick compare -metric AE [image1.png] [image2.png] null:

Use specific comparison method

magick compare -metric RMSE [image1.png] [image2.png] null:

Highlight differences in red

magick compare -highlight-color red [image1.png] [image2.png] [diff.png]

Search for a subimage

magick compare -subimage-search [haystack.png] [needle.png] [result.png]

Print detailed per-channel

magick compare -verbose -metric AE [image1.png] [image2.png] null:

说明

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.

参数

-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.

FAQ

What is the magick-compare command used for?

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.

How do I run a basic magick-compare example?

Run `magick compare [image1.png] [image2.png] [diff.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -metric _type_ do in magick-compare?

Comparison metric (AE, RMSE, PSNR, MAE, MSE, NCC, PHASH, DSSIM). Default: RMSE.