<?php
$im = imagecreate(100, 100);
$string = 'PHP';
$bg = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
// schreibe ein schwarzes "P" in die linke obere Ecke
imagechar($im, 1, 0, 0, $string, $black);
header('Content-type: image/png');
imagepng($im);
?>
Das oben gezeigte Beispiel erzeugt
eine ähnliche Ausgabe wie: