title: PHP GD Overlay transparent PNG on top of JPG
body: <p>I am trying to use PHP GD to overlay a frame onto an image.  Here is an example of my source images and what I am trying to achieve...</p>
  
  <p><a href="https://i.stack.imgur.com/veHUC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/veHUC.jpg" alt=""></a></p>
  
  <p>The frame image is a transparent png, my code looks like this...</p>
  
  <pre><code>$dest = imagecreatefromjpeg('image.jpg');
  $src = imagecreatefrompng('frame.png');
  
  imagecopymerge($dest, $src, 0, 0, 0, 0, 300, 300, 50);
  
  header('Content-Type: image/jpeg');
  
  imagejpeg($dest, 'output.jpg');
  
  imagedestroy($dest);
  imagedestroy($src);
  </code></pre>
  
  <p>My output image looks just like the middle one with no frame. Can anyone spot anything obvious I am doing wrong?</p>