Вот как я это делаю.
/* load the image */
$im = imagecreatefrompng("image.png");
/* black for the text */
$black = imagecolorallocate($im, 0, 0, 0);
/* put the text on the image */
imagettftext($im, 12, 0, 0, 0, $black, "arial.ttf", "Hello World");
/* load the jpg */
$jpeg = imagecreatefromjpeg("image.jpeg");
/* put the png onto the jpeg */
/* you can get the height and width with getimagesize() */
imagecopyresampled($jpeg,$im, 0, 0, 0, 0, $jpeg_width, $jpeg_height, $im_width, $im_height);
/* save the image */
imagejpeg($jpeg, "result.jpeg", 100);
Это довольно простой пример.