-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify expected behavior in presence of both cICP and ICC profile information #18
Comments
I've been thinking about this. For HDR content, the existing iCCP chunk is insufficient. In that case, we wouldn't want to prioritize iCCP over cICP. However, if we were using ICC v4 profiles (instead of iCCP's v2), maybe it would have been sufficient. What I just described is specific to HDR though. For WC, I can understand that iCCP may be sufficient and is more specific. I think this is where the confusion and divide came from. I don't think we want a rule like "If the cICP chunk describes a HDR color space, it takes priority. If not, the iCCP chunk takes priority." Even if we carefully defined what counts as HDR, this feels like the wrong approach. Instead, if the existing iCCP chunk is sufficient for WC (or any other non-HDR color), I think the user/creation program could simply provide only the iCCP chunk and not the cICP chunk. That way it effectively takes priority. They have no need for the cICP chunk so why waste bytes? I believe the user would only provide the cICP chunk when the iCCP chunk is insufficient. In which case, it should take priority. And later when we have support for ICC profiles that are sufficient for HDR, it can take priority over cICP. @LarsBrg Do you agree with this? Am I missing anything? If this looks good, we'll want to think about the iCC4 chunk enough to make sure we aren't making a mistake there. |
Looks good. See some comments inline.
From: Chris Blume ***@***.***>
For HDR content, the existing iCCP chunk is insufficient. In that case, we wouldn't want to prioritize iCCP over cICP.
(Is the existing iCCP chunk sufficient for WC?)
WC == Wide color gamut? Yes, ICC V2 handles wide color gamut such as Rec.2020.
Yes, AFAIK HDR requires ICC V4. I make such profiles, and I haven’t seen any ICC V2 profiles made for HDR.
However, if we were using ICC v4 profiles (instead of iCCP's v2), maybe it would have been sufficient.
So maybe we want iCC4 (new chunk, can rename) > cICP > iCCP.
What I just described is specific to HDR though. For WC, I can understand that iCCP may be sufficient and is more specific. I think this is where the confusion and divide came from.
I don't think we want a rule like "If the cICP chunk describes a HDR color space, it takes priority. If not, the iCCP chunk takes priority." Even if we carefully defined what counts as HDR, this feels like the wrong approach.
Yes, too fragile.
It would be hard to come up with a rule that determines if future CICPs are HDR or not.
And very hard to determine if an ICC profile is HDR.
Instead, if the existing iCCP chunk is sufficient for WC (or any other non-HDR color), I think the user/creation program could simply provide only the iCCP chunk and not the cICP chunk. That way it effectively takes priority. They have no need for the cICP chunk so why waste bytes?
Not sure.
For many hardware-supported devices, beyond GPU, CICP may be more useful, as the hardware usually is optimized for the most common CICP cases.
This optimization doesn’t work for ICC, especially not current ICC HDR profiles, as there are near-infinite ways to make such and you’d have to find if it matches your hardware. Like, does this ICC profile encode the PQ curve or not? With OOTF? Also, ICC profiles for HDR are large. HLG to display is very large. CICP is tiny.
I believe the user would only provide the cICP chunk when the iCCP chunk is insufficient. In which case, it should take priority. And later when we have support for ICC profiles that are sufficient for HDR, it can take priority over cICP.
Not sure.
We have HDR ICC profiles today in V4, sufficient for static HDR.
I assume that the ICC profiles we will see here are for consumption of content, not for editing of content.
In that context the ICC profile should be used if reasonable.
But:
The ICC profile might have been picked to render HDR to an SDR display. For an HDR display the CICP could be a better fit.
For image editing, use the CICP to get to the mastering display.
Not a trivial call.
Thanks,
Lars
@LarsBrg Do you agree with this? Am I missing anything?
If this looks good, we'll want to think about the iCC4 chunk enough to make sure we aren't making a mistake there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@ProgramMax wrote:
There is already a PNG erratum raised by Phil Green to update the PNG spec to reference ICCv4 and iccMAX. The restriction to ICC v.2 is unintentional, happened because that was the latest version at the time, and is not honored in practice. People can and do put ICC v.4 profiles into iCCP so the spec simply needs to be updated to reference the newer specifications and match the implementation reality. The proposed iCCN tag does need to be a new tag, however, as it also usefully changes the profile name from Latin-1 to UTF-8. |
@ProgramMax wrote:
I would put it the other way, if the cICP chunk is sufficient to describe the WCG content (for example, Rec. 2020 content) why waste like 2k for the iCCP? On the other hand, there are WCG cases where cICP is not sufficient. Content using ProPhoto, or Adobe (1998) RGB, or Display-P3, is not covered by ITU H.273so the options are:
|
Below is Lars's exact email. GitHub did not recognize which parts were quoting me and which parts were new, inline comments. I've reposted it to include that formatting and be easier for everyone to read.
WC == Wide color gamut? Yes, ICC V2 handles wide color gamut such as Rec.2020. Yes, AFAIK HDR requires ICC V4. I make such profiles, and I haven’t seen any ICC V2 profiles made for HDR.
Yes, too fragile. It would be hard to come up with a rule that determines if future CICPs are HDR or not. And very hard to determine if an ICC profile is HDR.
Not sure. For many hardware-supported devices, beyond GPU, CICP may be more useful, as the hardware usually is optimized for the most common CICP cases. This optimization doesn’t work for ICC, especially not current ICC HDR profiles, as there are near-infinite ways to make such and you’d have to find if it matches your hardware. Like, does this ICC profile encode the PQ curve or not? With OOTF? Also, ICC profiles for HDR are large. HLG to display is very large. CICP is tiny.
Not sure. We have HDR ICC profiles today in V4, sufficient for static HDR. I assume that the ICC profiles we will see here are for consumption of content, not for editing of content. In that context the ICC profile should be used if reasonable. But: Thanks, Lars |
If the PNG decoder doesn't understand cICP, it would assume sRGB without an iCCP chunk. This might be fine. If a website determines their users are migrated enough they could provide a PNG that has cICP and no iCCP fallback. Or perhaps the website could sniff browser version and serve two different PNGs. Fundamentally, I do like what you're saying: That if a cICP chunk works for the website, they could use just it and not the iCCP chunk to see a significant size savings. Talking about only WCG:
Given this, I think it is okay for either chunk to take precedence. For HDR content:
I'm coming around to having iCCP take precedence over cICP. I think my original concern may have been wrong. |
To spell out my change of mind (in case others felt similarly): Originally, I had thought cICP would be a handy shortcut for decoders to not need to parse and interpret iCCP. And during the transition period, iCCP would provide a fallback. End users would see correct colors until a website owner deems enough users have transitioned and iCCP could be removed. This fallback mentality is why I thought we needed the precedence to match spec order. But in the cases I listed above, the exact same effect happens without relying on iCCP as a fallback. The website owner can still remove iCCP when they are ready. And honestly, the time spent parsing iCCP isn't so bad that it is worth shipping PNGs that contain both iCCP and cICP. The website owner probably wouldn't want to send extra bytes during the transition. Realistically, the website owner will likely send either cICP or iCCP, not both. And if they aren't sending both, the precedence shouldn't matter. We could say that a PNG with both is invalid. I believe that is how we arrived at the undefined behavior from before. But surely someone will create a PNG with both and decoders will choose what to do. I think it might be better to specify a behavior and discourage sending both. I'm happy to specify iCCP taking precedence over cICP given that iCCP supports v4. |
For HDR content I would rather send CICP than ICC. This would save lots of bytes per image. 4 bytes instead of say 400 kbytes per image
Lars
From: Chris Blume ***@***.***>
Reply-To: w3c/ColorWeb-CG ***@***.***>
Date: Wednesday, March 31, 2021 at 10:52 AM
To: w3c/ColorWeb-CG ***@***.***>
Cc: Lars Borg ***@***.***>, Mention ***@***.***>
Subject: Re: [w3c/ColorWeb-CG] Specify expected behavior in presence of both cICP and ICC profile information (#18)
To spell out my change of mind (in case others felt similarly):
Originally, I had thought cICP would be a handy shortcut for decoders to not need to parse and interpret iCCP. And during the transition period, iCCP would provide a fallback. End users would see correct colors until a website owner deems enough users have transitioned and iCCP could be removed. This fallback mentality is why I thought we needed the precedence to match spec order.
But in the cases I listed above, the exact same effect happens without relying on iCCP as a fallback. The website owner can still remove iCCP when they are ready. And honestly, the time spent parsing iCCP isn't so bad that it is worth shipping PNGs that contain both iCCP and cICP. The website owner probably wouldn't want to send extra bytes during the transition.
Realistically, the website owner will likely send either cICP or iCCP, not both. And if they aren't sending both, the precedence shouldn't matter.
We could say that a PNG with both is invalid. I believe that is how we arrived at the undefined behavior from before. But surely someone will create a PNG with both and decoders will choose what to do. I think it might be better to specify a behavior and discourage sending both. I'm happy to specify iCCP taking precedence over cICP given that iCCP supports v4.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks for fixing that.
From: Chris Blume ***@***.***>
Reply-To: w3c/ColorWeb-CG ***@***.***>
Date: Wednesday, March 31, 2021 at 9:47 AM
To: w3c/ColorWeb-CG ***@***.***>
Cc: Lars Borg ***@***.***>, Mention ***@***.***>
Subject: Re: [w3c/ColorWeb-CG] Specify expected behavior in presence of both cICP and ICC profile information (#18)
Below is Lars's exact email. GitHub did not recognize which parts were quoting me and which parts were new, inline comments. I've reposted it to include that formatting and be easier for everyone to read.
For HDR content, the existing iCCP chunk is insufficient. In that case, we wouldn't want to prioritize iCCP over cICP.
(Is the existing iCCP chunk sufficient for WC?)
WC == Wide color gamut? Yes, ICC V2 handles wide color gamut such as Rec.2020.
Yes, AFAIK HDR requires ICC V4. I make such profiles, and I haven’t seen any ICC V2 profiles made for HDR.
However, if we were using ICC v4 profiles (instead of iCCP's v2), maybe it would have been sufficient.
So maybe we want iCC4 (new chunk, can rename) > cICP > iCCP.
What I just described is specific to HDR though. For WC, I can understand that iCCP may be sufficient and is more specific. I think this is where the confusion and divide came from.
I don't think we want a rule like "If the cICP chunk describes a HDR color space, it takes priority. If not, the iCCP chunk takes priority." Even if we carefully defined what counts as HDR, this feels like the wrong approach.
Yes, too fragile.
It would be hard to come up with a rule that determines if future CICPs are HDR or not.
And very hard to determine if an ICC profile is HDR.
Instead, if the existing iCCP chunk is sufficient for WC (or any other non-HDR color), I think the user/creation program could simply provide only the iCCP chunk and not the cICP chunk. That way it effectively takes priority. They have no need for the cICP chunk so why waste bytes?
Not sure.
For many hardware-supported devices, beyond GPU, CICP may be more useful, as the hardware usually is optimized for the most common CICP cases.
This optimization doesn’t work for ICC, especially not current ICC HDR profiles, as there are near-infinite ways to make such and you’d have to find if it matches your hardware. Like, does this ICC profile encode the PQ curve or not? With OOTF? Also, ICC profiles for HDR are large. HLG to display is very large. CICP is tiny.
I believe the user would only provide the cICP chunk when the iCCP chunk is insufficient. In which case, it should take priority. And later when we have support for ICC profiles that are sufficient for HDR, it can take priority over cICP.
Not sure.
We have HDR ICC profiles today in V4, sufficient for static HDR.
I assume that the ICC profiles we will see here are for consumption of content, not for editing of content.
In that context the ICC profile should be used if reasonable.
But:
The ICC profile might have been picked to render HDR to an SDR display. For an HDR display the CICP could be a better fit.
For image editing, use the CICP to get to the mastering display.
Not a trivial call.
Thanks,
Lars
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This is now spelled out explicitly at https://github.com/w3c/ColorWeb-CG/blob/master/hdr-in-png-requirements.md#decoder Closing |
The behavior should be defined.
The text was updated successfully, but these errors were encountered: