Image to color palette extractor

Upload or drop an image to get 5–8 representative HEX colors, sampled locally in your browser and ready to copy or export as CSS variables.

Use it to pull a working palette from a logo, screenshot, photo or moodboard. The image never leaves your device, and every swatch comes with a one-click HEX copy plus a :root CSS block.

or drop an image anywhere in this box

Choose or drop a PNG, JPEG or WebP image, or load the sample. Nothing is uploaded — all sampling runs in your browser.

How image color extraction works

The extractor draws your image into a small canvas, capped at 256 pixels on the longest side, and reads the pixels from that bounded sample. Working on a smaller copy keeps the page fast and stops a 20-megapixel photo from freezing the browser.

Each sampled pixel is grouped into a 32-level red, green and blue bucket. The tool counts how many pixels land in each bucket, ranks the buckets by coverage, and averages the pixels inside each one to produce a clean HEX value. Near-duplicate buckets are skipped, so the final list reads as distinct colors instead of eight almost identical blues. Transparent pixels are ignored.

The result is a representative palette, not a full color histogram. Large background areas and dominant brand colors rise to the top, while anti-aliasing, gradients and one-off noise pixels are absorbed into the bucket averages.

How to use the extracted palette

  1. Choose or drop a PNG, JPEG or WebP image, or load the bundled sample to try it immediately.
  2. Read the swatches from most to least dominant, then copy each HEX value you want to keep.
  3. Use the CSS variables block to paste the whole palette into a stylesheet, a design tool or a Tailwind theme.
  4. Check the text and background pair before you ship it with the WCAG color contrast checker.

Need the exact color of one pixel rather than a palette? Open the image color picker and click that pixel. Looking for proven combinations from shipped sites? Browse real website color schemes.

Palette extractor or pixel picker?

JobUse
Build a palette from a whole imageThis extractor, which ranks the dominant colors.
Read one exact pixelThe image color picker, with X/Y coordinates.
Test a pair for WCAG contrastThe contrast checker.

Image to color palette FAQs

How many colors does the extractor return?

It returns up to 8 representative colors, and at least 5 when the image contains that many distinct colors. A flat logo with only two or three colors returns those real colors rather than inventing extra swatches.

Is my image uploaded to a server?

No. The image is decoded and sampled with your browser's canvas API on your own device, then discarded when you close or reload the page. Nothing is sent to a server.

Which image formats work?

PNG, JPEG and WebP files up to 25 MB and 4096px on a side. PNG is best for logos and screenshots because it keeps sharp edges and transparency; JPEG and WebP are fine for photos.

Why does the extracted palette differ from the pixels I can see?

The tool samples a bounded grid of pixels instead of every pixel, then groups similar colors into buckets and averages each group. That keeps large flat areas and dominant tones while ignoring one-off pixels such as anti-aliasing and noise.

Keep exploring color

Pair an extracted palette with real references and accessible alternatives before you commit it to a design system.

More image tools

Color tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools