Page 1 of 1

-gravity center gives captions on bottom of images

Posted: 2016-01-06T10:55:20-07:00
by San Zamoyski
Hi!

I have SVG image and i'm trying to put text on it - horizontally and vertically centered, like this:

Code: Select all

convert old_book_cover_1.svg -font Ubuntu-Regular -bordercolor black -fill "#C8B56D" -gravity Center -pointsize 32 -size 540x caption:"Olivia Newton-John" -pointsize 72 -gravity Center -size 540x caption:"Gorączka Sobotniej Nocy" -append -resize 600x +noise gaussian out.png
It works quite cool, but the text is situated UNDER whole original image.

I'm quite new at IM, and sorry it my mistake is obvious.

Regards!

Re: -gravity center gives captions on bottom of images

Posted: 2016-01-06T11:08:44-07:00
by fmw42
Caption creates its own image and needs to be composited over your original image. If you do not want to do the compositing, then use -annotate or -draw, but they will not autofill. See http://www.imagemagick.org/Usage/text/

Untested, but try something like:

Code: Select all

convert old_book_cover_1.svg \
\( -background none -font Ubuntu-Regular -bordercolor black -fill "#C8B56D" \
-gravity Center -pointsize 32 -size 540x caption:"Olivia Newton-John" \
-pointsize 72 -size 540x caption:"Gorączka Sobotniej Nocy" -append \) \
-compose over -composite -resize 600x +noise gaussian out.png
Or separate each caption: command in its own parenthesis, clone and append, delete the pre appended images, then composite over the input.

Re: -gravity center gives captions on bottom of images

Posted: 2016-01-06T11:15:59-07:00
by San Zamoyski
fmw42 wrote:

Code: Select all

convert old_book_cover_1.svg \
\( -background none -font Ubuntu-Regular -bordercolor black -fill "#C8B56D" \
-gravity Center -pointsize 32 -size 540x caption:"Olivia Newton-John" \
-pointsize 72 -size 540x caption:"Gorączka Sobotniej Nocy" -append \) \
-compose over -composite -resize 600x +noise gaussian out.png
Perfect!

Many thanks!