Compare - scaled highlight

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
oddeven21
Posts: 1
Joined: 2014-04-15T11:19:11-07:00
Authentication code: 6789

Compare - scaled highlight

Post by oddeven21 »

Hi all,

Using the compare tool, i'm wondering if there is a way to have the highlight color scale based on the delta? For example, the larger the difference is between two pixels, the darker the highlight color is.

compare -metric ae a.png b.png diff.png

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Compare - scaled highlight

Post by fmw42 »

Not with compare. But you can do it with -compose difference. try this

Code: Select all

convert image1 image2 \
\( -clone 0 -function polynomial "0.5 0.5" \) \
\( -clone 0 -fill red -colorize 100 \) \
\( -clone 0 -clone 1 -compose difference -composite -colorspace gray -write show: \) \
-delete 0,1 -compose over -composite result
Adjust -function polynomial to make the background image fade as desired so that you can see the red colorization or make the background image black to just show the difference.

Code: Select all

convert image1 image2  \
\( -clone 0 -fill black -colorize 100 \) \
\( -clone 0 -fill red -colorize 100 \) \
\( -clone 0 -clone 1 -compose difference -composite -colorspace gray -write show: \) \
-delete 0,1 -compose over -composite show: 
or to see the color differences in each channel

Code: Select all

convert logo: logo_blur.png -compose difference -composite -auto-level show: 
see
http://www.imagemagick.org/Usage/compare/#difference
Post Reply