Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get PNG transparency working in browsers that don't natively support it?

Our (beloved) designer keeps creating PNG files with transparent backgrounds for use in our applications. I'd like to make sure that this feature of the PNG works in "older" browsers as well. What's the best solution?

edits below

@mabwi & @syd - Whether or not I agree about the use of a PNG is not the point. This is a problem that I need to solve!

@Tim Sullivan - IE7.js looks pretty cool, but I don't think I want to introduce all of the other changes an application. I'd like a solution that fixes the PNG issue exclusively. Thanks for the link.

like image 401
Ian Robinson Avatar asked Aug 13 '08 19:08

Ian Robinson


People also ask

Why are my transparent PNGs not transparent?

Not ALL applications support transparent PNG files unless the file itself is devoid of any "invisible" (there, but layer turned off in Photoshop) layers that might become visible if the application cannot distinguish between a layer that is visible and a layer that is not.

Which PNG types support transparency?

Transparency. The GIF and PNG formats also both support transparency. If you need any level of transparency in your image, you must use either a GIF or a PNG. GIF images (and also PNG) support 1-color transparency.

Why won't my image save with a transparent background?

You may be used to saving image files for web use as JPEGs, but JPEGs don't support transparent backgrounds. So, instead, you'll need to use a format such as GIF, TIF or, ideally, PNG. The PNG file is small enough for use online but still delivers high quality with transparency as well.


1 Answers

  • IE PNG Fix 2.0 which supports background-position and -repeat!

Also paletted 8-bit PNG with full alpha transparency exist, contrary to what Photoshop and GIMP may make you believe, and they degrade better in IE6 – it just cuts down transparency to 1-bit. Use pngquant to generate such files from 24-bit PNGs.

like image 174
Kornel Avatar answered Sep 22 '22 08:09

Kornel