ToolJutsu
All tools
Image Tools

Color Palette Extractor

Extract a dominant color palette from any image.

Processed on your device. We never see your files.

How to use Color Palette Extractor

What this tool does

The Color Palette Extractor analyses an image and identifies its dominant colours. Drop in any photo, illustration, or graphic and the tool downsamples it to a manageable size, clusters the pixels by colour similarity using a k-means algorithm, and presents the results as a grid of colour swatches, each labelled with its HEX value and its approximate share of the image. A slider lets you choose how many colours to extract (3 to 12, defaulting to 6). Each swatch has a copy button, and a “Copy all HEX” action grabs the entire palette at once. A proportional palette bar at the bottom visualises the colour balance. Everything runs locally in your browser — no library dependencies for the clustering logic, no server calls.

Why you might need it

Building a colour scheme from scratch is hard; extracting one from an image that already works is much faster and often produces more harmonious results than starting from a colour wheel.

For web and app design, pulling the palette from a hero photograph ensures the text colours, button accents and section backgrounds complement the image rather than fighting it. For brand work, analysing a logo or brand photography gives you the canonical palette even when the original brand guidelines are unavailable or out of date. For ecommerce, extracting the product colours and applying them to the page layout creates a visually consistent shopping experience that subtly reinforces the product’s identity.

Interior designers use palette extraction to identify the exact tones in a fabric swatch photograph before specifying paint colours. Print designers use it to generate a starting CMYK approximation from a reference image. Illustrators and game artists use it to maintain a consistent colour language across a project by extracting the palette from an approved reference piece and working within those extracted values.

How to use it

  1. Drop an image onto the upload area, or click to browse. JPEG photographs, PNG illustrations, WebP graphics and GIF images all work.
  2. The tool immediately extracts a default palette of 6 dominant colours and shows them as a grid of swatches with HEX codes and percentage labels.
  3. Use the Number of colours slider to adjust between 3 and 12, then click Extract palette to re-cluster.
  4. Copy individual colours using the copy icon on each swatch, or click Copy all HEX to grab the complete palette as a list.
  5. Check the proportional palette bar at the bottom to understand which colours dominate the image.

Format and quality notes

The algorithm works best with photographs and illustrations that have clear, distinct colour regions. For such images — a product photo against a studio background, a landscape with distinct sky, foliage and ground zones, a flat- design illustration — even 6 colours captures the essential palette well.

For complex photographic scenes with many hues — a crowded street, a detailed painting, a kaleidoscopic textile — you may need 10 to 12 colours to capture meaningful distinctions rather than averaged blends. If a swatch looks brownish or muddy, it means several similar colours have been merged into one centroid; increasing the count separates them.

JPEG compression slightly blurs colour boundaries and introduces artefacts that can affect clustering. PNG or WebP sources give cleaner results for images with sharp colour transitions, such as logos, infographics or pixel art.

Tips for best results

For brand colour extraction, use the highest quality version of the source image you can find — a lossless PNG export of the logo rather than a screenshot, and a full-resolution photograph rather than a thumbnail. Quality degradation in the source propagates into muddier extracted colours.

When generating a web design palette from a hero image, extract 8 colours and then visually identify which ones are too similar to distinguish on screen. Remove the duplicates manually and use the remaining ones. Pair the most dominant colour with the most contrasting one for your primary CTA. To convert the extracted HEX values into HSL or to build tints and shades, paste them into the companion Color Converter tool.

Frequently asked questions

Is my image sent to a server to extract the palette?
No. Every step of the extraction — downsampling, pixel sampling, k-means clustering — runs entirely in JavaScript inside your browser. No image data, no pixel values, and no results are transmitted anywhere. You can confirm this by watching your browser's Network tab while using the tool: you will see zero outbound requests related to your image.
What algorithm does the tool use to find dominant colours?
The tool uses k-means clustering: it first downsamples the image to a small grid (up to 200 × 200 pixels) to keep the computation fast, then randomly initialises cluster centroids using the k-means++ seeding strategy, and iteratively reassigns each pixel to its nearest centroid and recomputes the centroid positions. After convergence, the centroids represent the dominant colours, sorted by how many pixels they represent.
Why does re-running extraction give slightly different colours?
K-means initialisation has a random element (k-means++ seeding picks a random starting pixel weighted by distance). Different starting points can converge to slightly different local optima. If you want a consistent result, click Extract palette again and compare — for images with clearly distinct dominant colours the result is very stable. For images with smooth colour gradients the exact palette may shift slightly between runs.
What is the palette preview bar at the bottom?
The bar shows all extracted colours side by side, with each segment sized proportionally to how many pixels it represents in the image. A colour that covers 40% of the image takes up 40% of the bar. This gives an instant visual sense of the image's colour distribution without you having to mentally weigh the individual swatches.
How do I use the extracted colours in my design?
Click any swatch's copy button to grab its HEX code, then paste it into Figma, Sketch, CSS, Tailwind's config, or any design tool that accepts hex colour values. The 'Copy all HEX' button copies every colour on separate lines so you can paste them as a list. To convert colours to HSL, RGB, or CMYK, paste the HEX into the companion Color Converter tool.

Related tools