PNG rendering problems with IE8

Hello,

I’ve searched extensively for a solution to this problem, including on the sitepoint forums. I found a couple of threads that make good suggestions and none of them has worked yet for me.

I, like others I’ve seen on the forums, cannot get a png8 nor a png24/32 to render with transparency in IE8. I tried a plethora of methods, including:

  1. utilities like pngcrush to remove all chunks but transparency
  2. creating png8 with alpha transparency format using Fireworks as noted in this article: PNG8 – The Clear Winner » SitePoint
  3. using CSS filters such as this example:
    filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(src=‘image.png’, sizingMethod=‘scale’);

Absolutely nothing works. I have not tried IEpngFix as I’ve never been able to get that to work on any version of IE. I’m frankly out of patience with IE’s inability to do things like this when other browsers have no trouble. The site in question is:

Black Cypress Capital Management - Principles

None of the links in the menu have destinations at this time aside from the three under the “main” button. But, the lack of transparency is evident on all the links, especially on the dropdown menus. FF and Chrome render the transparency perfectly. Short of slicing out these menu item images for each and every page that has a different background, I can’t think of a workaround.

Any advice on getting IE8 to actually render a PNG properly would be much appreciated. Thank you.

IE should not have any trouble with semi-transparent images. IE6 did not correctly deal with alpha layers. IE7, 8, 9… have no issues there.

I see in IE7 that they do seem solid. However, I cannot see what IE does when you don’t add M$ filters to the links, which leads me to suspect they are messing with IE somehow (though I did assume you started out without doing any of these).

  1. utilities like pngcrush to remove all chunks but transparency

I use PNGcrush to help stop Firefox and Safari from destroying my colours (and usually reducing image size, yay), but not using it has never affected IE.

Though as a side note: if you are supporting IE6, set that colour you have in the semi-trans (the beige) as your background colour when you save… and IE6 should show that as a solid colour (as you’re getting now with all IE’s), which is better than the grey people tend to get.

  1. creating png8 with alpha transparency format using Fireworks as noted in this article: PNG8 – The Clear Winner » SitePoint

If you have that program, you should stick with that simply because of IE6 + smaller filesize : )

  1. using CSS filters such as this example:
    filter: progid: DXImageTransform.Microsoft.AlphaImageLoader(src=‘image.png’, sizingMethod=‘scale’);

Avoid this. Besides, IE8 was when Microsoft decided the Right Thing To Do would be to use -ms prefix like the other browsers do.

I’m interested in solving this because I’m curious why the images look solid in IE, but honestly, the links are easier to read in IE because they are not showing shadows everywhere.

The target and name attributes are a great throwback to the 90’s. Where’s my grunge band garage-shirt?

Could you make a test version without any IE filter-whatsits or anything, just the image? And remove in this test version the background positioning to show the semi-trans only on hover… leave it there for all states.

Thank you for your reply. You’re absolutely right about the target and name attributes on the anchors. I don’t know what I was thinking.

I did not create a separate test version of the page, I just backed up my work and made some slight mods to the current pages to leave the highlight images static for all states. I also removed any filter/opacity settings in the CSS and yes, they were not there when I initially tested the look of the images. I added the opacity/filter in the CSS to experiment, but it has no real impact on the look in any browser at 95% opaque.

Part of the problem with this is the strict aesthetic requirements placed on me by the designer/client. She wants that translucent look even though the links are easier to read in the solid IE version of the .pngs, not to mention she insists on a particular font that is not “standard” nor available via a substitution service like typekit. I can work around that to please the client but it hasn’t made implementing these navigation menus any easier.

I certainly appreciate any further suggestions you have to offer. Thanks again.

So is the link in your first post a “clean” version we can look at?

This is indeed really weird. http://stommepoes.nl/furnimg/panda.png gives me good see-through in my copies of IE (except 6)

I would suggest axing ALL the transparency as “non-viable web design” – the largest jpeg background ALONE is larger than I would usually allow for an entire PAGE (that’s markup + images + CSS). The effect you have is also so subtle, I very much doubt anyone would miss it.

Though… Hmm… I’m not actually seeing ANYTHING on the page that should warrant the use of alpha transparency… or transparency for that matter. OPACITY (as in the CSS3/IE filter)

… and it makes scrolling up and down painful on anything less than a quad core machine.

Yeah, I’m looking at this and going “what do you need image transparency for?” – precomposite and be done with it.

Of course, that you seem to have presentational images as IMG tags (those belong in the CSS), a slew of DIV and SPAN for nothing, elements that don’t even EXIST in modern code like target, the HTML5 doctype making anything resembling validation meaningless, and images for headings… (lose the fancy font, it’s not worth the non-semantic markup!)…

Oh, that’s where you’re using it, images for headings. I’d swing a giant axe at that as being a PITA to maintain (make a new image every time you want a new heading? No…).

Other issues include ID’s for nothing, incorrect/invalid use of the name attribute (I think you meant to use TITLE) , spans for nothing, spans and flat anchors doing the job of a nested list, and even more images as text making it an accessibility train wreck. You might really like that fancy font, but from a usability standpoint you’ve basically got “how not to design a website” going on there.

If I was REALLY determined to get those fonts in there, I’d be looking at something like fontsquirrel to do it. (Not that I usually advocate using CSS3 properties, but it’s safe enough of one since IE had it before CSS3 was a twinkle in the W3C’s eye)

So first order of business would be to throw about a third of that markup away:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	lang="en"
	xml:lang="en"
><head>

<meta
	http-equiv="Content-Type"
	content="text/html; charset=utf-8"
/>

<meta
	http-equiv="Content-Language"
	content="en"
/>

<link
	type="text/css"
	rel="stylesheet"
	href="screen.css"
	media="screen,projection,tv"
/>

<link
	rel="shortcut icon"
	href="favicon.ico"
/>

<title>
	Black Cypress Capital Management - Principles
</title>

</head><body>

<div id="firstPageWrapper"><div id="secondPageWrapper">

	<h1>
		Black Cypress
		<small>Principles</small>
		<span><!-- image replacement --></span>
		<b><!-- image replacement --></span>
	</h1>
	
	<ul id="mainMenu">
		<li>
			<a href="/">Main</a>
			<ul>
				<li><a href="/principles">Principles</a></li>
				<li><a href="/process">Process</a></li>
				<li><a href="/products">Products</a></li>
			</ul>
		</li>
		<li>
			<a href="/cypresslog">Cypress Log</a>
		</li>
		<li>
			<a href="/citizenship">Citizenship</a>
			<ul class="vertical">
				<li><a href="/philanthropy">Our Approach to Philanthropy</a></li>
				<li><a href="/environment">Environmental Stewardship</a></li>
				<li><a href="/charity">Charitable Partnership</a></li>
			</ul>
		</li>
		<li>
			<a href="/contact">Contact</a>
			<ul>
				<li><a href="/firm">Our Firm</a></li>
				<li><a href="/careers">Careers</a></li>
			</ul>
		</li>
	</ul>
	
	<div id="content">
	
		<h2>Independent Research, Independant Thinking</h2>
		<p>
			Black Cypress conducts independent, original research on each of its investments. Other investment managers may perform limited research of their own or may depend heavily on the research provided by brokerage firms. They may purchase securities based on estimates and targets that aren&#8217;t their own and therefore they take no responsibility for their accuracy and outcome. We believe investment success requires research and analysis independent of others.
		</p>
		
		<h2 class="even">Long-Term, Absolute Return Strategy</h2>
		<p>
			It is Black Cypress&#8217; goal to preserve capital and to compound investor assets across market cycles and in all market environments. However, at times it pays to take on additional risk exposures that may create unrealized losses in the near-term. While we constantly seek both positive absolute and relative performance, Black Cypress will not sacrifice long-term opportunity to avoid short-term emotional distress.
		</p>
		
		<h2>Absolute Valuation</h2>
		<p>
			Black Cypress determines an independent value for each of its prospective investments and only invests when the security is trading at an appreciable discount to that value. Reference to history, competitor, industry or index values is of secondary concern. Our investment process is called &#8220;absolute&#8221; value because securities must stand on their own merit as an investment. Relative value managers, on the other hand, attempt to pick the best securities in an industry or index without concern that the entire group may be overvalued. Black Cypress only buys securities it deems undervalued in an absolute sense, not merely undervalued relative to other securities.
		</p>
		
		<h2 class="even">Unrestrained Time Horizon</h2>
		<p>
			Black Cypress has a long-term focus that looks beyond a security&#8217;s often short-lived current trouble or record-beating performance. Our competitors, bound by short-term performance expectations, make decisions based on what may happen in the next couple of quarters. We instead concern ourselves with a security&#8217;s long-term earning power and its asset base--not whether a company will beat earnings estimates in the next quarter. We believe our unrestrained time horizon leads to better-controlled emotions, lower turnover and superior decision making in the face of panic or irrational exuberance.
		</p>
		
		<h2>Personally Invested</h2>
		<p>
			Our team invests all of our investment assets in the same programs as Black Cypress clients. Our interests are thus aligned with clients&#8217; through our personal holdings in Cypress SAP, Black Cypress&#8217; Separate Account Program and by the client asset management fees Black Cypress receives, which promote limiting investment costs and generating positive returns.
		</p>
		
	<!-- #content --></div>
	
