JPEG中的色彩配置文件检测 [英] Color profile detection in JPEG

查看:186
本文介绍了JPEG中的色彩配置文件检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够检测JPEG中颜色配置文件的存在。需要明确的是:我对实际进行颜色校正或对它们进行任何其他操作都没有兴趣。

I would like to be able to detect the presence of a color profile in JPEG. To be clear: I'm not interested in actually carrying out the color corrections or doing anything else with them.

我进行了一些调查,但找不到明确的答案。信息来源。到目前为止,这是我所知道的:

I did some investigation, but I could not find any definite source of information. Here is what I know so far:


  • XMP块中有颜色配置文件信息 。 XMP块位于 0xFFE1 JPEG部分中(与EXIF相同)。该部分的标记后是 http://ns.adobe.com/xap /1.0/ 字符串。但是,当我删除此部分时,Photoshop仍然能够检测到颜色配置文件。

  • There is a color profile information in the XMP block. The XMP block is in a 0xFFE1 JPEG section (the same as EXIF). The marked of this section is followed by the http://ns.adobe.com/xap/1.0/ string. However, when I stripped this section, Photoshop was still able to detect the color profile.

EXIF 中有一个颜色空间标签>本身(标签= 0xA001 )。它只有EXIF规范中定义的一个值:1 = sRGB。我注意到在我的图像中它取值为0xFFFF,这意味着未校准。所以不是这个标签。

There is a color space tag in EXIF itself as well (tag = 0xA001). It has only one value defined in the EXIF specification: 1 = sRGB. I noticed that in my image it takes the value 0xFFFF which means uncalibrated. So it’s not this tag.

我做了一个实验,将一张图像保存为两种不同的颜色配置文件,除了XMP和EXIF的变化外,我注意到可能会有一个全新的JPEG部分。它以 0xFFE2 开头,其标记后面是字符串 ICC_PROFILE

I did an experiment with one image saving it in two different color profiles, and besides the changes in XMP and EXIF, I noticed that there is probably a whole new JPEG section. It starts by 0xFFE2 and its marker is followed by the string ICC_PROFILE. This seems to be the most likely case.

有人在管理JPEG中的颜色配置文件方面有经验吗?我会说EXIF和XMP中的信息只是元数据,重要的是ICC_PROFILE节的存在。

Does anybody have experience with managing color profiles in JPEG? I would say that the information in EXIF and XMP are just metadata, and that the important thing is the presence of the ICC_PROFILE section.

推荐答案

ICC配置文件存储在JPEG文件的应用程序段中。这些块用于让应用程序存储所需的任何数据,因此JPEG规范不要求它们。换句话说,JPEG文件格式没有定义嵌入颜色配置文件的方法,您只是看到了事实上的实现方法。

ICC profiles are stored in a JPEG file's Application Segments. These blocks are for letting applications store whatever data they need, so they are not mandated by the JPEG spec. In other words, the JPEG file format does not define a way to embed color profiles, you are just seeing the de facto ways of doing it.

由于应用程序段可以被任何人使用时,您需要确定并验证其内容,然后才能确定其中包含ICC配置文件。

Since the application segments can be used by anyone for anything, you need to identify and validate the contents, before you can say for certain that it contains an ICC profile.

因此,共有三种常见方法提供ICC配置文件的方式:

So there are three ways common ways ICC profiles could be supplied:


  • 通过将ICC配置文件嵌入到应用程序段02中,以 ICC_PROFILE\开头0x00\0x01\0x01 进行识别。我目前不确定这两个 \0x01 是否有意义,或者是否始终如此。在这14个字符之后,将存储实际的ICC配置文件。

  • 通过将ICC配置文件嵌入到应用程序段01中的嵌入式EXIF元数据文件中。

  • 通过在应用程序段01中的嵌入式XAM元数据文件中嵌入ICC配置文件。此文件之前带有 http://ns.adobe.com/xap/1.0/\0x00

  • By embedding an ICC profile in Application Segment 02, prepended with ICC_PROFILE\0x00\0x01\0x01 for identifying it. I'm currently unsure if the two \0x01 mean anything, or if they are always that. After those 14 characters, the actual ICC profile is stored.
  • By embedding an ICC profile in an embedded EXIF metadata file in Application Segment 01.
  • By embedding an ICC profile in an embedded XAM metadata file in Application Segment 01. This is prepended with http://ns.adobe.com/xap/1.0/\0x00.

我也无法找到任何具体信息。如果ICC说这是怎么做,那将是很好的选择,但是我还没有找到任何一种。因此,据我所知,其中任何一个都可能用作ICC配置文件,并且取决于应用程序是否加载配置文件。
应用程序段02似乎是执行此操作的常用方法,尽管您要检查的内容可能取决于您的用例。正如其他评论所显示的那样,某些HELIOS EtherShare软件已经/拥有自己的方式。 (我尚未确认元数据中是否存在ICC配置文件,但是我看起来并不那么努力,如果您能在野外找到具有多个冲突的ICC配置文件的文件也不会令我感到惊讶。)

I have not been able to find any concrete information either. It would be nice if ICC said, "this is how to do it", but I have not yet been able to find any of the sort. Thus as far as I know, any of these could potentially be used as an ICC profile and it would depend on the application on whether it would load the profile or not. Application Segment 02 seems to be the common way of doing it, though what you want to check might depend on your use case. As the other comment showed, some HELIOS EtherShare software has/had its own way of doing it. (I have not yet confirmed the presence of an ICC profile in the metadata, however I haven't really looked that hard and it wouldn't surprise me if you could find files with multiple conflicting ICC profiles in the wild.)

这篇关于JPEG中的色彩配置文件检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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