Polysh for agents is in early access. Your coding agent records the demo, and Polysh finishes it. Join the waitlist →

Color Palette Extractor

Pull a ready-to-use color palette with HEX codes out of any image.

Loading your browser tool…

What Color Palette Extractor does

Instead of picking colors one pixel at a time, the extractor groups every pixel in the image into the number of colors you choose, from 3 to 12, and lists them from most to least common. Each card shows the HEX code, the RGB values and the percentage of the image it covers.

Two copy buttons make the result easy to reuse: Copy all HEX gives a comma-separated list, and Copy as CSS gives --color-1 to --color-n variables inside a :root block. Turn on Ignore white, black and gray to skip page backgrounds and text so the accent colors show. The same image always gives the same palette.

Example

You choose

A 1000 × 200 px image of four flat stripes: #3157D5 (40%), #ED6C50 (30%), #2BAE84 (20%), #16181D (10%)
Number of colors: 4

Copy as CSS gives

:root {
  --color-1: #3157D5;
  --color-2: #ED6C50;
  --color-3: #2BAE84;
  --color-4: #16181D;
}

With four flat colors and four slots, each stripe becomes one swatch, ordered by its share of about 40%, 30%, 20% and 10%.

How to use Color Palette Extractor

  1. Choose file or paste the image.
  2. Set Number of colors, and turn on Ignore white, black and gray for UI screenshots.
  3. Click Copy all HEX, Copy as CSS, or Copy on a single color.

Good to know

  • Palette colors are averages of groups of pixels, so a color may not exist exactly in the image. Use the Screenshot Color Picker for an exact pixel.
  • Small accents, like a thin brand-colored link, can be absorbed into a bigger group. Raise Number of colors to separate them.
  • Transparent and mostly transparent pixels are ignored, so a logo's background doesn't appear in its palette.

Questions about Color Palette Extractor

How do I get a color palette from an image?

Load the image and the palette appears below it, sorted by how much of the image each color covers. Change Number of colors to get more or fewer swatches, then copy the HEX codes or the CSS variables.

How many colors should a palette have?

Five or six is typical for a UI or brand palette: a background, a surface, text, a primary and one or two accents. Use 8 to 12 for photos or illustrations where you want the full range.

Why does my palette show mostly white and gray?

Screenshots of apps are mostly background and text. Turn on Ignore white, black and gray to skip near-white, near-black and gray pixels so brand and accent colors move to the top.