-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to measure perceptual difference between colors #76
Comments
I'm not sure that there is a precise answer, best bet would be to experiment and see how you like the results. Feel free to post your findings here. |
Original image Palette: red, green, yellow, black Random noise added, using color distance in CIELAB for palette matching: Same operation, but using distance in HSLuv for palette matching: It appears that HSLuv is not very good for color distance. Maybe this is because the Hue value is weighted 3.6 times more than luminance or saturation? I tried scaling hue so it would be [0..100], but that looked even worse. |
Euclidean distance HSLuv is bad for this purpose, for two reasons:
|
I played with your C# code using LUV, and convert UV to chroma and hue using trigonometry. |
@isral black and white both have chroma of 0. |
Yeah, don’t do that. If you insist on not using CIE DE2000 use Euclidean distance in LAB or LUV space. |
TLDR: check last 3 lines.
Both chroma is 0, so the only difference is ΔL which is 100.
I use LUV, note: all number rounded. Maybe euclidean distance can't be used here or both UV must be scaled down or I miss something else. Edit: I found online CIE DE2000 calculator (http://colormine.org/delta-e-calculator/cie2000) and the result is 75.872. |
Ah okay, I misunderstood you. You seem to be calculating Euclidean distance correctly [1], so the bad results you're getting must be the limitation of the Euclidean color distance method. [1] https://en.wikipedia.org/wiki/CIELUV#Color_and_hue_difference |
How do I find the most similar color to a certain color in a set of colors? Is euclidean distance a decent way to do this? e.g. sqrt((ΔH)**2+(ΔS)**2+(ΔL)**2)
If not, would euclidean distance be decent when looking for the closest color within a certain Hue? e.g. sqrt((ΔS)**2+(ΔL)**2)
The text was updated successfully, but these errors were encountered: