Nimble Toolbox

Pick a colour from an image

Drop in a picture and press anywhere on it to read the colour there as HEX, RGB, HSL, and HSV, each ready to copy. The main colours of the whole picture are listed beside it, most used first.

How to use it#

  1. Drop a photo, a screenshot, or a logo onto the box above, or click it to choose one. An iPhone HEIC photo opens too.
  2. Press the picture where the colour is. With a mouse, hold the button and drag to watch the colour change as you move.
  3. Copy the code you need from the "Picked colour" rows: HEX for CSS and most design apps, RGB, HSL, or HSV for the rest.
  4. Or press one of the main colours to see its codes, and copy the whole list with "Copy all" or save it with "Download .txt".

Getting the exact colour code from a picture#

Like the eyedropper in a design app, press a point on the picture and the colour there is written four ways. HEX, such as "#1d4ed8", is what CSS, Figma, Canva, and most design apps take. RGB gives the same colour as three numbers from 0 to 255, for red, green, and blue. HSL and HSV describe it by hue, saturation, and lightness or value; HSV is what Photoshop and many colour pickers call HSB. All four are the same colour, so copy whichever the place you are pasting into asks for. A pixel that is partly see-through, such as on the soft edge of a transparent logo, keeps its opacity: the HEX gets two more digits, as in "#dd292980", and RGB and HSL become rgba and hsla.

A photo is rarely one flat colour, even where it looks it. Sensor noise and JPEG compression make neighbouring pixels differ by a few points each, so a single pixel can come out a shade off from the area around it. The picker reads the single pixel you press, as an eyedropper does, which is exact for a logo, an icon, or a screenshot of flat colour. For a photo, set "Colour from" to "3 × 3" or "5 × 5" to average a small square instead. While you drag with a mouse, a lens shows the pixels under the pointer enlarged, with the ones being read outlined. A picture over about 16.7 million pixels is read scaled down to that size, the most Safari on an iPhone draws, which blends neighbouring pixels a little.

The main colours, sometimes called the dominant colours, are found across the whole picture at once: its pixels are sorted into groups of similar colour, each group is averaged, and the groups are listed by how much of the picture they cover. The percentage under each one is that share. A logo usually comes out as its two or three brand colours plus white, while a landscape gives the sky, the ground, and the shades between.

Up to eight are listed, and shades within a few points of each other count as one, so a logo of three colours shows three. Parts of the picture that are see-through, such as the background around a transparent logo, are left out, so they cannot add a colour that is not there. To check whether two of the colours are readable as text on each other, paste them into the colour converter, which gives the contrast ratio.

Why a picked colour can differ from what you remember#

The codes are in sRGB, the colour space CSS and the web use. A photo from a recent iPhone or a camera set to a wider colour space holds some colours sRGB cannot show, mostly very saturated reds and greens, and those are read as the nearest sRGB colour. For anything going on a web page or into a design app working in sRGB, that is the value you want.

Two other things change the colour you see without changing the code. Every screen shows colours a little differently, so the same HEX can look warmer on a phone than on a laptop. And a picture that was resized, compressed, or screenshotted has been through all of that already, so its colour is the colour of the copy you have, not of the original design. For a brand colour that has to be exact, ask for the original file or the brand guide.

Frequently asked questions#

Why average a few pixels?

#

Because neighbouring pixels in a photo are rarely identical. Noise from the camera and JPEG compression scatter each pixel a few points either side of the true colour, so one pixel can be a shade off. Averaging a 3 × 3 or 5 × 5 square around the point you press evens that out and gives the colour the area actually looks. For a screenshot, a logo, or anything else with flat colour, keep 1 pixel, which reads that one pixel exactly.

Can I pick a colour from a screenshot of a website or an app?

#

Yes. Take the screenshot, drop it in, leave "Colour from" at 1 pixel, and press on the button, the background, or the text you want. A screenshot keeps flat colours exact, so the HEX code is the one the site or app drew, as long as the screenshot was saved as a PNG. A screenshot saved or sent as a JPG can shift each colour by a point or two.

What does the percentage under each main colour mean?

#

It is the share of the visible picture closest to that colour. Every pixel is counted towards one of the main colours, and the percentages are rounded so they always total 100, with a sliver too small to round to 1% shown as "under 1%". See-through pixels are not counted. Shades close to each other, such as the soft edge around a shape, count as one colour, so a picture with few colours shows fewer than eight.

Does it work on a phone?

#

Yes. Open a photo from your library or a screenshot, then tap the picture where the colour is. A finger that moves scrolls the page instead of picking, so tap and lift. A ring marks the point you tapped, filled with the colour picked, and each code has its own Copy button.

Can I get the colour as CMYK for printing?

#

Not here. A CMYK value depends on the printer, the ink, and the paper, so there is no single CMYK number for an RGB colour, and a converted one would only be a guess. Give the printer or your design app the HEX or RGB code and let it convert with the printer's own profile, which is what it would do with a guessed value anyway.

Is my picture uploaded anywhere?

#

No. The picture is read and every colour is worked out in this browser tab. Nothing about the picture or the colours you pick is sent anywhere.