why annoted text backgound color must be opposite to image backgound color
Posted: 2016-12-13T02:07:58-07:00
My ImageMagick version: 6.3.9-Q8
OS: Windows 7
Hello,
I was trying to annotate a text to an image, but I found that must have text background color opposite to the image background color, otherwise the text won't show.
[Problem Description]
Say I get two images, one named "bg_white.jpg" (image backgound = white, colorspace = CMYK) and the other named "bg_black.jpg" (image background = black, colorspace = CMYK). The following cmd could have the text show.
# show text for bg_white.jpg
(A interesting thing here, although I set "-background Black -fill White", I could actually get white background with black text, in contrast, if I set "-background White -fill Black", I got nothing, this really confused me)
# show text for bg_black.jpg
[Testing Images]
bg_white.jpg (https://www.dropbox.com/s/1l2r3cqbebjsz ... e.jpg?dl=0)
bg_black.jpg (https://www.dropbox.com/s/oj7hfsiblxaht ... k.jpg?dl=0)
[Requirement]
My requirement is simple: add white borders around the image and write some text (in black) on the bottom border.
I was thinking since I had specified "-bordercolor White", so just annotating text with "-fill black" would solve the problem.
[Question]
Did I do something wrong? Is there anyway that always set "-background White -fill Black" to any image to get what I want?
Appreciate for your help.
Best Regards
John
OS: Windows 7
Hello,
I was trying to annotate a text to an image, but I found that must have text background color opposite to the image background color, otherwise the text won't show.
[Problem Description]
Say I get two images, one named "bg_white.jpg" (image backgound = white, colorspace = CMYK) and the other named "bg_black.jpg" (image background = black, colorspace = CMYK). The following cmd could have the text show.
# show text for bg_white.jpg
Code: Select all
convert bg_white.jpg -bordercolor White -border 40x40 -font Arial -pointsize 20 -background Black -fill White -gravity South -annotate +0+5 'ThisIsAWhiteBgTest' bg_white_annotated.jpg
# show text for bg_black.jpg
Code: Select all
convert bg_black.jpg -bordercolor White -border 40x40 -font Arial -pointsize 20 -background White -fill Black -gravity South -annotate +0+5 'ThisIsABlackBgTest' bg_black_annotated.jpg
bg_white.jpg (https://www.dropbox.com/s/1l2r3cqbebjsz ... e.jpg?dl=0)
bg_black.jpg (https://www.dropbox.com/s/oj7hfsiblxaht ... k.jpg?dl=0)
[Requirement]
My requirement is simple: add white borders around the image and write some text (in black) on the bottom border.
I was thinking since I had specified "-bordercolor White", so just annotating text with "-fill black" would solve the problem.
[Question]
Did I do something wrong? Is there anyway that always set "-background White -fill Black" to any image to get what I want?
Appreciate for your help.
Best Regards
John