IE8 中 PNG 的背景颜色 [英] Background colour of a PNG in IE8

查看:28
本文介绍了IE8 中 PNG 的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下徽标,它显示为与 FF3、Chrome 中的 HTML 正文相同的背景颜色 (#363636).

I have the following logo, which displays as the same background colour as the HTML body in FF3, Chrome (#363636).

但在 IE8 中,它显示不同的、更深的颜色.

But in IE8 it displays a different, darker colour.

这个 FF3/Chrome 是原谅我的 PNG,还是只是另一个 IE 错误(我认为他们修复了 IE7 中的 PNG 支持)?

Is this FF3/Chrome being forgiving of my PNG, or just another IE bug (I thought they fixed PNG support in IE7)?

更新:我仍然遇到这个问题,我用来纠正它的 pngcrush 参数是:

Update: I still get this problem, and the pngcrush arguments I use to correct it are:

pngcrush -replace_gamma 0.5181347 infile.png outfile.png

pngcrush -replace_gamma 0.5181347 infile.png outfile.png

Win32 二进制链接是 此处.

The Win32 binary link is here.

推荐答案

您的 PNG 中有伽马校正信息(gAMA 块)结构.如果您正在处理需要伽马校正的照片,那很好,但它不适合网络.

You have a gamma correction information (gAMA chunk) structure in your PNG. That's fine if you're working with photos where you want gamma correction, but it's not the right thing for the web.

在网络上,浏览器通常不会对 HTML/CSS 颜色或其他图像应用伽马校正,因此如果您使用伽马校正,您将在 PNG 上得到与页面其余部分不一致的结果.出于这个确切原因,某些浏览器不应用 PNG 伽玛,这就是您获得可变结果的原因.

On the web, browsers typically do not apply gamma correction to HTML/CSS colours or other images, so if you use gamma correction you'll get results on your PNG that are inconsistent with the rest of the page. Some browsers do not apply PNG gamma for this exact reason, which is why you are getting the variable results.

将徽标加载到图像编辑器中,然后在没有 gAMA 块信息的情况下将其保存.更多.

Load the logo into an image editor and save it back out without the gAMA chunk information. More.

这篇关于IE8 中 PNG 的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