Hi,
First time user. I am trying to create a difference image and for some reason it is not working.
I was able to get a difference mask using compare, to identify which images have diffs, but this is useless for my purposes.
I need the actual difference magnitudes.
All the resources online I found say I should be able to do this with:
composite base/$file opt/$file -compose difference out_$file
but the result is completely incorrect.
I even run this script, to composite the original image and itself and I get parts of the image black, parts of the image the original color, and parts of the image random garbage. The difference of an image with itself should be a completely black image so can someone please help me figure out what the correct script to do what I want is?
Version : ImageMagick 6.9.0-0 Q16
Thanks!
Difference image not working
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Difference image not working
try
or better use the more modern convert
see http://www.imagemagick.org/Usage/compose/#compose
Note that -compose difference is the absolute value of the difference. If you want use -compose minus, but that will clip out negative values unless you use HDRI compiled IM.
What kind of image files are you using? What platform?
This simple test works for me using the internal IM image rose:. The result is pure black
If you cannot reproduce this, then upgrade to the current IM, 6.9.1.4, which is what I tested on my Mac OSX Snow Leopard
Code: Select all
composite -compose difference base/$file opt/$file out_$file
Code: Select all
convert base/$file opt/$file -compose difference -composite out_$file
Note that -compose difference is the absolute value of the difference. If you want use -compose minus, but that will clip out negative values unless you use HDRI compiled IM.
What kind of image files are you using? What platform?
This simple test works for me using the internal IM image rose:. The result is pure black
Code: Select all
convert rose: rose: -compose difference -composite result.png