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.
Check Contrast and Coverage in an Image Palette
Dominant Color Extractor: how to use it
- Open a still JPG, PNG or WebP, or load the RGBA example.
- Set the maximum cluster count and sampling backdrop, then extract the colors.
- 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.