Skip to content

[css-color-4] Should we recommend DeltaE OK2 over the original DeltaE OK? #14207

Description

@svgeesus

Delta E is a class of algorithms to measure the actual perceived difference between two colors.

ΔEOK2 is a slightly modified version of the existing ΔEOK which scales the a and b axes by a factor of 2
as recommended by Björn Ottosson, inventor of Oklab:

Adjust the scaling of a&b to more accurately predict color distances

He also said

I unfortunately didn't spend that much time calculating and validating that scaling factor when I first derived Oklab since I was mostly focused on the orthogonality between L, C and h (and I didn't expect it to become so widespread so quickly), and it seems like it is off by quite a bit.
I've recently done some tests with color distance datasets as implemented in Colorio and on both the Combvd dataset and the OSA-UCS dataset a scale factor of slightly more than 2 for a and b would give the best results (2.016 works best for Combvd and 2.045 for the OSA-UCS dataset).

So instead of changing the definition of Oklab, which is now widely adopted, the proposal is to make another distance metric, ΔEOK2, if it is demonstrably better then ΔEOK.

Experimental verification

I generated a synthetic dataset of normally distributed base colors (so, favoring more common low-chroma colors but including wide-gamut colors). Colors outside rec2020 were eliminated. I then produced, for each color in the dataset, a group of similar colors by perturbing the lightness, chroma and hue (again, normally distributed).

To avoid any dependence on Oklab itself, the base colors were generated in CAM16 JMh as were the derived colors. Here is a plot of the base colors, converted to Oklab

Image

SVG

I then compared the well established (but computationally complex) ΔE2000 with the existing ΔEOK and proposed ΔEOK2.

For those who want to study the verification in detail, see the detailed description.

Results

The correlation coefficient (higher is better) and the line of best fit were calculated.

Image

SVG of ΔE2000 vs ΔEOK

Image

SVG of ΔE2000 vs ΔEOK2

Conclusion

ΔEOK2, which is ΔEOK with the Oklab a and b axes scaled by 2, agrees with the highly-regarded but computationally complex ΔE2000 noticeably better than ΔEOK does (correlation coefficient r² 0.722 vs 0.642 on 5000 BT.2020 color
pairs). Scaling the a/b axes by 2 is a measurable improvement, supporting Ottosson's recommendation. It remains computationally simple and fast.

Proposed resolution: add ΔEOK2 to CSS Color 4 and recommend it over ΔEOK.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions