-
Notifications
You must be signed in to change notification settings - Fork 9
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
Thanks for this project! #45
Comments
That's great to hear. Sorry for the late response, somehow I missed a notification. Your blogs were fun to read because I went down a very relatable path trying to solve a problem. Similar to the PDF problem, I wanted to extract a background color and foreground text color from music cover art. I started with a histogram but the results weren't appealing, and then wrote a simple median-cut implementation. Both had similar issues of favoring the uglier compression artifact pixels over what we see as dominant colors. I settled on k-means which resulted in this library. I used CIELAB color for the brightest and darkest k-means results, adding/subtracting from their luma component until the sRGB colors reached a suitable WCAG ratio (and ended up adding convenience functions to To the last point of the dominant colors blog, I completely agree about making tools small enough that you can finish them. Doing one thing and doing it well is something I try to abide by but sometimes features creep in that are convenient for the developer possibly at the expense of the user. 😅 |
@alexwlchan Thank you so much for sharing the message. As someone who is also trying to do more ai stuff on rust, your example repo was a savior |
@okaneco I am here to say thank you as well! ❤️ I was able to create a Elixir wrapper on top of it and using it in Livebook. https://github.com/29decibel/dominant_colors |
I couldn't find a better way to contact you, so have an issue.
Thanks for this project – I've had a Python implementation of kmeans on images for a while, but I wanted to switch to Rust to make it go faster. I thought I might have to implement it myself, then I found your library and decided to try that. It was super easy to get working and saved me a ton of work, thanks!
If you're interested, this is where I'm using it: https://github.com/alexwlchan/dominant_colours
The text was updated successfully, but these errors were encountered: