elefcode
← All guides

Design · 3 min read

Extracting a Colour Palette from an Image

A photo you love is a ready-made colour scheme. Picking colours from images — one pixel at a time or as an automatic palette — is a fast way to make a design feel cohesive with its imagery.

Try it yourself with the related tool.

Pick colours from an image →

Advertisement

Picking a single colour

A colour picker reads the exact pixel under the cursor. Photos are noisy, so neighbouring pixels can differ a lot; averaging a small area gives a more representative colour than a single pixel.

How palettes are extracted

Palette extractors group similar pixels together — usually with a clustering method such as k-means or median cut — and report the centre of each group. The biggest groups are the dominant colours.

Dominant is not always best

The most common colour in a photo is often a dull background — sky, wall, or shadow. A useful palette also includes a smaller, vivid accent. Pick one or two neutrals for backgrounds and text, and one accent for buttons and highlights, then check contrast.

Related guides