An image can be created using image* functions, where * is the file format.
They have this syntax in common:
bool image___(resource $im [, mixed $to [ other parameters]] )
Saving to a file
If you want to save the image to a file, you can pass the filename, or an opened file stream, as $to. If ...