Page 1 of 1

Subtitles in IM

Posted: 2012-06-29T03:37:31-07:00
by ajes
Hi,

I'd like to create image, that is subtitle to image. It should look like in VLC or like in YouTube with dark background.
I created something like this:

Code: Select all

convert -background 'white' -transparent 'white' -size '720x480' -fill "rgba(55,55,55,0.7 )" -draw "rectangle 0,380 720,480" -fill 'yellow' -font 'Helvetica' -pointsize '30' -gravity 'South' caption:'TEST' a.png
But text is little dark. I'd like to have real yellow. I think, that text is shadowed by transparent gray area, but I don't know how to change it.

And one more. How can I dynamic calculate position of text. If I have text: TEST, it require only one line on the image, but: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt" will require more lines, and I want that grey are will fit to this text. So how to do it dynamicaly?

Can someone help me?

Regards

Re: Subtitles in IM

Posted: 2012-06-29T11:36:01-07:00
by fmw42
Is this what you want?


convert -size 720x480 xc:none -fill "rgba(255,255,0,1 )" \
-font Arial -pointsize 30 -gravity South -annotate +0+0 "TEST" test.png

Sorry I had to use Arial, but you can put in Helvetica.

see
http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/text/#annotate

Re: Subtitles in IM

Posted: 2012-07-04T18:25:07-07:00
by anthony