How to Pick Colors From an Image Accurately
By the Hex Color Picker Team. Published . 8 minute read.
To get a color code from an image, open the image in a color picker and click the spot you want. The picker reads the color of that pixel and gives you its hex, RGB and HSL values. You can do it three ways: with a browser eyedropper that samples anything on your screen, with an image color picker that reads a file you open, or with the eyedropper tool built into design software. The color picker from image on this site works in any modern browser, and your image is never uploaded.
Getting a code is easy. Getting the right code is the harder part, because photographs, compression and color profiles can all make the pixel you picked differ from the color you saw. This guide covers the methods, the pitfalls and a practical way to turn one image into a palette.
Method 1: the browser eyedropper
Chromium-based desktop browsers, such as Chrome and Edge, include an eyedropper feature that lets a web page ask you to pick any pixel on your screen. On this site it is the "Eyedropper: pick from screen" button on the hex color picker and the other pickers. You click it, move the magnifier over the color, and click. The color loads into the picker immediately.
Its biggest strength is that it works on anything visible: another browser tab, a design file, a video frame. Firefox and Safari do not support this feature, so there the button is replaced by a link to the image picker.
One thing to remember is that the eyedropper reads what is displayed. If your screen applies night shift, a color filter or a calibration profile, the code you get can reflect that, not the original file.
Method 2: open an image in a picker
The image color picker works in every browser:
- Choose an image with the button, drag one onto the box, or paste one from the clipboard with Ctrl+V or Cmd+V.
- Move the pointer over the image. A small swatch and hex code preview the color under it.
- Click or tap to pick. The color loads into the codes beside the image.
- Repeat for other spots. The last twelve colors are listed so you can compare them.
The image is drawn into your browser and read there. Nothing is sent to a server, so it is safe to use with unreleased designs and private photos. Any format your browser can display works, including JPG, PNG, WebP, GIF and SVG. HEIC photos from some phones usually can't be opened by browsers, so export them as JPG first. For speed, images larger than 2,400 pixels on their longest side are scaled down before sampling. The scaling smooths the pixels very slightly, so for exact values on a very large file, crop to the area you need first.
Method 3: design software
Design apps have an eyedropper tool that samples from the open document. It is the best option when you need to sample in a specific color mode, or average several pixels. It is also the better choice for large files. The trade-off is that you need the software, while a browser picker needs nothing installed.
Why the result can differ from what you expected
If the code you pick doesn't match the color you thought you saw, one of these is probably the reason.
Photos are never one flat color
A photo of a blue wall contains many slightly different blues from lighting, shadow and camera noise. A single pixel might be a little lighter or darker than the wall as a whole. Pick several points in the same area and compare them.
JPEG compression adds noise
JPEG files compress by approximating small blocks of pixels, particularly in color. Near edges, text and sharp transitions, pixels can pick up colors that aren't in the original. Flat areas away from edges are safest. If you have the choice, use a PNG or the original file.
Color profiles and displays
Images can carry an embedded color profile, and displays differ in how they show color. The picker reads the pixel values after the browser has drawn the image into a standard sRGB canvas. So the code matches what a typical web page would use, but it can differ from the value a design app reports if that app works in another color space.
Lighting changes the apparent color of real objects
A photograph of a painted wall, a fabric or a product shows the color as lit at that moment. The same wall photographed under warm light and under daylight gives different codes. You can't recover the true paint color from a photo. If you need an exact physical match, use a physical sample or the manufacturer's color specification.
Screenshots of screenshots
Each capture and each compression step can alter the color slightly. Sample from the original image when you can.
Picking a representative color
Sometimes you need the color of an area, not of one pixel. Practical ways to get it:
- Sample three to five spots inside the area, and pick the one in the middle of the range. If the values differ only slightly, any is fine.
- Avoid edges. Pick well inside a shape.
- Avoid highlights and deep shadows, unless those are what you want. The mid-tone of an object is usually the most representative.
- For logos and flat graphics, click in the middle of a solid area. A PNG or SVG gives cleaner values than a JPG.
- Look for the original. If you're extracting a brand color from a logo, check whether a brand guide or vector file exists. The code in the guide is the correct one.
From one image to a palette
A single photograph is a good source for a palette, because the colors in it already work together. A simple process:
- Choose the image. Pick something that carries the mood you want for the project.
- Pick five colors. Take one dominant color, one or two supporting colors, one accent that stands out, and one neutral (a light or dark that appears in the image).
- Assign roles. The dominant or supporting colors can become backgrounds and surfaces, the accent becomes the action color, and the neutral supplies the text and borders.
- Check contrast. Image colors are often too light or too saturated for text. Darken or lighten them in HSL using the HSL color picker until the text pairs pass. The color contrast guide explains the targets.
- Generate helpers. Run your main color through the palette generator to get tints, shades and a complementary accent.
- Store the result as CSS variables, as described in how to build a color palette for a website.
For an example, if you pick a green from a photograph of a leaf and it reads #2E8B57, the hex color picker tells you it is exactly the CSS color seagreen. If the value is not a named color, it shows the closest name.
Naming and labeling what you pick
Raw codes are hard to remember, so give each picked color a short label. The picker helps here: it shows whether a color is exactly a standard CSS color or tells you the closest one. If you pick a green from a leaf and it reads #2E8B57, the page reports that it is exactly seagreen. If you pick #FFA600, one step away from the CSS color orange (#FFA500), it reports orange as the closest name.
Use the name as a label and the hex code as the value. The label makes a palette easy to discuss ("the seagreen from the leaf"), and the code keeps the color exact. If a named color interests you, its named colors page lists matching colors, shades and contrast ratios, and you can compare your pick against it.
Reading the result
When you click a pixel, you get codes in several formats. Which should you use?
| You need | Use |
|---|---|
| A color for a stylesheet or a design file | Hex |
| To compute or compare channels | RGB |
| To make lighter or darker versions | HSL |
| A hint for print | CMYK (standard formula, not a profile) |
The meaning of each format is covered in Hex, RGB, HSL and CMYK explained. You can also convert any value in either direction with the converters, for example hex to RGB.
Privacy and file safety
A browser-based picker that reads your image locally is safe for confidential files, but it is worth checking the claim for any tool you use. On this site, the image is decoded and drawn on your device and no copy leaves it. Recent colors are saved in your browser's local storage and can be cleared with the Clear button.
Tips for better results
- Zoom in. Pick from a larger version of the image, so you can place the pointer precisely.
- Use a stable image. Don't pick from a video frame or an animated GIF in motion.
- Turn off night mode and color filters before using the screen eyedropper.
- Check with a second tool if the result matters.
- Record the source of every color you pick, such as the image name and where in the image.
Common mistakes
- Trusting one pixel in a photo. Sample several.
- Picking from a compressed JPG edge.
- Expecting to recover an exact paint or Pantone value from a photo.
- Forgetting to check text contrast on picked colors.
- Picking from a screenshot of a screenshot.
- Using a night-shifted screen with the eyedropper.
- Not saving the codes. Copy them or use the recent list straight away.
Frequently asked questions
How do I find the hex code of a color in a picture?
Open the picture in the color picker from image, click the color, and copy the hex code that appears.
Is my image uploaded when I use the image picker?
No. It is read and drawn in your browser, and no copy is sent anywhere.
Why is the eyedropper button missing?
The browser's eyedropper feature is available in Chromium-based desktop browsers such as Chrome and Edge. In other browsers, use the image upload box.
Why does my picked color look different from the original?
Photos contain noise and compression artifacts, and different programs handle color profiles differently. Pick several points and use a lossless file if you can.
Can I get the dominant color of an image?
The picker reads individual pixels, so you choose the colors yourself. Click a few representative areas and take the one that appears most.
Can I build a palette from the colors I pick?
Yes. Pick a few colors, then use the palette generator to build tints, shades and complementary accents from your favorite.