Getting started with imagemagick – Compare the difference between an image

ImageMagick includes a number of command-line utilities for manipulating images.
Here we will use compare command-line tool.

compare tool is very useful. Suppose you want to test (e.g. layout,
color, icons etc.) the difference between your expected design UI HTML
file with actual result of JSP file, you just need to use compare command.
You do not need to compare with your own eyes.

1.jpg

enter image description here

2.jpg

enter image description here

First we will compare same image.

magick compare 1.jpg 1.jpg difference1.jpg

Result ⇒ difference1.jpg

White de-emphasizes (lowlight) pixels that are untouched by modifying.

enter image description here

Let’s compare an image to one thats been modifed.

magick compare 1.jpg 2.jpg difference2.jpg

Result ⇒ difference2.jpg

The red areas of the difference image emphasizes (highlight) pixels that are affected by the image modifying.

enter image description here

Here is the list of ImageMagick command-line utilities

if you want to reproduce, please indicate the source:
Getting started with imagemagick – Compare the difference between an image - CodeDay