title: PHP GD Merge images manipulated by function
body: <p>Hello there sorry to be a bother to you guys,</p>
  
  <p>I am trying to merge the images together after manipulating the image with a function i have created  but it is not working,</p>
  
  <p>Any ideas?</p>
  
  <pre><code>error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  function tester($image,$r,$g,$b) {
  $img = imagecreatefrompng($image);
  imagealphablending($img, false);
  imagesavealpha($img, true);
  imagefilter($img, IMG_FILTER_COLORIZE, $r,$g, $b);
  return $img;
  }
  header("Content-type: image/png");
  
  
  $image_1 = tester("1.png",123,111,0);
  $image_2 = tester("2.png",123,111,0);
  $x1 = imagesx($image_1);  
  $y1 = imagesy($image_1); 
  $x2 = imagesx($image_2);  
  $y2 = imagesy($image_2); 
  
  
  $slate = imagecreatetruecolor(max($x1, $x2), max($y1, $y2));
  $transparent = imagecolorallocatealpha($slate,0,255,0,127); 
  imagefill($slate,0,0,$transparent); 
  
  imagecopy($slate, $image_1, 0, 0, 0, 0, imagesx($image_1)-1, imagesy($image_1)-1); 
  imagecopy($slate, $image_2, 0, 0, 0, 0, imagesx($image_2)-1, imagesy($image_2)-1); 
  imagepng($slate);
  imagedestroy($slate);
  </code></pre>