Subtitles in IM

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ajes
Posts: 1
Joined: 2012-06-29T02:44:40-07:00
Authentication code: 13

Subtitles in IM

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Subtitles in IM

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Subtitles in IM

Post by anthony »

Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply