Page 1 of 1

Add text below Picture

Posted: 2007-02-03T13:42:51-07:00
by Creativ
Hi,
i just started working with imagemagick, so maybe my problem is easy to solve :D

I got a picture and I want to add with imagemagick a text with black background-color below the picture. So it is supposed to look like the thumbnails at imageshack.us:

Code: Select all

+----------------+
+     PICTURE  +
+                    +
+                    +
+----------------+
+     TEXT        +
+----------------+
I hope you understand what i mean.
How can i do this?

Dennis

P.S.: Sorry for my bad english. I'm from Germany ;)

Posted: 2007-02-03T14:04:20-07:00
by Bonzo
There was a similar post here: http://redux.imagemagick.org/discourse- ... php?t=8320

Code: Select all

exec("convert -size 500x500 old.jpg -thumbnail 150x150 -gravity South -bordercolor black -border 1x1 -background Black -splice 0x15 -fill white -draw 'text 0,0 \"150x150 23kb\"' new.jpg");

Posted: 2007-02-03T14:33:46-07:00
by Creativ
Hi,
Thanks....i almost works perfectly.
There is just one problem:
There isn't any Text.
I tried the following:

Code: Select all

exec("convert -size 500x500 Capture005.jpg -thumbnail 250x250 -gravity South -bordercolor black -border 1x1 -background Black -splice 0x25 -fill white -draw 'text 0,0 \"150x150 23kb\"' test2.jpg"); 
But i get the following picture:
Image

What do i do wrong?

Dennis

Posted: 2007-02-03T14:44:41-07:00
by Bonzo
I have had a similar problem along with others when it comes to text.

All I can suggest is upload a font to the same folder as the code and try to add the font path to the code.
In this case I have uploaded Arial.ttf

Code: Select all

exec("convert -size 500x500 Capture005.jpg -thumbnail 250x250 -gravity South -bordercolor black -border 1x1 -background Black -splice 0x25 -font Arial.ttf -fill white -draw 'text 0,0 \"150x150 23kb\"' test2.jpg");

Posted: 2007-02-03T14:50:37-07:00
by Creativ
Thank You!

Now it works perfectly fine! :D