Skip to content

Color Picker from Image

Drop, paste or choose a photo, then hover or tap to pick a colour through the magnifier. The palette and every colour code are worked out in your browser: the picture is never uploaded.

v2026.10.13

Example photo: a field of red poppies in green grass, with violet hills and a low sun in a pink and orange sky
or drop or paste one. It stays on this device: nothing is uploaded.

Colours in the palette

Palette colour 1 of 6

#50487A

Muted blue, about 33% of the picture. Closest CSS name: darkslateblue.

Width = share of the picture. Tap a colour, or pick your own from the photo.

  • HEX#50487A
  • RGBrgb(80, 72, 122)
  • HSLhsl(250, 26%, 38%)
  • HSVor HSBhsv(250, 41%, 48%)
  • CMYKnaive, no profilecmyk(34%, 41%, 0%, 52%)
  • OKLCHoklch(43.3% 0.081 289.9)
  • LABCIELAB, D65lab(33.4% 15.9 -27.3)
  • CSS nameclosestdarkslateblue

Contrast between the palette’s colours

WCAG 2.2 ratio for each pair as text and background. Green passes AA for body text (4.5:1), amber only for large text (3:1).

Contrast ratio between each two colours of the palette
Colour#50487A#3E6029#6A913F#EFA980#B7748F#B82119
#50487A1.12.24.12.31.2
#3E60291.11.93.62.01.1
#6A913F2.21.91.81.01.7
#EFA9804.13.61.81.83.2
#B7748F2.32.01.01.81.8
#B821191.21.11.73.21.8
How this works: Method, 7 sources, Checked against 1 worked example,

How this works

Method

A photo is a grid of pixels, and each pixel stores three numbers from 0 to 255 for red, green and blue. When you point at the picture, the page maps the pointer’s position to the pixel underneath it and reads those three numbers straight from the decoded image. Nothing is guessed or smoothed: the hex code is that pixel, and the magnifier shows the eleven by eleven pixels around it so you can land on exactly the one you want. Full method

How it’s tested

One worked example for this page is checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • Added eight pages: a colour picker for photos, a WCAG 2.2 and APCA contrast checker, a palette generator, a colour blindness simulator, and hex, RGB and CMYK converters.
  • Redesigned: paste a colour in any format, HSV and CMYK added, opacity, a contrast check against white and black text, and colour harmonies.
  • Fixed a crash when opening the colour picker.
  • First published.

Every change on What’s new

How we make toolsReport a mistake

How the picker reads a colour from a photo

A photo is a grid of pixels, and each pixel stores three numbers from 0 to 255 for red, green and blue. When you point at the picture, the page maps the pointer’s position to the pixel underneath it and reads those three numbers straight from the decoded image. Nothing is guessed or smoothed: the hex code is that pixel, and the magnifier shows the eleven by eleven pixels around it so you can land on exactly the one you want.

Photos are noisy. A blue sky that looks flat has pixels a few steps lighter and darker than each other, and the edge of an object mixes the two colours on either side. If the colour you get looks slightly off, move a pixel or two into the middle of the area, or use the palette, which averages whole regions for you.

The palette groups the picture’s pixels into clusters of similar colours with k-means, measured in OKLab, where equal distances look like equal differences to the eye. The starting colours are chosen with k-means++, which favours colours far from those already picked, so a small bright detail gets its own swatch instead of being swallowed by a large dull area. The random choices use a fixed seed: the same picture always gives the same palette.

pixel (x, y) → bytes at 4 × (y × width + x): red, green, blue

The example photo’s palette

The six colours the picker finds in the poppy field, with each one’s share of the picture and the more readable text colour on it.

The six colours the picker finds in the poppy field, with each one’s share of the picture and the more readable text colour on it.
ColourRGBShareBest textContrast
#50487Argb(80, 72, 122)33%White8.23:1
#3E6029rgb(62, 96, 41)21%White7.21:1
#6A913Frgb(106, 145, 63)16%Black5.73:1
#EFA980rgb(239, 169, 128)13%Black10.65:1
#B7748Frgb(183, 116, 143)12%Black5.90:1
#B82119rgb(184, 33, 25)6%White6.42:1

Frequently Asked Questions

Is my photo uploaded anywhere?

No. The browser decodes the picture on your device and the page reads its pixels there. There is no server that receives it, and when you leave the page or choose another picture the copy in memory is released. You can turn off your connection after the page has loaded and the picker still works.

How do I pick a colour from a screenshot?

Take the screenshot, then press Ctrl+V (⌘V on a Mac) on this page: a pasted image opens straight away. You can also drop a file onto the picture or use Choose a photo. On a phone, pick a screenshot from your photo library.

Why is the colour different from what I see in my photo app?

Some phones save pictures in a wider colour space (Display P3) and some apps adjust colours on display. The browser converts the picture to sRGB for the page, so a very saturated colour can come out slightly less vivid here. For web and most design work, sRGB values are the ones you want.

How many colours should the palette have?

Five or six capture most photos: a dominant background, one or two mid tones and an accent. Ask for eight or ten to see the smaller details split out, such as the dark and light sides of the same object. The shares under the swatches tell you how much of the picture each colour stands for.