News for hackers. Stuff that matters.
Re:K-Means Clustering and Art by tylerneylon on Saturday December 31, 2011 @04:11PM (#3411853)
I wrote some similar code in python recently -- I think color visualizations like this are both fun and potentially useful for certain image manipulations.

This includes a readable 36-line implementation of k-means clustering that could be shorter if one wanted to play some code golf :) I used a pie chart layout, with pie slices proportional to their corresponding cluster sizes.

Code: https://github.com/tylerneylon/imghist/blob/master/imghist.p...

Sample images: http://blog.zillabyte.com/post/11193458776/color-as-data http://blog.zillabyte.com/post/13141231882/hue-histograms

If anyone else is interested in this stuff, Austin A made a great suggestion on the original post to use the Lab colorspace.

There are no comments on this comment yet.