<?php
// Import the image to use... (Uses this file as background)
$TheImage = ImageCreateFromPNG("./imagefile.png");
// Color the text...
$ColorText = imagecolorallocate($TheImage, 0xFF, 0xFF, 0xFF);
// printing the text:
ImageTTFText($TheImage, 14, 0, 5, 20, $ColorText, "Verdana", "Some sample text");
// Let the browser know that it is an image..
header("Content-Type: image/PNG");
ImagePng ($TheImage);
?>
Read up on all the individual functions to learn more.