Código HTML:
<?php header("Content-type: image/png");
// Crear la imagen
$im = imagecreatetruecolor(400, 30);
// Crear algunos colores
$blanco = imagecolorallocate($im, 255, 255, 255);
$gris = imagecolorallocate($im, 128, 128, 128);
$negro = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $gris);
// El texto a pintar
$texto = 'Probando 123';
// Reemplaze la ruta con su propia ruta a la fuente
$fuente = 'arial.ttf';
// Agregar una sombra al texto
imagettftext($im, 20, 0, 11, 21, $gris, $fuente, $texto);
// Agregar el texto
imagettftext($im, 20, 0, 10, 20, $negro, $fuente, $texto);
// Usar imagepng() resulta en texto más claro, en comparación con imagejpeg()
imagepng($im);
imagedestroy($im);
?>