вот кусок моего скрипта отвецающий за создание картинки
$im=imageCreateFromPNG ("counter.png");
$white=imageColorAllocate($im, 255,255,255);
$black=imageColorAllocate($im, 0,0,0);
@imageString ($im, 2, 136, 17, " ".$today_hosts, $white);
@imageString ($im, 2, 136, 30, " ".$total_hosts, $white);
@imageString ($im, 2, 136, 42, " ".$today_hits, $white);
@imageString ($im, 2, 136, 54, " ".$total_hits, $white);
@imageString ($im, 2, 136, 66, " ".$online, $white);
header ("Content-type: image/png");
imagePNG ($im);
imageDestroy ($im);
?>