Page 1 of 1

Gimp-like Subtract

Posted: 2012-11-04T04:56:36-07:00
by blackswan
I noticed, that "difference" of two images looks very alike with Gimp's one
But "subtract" operation result is not even near Gimp's version. Is it possible somehow to do it the same way as Gimp does?

Re: Gimp-like Subtract

Posted: 2012-11-04T06:21:24-07:00
by snibgo
At least for greyscale images, "MinusSrc" is the same as Gimp's "Subtract".

Re: Gimp-like Subtract

Posted: 2012-11-04T11:22:32-07:00
by fmw42
What command did you use in IM? What version of IM? What platform? Which way did you subtract them in GIMP? The issue is whether you did (image1 - image2) or (image2 - image1).

Subtract in IM for (image1 - image2) is done by (swapping the order of the two inputs if using convert and not swapping if you use composite)

convert image1 image2 +swap -compose minus -composite result

or

convert image2 image1 -compose minus -composite result

or using the old composite

composite -compose minus image1 image2 result

See
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#minus

Also in IM difference gives the absolute value of the difference. Not sure if you want that or not?

convert image1 image2 -compose difference -composite result