How to Extract a Palette From an Image (and Use It Well)

The algorithm

Most palette extractors use k-means clustering. The idea: pick K (say, 5) random color centers, assign every pixel to the nearest center, recompute each center as the average of its pixels, and repeat until the centers stop moving.

Color moods

A raw extraction often looks muddy. Apply a mood preset to push the palette toward a feel:

Colorful - boost saturation.

Bright - boost saturation and lightness.

Muted - drop saturation.

Deep - drop lightness, keep chroma.

Dark - drop lightness aggressively.

Try it on your own photo at Extract from Image.