Dominant Image Color Algorithms
This is just a playground for testing out different algorithms for extracting dominant colors from images. I've tried various techniques for improving optimization, including downsampling, shifting certain color space channels, and eliminating Lab luminance altogether. Difficult to beat the speed of the MMCQ algorithm, though.
K-means clustering using the ml-kmeans and node-kmeans libraries. MMCQ (modified median cut quantization) algorithm from Leptonica library in colorquant2.c, later implemented in the quantize Javascript package. (quantize is the code used in the Color Thief library.) node-vibrant also uses MMCQ. Huge shoutout to the original author of MMCQ as implemented in Leptonica, Dan Bloomberg.