Here's a quick rundown of what you can do:
[man]imagecreate/man a gd image stream.
[man]imagecolorallocate/man some new colors (first one will be bg color!)
[man]file_get_contents/man to get the contents of the file (durr).
[man]imagestring/man that sweet sucker down onto the image.
[man]imagepng/man/[man]imagejpeg/man/any other output format you may enjoy to the browser.
[man]imagedestroy/man to clean up.
Voila. Very basic, but it should get you started.