
The temp folder must be chmodded to "0777" on linux servers in order for the image to be saved.
Any number of elements may be placed in each parts folder as long as each element is also defined in the drop down list for that image component.
Use the existing values as a template.
A 30x30 PSD file with a body, mouth, and eyes is supplied as an example.
*NOTE: Be sure the body position never changes! Then position new elements over the body and correct the position of those individually.
You can lock the body layer in Photoshop and it's probably a good idea to do so.
Hide/unhide elements and save the prepositioned elements without trimming.
The final image element size must always be 30x30!
Once your forms are in place and all image parts defined, start by creating
a 30x30 working canvas.
$canvas = imagecreate(30, 30);
$trans = imagecolorallocate($canvas, 200, 255, 200);
imagefill($canvas, 0, 0, $trans);
imagecolortransparent($canvas, $trans);
$body = imagecreatefromGIF($body);
$mouth = imagecreatefromGIF($mouth);
$eye = imagecreatefromGIF($eye);
The final task is to merge all parts with our working canvas and save the finished image to the temp folder
imagecopymerge($canvas, $body, 0, 0, 0, 0, 30, 30, 100);
imagecopymerge($canvas, $mouth, 0, 0, 0, 0, 30, 30, 100);
imagecopymerge($canvas, $eye, 0, 0, 0, 0, 30, 30, 100);

You can view the .phps file below to see how all this works or you can download the entire tutorial package here