/

Color Palette Extractor

Processed Client Side

Pull the dominant colors out of any image and export them as CSS variables, SCSS, a Tailwind config, JSON, or SVG swatches. The image never leaves your browser.

Image
Palette · CSS
CSSLength: 0Lines: 1Size: 0 BytesCursor: 1:1

Bookmark this tool now — skip the search next time you need it.

About Color Palette Extractor

This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.

Drop in an image and get the colours it is actually made of — not the colours you think you remember from it. The extraction uses median cut, the same family of algorithm a GIF encoder uses to reduce millions of colours to a small table: every pixel starts in one box, the box with the widest colour spread is repeatedly split at its population median, and each final box collapses to the average of the pixels inside it. That averaging is the part that matters. Picking the most common single pixel value out of a photograph gives you a colour nobody would describe as being in the picture, because a gradient sky has no single dominant value; averaging a region gives you the colour a person would point at. Each swatch comes back with the share of the image it accounts for, and the whole palette exports as CSS custom properties, SCSS, a Tailwind theme block, JSON, or an SVG of the swatches themselves.

Key features

  • Median-cut extraction of 4 to 16 dominant colours from any image
  • Per-colour share of the image, so you can tell a background from an accent
  • Proportional swatch bar — each colour occupies the width it occupies in the picture
  • HEX, RGB, and HSL for every colour, with click-to-copy on each swatch
  • Readable token names derived from the colours themselves (--color-teal, --color-dark-blue) rather than --color-1
  • Export as CSS variables, SCSS with a map, a Tailwind config block, JSON, or an SVG swatch strip
  • Sort by usage, by lightness, or around the hue wheel
  • Ignore white and ignore black switches, for logos on a flat background or product shots on white
  • Works with PNG, JPG, WebP, GIF, and SVG, up to 15 MB
  • The image is decoded in your browser and never uploaded anywhere

How to use it

  1. Drop an image onto the panel, or click to browse for one.
  2. Choose how many colours you want — six is a good starting point for a brand palette, twelve if you are studying a photograph.
  3. Turn on Ignore white or Ignore black if the image sits on a flat backdrop that you do not want in the palette.
  4. Click any swatch to copy its hex code, or reorder the palette by lightness or hue.
  5. Pick an export format and copy or download the result.

Tips & common mistakes

  • Fewer colours give you a usable palette; more colours give you an analysis. Four to six is what a design system can actually absorb.
  • The share percentage is the most useful number here — the colour covering 60% of the image is the background, and the one covering 3% is very often the accent you actually wanted.
  • A photograph on a white studio backdrop will hand you several near-whites before anything interesting. Turn on Ignore white and the palette collapses to the subject.
  • Extracted colours are descriptive, not prescriptive. A colour that reads well as a large area in a photo may be far too saturated as body text, so run any text colour through the Colour Contrast Checker before shipping it.
  • Sort by hue to see whether the image has a coherent scheme at all — a set of swatches clustered in one arc is an analogous palette, two clusters opposite each other is complementary.
  • Extraction runs on a downscaled copy of the image, so a single tiny bright pixel will not appear as a palette entry. That is deliberate: a palette should describe regions, not stray pixels.
  • The same image at different colour counts gives different colours, not just more of them — each extra split moves the boundaries of every box it touches. If a palette looks wrong, try one step up or down before dismissing it.
  • For a brand palette, extract from the logo rather than from a photo of the product. The logo has flat colour regions, which is exactly the case median cut reproduces exactly.

Related tools

Browse all 19 Frontend / CSS tools

Frequently asked questions

10

Drop the image onto the panel or click to browse for one, and the dominant colors appear immediately as swatches. Choose how many colors you want, then click any swatch to copy its hex code or export the whole palette.

No. The image is decoded and analysed entirely in your browser using a canvas, so it never leaves your device. The tool also works offline once the page has loaded.

It uses median cut: all pixels start in one box, the box with the widest color spread is repeatedly split at its population median, and each final box becomes the average of the pixels in it. Averaging regions is what makes the result match what you see, rather than returning one arbitrary pixel value.

Each percentage is the share of the analysed pixels that fell into that color's box. The largest share is almost always the background, and the smallest is often the accent color you were actually looking for.

Yes. Choose the CSS format and you get a :root block of custom properties, each named after the color itself and annotated with its share of the image. SCSS, a Tailwind config block, JSON, and an SVG swatch strip are also available.

Four to six for a palette you intend to design with, since that is about as many as a design system can meaningfully use. Ten to sixteen is better when you are analysing a photograph or trying to match an existing image.

Product shots and logos on a flat backdrop are mostly backdrop, so the palette reflects that. Turn on the Ignore white switch (or Ignore black on a dark backdrop) and the palette collapses to the subject.

Anything your browser can decode, which covers PNG, JPG, WebP, GIF, and SVG, up to 15 MB. Transparent pixels are skipped, so a logo with a transparent margin gives the colors of the mark itself.

Yes, and flat-color images like logos and UI screenshots are the easiest case — median cut reproduces flat regions almost exactly. Photographs with gradients give averaged colors instead, which is what you want from a palette.

They are a good starting point, but check them before shipping. Extracted colors describe what is in an image, not what is readable, so run any color you intend to use for text through the Color Contrast Checker first.