Re: [csswg-drafts] [css-color-4] Matrices for sRGB to XYZ and back were (slightly) wrong (#5922)

I reverted it in wikipedia (and you gave a wrong definition of edit war, that was vandalism revert anyway), and why you do not have access to IEC standars? It is anyway just one click away on btdig. Wow. This is unacceptable, no surprise just how wrong you are:

>is a 16 page PDF which you [buy from the IEC webstore for 70 CHF](https://webstore.iec.ch/publication/6168). I don't have a copy

>Which is a [51 page PDF and costs 175 CHF](https://webstore.iec.ch/publication/6169).


Anyway, 

>The standard is different from the [original definition of sRGB](https://www.w3.org/Graphics/Color/sRGB) because roundoff errors to 4 decimal places in the original proposal meant that the linear and curved parts of the transfer function were not continuous (although the effect made no difference, at 8 bits per component). The IEC standard fixed that.

This has nothing to do with XYZ matrix. But yes, transfer (nonlinearity) did change. XYZ also did change from NIF RGB, precursor of sRGB, as follows.


The magic of linear algebra is that it is not really able to approximate nonlinear algebra (lets not get into resultants and Koszul complex), so that is why the standard mandates (both ICC XYZ and ITU YCbCr) that the highest precision must be in direction of nonlinearity. IEC stadard that defines sRGB mandates that there is only one matrix, with infinite precision (that means the matrix actually has infinite zeroes after the 4 decimal points) as it goes from XYZ to RGB, becasue next step RGB --> R'G'B', not linear algebra. Same about YCbCr, matrix to R'G'B' is only one and has infiite precision. I perfectly described it here: 

>The decoding matrix for BT.2020-NCL is this with 14 decimal places.The smaller values in the matrix are not rounded, they are precise values. For systems with limited precision (8 or 10 bit, for example) a lower precision of the above matrix could be used, for example, retaining only 6 digits after decimal point

https://en.wikipedia.org/wiki/YCbCr


The amendment also recommends a higher-precision XYZ to sRGB matrix using seven decimal points, to more accurately invert the sRGB to XYZ matrix (which remains at the precision shown above):

https://en.wikipedia.org/wiki/SRGB


Looking into https://github.com/Igalia/webkit/commit/9b54678e6dcf46f18f2e0ad4135f8ee1c50f7210

 3.2404542f is wrong, it is just 3.240600000f.


This is crazy.





-- 
GitHub Notification of comment by ValZapod
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5922#issuecomment-1261578890 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 28 September 2022 23:48:54 UTC