<!-- #secondPageWrapper, #firstPageWrapper --></div>

</body></html>

Which really is about all that layout should really need. If I have time later I’ll toss together the CSS that would go with that. I’ll do it using CSS3/IE fonts with font-squirrel – what outline font is that you are using? (don’t recognize it offhand)

Of course, I’m also seeing other no-no’s like a splash page as “home” with no content on it… Might be pretty, but it’s an extra step of “nothing” that just annoys users. NASTY case of “but I can do it in photoshop” here.

The page loads slowly in chunks for me, but I figured I was having a slow innernets day (I have those).

lose the fancy font, it’s not worth the non-semantic markup!

The font is really the cause of most of those images.

Here’s why:

Either phinole does what the client wants, or someone else does what the client wants. She’ll get her crappy slow hard-to-read website no matter who does it. The question is, which developer will get paid?

And I still want to know why IE is showing those images as solid. It shouldn’t be! Regardless of whether the technique is good or bad. I can’t find the reason why it doesn’t work.

I dunno, I’m usually the one they come to AFTER stuff like that is implemented and fails.

Though really, if that’s the requirement I’d still look at taking the font in question, running it through fontsquirrel’s conversion, and using that instead of the images. At the VERY least I’d use image replacements on them so images off it’s not just crappy alt text and so it has actual headings for the headings.

The Alpha appearance is easy enough to fake. You just put a <b></b> sandbag in, negative margin it, put a span around the text, then position:relative the span… with the wrapping element set to overflow:hidden.

Though you are correct, when the client wants to shoot themselves in the foot, you’re often stuck if they won’t listen to reason. Even in those cases, educate, educate, educate and then if they won’t listen, do everything you can to “implement it both ways”.

In this case, I really think using opacity with webfonts would be better than trying to use images.

In this case, I really think using opacity with webfonts would be better than trying to use images.

Yeah, I’m starting to think so as well; with something like Palladio as the default font… that one looks pretty close to this weird font she’s got.

The font the client wants is Optima. I tried typekit and they don’t offer it. I’m going to try fontsquirrel next, just haven’t had the time.

By the way, I appreciate the comments and suggestions. A lot of seemingly unnecessary markup I throw into code is usually based on testing while I’m developing. Once I see how certain things fit and look, I go back and clean stuff up, change and remove what ultimately doesn’t belong. In any case, I’m not an absolute guru as I run a small operation, but I learn something new practically everyday, I would rather some of this stuff be a little more tactful even if it is critical. Take Stomme’s responses for example.

Thanks for your help. I’ll update again when I have the chance to work on it further.

Optima.

Oh, someone has that (some OS carries that font). I ended up stealing it to use in the Gimp (deleted after I made the header logo) because I had a client who wanted the font his logo on his print materials used (which was something like, Humanist 251 or something), and Optima or Gill Sans were the closest I could get to finding any standard font that looked even remotely like it.

Optima I believe I discovered was not free, so this would be why Typekit doesn’t offer it.

Then use a thin small font like Palladio as the base, because the issue with @font-face is, if users don’t have some skinny narrow font, the text pops out. This is why I think it’s a fundamental flaw in the specs for that: if you’re able to specify a whole new font, you should be able to specify a matching font-size, line-height etc with it.

This way you can use the appropriate font-size and line-height for the default font. Currently @font-face doesn’t deal with this properly and people run into trouble when they try stuff like narrow fonts, wide fonts and fancy fonts that just don’t match any web-safe font at all.

Since I use NoScript, I don’t get the fancy fonts (yay, quicker page loading for me), so I see what it looks like for users who don’t load @font-face… I suspect many developers never consider how badly their pages break without it.

The problem with IE8/7 etc is that you cannot use the alpha opacity filter in combination with a png image.

This rule will kill the png image that you are using.


div#leftSide ul#topNav li a, div#sprightSide ul#topNav li a
{
  display: block;
  text-decoration: none;
  opacity: .95;
[B]  filter: progid:DXImageTransform.Microsoft.Alpha(opacity=95);[/B]
}


As you are already using a png image here.


