-
Notifications
You must be signed in to change notification settings - Fork 47
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 I can to get dominant color for image? #9
Comments
This library does not provide a way to get the dominant color. Is there a reason you don't want to use color thief? I found dominant-color but it has a dependency on ImageMagick, which is not ideal. Maybe @mattdesl or @hughskennedy know of a good module for this. |
Hmm last I checked color thief was basically using the same library underneath (for quantizing). This lib should sort the results based on color frequency, so typically I just take the first color and assume it's the most dominant (ie: frequent). So it might already be what you want? |
Wondering what "dominant" really means. 🤔 |
@zeke for me it means that the average color of this image is black and blue (not semi-tones of them) |
It means: “most important, powerful, or influential.”
Agreed. |
But― this might be not a good way to get a dominant color. |
get-rgba-palette, which this module depends on, has a function palette.bins, which returns the relative percentage of each color. It would seem possible to use this to sort the colors returned by the bins "amount" value. |
That's interesting @ijambro. Do you want to take a shot at that in a pull request? |
I need to get dominant color for specific image (or color frequency).
For example, Color Thief can do it.
Is it possible with
get-image-colors
?Thanks
The text was updated successfully, but these errors were encountered: