Color · Made a little simpler

Dominant Color Extractor

Extract a local image palette with K-means. Compare estimated color coverage and contrast against black and white, then export CSS, Sass or JSON.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Dominant Color Extractor: how to use it

  1. Open a still JPG, PNG or WebP, or load the RGBA example.
  2. Set the maximum cluster count and sampling backdrop, then extract the colors.
  3. Compare visible sample counts and black or white text contrast. Download a developer snippet or JSON.

Limits and notes

Up to 25 MB, 24 megapixels and 12,000 pixels per side. The analysis clusters a browser-decoded sRGB sample within 256 × 256 pixels. Fully transparent samples are excluded. Partial alpha is composited on the selected backdrop.

How your privacy works →

Dominant Color Extractor: common questions

Why can I get fewer swatches than requested?

The setting is a maximum. A small image or a simple graphic can have fewer distinct visible sample colors.

Are the percentages exact for the full image?

They describe the visible pixels in the resized sample. The cluster mean may be a color between source pixels.

Which contrast ratings are shown?

Each solid swatch is checked against opaque white and black in sRGB. The normal-text cutoffs are 4.5:1 for AA and 7:1 for AAA.

Guides