When I perform and image overlay in php using the GD library, I always get a black background, however, all the images overlay correctly. Can someone help?
<?php
    $images = array( $_GET['color'], $_GET['face'], $_GET['hat'] );
    $img = imagecreatetruecolor(58, 75);
    imagealphablending($img, true);
    imagesavealpha($img, true);
    imagecolorallocate($img, 255, 205, 255);
    imagecolorallocate($img, 255, 255, 255);
    imagecolortransparent($img, $white);
imagefilledrectangle($img, 0, 0, $imgWidth, $imgHeight, $white);
    foreach($images as $fn) {
        $cur = imagecreatefrompng($fn);
        imagealphablending($cur, true);
        imagesavealpha($cur, true);
        imagecopy($img, $cur, 0, 0, 0, 0, 58, 75);
        imagedestroy($cur);
    }   
    header('Content-Type: image/png');
    imagepng($img);
?>