Code: Select all
convert infile.png -font font.ttf -gravity south \
-stroke "#000C" -strokewidth 3 -pointsize 400 \
-annotate 0 "Welcome to my world" \
-resize 1024x768 outfile.png
What I want to do is have pointsize calculated automatically so that I can specify the text size as a percentage of the total image size (or I'm happy stating it in pixels relative to the original image). In other words, what I'd like to do is something like this:
Code: Select all
#This doesn't work!
convert infile.png -font font.ttf -gravity south \
-stroke "#000C" -strokewidth 3 -size 3400x1020 \
-annotate 0 "Welcome to my world" \
-resize 1024x768 outfile.png
Code: Select all
#This doesn't work either!
convert infile.png -font font.ttf -gravity south \
-stroke "#000C" -strokewidth 3 -size 100% \
-annotate 0 "Welcome to my world" \
-resize 1024x768 outfile.png
What if I wanted to do 80% instead of 100%?
If I want instead to start by defining a bounding box for the text over the image, then let the text be scaled to fit within that box (with gravity applied as necessary), what is the best way then?