Page 1 of 1

Caption positioning on a background problem - advice sought!

Posted: 2013-06-19T03:56:13-07:00
by markth
Hi all

I have been battling for a couple of days with correct syntax, going around the houses. I have a background image that is 1024 x 768 px, and I want to drop a caption (of area 400 x 200) onto it, but at a position 150px from the left and 100px from the top. I can get the caption (with DropShadow!) onto the background image but I'll be a monkey's something if I can then position it correctly onto the background.

Here's where I am:

C:\imagemagick\convert.exe "background.jpg" ( -background none -fill white -kerning -2 -font "fonts\gotham.ttf" -geometry 44x44 -size 400x200 caption:"The Text I Want On The Image" ( +clone -shadow 60x2+1+1 ) +swap ) -layers merge "outputfile.jpg"

Any guidance on how to position the caption layers would be great.

Re: Caption positioning on a background problem - advice sou

Posted: 2013-06-19T03:56:59-07:00
by markth
PS the caption is positioning itself top left at the moment.

Re: Caption positioning on a background problem - advice sou

Posted: 2013-06-19T04:19:14-07:00
by snibgo

Code: Select all

convert -size 1024x768 xc:blue background.jpg

convert ^
  "background.jpg" ^
  ( -background none -fill white ^
    -kerning -2 -font "Arial" ^
    -size 400x200 ^
    caption:"The Text I Want On The Image" ^
    ( +clone -shadow 60x2+1+1 ) ^
    +swap ^
    -layers merge ^
    -repage +150+100 ^
  ) ^
  -layers merge ^
  "outputfile.jpg"
I have merged your caption and shadow then set a "-repage".

I've also removed "-geometry 44x44" as it didn't seem to be doing anything (but I could be wrong).

Re: Caption positioning on a background problem - advice sou

Posted: 2013-06-19T05:28:27-07:00
by markth
That's brilliant - thank you very much for your help - it has put me back on the right course!