How to add background color to drawn text

Using ImageMagick 6.8.1, my goal is to add text to the lower left corner of the image and make this text black. Essentially, I want something like a 20x20 black area in the lower left corner of my image and a black area to have text. I understood everything except part of the black background.

This is what I have so far: convert in.tif -pointsize 10 -background "#000000" -fill white -gravity SouthWest -draw "text 0,0 'a'" out.tif)

+6
source share
1 answer

Try what you are looking for undercolor instead of background. Undercolor fills the area covered by the text.

convert in.tif -undercolor Black -pointsize 10 -fill white -gravity SouthWest -annotate 0 'Text String' out.tif

+8
source

All Articles