title: Copy an Image with Drop Shadow and Tranparent Background
body: <p>I tried to duplicate a PNG image, which has drop shadow (i.e. alpha channel) and transparent background. However, the resulting image paints the shadow and transparent background with black. I tried with <code>imagecopy</code> and <code>imagecopymerge</code>; neither yielded to valid results, which aren't the same with the original image.</p>
  
  <p><a href="http://savvy.siku-siku.com/lab/php-imagecopy/" rel="nofollow">Preview of the images.</a></p>
  
  <pre><code>$src = imagecreatefrompng('img_box3-bg.png');
  
  /* Using imagecopy. */
  $dest = imagecreatetruecolor(116, 100);
  imagecopy($dest, $src, 0, 0, 0, 0, 116, 100);
  imagepng($dest, 'img_box3-bg.imagecopy.png');
  imagedestroy($dest);
  
  /* Using imagecopymerge. */
  $dest2 = imagecreatetruecolor(116, 100);
  imagecopymerge($dest2, $src, 0, 0, 0, 0, 116, 100, 100);
  imagepng($dest2, 'img_box3-bg.imagecopymerge.png');
  imagedestroy($dest2);
  
  imagedestroy($src);
  </code></pre>
  
  <p>Help? Thanks beforehand.</p>