K-Means Color Segmentation
Source code: KMeansSegmentation
Built with Processing
The vertical position of the mouse click determines the number of colors to use. The top of the images chooses one or two colors, toward the bottom chooses up to 60.