Image colour picker and palette extractor

Pick exact colours from a picture, extract its palette and export it as code.

Point at the picture to read a colour.

Mouse: move and click. Touch: drag your finger and lift to pick. Keyboard: arrow keys move the cross (Shift for 10 pixels), Enter picks.

Dominant colours

Median cut over the whole picture: the same picture always gives the same palette.

Under the cross

Point at the picture to read a colour.

Picked colours

Click the picture to add colours here.

What this tool does

Open a picture (or paste a screenshot) and move over it: a magnifier shows the pixels under the cross, and the colour is given as HEX, RGB, HSL and OKLCH, each with a copy button. Click or tap to keep a colour in your list. Below the picture, the tool extracts the picture's dominant colours, shows how much of the picture each one covers and which text colour reads on it, and writes the palette as CSS variables, Tailwind (v4 @theme or a v3 config), SCSS, JSON or a plain list. A contrast checker takes any two of these colours and tells you whether they pass WCAG for body text, large text and icons. The picture is never uploaded: it is decoded and read on this device.

Picking precisely

  • On a computer, move the mouse and click.
  • On a phone or tablet, drag your finger: the magnifier follows it and the colour is picked when you lift your finger, so your fingertip never hides the spot you choose.
  • With a keyboard, focus the picture and use the arrow keys to move the cross one pixel at a time (Shift moves 10), and Enter to pick.

Photos are noisy: neighbouring pixels of a "white" wall can differ by a few levels, and JPEG compression adds blocks of slightly different colour. Set Sample to a 3 × 3 or 5 × 5 average to read the colour of a surface rather than of one random pixel. Very large pictures are held at 4,096 pixels on the longest side for picking, which the tool says when it happens; for colour this changes nothing visible.

How the palette is found

The palette is computed by median cut: the picture's pixels are counted in a histogram of 32,768 buckets, all colours start in one box, and the box with the largest spread is repeatedly cut in two at the median of its widest channel until there are as many boxes as colours asked for. Each palette colour is the exact average of its box, and the share is the part of the picture it stands for. There is no randomness, so the same picture always gives the same palette, unlike k-means tools that change on every run. Ask for 4 to 6 colours for a brand palette, 10 to 16 to see the full range of a photograph.

Colour formats in one line each

  • HEX (#143c8c) and RGB are the same numbers, 0 to 255 per channel.
  • HSL is hue, saturation and lightness; easy to adjust by hand, but its "lightness" is not how bright a colour looks.
  • OKLCH is lightness, chroma and hue in a perceptual space: two colours with the same L look equally light, which makes it the best format for building tints and shades. It works in every current browser's CSS.

From a photo to a palette that works

A palette lifted straight from a photo rarely gives readable text: the saturated orange in a sunset photo (#f08c1e) has a contrast of only 2.48:1 against white, below the 4.5:1 that body text needs. The checker suggests the closest colour that passes, keeping the hue (#b1620c in this case, 4.5:1 or more). The article on photo palettes and contrast works through a full example. For gradients and harmonies built from a single colour, use the colour tools; for CSS gradients, the gradient generator.

Frequently asked questions

Is my picture uploaded?

No. The picture is decoded by your browser and its pixels are read on your device.

Why does the same spot give slightly different colours?

Photos contain noise and JPEG compression artefacts, so neighbouring pixels differ a little. Use the 3 × 3 or 5 × 5 average to read the colour of the surface.

Will the palette be the same next time?

Yes. Median cut has no random start, so the same picture and the same number of colours always give the same palette.

Does it work on phones?

Yes. Drag your finger over the picture; the magnifier shows the pixels under it and the colour is picked when you lift your finger.

Can I pick a colour from anywhere on my screen?

Take a screenshot and paste it here with Ctrl+V or Cmd+V. Browsers only let a page read pixels of pictures it has been given.