Click to See Complete Forum and Search --> : Removing PNG background green?


cemlouis
01-07-2007, 06:03 PM
Hello I have a sample code like below:

<?php
header('Content-type:image/png');
if ($_SERVER['HTTP_HOST'] == "www.remotedomain.com") {
readfile('granted.png');
} else{
readfile('failed.png');
}
?>


This code shows a PNG image from the same directory. Normally the background of the PNG seems transparent in photoshop but when the script runs on a site for ex grey background the image shows up with a green background. How can I remove this background? The back should be transparent...

Thank you,

MarkR
01-07-2007, 09:45 PM
Some browsers only have partial PNG transparency support. This includes MSIE6 and below.

The trick is (I believe) to create an indexed PNG with a transparent colour, and ensure that it uses that colour. Truecolour RGBA images won't be correctly shown in all cases by these browsers.

mark

Mythotical
01-08-2007, 01:38 AM
Follow this link: PNG Fix for IE (http://homepage.ntlworld.com/bobosola/)

That should fix your problem. Fixed mine.