Skip to content
UniKit

Image color picker

Load an image and read pixel HEX/RGB live on Canvas, click to collect swatches, inspect a magnified pixel grid, export the palette as HEX/RGB/CSS variables, and extract dominant colours with median-cut quantisation.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Choose an image

Drop an image here

The image is read locally with Canvas and never uploaded.

You can also drop an image onto the area above.

The sample is a 4×4 quadrant image (red / green / blue / white) drawn on Canvas by this page — no upload needed.

Current pixel

Move the pointer (or finger) over the image to read pixels live; click to add the colour to the palette.

Choose an image to hover for pixel colours and click to collect swatches.

Palette

Click anywhere on the image to collect swatches; duplicates are merged and at most 32 are kept.

Swatches: 0

No swatches yet — click the image to start picking.

Export

Export the current swatches as text you can copy or download.

Pick some colours first.

Dominant colours

Median-cut quantisation merges the image colours into the requested number of buckets.

6

Choose an image to hover for pixel colours and click to collect swatches.

What this tool does

  • Pick exact colours from a mockup, screenshot or product photo: hover to read the pixel, click to collect swatches instead of eyeballing a value.
  • Turn the dominant colours of an image into CSS custom properties you can paste straight into a stylesheet.
  • Verify what a page actually rendered: screenshot it, then zoom to pixel level to check gradients, shadows or alpha blending.
  • Get ground truth for accessibility work: read the real colour values first, then check contrast ratios with a dedicated tool.

Example

Input

A 4×4 quadrant image (#FF0000 top-left, #00FF00 top-right, #0000FF bottom-left, #FFFFFF bottom-right), colour count 4

Output

#0000FF
#00FF00
#FF0000
#FFFFFF

Median-cut quantisation restores the colours exactly when the bucket count equals the number of distinct colours; the export order is pixel count descending, then HEX ascending, so four equal buckets come out HEX-sorted.

Frequently asked questions

Are the picked colours offset from the original image?

There is no colour-space conversion or resampling here: values come straight from the Canvas getImageData call, i.e. the sRGB values your browser decoded. Note that an image carrying an ICC profile is converted to sRGB by the browser itself before this tool ever sees the pixels.

Which algorithm extracts the dominant colours?

Median cut: pixels go into one bucket, then the bucket with the largest channel spread is repeatedly split at the median of that channel until the bucket count matches your choice. Each bucket is averaged into a representative colour and reports how many pixels it holds. Ordering is fixed (pixel count descending, then HEX ascending), so the same image always yields the same result. Fully transparent pixels (alpha = 0) are excluded.

Is the image uploaded? Which formats work?

No upload: the file is read into a data URL with FileReader and handed to Canvas locally, with no network request at all. Supported formats depend on your browser — PNG, JPEG, GIF, WebP and BMP generally work. SVG will render too, but the picked colours come from the rasterised result.

What are the palette limits?

Swatches are de-duplicated by HEX, so clicking the same colour twice just moves it to the front, and at most 32 are kept. You can remove them one by one or clear the whole palette, and export as a HEX list, an rgb() list or a CSS custom property block.

What are the magnifier and the zoom level for?

The zoom level only scales the canvas without interpolation, which helps you aim precisely. The magnifier is a (2r+1)² pixel grid centred on the current pixel with the centre cell outlined, so you can read neighbouring pixel values directly. Neither one alters the image.

Keywords:image color picker

Related tools