Image Color Picker: Get a Color Code from a Photo
Open a picture and tap any point to read its color as HEX, RGB and HSL, with a copy button for each. A palette shows the main colors of the whole picture. Your picture stays on your device.
Your file is ready
- Files stay on your device. Nothing is uploaded.
- Free, no sign-up, no daily limit.
- Works with Wi-Fi off once the page has loaded. Check it yourself
Updated by Khokhar Sab
How do I pick a color from an image?
Choose a picture and the Colors tool opens. Tap or click any point, or drag across the picture, and the swatch shows the color with its HEX, RGB and HSL values. A ring marks the point you picked. Press Copy beside a value to put it on the clipboard and paste it into your design or code.
- Press Choose a picture, drop a file, paste with Ctrl+V, or press Take a photo on a phone.
- Tap or click a point on the picture. Drag to move the picker and watch the values change.
- Choose 1 pixel, 3 x 3 average or 5 x 5 average to set how much of the picture is read.
- Press Copy beside HEX, RGB or HSL.
- To zoom into a small detail first, press Zoom and pan instead, zoom in, then switch back to picking.
To cut out the part you want before reading its colors, use Crop Image. To change the colors afterward, try Photo Filters.
What are HEX, RGB and HSL color codes?
All three describe the same color. RGB gives the red, green and blue amounts from 0 to 255. HEX writes those three amounts as a six-digit base-16 code after a hash sign. HSL describes the color as hue in degrees, saturation and lightness in percent, which is easier to adjust by hand.
| Color | HEX | RGB | HSL (degrees, percent, percent) |
|---|---|---|---|
| Red | #FF0000 | 255, 0, 0 | 0, 100%, 50% |
| Dodger blue | #1E90FF | 30, 144, 255 | 210, 100%, 56% |
| Orange | #FFA500 | 255, 165, 0 | 39, 100%, 50% |
| Dark green | #008000 | 0, 128, 0 | 120, 100%, 25% |
| Mid gray | #808080 | 128, 128, 128 | 0, 0%, 50% |
Web pages accept all three in CSS. The MDN reference for the CSS color type lists the notations, and the Wikipedia article on HSL and HSV explains the hue, saturation and lightness model. The tool rounds each value to a whole number.
Why would I average several pixels instead of picking one?
A single pixel in a photo carries camera noise and sharpening, so two neighboring pixels of a wall can differ slightly. Averaging a 3 x 3 or 5 x 5 area gives the typical color of that spot, which is usually the color you mean. Use 1 pixel for flat artwork and logos.
A worked case: a 3 x 3 area has eight pixels of 200, 100, 50 and one black pixel in the middle. The average is (8 x 200) / 9 = 178 for red, (8 x 100) / 9 = 89 for green and (8 x 50) / 9 = 44 for blue. At the edge of the picture the area is cut to the pixels that exist.
How do I get the main colors of a picture?
The Colors tool lists the dominant colors of the whole picture under the swatch, biggest share first. Choose 5, 6 or 8 colors with the buttons, and press a color to read its codes. The picker groups similar colors with the median cut method, the same step the GIF Maker uses to build a palette.
For flat artwork the palette is exact. A picture of four red pixels, two blue and two white gives #FF0000 50 percent, #0000FF 25 percent, #FFFFFF 25 percent. A photo has thousands of shades, so each palette color stands for a group of close shades, and its share counts every pixel nearest to it.
How accurate is the color the picker shows?
The values come straight from the picture's pixels, so they match what the file holds. Your screen, its brightness and a phone's night mode change how the color looks, but not the code. For a very large photo the picker reads the preview copy, which is at most 2,048 pixels on the longest side.
Colors in a JPG file were already changed a little by compression, and a photo of a real object also depends on the light at the time. The picker reports the file, not the object. Edits you make in the editor, such as a filter, are included in what it reads.
Limits
- One picture at a time. Open the next picture after you save.
- Very large photos are held to 8,192 pixels on the longest side and 16 megapixels, the size a phone browser can draw.
- Camera details such as GPS location and camera model are not copied into the saved file.
- Animated GIFs open as their first frame.
Frequently asked questions
Is the image color picker free?
Yes. There is no sign-up, no watermark and no limit on how many pictures you open.
Is my picture uploaded?
No. Your browser opens the picture and reads its pixels on your device. The page has no upload step.
Can I pick a color from a screenshot?
Yes. Paste the screenshot with Ctrl+V, or save it as a file and choose it. It opens like any other picture.
Does it work on a phone?
Yes. Tap the point you want. Use Zoom and pan instead to enlarge a small detail, then switch back to picking.
Can I pick a color from a see-through PNG?
Yes. A fully see-through point has no color, and the picker tells you so. A partly see-through point shows its color without the transparency.
Related PDF tools
How this tool was built and tested
- MDN: the CSS color type: how HEX, RGB and HSL colors are written in CSS
- Wikipedia: HSL and HSV: the hue, saturation and lightness model
- Test method: every operation is checked on hand-worked values in src/tools/imgedit/layout.test.ts and imgedit.test.ts; the numbers on this page are computed from the same code when the page is built