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

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
truchty

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

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post 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
truchty

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

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post 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 ");
?>  
Post Reply