Skip to contentSkip to the inputSkip to the result

Pick colours from a photo

Find the colour codes in a photo

Loading tool

Instructions

Pick colours from a photo

How to use

  1. Choose a photo and press where you want the colour, or move there with the arrow keys.
  2. Press a colour to copy its code.

Supported input

  • JPG, PNG, WebP, GIF and BMP up to 40 MB.
  • Common colours come from a reduced copy grouped into similar colours, top six, copied as a HEX list, CSS variables or JSON.
  • A picked colour can be opened in the colour converter.

Input example

A logo

Result example

#1e90ff · rgb(30, 144, 255)

Troubleshooting

  • Unsupported formats and oversized files are refused with a reason.
  • The original file is never changed.

Limitations

  • Colours are read from a copy reduced to 1,600 px on the long side, so hairlines can blend with their surroundings.
  • Colour profiles such as P3 are not applied.

How it works

  • Reads the colour where you press as HEX, RGB and HSL with its contrast against text, and lists the most used colours in the photo to copy at once.

From a photo to colour codes: one-pixel readings and the six-colour palette

When it helps

  • You have only an image of a client’s logo and need the exact colour for a slide deck
  • You want to lift the mood of a photo into a colour scheme for a web page or merchandise
  • You are about to put text over a photo and need to know whether white or black will read better
  • You want a rough check that a printed proof matches the colour you saw on screen

A picked colour is a single pixel

The colour where you press is read from exactly one pixel of the copy drawn on screen, which is at most 1,600 px on its long side. Nothing is averaged, so in a JPEG with compression noise a neighbouring pixel can differ by a few levels. Drag slowly while pressing and settle where the same value keeps appearing; that is usually the intended colour.

Flat artwork such as a logo, read from a PNG original, often matches the design file exactly. The arrow keys move the reading point by 1% of the photo, or 10% with Shift.

How the six common colours are chosen

The photo is reduced to 64 × 64, which leaves 4,096 points. Each red, green and blue value is judged by its top three bits, giving 8 × 8 × 8 = 512 bins, each spanning 32 levels per channel. Points less than half opaque (opacity below 128) are skipped. The six bins with the most points win, and each is shown as the average colour of the points inside it.

Worked example: blues that merge and blues that split

  1. 1(30, 144, 255) and (31, 159, 224) both fall in the bin for red 0–31, green 128–159 and blue 224–255, so they merge into one averaged swatch.
  2. 2(32, 144, 255) differs from the first by only two levels of red, yet lands in the red 32–63 bin and is counted separately. Colours sitting on a bin edge can show up as two nearly identical swatches.
  3. 3Large flat areas such as a white wall or a sky hold the most points and take the first places. For a small accent colour, crop to that part first and extract again.

Reading the contrast figures

The contrast values under a picked colour use the WCAG 2.2 contrast ratio. Body text needs 4.5:1 and large text 3:1. #1e90ff, for instance, gives 3.24:1 with white text and 6.49:1 with black, so white works only for large headings and black is right for body copy. #c8553d gives 4.35:1 with white, just short of the body-text threshold.

HSL and OKLCH are listed too: #1e90ff is hsl(209.6, 100%, 55.9%) and oklch(65.2% 0.19 253.2). OKLCH’s first number is designed to track perceived lightness, which makes it a good anchor when you want other colours to look equally light.

Copy formats and limits

  • CSS variables come as --color-1 to --color-6 inside :root, JSON as an array of HEX strings, and the HEX list one per line.
  • Swatches are averages, so they may not match any single pixel exactly. When precision matters, use the picked colour rather than a swatch.
  • Embedded colour profiles are not applied, so the most saturated colours of a wide-gamut photo can differ from the values stored in the file.

Checked

Frequently asked questions

The colour I picked differs a little from my design file.

JPG compression blends colours slightly, colour profiles such as P3 are not applied, and colours are read from a copy reduced to at most 1,600 px on the long side. For exact values, check the original design file.

How are the most used colours chosen?

The photo is reduced to 64×64, similar colours are grouped into 512 bins, and the average colour of the six largest bins is shown. Transparent areas are skipped.

How do I copy a colour code?

Press the picked colour card or a swatch of a common colour to copy its HEX code; the HSL, OKLCH and contrast values under the card copy when pressed too. The six common colours copy at once as a HEX list, CSS variables or JSON.