How to find the exact colour code in an image
Clicking a colour with an eyedropper gives you a code in a second. Getting the right code takes a little more care, because photos, JPEG compression and colour profiles all nudge the number.
Processed locally in your browserTo find the colour code in an image, open it in a colour picker, click the colour and copy the HEX code it shows, such as `#1E3A8A`. ImageDoctor's Color Picker copies the HEX code to your clipboard as soon as you click, and shows the same colour as RGB, RGBA and HSL. For photos and compressed images, sample an average of a small area rather than one pixel, because neighbouring pixels are rarely the same.
Pick a colour from an image, step by step
- Open the Color Picker and add the imageDrop a photo, logo or screenshot into the Color Picker. It is read in your browser and not uploaded to ImageDoctor.
- Hover, then click the colourThe panel previews the colour under the pointer. Click to sample it: the HEX code is copied straight away and the colour is added to a list of up to 24 samples.
- Average a small area on photosRaise Sample area (0 to 8 px) to average a square around the pointer — at 8 px that is a 17 × 17 pixel square. It gives a truer colour on skin, fabric, sky or a noisy JPEG than any single pixel.
- Copy the format you needHEX, RGB, RGBA and HSL each have a copy button. To keep a set, export the sampled colours as a text palette.
For precise work, focus the image and use the arrow keys to move the crosshair one pixel at a time (hold Shift to move ten), then press Enter to sample. Very large images are sampled from a copy reduced to 16 megapixels, which is still far more detail than the eye can pick between.
What HEX, RGB and HSL mean
They are three ways of writing the same colour. Here is one blue written each way:
| Format | Example | How to read it |
|---|---|---|
| HEX | #1E3A8A | Red, green and blue as two hexadecimal digits each, from 00 to FF |
| RGB | rgb(30, 58, 138) | The same three channels as numbers from 0 to 255 |
| HSL | hsl(224, 64%, 33%) | Hue as an angle on the colour wheel, then saturation and lightness as percentages |
| RGBA | rgba(30, 58, 138, 1) | RGB plus opacity, from 0 (transparent) to 1 (solid) |
HEX is what most design tools, website builders and brand guides ask for. CSS also accepts short three-digit forms (#FFF is #FFFFFF) and eight-digit forms with an opacity at the end (MDN). HSL is the easiest to adjust by hand: keep the hue and change the lightness to get a darker or lighter shade of the same colour.
Why the colour you picked isn't the colour you expected
- Photos are never one flat colour. Light, shadow and texture change the value from pixel to pixel. A red jumper in a photo might give a dozen different reds a few pixels apart. Average an area, and pick from a part of the object that is evenly lit.
- JPEG compression shifts colours. A lossy JPEG usually stores colour at lower resolution than brightness and adds faint blocks and ripples, strongest around edges and text. Sample from the middle of a flat area, away from edges, or use a PNG or the original file if you have it. Our JPG vs PNG comparison explains why screenshots suffer most.
- Edges are blends. The pixels at the edge of a logo or a letter are smoothed into the background on purpose (anti-aliasing), so they are neither colour. Pick from the solid middle.
- Colour profiles change the numbers. The Color Picker reads pixels after your browser has converted the image to sRGB, the colour space a browser canvas uses by default (MDN). That is the value a web page will show for that code. A photo editor working in a different profile can show slightly different numbers for the same pixel, and neither is wrong.
Colour pickers already on your computer
To sample something anywhere on screen, not just in an image file, use the one built into your system (all checked 4 November 2026):
- Mac: the Digital Color Meter app shows the values of the pixel under the pointer; Color › Copy Color as Text (Shift-Command-C) copies them (Apple Support).
- Windows: Microsoft's free PowerToys includes a Color Picker that opens with Win+Shift+C by default and copies HEX by default (Microsoft Learn). Microsoft says Snipping Tool's own colour picker is only available on a Copilot+ PC.
Screen pickers read the pixels as displayed. If the image is zoomed out, a sample may be a blend of several pixels, so view it at 100% before picking.
Getting a whole palette from a photo
As soon as an image loads, the Color Picker lists its eight dominant colours. They come from a reduced copy of the image: similar colours are grouped into a coarse colour grid and ranked by how many pixels fall in each group, ignoring mostly transparent pixels. That is a quick, honest read of which colours cover the most area, not an artistic palette. A small accent colour that matters to the design may not make the list, so pick those by hand and export the samples together.
If you are building a brand kit for the Brand Poster Maker, sampling the logo's main and accent colours here is a quick way to get its HEX codes.
Check the colour works as text
A colour picked from a photo often ends up as a text or button colour, where readability matters. The Web Content Accessibility Guidelines ask for a contrast ratio of at least 4.5:1 between normal-size text and its background, and 3:1 for large text (W3C, WCAG 2.2). The example blue above, #1E3A8A, comfortably passes as text on white; a pale sampled colour such as a sky blue usually needs to be darkened first, which is where HSL's lightness value is handy.
Common questions
Tools in this article
Keep reading
- JPG vs PNG: which image format should you use?The practical difference between JPG and PNG: transparency, text, file size and quality loss — with a simple rule for choosing, and how to convert either way.
- How to make an image background transparentWhat transparency actually is, which formats keep it, how to turn a white background into a real transparent one, and how to check the result before you use it.
- Which ImageDoctor tool should you use? A guide to all of themA plain-language map of every tool on ImageDoctor, what each one is for, and how browser-based tools compare with upload-based sites and desktop software.Guides