-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[css-color] Values in relative-color-out-of-gamut.html
seem slightly wrong.
#45147
Comments
relative-color-out-of-gamut.html
seem slightly wrong.relative-color-out-of-gamut.html
seem slightly wrong.
They could have. There was a bunch of detailed work done over the last few years, some in CSS Color 4 and some in color.js, often in parallel, to really reduce sources of cumulative error like slightly-different white points, inverse matrices calculated from rounded-off values, and so forth. In most but not all cases, the result of this was better precision but well below the level of a visual difference. My suspicion is that browser implementers could usefully check their matrix values against the current ones in sample code which are now as accurate as we can make them for 64bit floats, and update as needed. |
A quick glance in WebKit at least shows that they have outdated matrix values:
|
@weinig could you take a look? The difference will not be visible to the eye (mostly, unless errors accumulate through a chain of conversions) but could cause automatic tests to fail. It looks here as if the fuzziness of the fuzzy test is set rather high, to mask these differences. But WPT should be using the correct results here. The sample code uses rational number where possible (it isn't, for prophoto) so should be accurate to 64 bits. |
@weinig @myst729 do you agree with my reasoning? @romainmenke could you submit a PR to fix those tests, and also to tighten up the fuzziness a bit? Regardless of the accuracy required to pass the tests, the tested values should always be the correct ones. |
I've opened a PR to fix these tests: #49680 Safari (Preview) seems to now get it right, other engines not so much. |
Yeah, all looks good to me. Thanks for fixing the tests! (I updated webkit with the new matrices a number of months ago, so it makes sense Safari works). |
wpt/css/css-color/parsing/relative-color-out-of-gamut.html
Lines 24 to 52 in 6018167
When verifying various tests for css-color I noticed that I get different results here.
For example:
rgb(from color(display-p3 0 1 0) r g b / alpha)
results:
color(srgb -0.511814 1.01832 -0.310726)
(wpt)color(srgb -0.5116 1.01827 -0.31067)
(my results)color(srgb -0.5116 1.01827 -0.31067)
(colorjs.io)I am not sure if the recorded values in the tests are slightly wrong, or if maybe Chrome is slightly wrong.
@svgeesus Are implementations expected to have interop to this degree?
If so, then there should be tests for this.
@mysteryDate I think you submitted these tests, is there anything you can think of that could explain this difference?
Maybe we should just reduce the precision of the value to match the epsilon of the fuzzy tests.
Note:
fuzzy_test_computed_color
has a default epsilon of0.01
so these tests are checking the full values.Note:
Although these tests are related to gamut mapping, they actually test that no gamut mapping happens for specific values. So this is a general issue, not a gamut mapping bug.
The text was updated successfully, but these errors were encountered: