Page 1 of 1

How to annotate text using Xor instead of specific fill color?

Posted: 2015-12-09T23:22:16-07:00
by dawnsong
How to pass a Xor method instead of fill a solid color to write a text into an image?
With Xor, I don't need consider what background of the image would be, and where I cannot write text.
Thanks a lot.

mogrify -gravity SouthWest -fill Blue -annotate +5+5 "X-Y=z" test.png

Re: How to annotate text using Xor instead of specific fill color?

Posted: 2015-12-10T00:03:52-07:00
by fmw42
I am not sure I understand what you want. There is no option for -annotate to use Xor. But you can create a text image using label: or caption: and composite it over the background image using -compose Xor.

See
http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#xor
http://www.magemagick.org/Usage/basics/#mogrify_compose

Please always provide your IM version and platform. See viewtopic.php?f=1&t=9620

Re: How to annotate text using Xor instead of specific fill color?

Posted: 2015-12-10T08:30:46-07:00
by dawnsong
Thanks for the confirmation, I cannot find the option of Xor for -annotate, never thought it does not have :)
I will do it with 2 steps.

Re: How to annotate text using Xor instead of specific fill color?

Posted: 2015-12-10T10:31:27-07:00
by fmw42
Annotate writes directly onto the image and perhaps is using a -compose over method. But I do not think there is any define to change the -compose method to Xor, though you can try adding -compose Xor to the command line just before -annotate and see if that changes things.