imagemagick

 

目錄

 


convert

 

convert old.png -resize '400x300!' new.png

-resize 50% Old.png New.png

-scale 50%

minify / magnify the image with pixel block averaging and pixel replication, respectively.
(The results are thus equivalent to using -resize with a -filter setting of box.)
faster form of the resize command.
 

在 compare 時的應用

The size of thumbnails to compare: the smaller it is, the more details are removed.

The exclamation mark is needed to force image scale without preserving ratio.
 


compare

 

Mathematically and visually annotate the difference between an image and its reconstruction.

# compare two images similarity

  • keypoint matching
  • histogram

Usage

compare input-file input-file [options] output-file

-metric type

To measure differences between images with type (PSNR ...)

To get the metric value use the string format "%[distortion]"

type

PSNR (Peak Signal to Noise Ratio)

The ratio of mean square difference to the maximum mean square,
that can exist between any two images, expressed as a decibel value.

The higher the PSNR the closer the closer the images are,
with a maximum difference occurring at 1.

A PSNR of 20 means differences < 1%

AE (Absolute Error)

count of the number of different pixels (0=equal)

This value can be thresholded using a -fuzz setting to only count pixels that have a larger then the threshold

PAE (Peak Absolute Error)

MAE (Peak Absolute Error)

within a channel, for 3D color space)

MSE (Mean squared error)

RMSE

(sq)root mean squared error

i.e.

# 獲得一個 floating point number (i.e. 17.66828)

compare -metric PSNR 1.png 2.png /dev/null