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

Why does this not extract the color white? #2

Open
delebash opened this issue Sep 16, 2022 · 1 comment
Open

Why does this not extract the color white? #2

delebash opened this issue Sep 16, 2022 · 1 comment

Comments

@delebash
Copy link

satellite-9-82-180-LandscapeSize-2017

Trying to get colors from this image. TY

@zygisS22
Copy link
Owner

Good question!, I tried today some examples myself and I think you need to play a bit with the values, if we increase the DEPTH base to say 6, we get more colors and something more similar to "white", I guess this is because as we are constantly cutting the colors by the middle we are not getting the extremes represented correctly, and to see this we have to expand the number of colors.

Below you can see an example using DEPTH 6
base6example
You could also tweak this part here where we calculate the difference between the colors, since we are omiting various one of those could be something more akin to the white you are looking for
https://github.com/zygisS22/color-palette-extraction/blob/master/index.js#L23
omitcolors

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