Add text on image at specific point using imagemagick

waqas picture waqas · Apr 23, 2014 · Viewed 28.7k times · Source

I want to add text on an image at specific point and want it be centre aligned. How can I specify to margin from top? I want to specify margin in pixels/inches from top.

Currently I am using this command:

 convert temp.jpg -gravity Center  -pointsize 30 -annotate 0 'Love you mom' temp1.jpg 

it is writing text in centre of image. I want text to move to top.

This is what I am getting: enter image description here

This is what i want: enter image description here

Answer

Andrea picture Andrea · Apr 23, 2014

Try using -gravity North (this will move your text to the top of the image) and then adding an offset (-annotate +0+100) to move down your text:

convert temp.jpg -gravity North -pointsize 30 -annotate +0+100 'Love you mom' temp1.jpg