Back to the snippets index

Text made from an image on another image

( Anthony 21/6/2008 )

This creates some text from on image and places it on another image.

IM code:

<?php  
// Create the text from an image and a tempory mask of the word Rubblewebs
$cmd " -size 490x110 xc:none -pointsize 90 ".
" -gravity center -fill black -annotate +0+0 \"Rubblewebs\"  miff:- | ".
" composite -compose Dst_In -gravity center - input.jpg -matte"
Create tempory image
exec
("convert $cmd temp.png"); 
// Place the word image from above over the second image
exec("composite -gravity center temp.png input1.jpg output.png ");
// Delete tempory image
unlink('temp.png');
?>

Image to go with Text made from an image on another image example code