Merging Three or More Images -- PHP
<p>For my website, I've been trying to make it so people's characters (which are currently composed of several pictures that are moved by CSS) are merged into one image as to make my life easier.  The chunk of code that currently doesn't work is as follows:</p>

<pre><code>                    $template = $charRow['template'];
                    $gender = $charRow['gender'];
                    $shirt = $charRow['shirt'];
                    $pants = $charRow['pants'];
                    $hat = $charRow['hat'];

                    $templatePic = imagecreatefrompng("Templates/".$template);

                    if (!empty($shirt)) {
                        $shirtPic = imagecreatefrompng($shirt);
                        imagecopy($templatePic,$shirtPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic));
                    }
                    if (!empty($pants)) {
                        $pantsPic = imagecreatefrompng($pants);
                        imagecopy($templatePic,$pantsPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic));
                    }
                    if (!empty($hat)) {
                        $hatPic = imagecreatefrompng($hat);
                        imagecopy($templatePic,$hatPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic));
                    }

                    imagePNG($templatePic, 'Images/'); //Problem line...
</code></pre>

<p>This is the error PHP is giving me:</p>

<blockquote>
  <p>Warning: imagepng() [function.imagepng]: Unable to open 'Images/' for writing: Is a directory in PathToParentFolderOfFollowingFile/testFile.php on line 139</p>
</blockquote>

<p>What exactly does this error mean and how can it be fixed?</p>

<p>NOTE: <code>$charRow</code> is not the problem.  The query to get that is just not being displayed to all of you.</p>

<p>Also...How do you make the transparency work?  All the files I'm working with are PNG files WITH transparency.</p>