div#leftSide li.nav a#logMenu
{
  background: url(http://test.blackcypresscapital.com/images/nav/cypressLog.png);
  width: 132px;
  height: 34px;
}


Then why try and make it more transparent with the filter? Just adjust the image itself.

Thanks Paul. I already tried taking the filters and opacity settings completely out of play. The problem still exists with a lack of transparency on the .pngs in the menus regardless of if the filter is in the CSS or not.

Looks like Optima on the menus, but the chiseled/outlined version bears no resemblance – It actually looks like an old windows 3.x plotter font and not any modern Truetype one.

Though that could just be that it’s difficult for me to read it given the combination of bad anti-aliasing and serifs.

I’ll belt out the final bits of CSS now to show a recode in action that doesn’t resort to images for the text while maintaining a transparent background on those elements.

Ok, those headings are Goudy Handtooled, not optima. Hmm, it’s similar but the descenders are longer… I’ll use GH for now, we’ll iron out the correct one once I show you how I’d approach that. The menu is optima though as you said.

Though it’s annoying how large it got – not really an improvement over using images; well, except now it has accessibility.

Black Cypress Capital Management - Principles

As with all my examples the directory:
Index of /for_others/phinole

is wide open for easy access to it’s bits and pieces. I also tossed in an archive rar
http://www.cutcodedown.com/for_others/phinole/archive.rar

So you can grab it all in one fell swoop.

Valid XHTML 1.0 Strict, would be valid CSS 2.1 if not for the CSS3 fonts. Tested working IE 5.5, 6, 7, 8 and 9, FF 3.5 and latest, and the latest flavors each of Opera, Safari and Chrome.

The embedded fonts are pretty big though – especially Goudy HT but that’s always had a ridiculous number of vectors in it.

Doesn’t look 100% identical, but I’m not sure goudy ht is the correct font either; but it does give you a working example of how to go about it.

Looks like Jason (good work by the way) has given you an alternative anyway but I can tell you that I checked locally and removing the opacity filter made the png images work straight away. Unfortunately I didn’t save the page but I will re-build if you need confirmation.

Paul,

Perhaps I have a problem with IE and caching. It wouldn’t be the first time. I’ve actually had to restore IE8 to factory settings after changing a Sharepoint configuration from straight web parts to XML/XSLT. I will try again with no opacity/filter settings to see if I can mimic your result.

deathshadow, wow. I am really surprised and impressed that you took the time to create a solution on your own. I sincerely appreciate it. I’m definitely not accustomed to getting that kind of help but then again this is sitepoint, and I love sitepoint for a reason. :slight_smile: Thank you very much for making the effort to do that.

I’m on a business trip at the moment and haven’t had time to revisit this problem, but I will be sure to do so when I return home.

Thanks again to the 3 of you that have contributed to this, I greatly appreciate it. I’ll post an update when I get a chance to work on it again.

Is it possible that your PNG has embedded Fireworks code in it that could be causing these issues? Keep in mind that Fireworks stores it’s data in PNG format vs PSDs in Photoshop. If you have Photoshop I’d try exporting in Fireworks to PSD or TIF, and than in Photoshop or some other graphics software try to export it for the web. Just like everyone else here I have only had issues with PNGs in IE6.

I first exported the images as .PNG directly out of Photoshop CS4 after they were sliced out of the .psd. They were exported as PNG-24 with transparency enabled and a neutral/transparent matte. It wasn’t until I was attempting to resolve the problem of no transparency in IE8 that I opened the .psd in Fireworks and exported the .PNGs from there. Each time I exported, both from Photoshop and Fireworks, I ran PNGCrush and removed all chunks except transparency. So far nothing has made an impact. I will try solving this again soon, just overloaded with other work at the moment. Thanks for your input.

The png colour issue is a different problem and it’s usually the other way around and Photshop pngs always look different cross browser because of the gamma profile they embed. Pngcrush usually sorts this out but Fireworks does it by default.

Fireworks pngs work out of the box and cross browser without problem and indeed provide better png8 images by default as mentioned in an old Sitepoint article.

I think you’ll probably find that the problem with IE was as I stated above and is a known problem in that you cannot mix the alpha image loader with the opacity filter at the same time (although other different filters can be used on the same element).

I think you’ll probably find that the problem with IE was as I stated above and is a known problem in that you cannot mix the alpha image loader with the opacity filter at the same time (although other different filters can be used on the same element).

Though this makes for strange chronological sense since the ms filter was added when the original alpha-layer images seemed opaque in IE. If I understand the OP correctly.

Re gamma: PNGcrush helped, a lot, but Safari on Mac who is not using an actual Apple-brand monitor will still manage to mangle colours. Sometimes they assume gamma values that simply aren’t there… I can’t figure out any other possible explanation.

Except maybe UFOs. It could be that.

A complimentary link to Paul’s: The sad story of PNG gamma “correction”