How do you pick a color from an image?
To get the exact color of a point in a picture, you need an eyedropper: you point at a pixel and read its value. This page is an online image color picker. Open any picture, click or tap the spot you want, and you get the color as HEX (for example #1e90ff), as RGB, as HSL, with the nearest CSS color name, and with its contrast against white and black text. You can keep several picked colors, see the dominant colors of the whole picture, and export everything as CSS, SCSS, Tailwind, JSON or a plain HEX list.
It fits the usual jobs: copying a brand color from a logo screenshot, matching a button to a photo, building a palette from a painting, checking whether text will be readable on a color, or just finding the code of a color you saw. If you want the main colors of a picture without clicking, the dominant colors list does that, and Color palette from image is a page focused on it.
The picture never leaves your browser. It is read and drawn on your device, nothing is uploaded, and there is no account or watermark.
How to get the HEX code of a color in an image
- Drag a picture onto the page, click the area to choose a file, or paste an image with Ctrl+V. PNG, JPG, WebP, GIF and AVIF are accepted. You can also press Load example, so the page is never empty.
- Hover or tap the image: the pointer follows your finger or mouse. Click to pick. With the keyboard, use the arrow keys to move the pointer (Shift moves 10 pixels) and Enter to pick.
- Read the Selected color card: HEX, RGB, HSL and Nearest CSS name, each with a copy button. Below, the With white text and With black text lines show the contrast ratio and whether it passes (AA, AAA) or Fails.
- Every pick is added to Picked colors. Click a swatch to select it again, use the cross to remove it or Clear to start over.
- Under Dominant colors, move Number of colors (3 to 12) to see the main colors of the whole image, with the share each one covers.
- In Export palette, choose Colors to export, then a Format (CSS variables, Tailwind, JSON, SCSS or a HEX list), then copy or download it.
- In browsers that support it (Chrome, Edge and other Chromium browsers), Eyedropper (whole screen) picks a color from anywhere on your screen, even outside the page. Elsewhere, use the image itself.
Examples
A brand color from a screenshot
You paste a screenshot of a website header and click the blue bar. The tool shows #1e90ff, rgb(30, 144, 255) and the nearest CSS name dodgerblue. Copy the HEX and use it in your stylesheet.
Is the text readable on this color?
Contrast is calculated with the WCAG formula for normal text: 4.5:1 is AA and 7:1 is AAA.
| Color | White text | Verdict |
|---|---|---|
#767676 | 4.5:1 | Passes AA, the lightest gray that does |
#777777 | 4.4:1 | Fails |
#ff0000 | 4.0:1 | Fails |
#000000 | 21:1 | Passes AAA |
Black on white is the maximum, 21:1. Pick the background and look at both lines to decide which text color to use.
Export a palette for Tailwind
You pick three colors from a photo. In Export palette choose Tailwind and you get 'color-1': '#...' lines inside braces, ready to paste into the colors of your config. As CSS you get :root { --color-1: #...; }; as SCSS, $color-1: #...;. The names are numbered, so rename them to something meaningful.
Many photos, one palette
Load one photo, pick the colors you want, then load the next: the Picked colors list stays, so you can combine colors from several pictures and export them together.
Common errors and how to fix them
- "This file could not be read as an image. Choose a PNG, JPG, WebP, GIF or AVIF file.": the file is damaged or in another format. Convert it first with Convert images.
- The color is slightly different from the one in the original editor: the picture is reduced to 1,600 px on its longest side when loaded, and JPG compression itself blends neighboring pixels. For an exact value, click the middle of a flat area, not an edge.
- "This browser has no screen eyedropper; click or tap the image instead.": the whole-screen eyedropper exists only in Chromium browsers. Take a screenshot, paste it here and click it.
- The tool shows few dominant colors: the picture really has few. The color list is shorter than the number you asked for.
- Transparent areas are missing from the dominant colors: pixels that are mostly transparent are ignored in the dominant colors.
Frequently asked questions
How do I find the color code of any pixel in an image?
Open the image here and click the pixel. The HEX code appears right away, and RGB and HSL too. For colors outside a picture, such as something on another window, use the whole-screen eyedropper in Chrome or Edge.
What is the difference between HEX, RGB and HSL?
They are three ways to write the same color. HEX (#1e90ff) and RGB (rgb(30, 144, 255)) give the red, green and blue amounts; HSL gives hue, saturation and lightness, which is easier to adjust by hand. To convert between formats, use Color converter.
Is the color picker free, and are my images uploaded?
It is free, with no account. Images are processed in your browser and are not sent anywhere.
Does it work on a phone?
Yes. Tap the image to pick a color; the page works from 390 px wide.
Can I get a whole palette instead of one color?
Yes: the Dominant colors section lists the main colors of the picture, and you can export them in five formats.