Page 1 of 1

How to push text label down

Posted: 2015-09-05T00:01:24-07:00
by robocop
Hi Folks, Hope someone could help me please :)

With the following command:

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font times.ttf \
          -size 500x500  -pointsize 300   -gravity center \
          label:W    sample.jpg
I get the following image which appears center:
Image

I'm trying to push the text a bit down so it would appear something like this:
Image

I'm not using the -gravity south feature as I need it at an exact position. I also tried the padding feature but it added more pixels to the image canvas size. I do need the canvas size to remain the same.

Using ImageMagick 6.7.7-10

Any help is greatly appreciated!

Thank you

Re: How to push text label down

Posted: 2015-09-05T01:06:52-07:00
by Bonzo
You can use -geometry +0+0 on its own to set the distance from the top left corner or use it with -gravity to adjust it from there.

Although it may not work with label: depending the effect yoU are after can you use -annotate ?

Re: How to push text label down

Posted: 2015-09-05T06:19:19-07:00
by 246246
Bonzo wrote:You can use -geometry +0+0 on its own to set the distance from the top left corner or use it with -gravity to adjust it from there.

Although it may not work with label: depending the effect yoU are after can you use -annotate ?
-extent seems to work for label; you have to use negative y value to move down.

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font '/Library/Fonts/Times New Roman.ttf' -size 500x500  -pointsize 300 -gravity center -extent +0-50 label:W show:
Edit:
To modify to correct order by snibgo's suggestion just below:

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font '/Library/Fonts/Times New Roman.ttf' -size 500x500  -pointsize 300 -gravity center label:W -extent +0-50 show:

Re: How to push text label down

Posted: 2015-09-05T06:30:14-07:00
by snibgo
"-extent" is an image operation, not a setting. So it should be placed after the image has been created, not before.

Re: How to push text label down

Posted: 2015-09-05T06:50:38-07:00
by 246246
Thank you snibgo for correcting. (Currently it works even at the very first position, probably for backward compatibility.)

Re: How to push text label down

Posted: 2015-09-06T06:26:46-07:00
by robocop
246246 wrote:
Bonzo wrote:You can use -geometry +0+0 on its own to set the distance from the top left corner or use it with -gravity to adjust it from there.

Although it may not work with label: depending the effect yoU are after can you use -annotate ?
-extent seems to work for label; you have to use negative y value to move down.

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font '/Library/Fonts/Times New Roman.ttf' -size 500x500  -pointsize 300 -gravity center -extent +0-50 label:W show:
Thank you so much! The code worked perfect with the -extent suggestion you gave. This will save me a great deal of time :) Thanks again!

Re: How to push text label down

Posted: 2015-09-06T06:28:50-07:00
by robocop
Bonzo wrote:You can use -geometry +0+0 on its own to set the distance from the top left corner or use it with -gravity to adjust it from there.

Although it may not work with label: depending the effect yoU are after can you use -annotate ?
I did try both of them with not much luck, however the -extent operation given by 246246 did the trick.

Thanks again for your help and suggestions! Appreciate it!

Re: How to push text label down

Posted: 2015-09-06T10:48:13-07:00
by fmw42
Another solution is just to use -roll, if you have enough padding.

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font '/Library/Fonts/Times New Roman.ttf' -size 500x500  -pointsize 300 label:W -roll +0+50 show:
see
http://www.imagemagick.org/script/comma ... s.php#roll

Re: How to push text label down

Posted: 2015-09-11T05:15:27-07:00
by robocop
fmw42 wrote:Another solution is just to use -roll, if you have enough padding.

Code: Select all

convert -background white -fill '#FF6961' -stroke '#FF6961'  -font '/Library/Fonts/Times New Roman.ttf' -size 500x500  -pointsize 300 label:W -roll +0+50 show:
see
http://www.imagemagick.org/script/comma ... s.php#roll
Yes this works great as well! Both the solutions do the trick :)

Thanks for your help. Much appreciated! Cheers