PHP png image compositing
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1394061/how-to-merge-transparent-png-with-image-using-php">How to merge transparent PNG with image using PHP?</a>  </p>
</blockquote>



<p>I am completely lost here, so help would be greatly appreciated.
I am new to PHP image manipulation.</p>

<p>I have two semi-transparent png files, and I would like to overlay one over the other and output the resulting png.</p>

<p>Thanks in advanced.</p>

<p>EDIT:</p>

<ol>
<li>GD, though I can change that if needed.</li>
<li>So far I've hacked this together from what I could find on the internet.
It does not work.</li>
</ol>

<p><br />


<pre><code>$img = imagecreatefrompng('image.png');
imagealphablending($img, true);
imagesavealpha($img, true); 
$src = imagecreatefrompng('image2.png');
imagealphablending($src, true);
imagesavealpha($src, true);
imagecopymerge($img, $src, 0, 0, 0, 0, 200, 200, 50);

header("Content-type:image/png");
imagepng($img);
?&gt;
</code></pre>
