Tuesday, February 14, 2012

Does embedding an ICC profile into an image actually embed the entirety of that profile into an image?

Question

This is very much a imaging question, but Photography looked like the best site to ask.

I've been reading information about ICC, color spaces, JPEG metadata, and the like trying to understand this.

When an application 'embeds' a color/ICC profile into an image, like a JPEG, does that actually embed the entire ICC Profile? If I saved a photo with the sRGB or Adobe RGB color profiles embedded, does that mean color-aware applications will:

  1. Open the image
  2. Extract the profile data (i.e. it sees the image is AdobeRGB)
  3. Apply transformations on the color using the information from the profile
  4. Display the image

My confusion comes from inspecting a bunch of photos I have - I viewed their metadata with exiftool, and this snippet of information came out:

Color Space                     : sRGB
Profile CMM Type                : Lino
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
CMM Flags                       : Not Embedded, Independent <--- does anything use this?
Device Manufacturer             : IEC
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Description             : sRGB IEC61966-2.1
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB

So this photo has an sRGB profile, that's fine. But what is the CMM Flags field for and does anyone use it?

The ICC standard, in section 7.2.11, says the CMM field data indicates this this:

The profile flags field shall contain flags to indicate various hints for the CMM such as distributed processing and caching options

Position 0 - Embedded profile (0 if not embedded, 1 if embedded in file)

Position 1 - Profile cannot be used independently of the embedded color data


So condensed to a couple related questions:

  1. Does embedding an ICC profile into an image actually embed the entirety of that profile into an image? Or does it only serve to tell color-aware applications to look for that profile in the system (i.e. Windows' ICC directory)

  2. Am I just confused and the CMM Flags are independent of the notion of embedding an ICC profile?

Thanks, I hope my question is clear enough.

Asked by birryree

Answer

The CMM Flags field is referring to Color Management Module flags. In this case, its saying that the ICC profile the JPEG image is tagged with is not embedded. It is possible, although not required, to embed ICC profiles within images, including JPEG images (as according to the very document you linked:)

B.4 Embedding ICC profiles in JPEG files

The JPEG standard (ISO/IEC 10918-1[2]) supports application specific data segments. These segments may be used for tagging images with ICC profiles. The APP2 marker is used to introduce the ICC profile tag. Given that there are only 15 supported APP markers, there is a chance of many applications using the same marker. ICC tags are thus identified by beginning the data with a special null terminated byte sequence, “ICC_PROFILE”.

The length field of a JPEG marker is only two bytes long; the length of the length field is included in the total. Hence, the values 0 and 1 are not legal lengths. This would limit the maximum data length to 65 533. The identification sequence would lower this even further. As it is quite possible for an ICC profile to be longer than this, a mechanism is required to break the profile into chunks and place each chunk in a separate marker. A mechanism to identify each chunk in sequence order is therefore necessary.

The identifier sequence is followed by one byte indicating the sequence number of the chunk (counting starts at 1) and one byte indicating the total number of chunks. All chunks in the sequence should indicate the same total number of chunks. The 1-byte chunk count limits the size of embeddable profiles to 16 707 345 bytes.

Generally speaking, I think images are usually only tagged with ICC profiles, rather than having them embedded, when associated with sRGB, AdobeRGB, or one of the other very common color spaces. It may be necessary to embed a profile if it is a custom profile, one that you do not expect to exist on the machines the image will generally be viewed on.

Answered by jrista

No comments:

Post a Comment