title: PHP GD - Add a color layer over a image
body: <p>I want to add a color layer over a image in php using gd.</p>
  
  <p>This is the image: <a href="https://i.stack.imgur.com/vJc6N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vJc6N.png" alt="Image"></a></p>
  
  <p>I want to overlay this with this color: #ABD0D2</p>
  
  <p>I made a quick image how it should look at the end.
  Keep in mind that the image should still be transparent
  <a href="https://i.stack.imgur.com/WKFRU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WKFRU.png" alt="enter image description here"></a></p>
  
  <p>So far I have this code:</p>
  
  <pre><code>$img = imagecreatefrompng('image.png');
  
  imagesavealpha($img, true);
  imagefill($img, 0, 0, imagecolorallocatealpha($img, 0, 0, 0, 127));
  
  // make overlay with new color???
  
  imagepng($img, 'new.png');
  imagedestroy($img);
  </code></pre>