Awesome, I used this technique to find the dominant color in favicons so I could create a gradient in NewsBlur. See the effect here: http://cl.ly/KElb Here's the Python I use to do it: https://github.com/samuelclay/NewsBlur/blob/master/utils/Ima... from PIL import Image import scipy import scipy.cluster from pprint import pprint image = Image.open('logo.png') NUM_CLUSTERS = 5 # Convert image into array of values for…
Using python and k-means to find dominant colors in images
31–34 of 34 posts
Re: Using python and k-means to find dominant colors in images
#32Just wanted to say thanks for mentioning my book! I'm so happy that people are still getting value from it.
Re: Using python and k-means to find dominant colors in images
#33Just wanted to say thanks for mentioning my book! I'm so happy that people are still getting value from it.
I took a look at it a few weeks ago based on a recommendation here on HN and have been enjoying it ever since.
I'm in the process of trying to extend some very basic programming skills and refresh / extend equally basic math.
I started reading expecting something that would assume enough to fly right over in my head. Instead, I found a comfortable pace and very "practical" examples.
Every few pages is a delightful "Ohhhh...So that's how that works." demonstration of things that I've always wondered and theorized about, but never understood the mechanics of.
It's a great book, one that I expect will end up being pretty significant to me.
Re: Using python and k-means to find dominant colors in images
#34Just wanted to say thanks for mentioning my book! I'm so happy that people are still getting value from it.
I like that the code is in python, which I find easier to read than the java examples in Algorithms of the Intelligent Web. Being a perl guy (and a perl shop), python feels pretty similar and it's easy to port anything I need. If the rest of the book is as good as the clustering chapter, it's going to be a fun treat for my brain!