Image segmentation, using K-means clustering: https://en.wikipedia.org/wiki/K-means_clustering

Maybe I'll make a tutorial?

(Below image is an animated GIF btw)

k-means clustering - Wikipedia

KMeansImageSegmentation

KMeansImageSegmentation

Codeberg.org