How to get the color code from an image
You want your store's buttons to match your logo exactly, or you need to describe a product color precisely to a designer. Guessing by eye is not enough. You need the real number.
Three ways to write the same color
- HEX, like #FF0000: the most common in websites and design tools.
- RGB, like rgb(255, 0, 0): the amount of red, green and blue from 0 to 255.
- HSL, like hsl(0, 100%, 50%): hue, saturation and lightness, handy when you want a lighter or darker version of the same color.
A click on a pure red pixel: #FF0000, rgb(255, 0, 0) and hsl(0, 100%, 50%).
A click on a pure blue pixel: #0000FF, rgb(0, 0, 255) and hsl(240, 100%, 50%).
A teal green like our own buttons: #0F6B5F, rgb(15, 107, 95) and hsl(172, 75%, 24%).
How to do it
- Open the Image color picker and choose your image.
- Click or tap the point whose color you want. You can drag the marker and watch the magnifier to see the pixels up close.
- For precision, move the marker with the arrow keys one pixel at a time, or type the coordinates.
- Copy the value in the format you need.
Why do two neighboring points differ slightly?
In JPEG photos, neighboring pixels differ a little because of compression, even when an area looks like one color. Use the magnifier and pick a pixel that represents the area well. If you want all the main colors of the picture rather than one point, the right tool is the Image palette extractor extractor.
Details worth knowing
- The value comes from a single pixel of the original full-resolution image, not from the scaled preview.
- Values are sRGB as decoded by the browser. Images with other color profiles can give numbers slightly different from design software.
- A fully transparent pixel has no real color, and the tool warns you about it.
- The history keeps the last 12 distinct colors for the current image only.
Once you have the color, check that text on top of it is readable with the Color contrast checker, especially if it is for buttons or headings.
Common questions
Does the tool average the color of an area?
No, it reads one pixel. To extract the main colors of an image, use the palette extractor.
Does it work on a phone?
Yes. Touch the point with your finger and watch the magnifier to choose the exact pixel.
Is my image uploaded?
No, the image is read inside your browser.
