解码 JPEG 文件时跨浏览器不兼容?
有些事情让我感到困惑 - 为什么此图像在每个浏览器中显示不同?
IE9(和 Windows 照片查看器)中的图像:
Firefox(和 Photoshop)中的图像:
Chrome(和 Irfanview)中的图像:
他们的 JPEG 解码过程中发生了什么,导致最终输出如此不同?
(在 IE、Firefox、Chrome 等浏览器中查看即可明白我的意思。)
Something is puzzling me - why does this image appear different in every browser?
Image in IE9 (and Windows Photo Viewer):
Image in Firefox (and Photoshop):
Image in Chrome (and Irfanview):
What is going on in their decoding processes of the JPEG to make the eventual output so different?
(View it in IE, Firefox, Chrome, etc. to see what I mean.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
JPEGSnoop(来源现在可用@sourceforge)在我们到达 Y'CbCr 之前就报告了大的亮度溢出到 RGB 转换。我在其他一些文件上遇到这些错误,但溢出通常很小 - 256 或 257,而最大值为 255。此处计算的亮度为 729!
JPEGSnoop 作者对 YCC 溢出的评论:
我对跨 MCU DC 并不熟悉,但 Pennebaker &米切尔同意。
JPEGSnoop (source now available @ sourceforge) reports large luma overflow before we even get to Y'CbCr to RGB conversion. I get these errors on some other files, but the overflow is typically small- 256 or 257 vs. a max of 255. The luma calculated here is 729!
JPEGSnoop's author's comments on YCC overflow:
I wasn't familiar with the inter-MCU DC, but Pennebaker & Mitchel concur.
JPEG 可以用 RGB 或 CMYK 进行编码。这些细节通常在 CMYK 时出现。在图像编辑程序中打开文件并将其另存为 RGB JPEG,然后向 CMYK 打印机致敬,它们现在将具有与您之前在浏览器中看到的不同结果。
JPEG can be encoded in RGB or CMYK. These nicities usually occur when it's CMYK. Open the file in an image editing program and save it as RGB JPEG, and salute the CMYK printers, which will now have the different results you previously had in the browser.
我只是猜测。
如果创建图像是为了显示这些差异,那么它可能不是经过编码的正常图像,而是无效的图像,其中计算的颜色超出 0 到 255 的范围,并且不同的解码器以不同的方式处理这些图像。
I'm only guessing.
If the image was created to show these differences perhaps it's not a normal image which was encoded, but an invalid one where the calculated colors are outside of the 0 to 255 range and different decoders handle these differently.
例如,如果您在 Photoshop 中将该特定图像的颜色配置文件从 CMYK 更改为 sRGB,则它在所有浏览器中的显示效果或多或少会相同。
If you change the color profile of that particular image from CMYK to sRGB in Photoshop, for instance, it will appear more or less equally in all browsers.