GD and Converting a Transparent PNG-8 to a Transparent GIF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux