Image Colour Picker
Convert hex colors to RGB and HSL with family naming.
How the colour picker samples a point
Click anywhere on the picture, or drag across it, and the colour under the pointer is reported as a hex value and an RGB triplet. That value is the average of a small square window centred on the point; the radius control sets the window size in pixels, and the window is clamped at the edges, so a click in a corner still returns a colour instead of a blank. The exact pixel under the pointer is shown beside the average, which is what makes a click on a hard edge readable: you see both what the window averaged and what the single pixel was.
The dominant-colour list is built from a fixed histogram over the whole picture: pixels are bucketed by their colour, near-identical buckets are merged, and the heaviest buckets are reported with their share of the image. There is no random seeding and no clustering pass that depends on run order, so the same image always produces the same list in the same order. The list length is a control, from three to twelve colours.
How to use it
Choose an image file, then click or drag on the preview. The radius control changes how much of the picture the average covers; the colour-count control changes how long the dominant list is. Each reported colour can be copied as a hex value with its own button.
Why it runs in your browser
The picture is decoded and read on this page with the canvas API. It is never posted to a server, so the page works offline after it loads and nothing is retained anywhere. Reloading the page discards the image and the readings.
Open a picture and click or drag on it: this page reports the colour under the pointer as a hex value, an rgb triplet and an hsl triplet, averages a small square around it, and lists the picture's dominant colours as swatches.
The file is decoded in the tab with the browser's own decoder and never uploaded. Sampling reads the decoded pixel buffer, not the visible canvas, and the crosshair is drawn on a separate overlay, so the marker can never become a pixel the next average includes.
Two sliders control the work: the sample radius from one to twenty pixels, and the number of dominant swatches from three to twelve. The exact pixel under the pointer is shown separately from the averaged area, so you can tell a flat fill from a gradient.
Sampled area versus exact pixel
The large value is the average of a square whose half-width is the radius slider, clamped at the edges of the picture. A radius of three therefore reads a seven-by-seven block, which is why a noisy photograph returns a steadier hex value than a single pixel would.
The exact-pixel row is the one pixel under the pointer, with no averaging. It is the figure to copy when you need the literal value in the file rather than a representative colour.
- Radius slider: 1 to 20 pixels, default 3
- Swatches slider: 3 to 12 colours, default 6
- Copy puts the sampled hex value on the clipboard
How the dominant colours are chosen
The page builds a histogram from the decoded pixels and reports the most frequent buckets, reduced to the number of swatches you asked for. It is a frequency count, not a perceptual clustering model, so two nearly identical shades may occupy two slots while a small accent colour is missed.
Transparent pixels contribute their stored colour values rather than being skipped, which is worth knowing on a PNG with a large transparent region.
How to use the picture and sliders
Open the picture with the Image file control, then click or drag on it: the Sampled Colour panel reports the colour under the pointer as hex, rgb and hsl, averages the square around it, and lists the picture's dominant colours as swatches. Copy any value with its Copy hex button.
Set the Sample radius from 1 to 20 pixels and Swatches from 3 to 12: a radius of three reads a seven-by-seven block for a steadier hex on noisy photographs, while the exact-pixel row stays unaveraged. The file is decoded in the tab and never uploaded.
What to Expect
Best for
- Picking a hex value out of a screenshot or a photograph
- Getting a small palette from an image before choosing brand colours
- Comparing a flat fill with a gradient, using the exact pixel beside the average
Not ideal for
- Colour-managed work that depends on a calibrated display profile
- Extracting every distinct colour, which needs a different tool
- Editing the picture, since the page samples and never exports an image
What this tool keeps
- Hex, rgb and hsl values for the sampled area, all from the same average
- The file in the tab, with no upload request anywhere in the page
- Swatch counts and radii you chose while dragging, until you change them
What may need cleanup
- An averaged hex value that does not appear anywhere in the file
- Dominant colours that split one perceived shade across two swatches
- A sample taken too close to an edge, where the square is clipped
Common errors
- Copying the averaged value when the exact pixel is the one wanted
- Expecting colour management, which a browser canvas does not apply here
- Reading a dominant swatch as a proportion of the picture, which it is not
Example use cases
- Matching a button colour to a client logo
- Building a six-colour palette from a photograph
- Checking whether two screenshots used the same grey
Sample input
Open a product photograph on a white background and click the centre of the label with the radius left at three pixels.
Sample output
A sampled hex of #c8452f, an averaged rgb of 200, 69, 47, an hsl of 7, 62, 48 and six dominant swatches beneath it.
Who this is for
- Designers matching a colour from a supplied image
- Front-end developers sampling a screenshot
- Anyone who needs a palette rather than a single value
Frequently asked questions
What does clicking the picture report?
The colour under the pointer as a hex value, an rgb triplet and an hsl triplet, averaged over a small square, plus the picture's dominant colours.
Can I extract every distinct colour?
No. The page samples and reports dominant swatches; a full palette extraction needs a different tool.
Why does a swatch not appear anywhere in the file?
The sampled value is an average of a small square, so it can be a colour that no single pixel has.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.