4

I have came up with this:

montage -background Orange -label "Faerie Dragon" -gravity South test.png -geometry "100%" -font TREBUC.ttf -pointsize 25 out.png

It adds text "Fearie Dragon" with font Trebuchet in size 25 on orange background below the image test.png and doesn't scale original image.

The only problem is: how can I put the text above the image not below? Gravity option doesn't seem to do anything.

Andrea
  • 11,801
  • 17
  • 65
  • 72
Tom
  • 2,962
  • 3
  • 39
  • 69
  • 1
    Your example ( except you are using montage instead of convert for some reason ) came from this page originally and it should answer your question: https://www.imagemagick.org/Usage/annotating/ – Bonzo Mar 19 '17 at 20:50
  • They suggest on this page to change order or "images" but that doesn't do anything good- the label doesn't appear on the image. – Tom Mar 20 '17 at 23:56
  • 1
    It is the main Imagemagick example site and it is strange it does not work for you. But I can not add any other advice as you do not say what operating system you are using, how you are running the code or show a copy of the code you are using now. – Bonzo Mar 21 '17 at 07:43

1 Answers1

3

You can put the annotation on the upper side of the image using convert instead of montage with the following command:

convert test.png -pointsize 25 -gravity North -background Orange -splice 0x32 -annotate +0+4 "Faerie Dragon" out.png

This is the output of your command with montage:

enter image description here

This is the output of the command with convert:

enter image description here

Starting from a 400x300 image both commands generate a 400x332 image.

Tested with ImageMagick 7.0.5-3 on Windows

Andrea
  • 11,801
  • 17
  • 65
  • 72