title: PHP remove a section of image leaving a transparent space
body: <p>I have an transparent image with a bar through the middle...
  <a href="http://i66.tinypic.com/2zyeg4h.png" rel="nofollow">http://i66.tinypic.com/2zyeg4h.png</a></p>
  
  <p>Using php I would like to remove the middle part on the bar, leaving a transparent space in the middle of the bar. I try this code...
      
  
  <pre><code>$im = imagecreatefrompng('****root****/image.png');
  //make a yellow box
  $transparent = imagecolorallocate($im, 255, 255, 0);
  //make the yellow box transparent
  imagecolortransparent($im, $transparent);
  imagefilledrectangle($im, 200, 115, 300, 137, $transparent);
  
  imagealphablending($im, false);
  imagesavealpha($im, true);
  
  header ('Content-Type: image/png');
  
  imagepng($im);
  
  $save = "****root****/test.png";
  imagepng($im, $save);
  imagedestroy($im);
  ?&gt;
  </code></pre>
  
  <p>But the output image has the rectangle retain the yellow colour, rather than turn it transparent. </p>
  
  <p><a href="http://i67.tinypic.com/1ny6j4.png" rel="nofollow">http://i67.tinypic.com/1ny6j4.png</a></p>
  
  <p>Where am I going wrong? If I remove...</p>
  
  <pre><code> imagealphablending($im, false);
   imagesavealpha($im, true);
  </code></pre>
  
  <p>I get the transparent box in the center (in the browser), but the rest of the image loses it's transparency and has a white background instead, also when I download that image and open in a photo editor, the transparency box in the center is gone. I have GD libraries set up on my server.</p>