Skip to content

How to Pick a Color from an Image and Get the Exact HEX Code

By Durim Hoti · Last updated

You see a color on a website, in a logo or in a photo and want to use it in your own design. Guessing gets close; reading the pixel gets it exact. The image color picker reads the color values straight from the image data.

Pick a color step by step

  1. Open the image color picker.
  2. Open an image, or paste one from the clipboard with Ctrl+V (Cmd+V on a Mac). Screenshots work well: on Windows, Win+Shift+S copies a screen area that you can paste right away.
  3. Move over the image: the magnifier shows the pixels around the pointer. Click the spot you want.
  4. Copy HEX, RGB or HSL under Selected color. Every pick is also kept in Picked colors.
  5. Use Main colors in this image for the overall palette, and open a color in the color picker for shades and contrast.

Example: a test image with known colors

To check the picker, we made a 600 × 400 pixel image from three known colors: blue #1D4ED8 on the left (360 px wide), orange #F59E0B and white on the right.

The image color picker with the test image: a blue area on the left, orange top right and white bottom right. The magnifier sits on the edge between blue and orange. Selected color shows #1D4ED8, and Main colors in this image lists 60 % #1D4ED8, 25 % #F59E0B and 15 % #FFFFFF.
The PNG version: exact colors, and the main colors with their real shares.

The main colors matched the image exactly: 60 % blue, 25 % orange and 15 % white, which are the real proportions of the three areas.

PNG vs JPEG: why the HEX code can be off

We saved the same image as a JPEG at quality 40, a strong compression, and clicked the same four spots:

SpotOriginalPNGJPEG
Center of the blue area#1D4ED8#1D4ED8#1A4ED5
Center of the orange area#F59E0B#F59E0B#F59F0A
White area#FFFFFF#FFFFFF#FFFFFF
Last blue pixel before the edge#1D4ED8#1D4ED8#31518E

In the flat areas the JPEG was off by a few steps per channel. Next to the edge it was far off: #31518E is a mix of blue and orange that doesn't exist in the original. The JPEG's main colors also gained five extra entries of about 1 % each from these mixed pixels.

Common problems

The color is a little different every time I click

In photos, neighboring pixels differ because of light, noise and compression. Zoom in with the magnifier and pick from the middle of an even area, or use the main colors list, which averages similar pixels.

The color from a screenshot doesn't match the website's CSS

Check the file type: screenshots saved as JPEG change colors. Display scaling and color profiles can also change pixels. If you have access to the site, read the value from the CSS with your browser's developer tools.

Text on the picked color is hard to read

Check the pair with the contrast checker, or build a full palette; see how to build a website color palette.

What to do next

To understand the three codes you get, read HEX vs RGB vs HSL.

FAQ

How do I get the HEX code of a color in a picture?
Open the image in the image color picker and click the spot. The HEX, RGB and HSL values of that pixel appear under Selected color, each with a Copy button.
Why is the color slightly different from the original design?
Most photos and many screenshots are saved as JPEG, which changes colors slightly to save space, most of all at edges. Use a PNG screenshot when you need the exact value.
Can I pick a color from my screen instead of a file?
In browsers with the EyeDropper feature, such as Chrome and Edge on a computer, a Pick from screen button appears and lets you pick any pixel on your screen. In other browsers, take a screenshot and open it.
Is my image uploaded?
No. The image is opened and read in your browser. Images up to 40 MB can be opened; very large ones are scaled down to 4,096 pixels on the longest side for picking.
What are the main colors shown under the image?
The picker groups similar pixels and lists the most common colors with their share of the image, most common first. Click one to select it.

Try it and keep reading