← All resources

HyAB k-means for color quantization

Auto-discovered

Blog Intermediate

Visit resource ↗

Description

HyAB k-means for color quantization is a technical blog post on 30fps.net about palette reduction in CIELAB using the HyAB hybrid distance. The URL is one illustrated article with visual comparisons against common quantizers.

It explains why Euclidean sRGB distance is not perceptually uniform, introduces CIELAB, and adopts the HyAB CD1 formula that combines absolute L difference with Euclidean a-b chroma distance from a 2019 color-difference paper. The author plugs HyAB into k-means, compares Pillow and libimagequant, tries L-channel weighting, and uses median for L with mean for a-b. Caveats cover dithering and cases where plain sRGB k-means still looks smoother.

The piece suits intermediate graphics and image-processing readers working on palette mapping or retro color reduction. Basic clustering vocabulary is assumed.

Access is a free web article with side-by-side images and a linked implementation. No account is required.

It helps evaluate whether HyAB improves large color differences, framed as a controllability tweak rather than a drop-in replacement for a tuned pipeline.