Page 1 of 1

newbie: can text be rendered ontop an image on the disk?

Posted: 2007-08-09T07:09:20-07:00
by truchty
Hi,

I'd like ImageMagik to render text (from a specific font, size, color, etc.) over a picture I have on disk. Is this possible?

Can ImageMagik render gradients? If so, is it possible for the color of the rendered text to be a gradient?

Thank you very much !! --truchty

Re: newbie: can text be rendered ontop an image on the disk?

Posted: 2007-08-09T07:45:03-07:00
by Bonzo
I tend to use php and I have some examples on my site that you are looking for see my signature.

To use the code on windows or Linux you can change

Code: Select all

exec("convert -size 100x50 gradient:orange-yellow gradiant1.png");
To

Code: Select all

convert -size 100x50 gradient:orange-yellow gradiant1.png

Re: newbie: can text be rendered ontop an image on the disk?

Posted: 2007-08-09T11:27:56-07:00
by truchty
Bonzo: Awesome - :D :D :D thank you for showing how to make gradients. I'll check this out.

World: the other half of the question:

I'd like ImageMagik to render text (from a specific font, size, color, etc.) over a picture I have on disk. Is this possible?

Thanks much, truchty

Re: newbie: can text be rendered ontop an image on the disk?

Posted: 2007-08-09T11:56:36-07:00
by Bonzo
In your first post you mentioned using a gradiant as the text. At the second step use a gradiant image as opposed to my sunflower image and that will do what you want.

http://www.rubblewebs.co.uk/imagemagick ... mposte.jpg

Code: Select all

<?php
// Create the text to use as a mask
exec("convert -size 460x65 xc:none -font action.ttf -pointsize 70 -draw \"gravity center fill black text 0,0 'Albir' \" text_mask.png");
// Lay the mask over the first image to create the text from the image
exec("/usr/local/bin/composite -compose Dst_In text_mask.png -gravity center sunflower_border.jpg -matte text_gradiant.png  ");
//Lay the text over the second image
exec("/usr/local/bin/composite -gravity center text_gradiant.png albir1.jpg composte.jpg ");
?>