Image Color Palette Extractor

Choose a palette size from 2 to 10 and the tool groups the pixels of your image into that many representative colors. Copy one swatch, the whole list as HEX, or a :root block of CSS custom properties. To read the exact color of a single spot, use the Image Color Picker instead.

Drop your image here or click to select

Supports PNG, JPG, and WebP - up to 50 MB

Runs in your browser: your files and text are not uploaded. Free, no account needed.

Last updated: · Reviewed by the QuickTooly Team

How the palette is built

How the Palette Is Calculated

The tool uses the Color Thief library (version 3). It reads the image at full size, samples every 10th pixel, and skips pixels that are mostly transparent (alpha below 125) or nearly white (red, green and blue all above 250).

The sampled colors are converted to OKLCH, a color space where equal distances look roughly equally different, and grouped with modified median cut quantization (MMCQ). MMCQ puts all colors in one box and keeps splitting a box at the median of its longest side. It first splits the boxes holding the most pixels, then the boxes that are both large and spread out. Each final box becomes one swatch: the average color of the pixels inside it.

What that means for your results

  • Swatches are averages. A palette color may not appear exactly anywhere in the image. Use the Image Color Picker for an exact pixel value.
  • White backgrounds are ignored. A product on a white background returns the product's colors. If almost the whole image is white, the filter is turned off so you still get a result.
  • Small accents can disappear. A small logo in a large area of sky can be merged into a nearby swatch. A larger palette size gives it a better chance of its own swatch.
  • Fewer swatches than requested are returned when the image has fewer distinct colors than the palette size, as in flat logos.

Using the Copied Palette

Copy as CSS produces :root { --color-1: #…; } with one variable per swatch, numbered in palette order. Rename the variables to their roles, such as --brand or --accent, before you use them. The swatches are not chosen for contrast, so test text and background pairs before using them together.

Palette Questions

Why is the main color of my image not first?

The swatch order comes from the median cut algorithm, which ranks color boxes by pixel count multiplied by color range. A large, uniform area can rank below a smaller, more varied one.

Why is white missing from my palette?

Pixels with red, green and blue all above 250 are skipped so that white backgrounds do not take over the palette. White only appears if almost nothing else is left after filtering.

Why did I get fewer colors than I asked for?

If the sampled pixels contain fewer distinct colors than the palette size, the tool returns only the colors that exist. This is common with logos and flat graphics.

How is this different from the Image Color Picker?

This tool summarizes the whole image into averaged colors. The Image Color Picker reads the exact value of the single pixel you click and shows it as HEX, RGB and HSL.

Related Color Tools