Internet Explorer Support for PNG


Summary: ProductFeedback about InternetExplorerStandardsSupport for Portable Network Graphics

The PNG (Portable Network Graphics) standard: http://www.w3.org/Graphics/PNG/



more at http://blogs.msdn.com/ie/archive/2005/04/26/412263.aspx


AlphaImageLoader Bugs


There are two major AlphaImageLoader bugs out there that burn me on a daily basis: --adam hill

  1. Spaces in the URL path. We can load files from the local filesystem, but if there is a space in the path IE will fail to display the PNG. Spaces in the name are fine. So apps that run off Cassini or are HTA's off the local filesystem that follow MS guidllines and are installed in ""Program Files/<app name>"" break. It does not matter if the full path is or is not in the 'src=' tag. This bug got reported over 2 years ago and acknowledged by MS support, it has not been fixed to date as far as I know.
  2. No HTTPS support. If you serve up a page via https: all PNG's fail to display. You must hard code the 'src' tag with ""http://<full_path>"". If you hardcode ""https:///"" in the 'src=' attribute, it is still busted. So you have a secure page but not secure pictures. This is highly suboptimal.

URLs are not allowed to have spaces in them. You need to encode them (as %20, IIRC). --branko
That was the first thing we tried. But it still does not fix the relative path case of '../Images/foo.png'. Whatever resolve's paths for the DX Filters is not escaping with %20's correctly when the path is fully expanded. - adam

PNG fix with AlphaImageLoader in IE6 breaks when display settings at 120 DPI. Transparent pixels are shown as black. See more at http://blogs.msdn.com/ie/archive/2005/04/26/412263.aspx -- meep



Alpha Transparency Support


Alpha transparency in PNGs allows web designers to do amazing things - the lack of support for alpha transparency in IE/Win is holding back web designers who want to make the most compelling and beautiful sites possible. The fact that IE/Win is the only browser still in general use that dosen't support this is disheartening. -- DalanGalma

Not the prettiest demo, but somebody with a creative streak can easily understand by looking at this how useful alpha PNGs can be for web design: PNG Demo -- DalanGalma



Gamma Correction


The Sad Story of PNG Gamma 'Correction' has a nice overview of the problems with implementing gamma correction. My vote: leave it out if you cannot get it right. I would prefer consistent colors on a web page over inconsistent colors of which some are right.



Summary of Issues

IE 6.0 SP2 (as of this writing) only partially supports PNG images, except for the Mac version, which has very good support. The following info was taken from libpng.org -- fshields

* broken alpha support in Windows versions 4.0b2 through 6.0
* simple transparency only, with bad threshold for transparency vs. opacity, and only for palette images
* completely fails to render some transparent palette images apparently due to nearly-but-not-quite-opaque alpha values
* non-palette images are rendered fully opaque against a light gray background
* 32-bit alpha transparency (but not palette alpha) supported in version 5.5 and later if and only if HTML content is rewritten to use Microsoft-specific DirectX extensions to CSS
* gamma support, apparently slightly broken
* on sRGB (display-gamma 2.2) systems when both sRGB and gAMA chunks are present, uses display-system gamma of approximately 1.93 (i.e., colors appear slightly dark)
* workaround for image authors is to include only sRGB (not both sRGB and gAMA as recommended by PNG spec)
* progressive display of interlaced images (replicating method)
* broken OBJECT support Note 3
* only if "Run ActiveX controls and plug-ins" security preference enabled
* adds unnecessary scrollbars
* MNG support via Jason Summers' MNG4IE ActiveX control
* fails to display PNG images used as CSS backgrounds Note 6
* fails to display PNG images of 4097 or 4098 bytes in size
* sometimes completely loses ability to display PNGs (see FAQ page for various fixes)





Workarounds for IE/Win 5.5+


Note : These don't preclude actual support in the application, since they require additional developer effort, don't support certain things (like alpha-PNG backgrounds) and require clients to download large amounts of fix code. -- DalanGalma

Alpha support requires use of a propertory filter -- ShiningArcanine

There was a javascript fix to get it working, but I haven't tested it myself. -- PTDC

The best fix at the moment seems to be the IE7 behaviour designed by Dean Edwards. Why is it that someone can fix PNG support for IE in their spare time and Mozilla had had it since v1.0; perhaps the IE team are too busy fixing bugs and so have little time to actually improve the browser? This workaround does fix alpha transparency -- sbc

BenAnderton: It seems to me that it should be possible for someone to write a simple browser helper object (BHO) which watches for pages loading and takes a quick trip through the DOM looking for images. When it finds them, it can then turn them into blank images and apply the alphaImageLoader filter so that IE displays them transparently. Users could then install this BHO and have alpha transparency work for all sites, which seems a lot more sensible than having every site install special workaround code. Has this already been done? Is it actually impossible? I'm inclined to try it, but I've never written a COM application before so it'd take me a lot more time than it would take a seasoned COM programmer.



