ImageMagick Text Positioning

Viewed 18

I have the following ImageMagick code to make a custom banner. Im slowly dialing it in, however I can't seen to work out the text position. Im not sure if my -annotate +150+200 is even the correct approach here. This is the test page. The text needs to be vertically centered and moved to the right so that its in the teal section. https://drunkrobots.net/test_img_all.php

exec("convert https://drunkrobots.net/dr_img/3.png -resize 600x600 -gravity west -background teal -extent 1800x600 -pointsize 130 -fill 'white' -annotate +150+200 'This is test text' output.jpg");

enter image description here

1 Answers

In Imagemagick 6 (unix syntax), you could resize the 3.png image, then create a teal colored image that is 1200x600 (1800-600 in width). Then annotate that in the center. Then append the two images.

convert https://drunkrobots.net/dr_img/3.png -resize 600x600 \( -size 1200x600 xc:teal -pointsize 130 -fill 'white' -gravity center -annotate +0+0 'This is test text' \) +append output.jpg

enter image description here

Related