png colors not rendering correctly in IE7.

I generated a 24bit png file with transparency using photoshop cs2

the solid color was #373737 with a transparent gradient at either end.

I then used this css:

background: #373737 url(image.png);

when viewed in firefox all was well and good

when viewed in IE7 the solid color was no longer #373737(r:55 g:55 b:55).

It was #242424 (r:36 g:36 b:36)

When ever I change the solid fill color in the image I get a linear shift in the color interpretation in IE7. I was able to shift the fill color up and get it to match the 373737 background color but it no longer matched in any other browser. :-(

So, clearly there is something wrong with IE7's color interpretation with regard to png images. There is a consitant color shift there that is insanely frustrating to deal with.

I would enter a bug report, but alas microsoft took down the connect site after releasing IE7. :-(

I guess they figure there are not more bugs in there.

I was so excited that IE finaly supported 24 bit transparency and now this.

criminy...

Has anyone else seen this and figured out a way around it?

Thanks

Simeon

[1185 byte] By [SimeonKessler] at [2007-12-27]
# 1

I've got non transparent png files wich show the same behaviour.

The hex color values are lower then they are supposed to be (ie. darker image)

The PNG files were generated with Paint.NET 3.0 beta 1, so in fact they were generated with system.drawing on .NET2.0

developers can ask me the png, jpg & pdn files if they could help squat this bug.

I searched an entire day for more info and this thread was the only thing I found.

my current solution is: Switch to JPG

kiekn at 2007-9-4 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 2

I found a utility that strips out the gamma information from the png file. The browsers are trying to adjust the images based on the gamma of the machine that created it. Of course that keeps the png from matching the css background colors.

google pngcrush and gamma.

It worked for me.

simeon

SimeonKessler at 2007-9-4 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 3

Great, yet another *fun* feature

Why would I want IE to change my colors? I've got 32-bit RGBA colors in my PNG and I've got 32-bit color in my CSS (24 bits + 8bits locked on full opaque)
You would think the webdeveloper knows best wich colors should be used, or at least IE should change ALL colors, so they match like they should

I hope this thing actually works on Vista

kiekn at 2007-9-4 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...