图像和 html 之间的颜色差异
我在将 css 背景颜色与同一 html 页面上的图像颜色进行颜色匹配时遇到问题。 是什么赋予了?
I'm having issues with color matching css background colors with colors in images on the same html page. What gives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我猜你用的是PNG图像? 这是伽玛校正“功能”。 Mark Ransom 发布了有用的文字,内容涉及这。
请注意,某处列出的
pngcrush
解决方案对我不起作用。I'm guessing that you use a PNG image? This is a gamma correction “feature”. Mark Ransom has posted a useful text about this.
Notice that the
pngcrush
solution listed somewhere hasn't worked for me.您使用什么图像编辑程序? 我找到了这篇有关 Photoshop 颜色配置文件的文章。 PNG gamma 校正 也可能存在问题。
What image editing program are you using? I found this article about Photoshop color profiles. There can also be issues with PNG gamma correction.
可能是由于浏览器的颜色管理所致。
Could be due to the browser's colour management.
这可能是颜色配置文件问题。
例如,如果图像是 JPEG 且具有颜色配置文件,而您的浏览器不支持以它们指定的颜色配置文件显示图像,则图像本身的颜色将在浏览器中呈现不同的效果。 在这种情况下,如果您在 Photoshop 中检查图像的颜色(支持颜色配置文件),然后在 CSS 中应用该颜色,并在不支持颜色配置文件的浏览器中查看页面,则页面看起来会有所不同。
It might be a color profile issue.
For instance, if the image is a JPEG and has a color profile and your browser doesn't support displaying images in the color profiles that they specify, the colors of the image itself will render differently in your browser. In this situation, if you checked the color of the image in Photoshop (color profile aware) and then applied that color in your CSS and viewed the page in a browser that is not color profile aware, it would look different.
我想到了三种可能性:
我在很久以前使用过的解决方法是通过重复小图像来设置背景颜色,而不是在 HTML 中设置它。 这种技巧在网络安全调色板等时代很有用,但现在不太有用。
Three possibilities spring to mind:
A workaround that I have used in the distant past is to set the background colour by repeating a small image, instead of setting it in the HTML. This kind of trick was useful in the days of web-safe palettes and so on, but less useful now.
可能是你测试的浏览器,我在 ie 6 上遇到了很多麻烦。
Probably the browser your testing, I've had a lot of trouble with ie 6.