How colour palette extraction works
Choose dominant, balanced or saturated colours from an image, understand the sample percentages and check contrast before using a palette in a design.
By ToolsNow · Published · updated
Open an image in the palette extractor and start with six colours. Use Balanced palette for a range of shades, Dominant colours for what occupies the most space, or Most saturated when you are looking for vivid accents.
A photograph of a person against a beige wall may produce several beige swatches. That can be useful for matching the photo’s overall appearance, but less useful if you wanted the colour of a small red scarf.
Choose the method for the job
| What you need | Method | What to expect |
|---|---|---|
| A summary of the largest colour areas | Dominant colours | Backgrounds can take most of the slots |
| A broader range of shades | Balanced palette | Similar shades are grouped, but small accents can still be missed |
| Bright accents for a theme | Most saturated | Muted and very light or dark pixels are filtered first |
| A colour from one specific area | Image colour picker | Sample that area instead of summarising the whole picture |
The colour picker is useful when you know which part of the image you want. For extraction, cropping to the subject before opening the file can also help keep a large background from dominating.
Keep useful swatches and save them
Compare the methods with the same colour count. Increase the count if an important shade is missing, or reduce it if the palette is full of colours you will not use. More swatches do not necessarily make a better theme.
The extractor shows hex, RGB and HSL values. You can copy a colour, lock swatches while regenerating others, change their display order or save a PNG swatch sheet. Regenerate unlocked is not a random palette generator; unchanged inputs can produce the same result.
Use For pixel art to save a hex list for the pixel-art tool. Text, JSON and CSS exports are also available. Check exported filenames and source-name fields if you plan to share the palette file itself.
Read percentages as sample information
The extractor works from a copy capped at 1600 pixels on its longest edge, then samples up to roughly 40,000 pixels. It excludes pixels with alpha below 128 out of 255, including fully transparent pixels.
Those choices keep processing manageable, but can miss a small feature or change its apparent share. The percentages are not exact measurements of the original image’s area.
They also mean different things by method. Dominant mode reports the share in each selected colour bucket; unselected buckets may account for the rest. Balanced mode reports the populations of its groups. Most saturated mode can report shares of the filtered vivid pixels rather than the whole image. Locked swatches retain their existing weights, so a regenerated palette is not an area audit either.
Check text contrast separately
A pleasant palette can still make text hard to read. Choose the intended foreground and background under Contrast between two palette colours and read the numeric result and verdict.
WCAG’s Level AA minimum is 4.5:1 for ordinary text and 3:1 for large text, subject to the criterion’s exceptions. Large text means at least 18 pt regular or 14 pt bold, or equivalent sizing. Enhanced Level AAA contrast uses 7:1 and 4.5:1 respectively.
Different hues do not necessarily give enough light-dark contrast. Check the actual colours used in the final interface, including any background image or transparency. A passing swatch pair is not a complete accessibility assessment.
Why an extracted colour may differ from a brand reference
Lighting and white balance change photographed colours. JPEG compression can change colour values, and antialiasing blends edges with nearby pixels. Colour profiles and the software decoding a file also affect what reaches the sampling canvas.
An extractor may return an average of a group, not the exact value of a particular pixel. Use extracted colours as a starting point for design. When an official brand colour is available, use that specification rather than treating a photograph or screenshot as authoritative. A clean source asset can match the official colour, but extraction alone cannot establish that it does.
How the grouping works
Dominant mode groups similar RGB values into buckets before counting them. In this tool, each channel is reduced to 32 bucket levels; the output swatch is the average of the sampled colours in a selected bucket. Nearby shades can still occupy different buckets.
Balanced mode uses a median-cut variant. It repeatedly divides groups of sampled colours, choosing a weighted RGB channel range to split, then averages each resulting group. It does not guarantee equal populations, unique-looking swatches or inclusion of every minority colour.
Most saturated filters by saturation and lightness before median cut. If too few vivid samples remain, it falls back to the broader sample, so a monochrome image can still return a muted palette.
Other tools can use different sampling, distance measures and clustering methods. RGB distances do not map evenly to perceived differences; Lab is one way to make colour comparison more perceptually meaningful. ToolsNow’s pixel-art matching uses Lab, while these extraction groups are formed in RGB. The two operations should not be confused.
Averaging encoded sRGB values also differs from averaging light. The RGB
average of black and white is approximately #808080, darker than a
linear-light midpoint. This extractor uses RGB averages, so it should not
be treated as a physical light measurement.
Sources and further reading
- Heckbert, P. “Color Image Quantization for Frame Buffer Display.” SIGGRAPH ’82 — median cut
- CIE 15:2018 Colorimetry — CIELAB and colour difference
- IEC 61966-2-1 — sRGB
- W3C — WCAG 2.2 Contrast (Minimum)
- ITU-R BT.709 — colour primaries and signal definitions
- International Color Consortium — original profile explainer link
Last reviewed 2 October 2026.
Published by ToolsNow. Read how tools and sources are checked.
Found a mistake or an outdated detail? Send a correction with the article title and the detail to review.