I would like to put a small watermark on images.
I would like the color of the text to be an inversion of the colors below it, on a pixel by pixel level, thereby insuring it showed up on everything.
Is this possible?
annotate with inverted text colors?
Re: annotate with inverted text colors?
I would guess you would need to create a mask of your watermark - select the part of the image your watermark covers - negate it then composite it back. I do not know how good it would look though.
Re: annotate with inverted text colors?
Thanks. Would there be any sane way to do this with annotate or something similarly simple? The text is just pixel text.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: annotate with inverted text colors?
try these. as bonzo has suggested, you need to create a mask from your text and use it to composite the image and its negative
convert \( rose: -resize 400% \) \( -clone 0 -negate \) \
\( -clone 0 -fill black -colorize 100% -fill white \
-font arial -pointsize 48 -gravity center -annotate +0+0 "TESTING" \) \
-compose over -composite rose_test.png
convert \( rose: -resize 400% \) \( -clone 0 -negate \) \
\( -clone 0 -fill black -colorize 100% -fill white \
-font arial -pointsize 48 -gravity center -annotate +0+0 "TESTING" \) \
-compose dissolve -define compose:args=50,100 -composite rose_test2.png
I resized the rose: IM internal image to make it larger so that I could use a bigger font for demonstration.
convert \( rose: -resize 400% \) \( -clone 0 -negate \) \
\( -clone 0 -fill black -colorize 100% -fill white \
-font arial -pointsize 48 -gravity center -annotate +0+0 "TESTING" \) \
-compose over -composite rose_test.png
convert \( rose: -resize 400% \) \( -clone 0 -negate \) \
\( -clone 0 -fill black -colorize 100% -fill white \
-font arial -pointsize 48 -gravity center -annotate +0+0 "TESTING" \) \
-compose dissolve -define compose:args=50,100 -composite rose_test2.png
I resized the rose: IM internal image to make it larger so that I could use a bigger font for demonstration.
Re: annotate with inverted text colors?
Great work, Fred! Thanks!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: annotate with inverted text colors?
If you use 'difference' composition with a mask. Black remains normal, white becomes negated.
http://www.imagemagick.org/Usage/compose/#difference
However with any negation method perfect grays will always remain unchanged.
This is which watermarks that both lighten and darken images are often a better option. It removes the possibility of having no effect for some specific color in the image.
http://www.imagemagick.org/Usage/compose/#difference
However with any negation method perfect grays will always remain unchanged.
This is which watermarks that both lighten and darken images are often a better option. It removes the possibility of having no effect for some specific color in the image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: annotate with inverted text colors?
Good point. Perhaps a shadow under that annotation?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: annotate with inverted text colors?
If you are wanting annotation rather than watermarking, look at IM examples, Annotations
http://www.imagemagick.org/Usage/annotating/
http://www.imagemagick.org/Usage/annotating/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/