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

Calculation wrong #4

Closed
ddsol opened this issue Jan 18, 2017 · 4 comments
Closed

Calculation wrong #4

ddsol opened this issue Jan 18, 2017 · 4 comments

Comments

@ddsol
Copy link

ddsol commented Jan 18, 2017

This Delta E calculation is wrong. For some insight I suggest reading this paper.

Details:

de({l: 60, a: -79.86355100472929, b: 60.18150231520482}, {l: 60, a: 79.86355100472929, b: -60.181502315204824}) = 59.58968443596155;

de({l: 60, a: -79.86355100472929, b: 60.18150231520482}, {l: 60, a: 79.863656041144, b: -60.18136292692152}) = 102.06502930178404;

How can that be right when the difference in the second color is extremely small (and no difference in the first color) but the resulting Delta E is radically different?

@zschuessler
Copy link
Owner

zschuessler commented Jan 18, 2017

I've verified the calculation is correct here:
http://colormine.org/delta-e-calculator/cie2000

I read the linked resource when creating this library. Does something specific exist in the paper which refutes the accuracy of the implementation?

(By the way, de00 gives inaccurate results when there is a hue shift of 180/360 degrees. this is mentioned in the paper)

@zschuessler
Copy link
Owner

I just noticed in your original message you said the difference in color is extremely small. Are you using the CIELAB color space? The colors are drastically different. Bright green vs bright pink.

You can also tell the colors are polar opposites in hue because the colors are inverted in A/B values.

@ddsol
Copy link
Author

ddsol commented Jan 18, 2017

Well, I fed all the test data in that paper through this function and it looks like the results are the same.
The difference in the second color is extremely small in both cases. But it is a flip at the 180° mark.

Also, the paper only tests colors with a very small color difference (R<2.5) so the discontinuity is small there. But as you can see above, the discontinuity is huge.

That said, DeltaE is apparently just really bad at diffing colors where dE>5 or so. So, if (dE00(a,b)>5) return NaN; 😄.

From the paper:

Though the CIEDE2000 color-difference equations are only applicable for small color differences, it is preferable that data for testing software implementations should include at least a few large color differences

@ddsol ddsol closed this as completed Jan 18, 2017
@zschuessler
Copy link
Owner

Momma always said nothing was perfect 😉

Reviewing this, it would be cool if discontinuity was calculated. Too specific of a use case and time consuming for it to be a good addition I think.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants