Optimized $k$-means color quantization of digital images in machine-based and human perception-based colorspaces

Optimized $k$-means color quantization of digital images in machine-based and human perception-based colorspaces
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Color quantization represents an image using a fraction of its original number of colors while only minimally losing its visual quality. The $k$-means algorithm is commonly used in this context, but has mostly been applied in the machine-based RGB colorspace composed of the three primary colors. However, some recent studies have indicated its improved performance in human perception-based colorspaces. We investigated the performance of $k$-means color quantization at four quantization levels in the RGB, CIE-XYZ, and CIE-LUV/CIE-HCL colorspaces, on 148 varied digital images spanning a wide range of scenes, subjects and settings. The Visual Information Fidelity (VIF) measure numerically assessed the quality of the quantized images, and showed that in about half of the cases, $k$-means color quantization is best in the RGB space, while at other times, and especially for higher quantization levels ($k$), the CIE-XYZ colorspace is where it usually does better. There are also some cases, especially at lower $k$, where the best performance is obtained in the CIE-LUV colorspace. Further analysis of the performances in terms of the distributions of the hue, chromaticity and luminance in an image presents a nuanced perspective and characterization of the images for which each colorspace is better for $k$-means color quantization.


💡 Research Summary

This paper investigates how the choice of color space influences the performance of k‑means‑based color quantization, a technique that reduces the number of colors in a digital image while preserving visual quality. While most prior work applies k‑means in the machine‑oriented RGB space, the authors evaluate three additional spaces that are designed to align with human visual perception: CIE‑XYZ, CIE‑LUV, and its polar counterpart CIE‑HCL.

A dataset of 148 images was assembled, covering a wide variety of scenes, subjects, lighting conditions, and statistical distributions of hue, chromaticity, and luminance. For each image, quantization was performed at four levels of palette size (k), typically k = 2, 4, 8, 16. The authors used a state‑of‑the‑art implementation of k‑means: the Hartigan‑Wong Optimal Transfer Quick Transfer (OTQT) algorithm with k‑means++ initialization, ensuring fast convergence and reduced sensitivity to initial centroids. Because HCL encodes hue as an angle, the authors transformed HCL to the Cartesian LUV representation (U = C cos H, V = C sin H) before clustering; they proved that this transformation does not alter the maximum‑likelihood estimates within each cluster, as the Jacobian of the transformation merely rescales the density.

Quality assessment was carried out with the Visual Information Fidelity (VIF) metric rather than PSNR, because VIF measures the amount of visual information retained based on natural scene statistics and a model of the human visual system, making it more appropriate for comparing results across different color spaces.

The results reveal a nuanced picture. Approximately half of the images achieve the highest VIF when quantized in the RGB space. For the remaining images, the CIE‑XYZ space consistently outperforms RGB, especially at higher palette sizes (k ≥ 8). At lower palette sizes (k = 2 or 4), the CIE‑LUV space sometimes yields the best scores, particularly for images whose hue distribution is narrow but chromaticity is strong (e.g., portraits or scenes with dominant colors). Further statistical analysis shows that images with a wide spread of hue values benefit from XYZ, whereas images with concentrated hue but high saturation benefit from LUV.

The authors conclude that there is no universally optimal color space for k‑means quantization; the best choice depends on both the desired number of colors and the intrinsic color distribution of the image. This insight suggests that adaptive pipelines could first analyze an image’s hue‑chromaticity‑luminance statistics and then select the most suitable color space before applying k‑means. Such a strategy could improve compression efficiency and visual fidelity in applications ranging from web image delivery to resource‑constrained embedded displays.

Future work is proposed to extend the comparison to other perceptually uniform spaces such as CIE‑LAB, to explore alternative clustering algorithms (e.g., Gaussian mixture models, hierarchical clustering), and to integrate the findings into deep‑learning‑based quantization frameworks. The paper thus provides both a thorough empirical benchmark and a theoretical justification for incorporating human‑perception‑based color spaces into practical image quantization workflows.


Comments & Academic Discussion

Loading comments...

Leave a Comment