Free public tools - no ToolsKitFree account required, with browser and clearly labelled VPS processing.
Guides

How to Extract a Color Palette From an Image (2026 Guide)

Learn how to extract a color palette from an image - crop to your subject, pull out five or six dominant colours, and copy the HEX codes into CSS, Figma or slides.

By ToolsKitFree Team · 11/11/2026

Every designer has been there: a client sends a logo PNG and says "use our colours", with no brand guide and no HEX codes. Or you see a photo whose colours would be perfect for a website, and you need those exact shades — not a guess. Extracting a colour palette from an image solves both in seconds: upload the picture, get its dominant colours with codes you can copy straight into Figma, CSS or any design tool.

This guide explains how palette extraction works, how many colours to take, and the exact workflow to follow — with a free browser tool that does it all without uploading your image anywhere.

What "extract a palette" actually means

A photo contains hundreds of thousands of pixels and tens of thousands of distinct colours. Pulling a palette out of it means grouping similar pixels together and naming each group with one representative colour. The standard method is called k-means clustering: the tool samples the image, groups pixels that look alike, and returns the centre of each group as a swatch, ranked by how much of the image each colour covers.

That ranking is what makes an extracted palette useful. The biggest swatch is usually the background or main subject colour; the smaller ones are the accents — the exact colours that make the image feel the way it does. A good palette is not just the five most common colours; it is the mix of dominant tones and strong accents.

So when people say "extract a palette from an image", they really mean: give me the handful of colours that define this picture, with codes I can paste into my work.

Step 1: pick the right image — and crop it first

The palette you get is only as good as the image you feed in. A photo with a huge sky will return mostly blues, even if the subject you care about is a red jacket in the corner. Before extracting, crop to the part that matters.

If you want the colours of a logo, crop out the white background around it first — otherwise white will dominate the palette and push the real brand colours down the list. If you want the mood of a landscape, keep the whole frame. The rule is simple: the palette reflects whatever fills the frame, so frame only what you want reflected.

Use the free Image Cropper to cut the image down to the subject before you extract anything.

Step 2: choose how many colours to take

Most extractors let you pick between 3 and 12 colours. The right number depends on what the palette is for:

  • 3–5 colours: brand palettes, website themes, slide decks. Fewer swatches force a clear hierarchy — one dominant colour, one or two supporting tones, one accent.
  • 6–8 colours: mood boards, illustrations, social templates. Enough range to capture the image's character without turning into noise.
  • 9–12 colours: detailed artwork or photo reference. Useful when you need every shade, but too many for a brand — nobody remembers a 12-colour brand.

Start with 5 or 6. You can always add one more accent afterwards, or drop a swatch that is almost a duplicate of another. A palette with two near-identical blues is a palette with one wasted slot.

To extract, open the free Image Color Palette tool, upload the image and get its dominant colours with HEX and RGB codes to copy. Extraction runs in your browser, so your photo is never uploaded to any server.

Step 3: read the palette, don't just copy it

The swatches come back ranked by share of the image. Read them in that order:

  • The largest swatch is your background or base colour — use it for page backgrounds, large areas and the overall feel.
  • The middle swatches are your supporting colours — headings, cards, secondary buttons.
  • The smallest strong swatch is often the most valuable: a vivid accent that covers 5% of the image but gives it its energy. Use it sparingly — buttons, links, highlights — and it will pop exactly the way it pops in the photo.

Check the contrast before you use any pair as text on background. Two colours that sit nicely side by side in a photo can be unreadable as text: light grey on white, or a mid-tone on another mid-tone. If a combination fails a contrast check, darken the text colour or lighten the background — the extracted codes are a starting point, not a rule.

Step 4: pick exact pixels when one colour matters

Sometimes the palette is not enough — you need one exact colour, like a logo's blue or the shade of a button in a screenshot. That is a job for a colour picker, not a palette extractor: click the single pixel and read its code.

Open the free Image Color Picker, upload the same image, click the pixel you want, and copy its HEX, RGB or HSL code. Use the picker for exact matches and the palette tool for the overall scheme — together they cover every "what colour is this?" question.

Step 5: put the palette to work

Once you have the codes, the palette is ready to use anywhere:

  • Websites and CSS: paste the HEX codes as CSS variables, then use them for backgrounds, text and buttons. The favicon should match too — generate one from your logo with the free Favicon Generator so the browser tab carries the same colours.
  • Figma and design tools: create colour styles from the HEX codes, so the whole team uses the same values.
  • Slides and social posts: one dominant colour for backgrounds, one accent for headings and calls to action. Two colours used consistently look more designed than six used at random.
  • Brand matching: when a client has no brand guide, an extracted palette from their logo is the fastest honest starting point — then ask them to confirm the codes before you build on them.

One caution: an extracted HEX is exactly what the browser renders for that pixel, which may not be what the original designer specified — a logo saved as a JPG can shift a colour slightly. Treat extracted codes as a starting point for digital work, and confirm with the brand owner when the colour has to be exact, for example in print.

The workflow in short

Crop to the subject, extract five or six colours, read them in order of share — base, support, accent — pick any exact pixel with the colour picker, and paste the codes into your CSS, Figma file or slides. A minute of work, and the colours of any photo or logo become a palette you can actually use.

Frequently asked questions

How do I get a color palette from an image?+

Upload the photo to a palette extractor, and the tool reads its pixels and pulls out the dominant colors with their HEX and RGB codes. Crop to the subject first so the background does not dominate the result.

How many colors should a palette have?+

Five or six is the best starting point for most uses — one dominant color, two or three supporting tones and one accent. Brand palettes work best at three to five; detailed artwork can use up to twelve.

What is the difference between a color palette extractor and a color picker?+

An extractor gives you the dominant colors of the whole image, ranked by how much of it each color covers. A picker reads one exact pixel you click on. Use the extractor for the overall scheme and the picker when a single color has to match exactly.

Are my images uploaded when I extract a palette online?+

Not with ToolsKitFree's browser tools. Extraction runs locally in your browser, so your photo never leaves your device — there is no upload, no account and no waiting for a server.

Can I use an extracted palette for my brand?+

Yes, as a starting point. Extract the colors from your logo, then confirm the codes with whoever owns the brand before using them in print, where exact values matter more than on screen.