Image Color Picker (Get HEX Color from Image)

Click any pixel of an image to read its HEX, RGB and HSL value, copy it, and pull a six-swatch dominant palette out of the picture. All in your browser.

🌐 Español

Image Color Picker (Get HEX Color from Image) works entirely in your browser — upload a PNG, JPG, WebP or GIF above, then click any pixel to get its exact color as HEX, RGB and HSL, with copy buttons and an auto-extracted palette of the image's most dominant colors.

🔒 Private by design: everything runs locally in your browser and never uploaded to any server.

One colour, written three ways

The panel next to the picture shows the same colour in three grammars, because three different jobs want three different notations. HEX is what stylesheets, design files and brand documents almost always want. RGB is what canvas code, image processing and most graphics APIs speak. HSL is the one to reach for when you are not copying a colour so much as adjusting it, since nudging lightness or saturation by hand is arithmetic in HSL and guesswork in hex.

Each row has its own copy button, so you never have to retype a value or convert between the forms afterwards. If you do want to go the other way, from a value you already have to the other two notations, that is a separate job and the colour converter is where it lives.

The 1400 pixel working copy, and when it changes the answer

Your file is decoded and drawn onto a canvas that is capped at 1400 pixels on its longest side. Under that cap nothing is touched and the numbers you read are the exact bytes from the file. Over it, the picture is drawn down to fit, and a scaled draw interpolates, which means a pixel that sat on a hard boundary in the original can come back as a blend of the two colours that met there.

That is a real limitation and it is worth knowing where it bites. Sampling the fill of a button, a logo’s flat body, or a patch of sky is unaffected, because a whole neighbourhood of identical pixels averages to itself. Sampling one pixel of anti-aliased text, or the exact edge of a shape, in a twenty-megapixel photo is where the cap can shift your answer. Click a little way inside the shape instead.

The cap buys something in return. Palette extraction walks every pixel, and both the hover preview and the click read from the same buffer, so the ceiling is what keeps a huge photo responsive under a moving cursor rather than stuttering.

Lifting a colour off a screenshot

  1. Press Upload an image to pick colors from and choose a file. Anything your browser can decode works, and the Dominant colors strip appears as soon as decoding finishes.
  2. Move the pointer across the picture. The panel follows it and is labelled Hovering (click to lock) while it does.
  3. Click the pixel you want. The label changes to Picked color and the values stop tracking your cursor.
  4. Press Copy beside HEX, RGB or HSL, whichever notation you need. The button reads Copied! for about a second.
  5. To clear everything and start over, press Choose another image. Loading a second picture straight from the upload control clears the canvas, the readout and the palette just the same.

Six swatches out of 4096 buckets

The strip under the picture is not a list of the six most common individual pixel values, which on a photograph would give you six near-identical shades of the same thing. Each channel is first rounded down to four bits, which puts every pixel into one of 4096 coarse boxes in RGB space, so colours that merely look alike land together. Pixels whose alpha byte is 8 or lower are skipped, so a transparent PNG’s empty background never takes the top slot.

The boxes are then sorted by population and the top six are drawn. Each swatch shows the average of every pixel that fell into its box, so it is a representative colour rather than the corner of a grid cell. Ties are broken by the box’s own numeric key, which means the same image always produces the same strip in the same order.

Click a swatch and it loads into the main readout as if you had clicked that pixel. Click its hex label instead and it copies straight to the clipboard. This is the fastest route from a moodboard, a photograph or a competitor’s screenshot to a set of values you can paste into a theme file, and it pairs naturally with the CSS gradient generator when two of those colours want to become a background.

Alpha survives the pixel readout, not the palette

The canvas the picture is drawn onto is never given a background fill, so transparency is preserved. Click a fully opaque pixel and you get a six-digit hex, an rgb() string and an hsl() string. Click a semi-transparent one and all three grow an alpha component: an eight-digit hex, an rgba() string and an hsla() string. That distinction matters if you are pulling values out of a UI mockup where overlays and scrims carry meaningful opacity.

The palette works differently and cannot do the same thing. Every entry there is an average across many pixels, and averaging alpha would produce a number that describes no actual pixel, so palette swatches are always emitted fully opaque.

Where the picker stops and other colour tools start

This tool answers one question well: what colour is that, exactly. It does not invent colours. If you need a harmonious set built from a rule rather than lifted from a photograph, the colour palette generator rolls five swatches under random, complementary, analogous or triadic harmony instead.

Two checks are worth running on anything you pick before it ships. The contrast checker will tell you whether a foreground and background pair clears WCAG’s 4.5 to 1 threshold for AA body text or the stricter 7 to 1 for AAA. The colour blindness simulator shows what the same combination looks like to someone who does not separate red and green. And if the source photograph itself is too dark or too flat to sample confidently, adjust image brightness and colour first, then come back and pick from the corrected version. The rest of the image tools cover the editing side of that workflow.

See it in action

Screenshot of the Image Color Picker (Get HEX Color from Image) tool with an empty dropzone waiting for an image to sample colours from
Image Color Picker (Get HEX Color from Image) mid-process: an empty dropzone waiting for an image to sample colours from.
Screenshot of the Image Color Picker (Get HEX Color from Image) result screen showing the image loaded and ready to be clicked anywhere to read the colour under the cursor as a hex value
The finished result: the image loaded and ready to be clicked anywhere to read the colour under the cursor as a hex value. The download link is a local blob URL — the file never leaves your device.

Frequently asked questions

The readout keeps changing as I move the mouse. How do I make it stop?

While the pointer is over the picture the panel is in preview mode and says "Hovering (click to lock)" above the values. Click the pixel you want and the label switches to "Picked color", after which the values stay put until you click somewhere else or choose a palette swatch. The copy buttons work in either state, but locking first is safer.

Are the values I read taken from the original pixels or from a resized copy?

From a working copy that is capped at 1400 pixels on its longest side. Anything smaller than that is used as is, so the values are the original bytes. Anything larger is drawn down to fit, and that draw interpolates, so a pixel sitting on a hard edge in a big photo can read as a blend of the two colours meeting there. Sample a couple of pixels inside a flat area rather than right on a boundary and this never bites.

How does the dominant colours strip decide what counts as dominant?

Each channel is rounded down to four bits, which sorts every pixel into one of 4096 coarse boxes in RGB space. Pixels that are almost transparent are skipped entirely so an empty background cannot win. The boxes are then ranked by how many pixels landed in each, and the top six are shown as the average colour of everything inside that box, not as the box's corner.

Why is a palette swatch never semi-transparent even when the image is?

Because the palette entries are averages, and an average of many pixels has no single meaningful alpha, so every swatch is emitted fully opaque. The pixel readout is different and does keep alpha. Click a semi-transparent pixel directly and you get an eight-digit hex, an rgba() value and an hsla() value instead of the three-part forms.

I pressed Copy and nothing seems to have happened.

The button only shows its confirmation when the browser actually granted clipboard access. If that call is refused, by a permission prompt, an insecure context or an older browser, the copy is skipped quietly and the label never changes. The values are plain selectable text on the page, so highlight one and copy it by hand when that happens.

Can I load a second picture without reloading the page?

Yes. The upload control stays on the page the whole time, and picking a new file clears the readout and the palette before the new image is decoded, so there is no chance of comparing a value from one photo against a swatch left over from the previous one. "Choose another image" does the same clearing and also returns the page to its empty state, which is what you want when you are finished rather than swapping pictures.

Related tools