diff --git a/Unicolour/Oklab.cs b/Unicolour/Oklab.cs index f2bce89..1944b19 100644 --- a/Unicolour/Oklab.cs +++ b/Unicolour/Oklab.cs @@ -53,6 +53,11 @@ internal Oklab(double l, double a, double b, ColourHeritage heritage) : base(l, * LMS = M1 * RgbToXyz * Rgb * RgbToOklab = M1 * RgbToXyz * M1 = RgbToOklab * RgbToXyz^-1 + * -------------------- + * ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ the "proper" way to define M1 is hidden in some random GitHub thread, instead of in any Oklab documentation + * https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-945714988 + * modern colour spaces seem to make it hard to implement things accurately (see also: XYB) + * will consider reworking M1 calculation if there's ever any complaints to my reverse engineering */ private static readonly WhitePoint OklabWhitePoint = Illuminant.D65.GetWhitePoint(Observer.Degree2); diff --git a/Unicolour/Xyb.cs b/Unicolour/Xyb.cs index 5696619..4aad6a2 100644 --- a/Unicolour/Xyb.cs +++ b/Unicolour/Xyb.cs @@ -20,7 +20,7 @@ internal Xyb(double x, double y, double b, ColourHeritage heritage) : base(x, y, public override string ToString() => base.ToString(); /* - * XYB is a transform of RGB + * XYB is a transform of RGB Linear * Forward: https://ds.jpeg.org/whitepapers/jpeg-xl-whitepaper.pdf * Reverse: n/a - not provided, using own implementation * @@ -32,7 +32,12 @@ internal Xyb(double x, double y, double b, ColourHeritage heritage) : base(x, y, /* * NOTE: the final step of B -= Y is not documented in the JPEG XL white paper * but apparently the intention is that B = sGamma should be B = sGamma - Y ๐Ÿคท - * (at least it makes the colour greyscale when X == 0 and B == 0, in the same way as LAB) + * (at least it makes the colour greyscale when X == 0 and B == 0, in the same way as LAB-like spaces) + * -------------------- + * ๐Ÿ’ฉ๐Ÿ’ฉ๐Ÿ’ฉ the only mention of this "subtract Y from B" is just some random Twitter post and a 10 second YouTube video + * so it's not particularly convincing that this extra step, which is left out of the white paper, should be performed + * https://github.com/Evercoder/culori/issues/200 ยท https://twitter.com/jonsneyers/status/1605321352143331328 ยท https://www.youtube.com/watch?v=rvhf6feXw7w + * modern colour spaces seem to make it hard to implement things accurately (see also: Oklab) */ private const double Bias = 0.00379307325527544933;