Documentation http://www.imagemagick.org/Usage/compos ... s_subtract states "This operator [ModulusSubtract] is not recommended for use in any situation, as 'ModulusAdd' with a Negated Image will provide the same result." But this isn't quite true because black is zero and white is 65535 (in Q16), and 65535 is treated as -1 in modulus arithmetic. -1 is close, but not equal, to zero.
(In addition, the link is broken, and should be to http://www.imagemagick.org/Usage/color_mods/#negate .)
The following commands show the difference:
convert xc:#000100020003 m.png
convert m.png txt:
convert xc:black m.png -compose ModulusSubtract -composite txt:
convert ( xc:black -negate ) m.png -compose ModulusAdd -composite txt:
We can cure the problem by adding 1:
convert ( xc:black -negate ) m.png -compose ModulusAdd -composite -evaluate AddModulus 1 txt:
Tested under IM v6.8.7-1 on Windows 7.
Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
2 posts • Page 1 of 1