Discussion



A petition (with over 14,500 signatures) that requests Microsoft implement proper PNG Alpha Transparency support is here -- ShiningArcanine




Forget the petition (it means nothing, so any arguments attempting to invalidate it are swiping at thin air), the fact is that every other major browser supports it, even IE5/Mac, and IE/Win dosen't. That's gotta change, no matter if people made a petition or not. -- DalanGalma




That petition is an interesting document, and I was not aware that Microsoft promised full PNG implementation (just goes to show where I've been). But the part of petition that I thought was totally lame was this: _ The PNG format is a World Wide Web Consortium (W3C) recommendation: Microsoft has repeatedly stated their renewed commitment to web standards, so implementing full PNG support would be the next logical step in fulfilling this promise...._ I've seen this type of argument put forth in a number of guises. Sure, Microsoft has a strong commitment to open standards, but that by itself does not commit it to adopting or implementing every specification that passes W3C, IETF, OASIS, ECMA and any other open standards body. Let's take this "next logical step" logic one step further. My drivers licence lets me drive on roads, and I am committed to keeping my car (mostly) on roads: the "next logical step" would be to compel me to drive on every road in the country. I am not saying that supporting PNG is bad or undesirable. I am saying this purported logic is a perversion of logic, and thus weakens the argument. At least in my opinionated and irrelevant opinion. -- StuartCelarier




From the "A little research never hurt anyone" category: In the PNG specification version 1.0, as recommended by the W3C on 1 October 1996, Section 2.4. Alpha Channel#DR.Alpha-channel, clearly and unambigously states: "Viewers can support transparency control partially, or not at all." In other words, a browser (viewer) such as InternetExplorer, may elect to not implement alpha transparency support and still be completely conformant with this specification. So much for the "implementing full PNG support would be the next logical step" argument. If you are going to hold someone's feet to the specification fire, you need to make sure the specification says what you claim it does. This also pretty much invalidates the petition's claim that Microsoft has failed to deliver on its promise for full PNG support, since full support includes viewer support of alpha transparency as an optional feature. Given the false premise of the petition, and the dubious nature of some of the signatures (8. w00kie?), how seriously should anyone take this document? Again, I would absolutely love to see alpha support in IE, and I love to see Microsoft soliciting and responding to customer feedback, but I question the accuracy, integrity and logic of this petition. -- StuartCelarier




Petition, schmetition. Every other modern browser supports alpha transparency for PNGs, including Microsoft Internet Explorer for Mac. In fact, IE/Win supports alpha tranparency for PNGs as well; it just requires the use of non-standard gobbledygook. Kill the gobbledygook, please. Requiring that sort of thing for fancy MS-only features is understandable. Requiring it for standardized functionality, optional or no, isn't. -- setmajer




Petition or no petition. This issue has been my pet issue with IE for a long time - Surely the mere fact that this page exists and the fact that the MSDN and KB have had workaround articles for this issue (using the IE alpha filter) for some years now, shows that this is a major want for developers.

The general lack of development in IE is all the more galling when such strides have been taken with ASP.Net. IE is effectively the presentation layer for several of my companies products, and while Windows.Forms are being now being superseded by Avalon's vector based imagery, we're still stuck trying to get simple transparency.

Full native PNG support shouldn't be an issue it should be a given - IE should be moving onto more complex issues such as SVG and CSS 3. I know I'm drifting a bit here from just PNG support, but to me four or five years ago the IE led the way; we used the (then) advanced features and only had to worry about other broswers catching up, whereas now it's a issue of how do we workaround this limitation of IE on issues like this. Bottom line - it disrupts my workflow and thus costs my company money.

To me PNG support is such a simple easy no-brainer that it really is one of those things that just irks a developer, sure it's not necessary - yeah most major websites still use GIFs yada yada but I remember IE leading the way and that's how it should still be. -- AlexM




The thing that strikes me as odd is that full alpha support would be such a Microsoft thing to do. After all, Microsoft is all about adding features, about happy customers; full alpha would help supply that. --Branko




The code to do it is already there somewhere, you just have to use that filter thing to activate it. Please just activate it automatically for png's with an alpha channel.




Talk with Greg Roelofs. He is not going to do your work for you, but he is probably most aware of what could be improved regarding PNG support in IE/Win.




While you're fixing PNG, why not support MNG and/or APNG as well? APNG is dead simple, it's just an animated sequence of 'flat' PNGs in the one file. Unlike GIF, PNG offers variable bit depths, translucency as well as straight-out transparency, and higher compression efficiency. Tools like MS-Paint can handle it well, why not MSIE? -- leonbrooks
Microsoft Communities