Skip to content
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

[BUG] Outdaded SrGB value calculation #391

Closed
ferBonnin opened this issue Jun 19, 2019 · 3 comments
Closed

[BUG] Outdaded SrGB value calculation #391

ferBonnin opened this issue Jun 19, 2019 · 3 comments
Labels
bug Something isn't working status: resolved This issue has been merged into main.

Comments

@ferBonnin
Copy link
Contributor

Describe the bug
Per WCAG bug Non-sRGB color spaces, outdated sRGB threshold, and other issues in the "relative luminance" definition

the number used to calculate relative luminance is incorrect.

Additional context
Blocked until WCAG bug gets resolved.

@ferBonnin ferBonnin added bug Something isn't working status: blocked This issue is blocked. labels Jun 19, 2019
@msft-github-bot msft-github-bot added the status: new This issue is new and requires triage by DRI. label Jun 19, 2019
@msft-github-bot msft-github-bot removed the status: new This issue is new and requires triage by DRI. label Jun 19, 2019
@ferBonnin
Copy link
Contributor Author

calculation of this is in ColorContrastViewModel.cs

@karanbirsingh karanbirsingh removed their assignment Jun 24, 2019
@Myndex
Copy link

Myndex commented Jul 10, 2019

I am the W3C member who is working on these issues in the WCAG. The correct threshold for the reverse transform (going to linear) is 0.04045 and this should be used, not 0.03928 as incorrectly listed in the WCAG Understanding document. Also, the sRGB working draft from 1996 is not the standard, IEC 61966-2-1:1999 is the relevant international standard for sRGB.

There is no real reason to use the incorrect threshold. In terms of the WCAG contrast measurement, it functionally makes no difference, but it can make a difference if you are using the equation for image processing. As a matter of best practices, the correct math should be used for converting sRGB to linear RGB, and this is the threshold value of 0.04045

For background, the reason for the change from the original sRGB draft has to do with a discontinuity at the intercept between the power curve and the linearized segment.

There are some color transform libraries that use a more accurate (more decimal places) method which is advisable if you are doing multiple round trips for image processing applications. In the case of the reverse transform this is 0.0404482 (IEC rounded to 0.04045). This is discussed to some degree in the Wikipedia page on the subject.

Nevertheless the DEFINED STANDARD is 0.04045

@ferBonnin ferBonnin added the status: ready for work This issue is ready to be worked on. label Jul 10, 2019
@msft-github-bot msft-github-bot removed the status: blocked This issue is blocked. label Jul 10, 2019
@DaveTryon DaveTryon self-assigned this Jul 15, 2019
@DaveTryon DaveTryon added status: active This issue is currently being worked on by someone. and removed status: ready for work This issue is ready to be worked on. labels Jul 15, 2019
@DaveTryon DaveTryon changed the title [BUG] Outaded SrGB value calculation [BUG] Outdaded SrGB value calculation Jul 15, 2019
@DaveTryon DaveTryon added the status: resolved This issue has been merged into main. label Jul 17, 2019
@msft-github-bot msft-github-bot removed the status: active This issue is currently being worked on by someone. label Jul 17, 2019
@DaveTryon
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: resolved This issue has been merged into main.
Projects
None yet
Development

No branches or pull requests

5 participants