Color Quantisation

Color quantization is primarily used in computer graphics research literature; in applications, terms such as optimized palette generation, optimal palette generation, or decreasing color depth are used. Some of these are misleading, as the palettes generated by standard algorithms are not necessarily the best possible. - wikipedia

Fast color quantization in OpenCV

Color quantization using k-means

This iterate several times over the whole images before convergence.

Median Cut

Reduce processing on each iteration.

Own Implementation

see also

Written on August 10, 2024, Last update on August 25, 2024
color quantization nearest-neighbor algorithm opencv