本文主要是介绍IE与CMYK和RGB色彩模式的兼容问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天发现有几张图片在ie下面显示不了,firefox下面则显示正常,检查了一下发现图片是cmyk色彩模式的。然后google得知到目前为止微软的Internet Explorer 浏览器IE6,IE7,IE8都不支持CMYK颜色模式图像,除IE外其他浏览器均能支持,而通常网络上使用的基本都是RGB色彩模式。
翻了一下convert的文档,发现在convert的时候加一个 -colorspace RGB 参数就可以解决这个问题,附官方部分help:
colorspace
the type of colorspace
Choices are: CineonLog, CMYK, GRAY, HSL, HWB, OHTA, RGB, Rec601Luma, Rec709Luma, Rec601YCbCr, Rec709YCbCr, Transparent, XYZ, YCbCr, YIQ, YPbPr, or YUV.
Color reduction, by default, takes place in the RGB color space. Empirical evidence suggests that distances in color spaces such as YUV or YIQ correspond to perceptual color differences more closely than do distances in RGB space. These color spaces may give better results when color reducing an image. Refer to quantize for more details.
Two gray colorspaces are supported. The Rec601Luma space is based on the recommendations for legacy NTSC television (ITU-R BT.601-5). The Rec709Luma space is based on the recommendations for HDTV (Rec. ITU-R BT.709-5) and is suitable for suitable for use with computer graphics, and for contemporary CRT displays. The GRAY colorspace currently selects the Rec601Luma colorspace by default for backwards compatibly reasons. This default may be re-considered in the future.
Two YCbCr colorspaces are supported. The Rec601YCbCr space is based on the recommendations for legacy NTSC television (ITU-R BT.601-5). The Rec709CbCr space is based on the recommendations for HDTV (Rec. ITU-R BT.709-5) and is suitable for suitable for use with computer graphics, and for contemporary CRT displays. The YCbCr colorspace specification is equivalent toRec601YCbCr.
The Transparent color space behaves uniquely in that it preserves the matte channel of the image if it exists.
The -colors or -monochrome option, or saving to a file format which requires color reduction, is required for this option to take effect.
不明白这是什么意思 !希望已经回来能懂。
这篇关于IE与CMYK和RGB色彩模式的兼容问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!