Getting .png images to work with ie

Getting .png images to work with ie

by matias törrönen -
Number of replies: 4
Hello!

I would like to use .png images in my Moodle Themes.
Problem is that png images with alpha transparenty doesn't work well with ie.

Now somebody is maybe about to say: "just forget png", but I think that there is a way to get them work in ie as well.

http://koivi.com/ie-png-transparency/
From link above you can find a php-script which will get pngs work in ie!

So my question is: Where should I but this php-script in my moodle directory?
In what file should i put that it would work?


Average of ratings: -
In reply to matias törrönen

Re: Getting .png images to work with ie

by Greg Lyon -
I've gone with a less elegant solution, but one that satisfies in my situation...

If you a) know what the background color your pngs will be on is, and don't have too many of 'em, you can change the background color to match. No php required, alpha transparency retained for 'modern' browsers, and it looks pretty good in IE6 too...

here's a program that can manipulate the background color. http://entropymine.com/jason/tweakpng/ it's the bKGD parameter that has to be changed. I have quite a few to modify and am planning to script it but haven't got to that yet. I did decide that this would be less intrusive then the php script way for my own Moodle needs...

Hope it helps!
In reply to matias törrönen

Re: Getting .png images to work with ie

by Damon Seymour -
Hi. I went to crazy lengths to figure out how to use PNG images in my Silk theme. In the end I gave in and went back to GIFs. Sadly, the IE6 PNG scripts I found made the page load painfully slow if there were more than 10 images that needed replacing.

If you still want to, the easiest way I figured out how to use PNG images in a Moodle theme is to simply change the .png extension to .gif and throw them in the pix folder. It seems silly, but every browser I used didn't have a problem with it. They ignore the file extension and use the data inside the file to render it. Sweet looking in every browser but IE6.
In reply to Damon Seymour

Re: Getting .png images to work with ie

by Albert Kapune -
Hi Damon,

I have converted all the PNG files to (transparent) GIF and changed the references to them accordingly. I think your clear theme is worth that work. smile

If someone is interested I would be glad to share that modified theme.

Kind regards
Albert