Black background when turning a PNG into a GIF
<p>I have a PNG image I am trying to open and then output as a GIF image. However, the transparency is lost when I do this and the background turns black. If I output the image as a PNG, it works, but I specifically need to open the image as a PNG and the output it as a GIF.</p>

<p>This is what I have so far:</p>

<pre><code> &lt;?php
 header("Content-type: image/gif");

 $new_img = imagecreatefrompng($image);
 imagealphablending($new_img, false); 
 imagesavealpha($new_img, true); 
 imagegif($new_img);
 ?&gt;
</code></pre>

<p>However, imagepng($new_img) saves the background transparency but does not output as a GIF.</p>
