Hi

I am having problems getting GD to convert a transparent PNG-8 to a transparent GIF
The below WILL produce a GIF...but leaves a white background

# Convert the PreExisting PNG Image to a GIF
$img = imagecreatefrompng($pngPath);

# Set the GIF to be transparent: Does not seem to work
$trans_color = imagecolortransparent($img );
$trans_index = imagecolorallocate($img, $trans_color['red'], $trans_color['green'], $trans_color['blue'] );
 imagecolortransparent($img, $trans_index );
                        
# Save the Image as a GIF in the directory
imagegif($img, $gifAbsolutePath);


Is there another way that works?

Many thanks in advance

G

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to