How to Pick Exact Colors From an Image (and Why Values Sometimes Differ)
A client sends a logo as a JPEG attachment and asks you to “match the blue”. You open an eyedropper, click, and get #1F5FA8. A colleague clicks two pixels away and gets #2160A9. Neither of you is wrong. Pixel-level color picking is simple in principle, but compression, anti-aliasing and color profiles all affect the number you see. Knowing where those differences come from lets you pick the right value the first time.
How an eyedropper works
Every digital image is a grid of pixels, and each pixel stores a color, usually as red, green and blue values from 0 to 255. An eyedropper tool reads the value of the pixel under your cursor and shows it as HEX or RGB. In a browser-based picker like the image color picker above, the image is drawn onto an HTML canvas and the canvas returns the pixel’s RGBA values. No file is uploaded, because the canvas lives on your device.
Design apps work the same way, with one useful extra: many let you sample an average of a 3×3 or 5×5 pixel area instead of a single pixel. Averaging reduces the effect of noise in photos.
Why two clicks give two different colors
JPEG compression. JPEG splits an image into 8×8 pixel blocks and stores an approximation of each block. Flat areas of color come out slightly uneven, and colors near sharp edges pick up neighbouring tones. At high compression you can see this as blocky artifacts. That is why a logo color sampled from a JPEG often varies by a few values from pixel to pixel.
Anti-aliasing. The edges of text and shapes are smoothed by blending them with the background. A pixel on the edge of a blue letter on white is partly blue and partly white. Always sample from the middle of a solid area, never from an edge.
Chroma subsampling. Many JPEGs store color at half or quarter resolution compared to brightness (called 4:2:0 subsampling). Fine colored details, like thin colored text, lose color accuracy even when the shapes look sharp.
Scaling. When an image is resized, pixels are blended together. A screenshot of a website at 150% zoom is not the same as the original colors at 100%.
Color profiles. Photos from cameras and phones often carry an embedded color profile, such as Display P3 on recent iPhones. Browsers convert those colors into the screen’s color space when drawing them. Most web pages work in sRGB, so values sampled in a browser are usually sRGB values, which is what you want for CSS. A design app working in a different color space might show different numbers for the same image.
Choosing the best source file
| Source | Color accuracy | Notes |
|---|---|---|
| SVG or vector PDF | Exact | Colors are stored as numbers, not pixels. Open the file and read the fill value. |
| PNG | Exact for flat colors | Lossless; perfect for logos and UI screenshots. |
| JPEG (high quality) | Close, ±1–5 values | Sample the center of large flat areas. |
| JPEG (low quality) or social media download | Approximate | Re-compression shifts colors and adds noise. |
| Photo of a printed item | Rough | Lighting, camera and paper all change the color. |
If you need a brand color exactly, the best source is not an image at all. Ask for the brand guidelines, or open a vector version of the logo and read the color from the file. An eyedropper is the fallback when nothing better exists.
A reliable workflow
- Get the cleanest file available. Prefer SVG, then PNG, then the largest JPEG.
- Zoom in on a large flat area of the color you want.
- Sample several points and compare. If they differ, the most common value or an average is usually closest to the original.
- Check the result in context. Put the sampled color next to the original image. If it looks off, the original might be in a wide-gamut color space or heavily compressed.
- Round sensibly. If you get
#1F5FA8,#2060A8and#1E5EA7, the designer probably used a single value close to those. Pick one, document it, and move on.
Sampling colors from photos
Photographs don’t have one “true” color. A red apple has dozens of reds across its surface, depending on light and shadow. When building a palette from a photo, sample deliberately:
- one point from the brightest highlight (often near white or a light tint),
- a few from the midtones, where the color is most saturated,
- one from the deepest shadow (often a dark, desaturated tone).
This gives a natural range from light to dark within the same mood. If you just want the most common colors automatically, an image palette extractor groups similar pixels and returns the dominant colors, which is faster for mood boards.
Eyedropper versus palette extractor
| Task | Eyedropper | Palette extractor |
|---|---|---|
| Match one exact brand color | Best choice | Not precise enough |
| Get 5–8 colors representing a photo’s mood | Slow, manual | Best choice |
| Find the color of a specific object | Best choice | May merge it with similar colors |
| Ignore noise and texture | Needs care | Handles it automatically |
Turning the picked color into something usable
Once you have the HEX code, you will usually need more than one version of it. Convert it to RGB, HSL or CMYK with a color converter. Build lighter and darker variants with a tints and shades generator. And if the color will be used for text, check it against its background with a contrast checker; colors picked from logos are often too light for small text.
If you are trying to describe the color in words, for example in a design brief, a color name finder gives you the closest standard name.
Privacy note
Screenshots of client work, unreleased products or internal dashboards shouldn’t be uploaded to random websites. Browser-based tools that use the canvas process the image locally; you can confirm this by disconnecting from the internet after the page loads, and the tool will still work.