Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick multiline text and background image

I'm learning to use ImageMagick, but I'm having trouble when I try to generate an image like the example below:

ImageMagick Example

And for that, I'm using the following code:

convert original.jpg -size 460x caption:'This is a multiline caption, This is a multiline caption, This is a multiline caption.' result.jpg

This command generated two separate images, one with just the title. Can you help me?


PS: I'm using RubyOnRails with ImageMagick, but you can suggest examples with MiniMagick or Rmagick. Thanks.

like image 479
Caio Tarifa Avatar asked Apr 27 '12 15:04

Caio Tarifa


1 Answers

This works in php and I can not see why it will not work o RubyOnRails:

convert original.jpg -size 460x -background transparent -fill black -pointsize 40 caption:'This is a multiline caption, This is a multiline caption, This is a multiline caption.'  -gravity center -composite result.jpg
like image 55
Bonzo Avatar answered Nov 09 '22 08:11

Bonzo