Back to blog
Field notes · color

K-means Belongs in CIELAB, Not RGB: Picking Five Colors From an Image That Look Right

Run k-means on an image in RGB and the output is muddy browns. Run it in CIELAB and you get the colors a designer would pick. The reason is one paragraph; the implementation is a 256-entry lookup table and a 3×3 matrix. Here it is.

7 min readVectobox Team