How do you get PHP codes for writing on an image?

You can use the GD extension for PHP to edit image files.