-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add EuclideanDistance trait #288
Comments
I tried working on this a bit but ran into a stumbling block for cylindrical color spaces. How should the various RGB Hue spaces be treated, LcH, etc.? Would their implementations of the trait be omitted, would they be converted to the Cartesian coordinates (RGB, Lab, etc.), or something else? There may be other exceptions but this question made me put it on hold and forget about it until this issue. I think it'd be nice to get a better idea of what to do for all the color spaces to make it easier for implementing. |
Thanks a lot for giving this a try! I think it makes sense to simply skip anything with polar coordinates. At least for Some of the other spaces do have clear Cartesian counterparts ( |
I'm implementing this as part of some general color difference improvements in #316. Let me know if there's anything I missed that you were about to add, if you want. |
Thanks so much for working on this, looks great. I think that covers most use cases I had in mind. Since then, I came across this paper where the HyAB (hybrid model of |
Interesting! It looks like HyAB would be a simple and good addition. I'll skip it in the current PR, though, just to not rush it in. Would you like to open an issue for it? Otherwise, I'll do it and link to your comment. 🙂 |
Discussed in #275
Originally posted by okaneco March 6, 2022
I find myself rewriting boilerplate often enough that maybe it'd be nice to have upstream. The
ColorDifference
trait exists but I don't always need the expensive CIEDE2000 calculation. Sometimes I'd like a more simple Euclidean distance/norm or the squared distance for comparing to a tolerance value.This is a sketch of what I had in mind.
Perhaps this can be added to the
ColorDifference
trait?There may be other "general enough" functions that people find themselves re-implementing similar to these which would carry their weight as additions to the library.
The text was updated successfully, but these errors were encountered: