Skip to content

Image Color Palette Extractor

Pull the dominant colours out of a photo and copy them as HEX, RGB, HSL, CSS variables or JSON, with the share of pixels each one covers.

Choose an image

Colour sampling happens in this tab. Nothing is uploaded.

Dominant colours

The dominant colours and their HEX, RGB and HSL codes appear here.

Swatches with HEX, RGB and HSL codes appear here.

Shares are measured over opaque pixels only. Transparent areas contribute no colour, and very similar shades are merged so the list names colours a person would actually use.

Your file is never sent to a server. It is read and processed by your own browser, and the results are not stored.

How to use it

  1. Choose a photo. Sampling is done at a reduced size so large images stay fast.
  2. Move the slider to choose between 2 and 12 colours.
  3. Copy a single HEX value or export the whole palette as CSS or JSON.

Limits worth knowing

  • Between 2 and 12 colours are reported. More swatches stop being a palette and start being a histogram.
  • Sampling runs at a reduced size, not on every original pixel. For a flat graphic the result is exact; for a noisy photo it is a stable summary rather than a per-pixel census.
  • Transparent pixels are skipped, so the percentages describe the opaque area.
  • The palette is a visual summary, not an accessibility check. Contrast ratios are not measured here.

What “dominant colour” means here

The image is drawn onto a small canvas, its opaque pixels are bucketed by colour, and the buckets are ranked by pixel count. Nearby buckets are merged so the list does not repeat almost-identical shades. The percentage beside each swatch is the measured share of opaque pixels.

This is deliberately not a k-means or median-cut library call. A deterministic bucket-and-merge pass is fast enough to run on every slider change and produces the same answer for the same image.

Using the palette honestly

A photograph’s dominant colours are averages, not brand decisions. They are a useful starting point for a mood board or a background tint, but a design system needs contrast checks and a limited type scale, neither of which this tool claims to produce.

The CSS export uses numbered custom properties so the palette can be dropped into a theme file. Keep the comments: they record the measured share, which is the part a future reader cannot recover from the hex value alone.

Frequently asked questions

Does Image Color Palette Extractor upload my files to any server?

No. Image Color Palette Extractor runs in your browser, and the file is read there rather than sent to a server for processing. Our host still sees ordinary page-request metadata, which is described on the privacy page.

Is Image Color Palette Extractor free to use?

Yes, Image Color Palette Extractor is free, with no paid tier, no account, and no watermark added to your output. The limits are technical rather than commercial: file size, page count and supported formats are listed on this page.

What file formats and sizes are supported?

Image Color Palette Extractor supports .jpg, .jpeg, .png, .webp files up to 25MB directly in your browser.

How are the dominant colours chosen?

Opaque pixels are sampled at a reduced size, grouped into colour buckets, and ranked by how many pixels each bucket covers. Very similar shades are merged so the result names colours a person would use rather than a dozen imperceptibly different blues.

Why is there no colour from a transparent area?

Transparency has no colour to measure. Fully transparent pixels are skipped, and partly transparent pixels contribute their visible colour. The displayed share is therefore a share of opaque pixels, not of the whole canvas.

Can I use the result in a design system?

Yes. The CSS export writes custom properties with numbered names and a comment showing each share, and the JSON export includes HEX, RGB, HSL and the percentage. Neither is a full contrast-checked palette, so check text contrast separately.