Re:Make photomosaics, GIFs, and murals from pictures in Pyth...
by muzakthings on Thursday December 13, 2018 @03:21PM
(#18675688)
Right. See my comment above.
As to why it was in the project: If you treat each pixel as an example vector in 3 dimensions and cluster, you get the “dominant” colors for the image. It’s a primitive way to compress images as well. In this case I just was using it to generat fun cards that would use a minimal number of dominant colors. It’s still in the code if you’d like to use it but a bit hidden.
Re:Make photomosaics, GIFs, and murals from pictures in Pyth...
by _fullpint on Thursday December 13, 2018 @05:32PM
(#18676749)
K-nearest neighbor clusters based upon the k most similar objects.
K-means, clusters on centroids that are means. After every interation new means are calculated and then reclustering occurs.
https://en.wikipedia.org/wiki/K-means_clustering