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

Sub-optimal color approximation due to Euclidean metric in RGB #9

Open
jaseg opened this issue Feb 18, 2016 · 1 comment
Open

Sub-optimal color approximation due to Euclidean metric in RGB #9

jaseg opened this issue Feb 18, 2016 · 1 comment

Comments

@jaseg
Copy link

jaseg commented Feb 18, 2016

Hi,

The Euclidean metric ( sqrt(a^2+b^2+c^2) ) does not approximate perceived color distance very well. In my version of this project (this seems to be one of these weird wheels everybody keeps reinventing^^) I used the LUV color space, where the Euclidean metric gives somewhat better (though still imperfect) results.

Also, using the ANSI standard palette (colors 0-16) is unwise for image display since users tend to re-define these colors using color themes in their terminal emulators.

Cheers,
jaseg

@atextor
Copy link
Owner

atextor commented Feb 19, 2016

Hi jaseg,
both points are valid. Regarding colorspace, I honestly did give it not much thought. Now that we have an issue open, maybe someone wants to take it on and send a pull request. I know I probably won't for a while.
You're right about redefined ANSI colors as well. The easy fix would be to just ignore those in the search. I also thought about reading the the corresponding X resources and use the acutally defined colors, but it's not that straightforward because it depends on the terminal emulator (i.e., you could have defined URxvt*color0 or XTerm*color0 and so on). Also I'm not sure the effort for the resulting minimal improvement is worth it.

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