glunty

Color Palette Extractor from Image

Extract dominant colors from any image. Pure client-side.

What this tool does

Reads an image, samples its pixels, and groups similar colors together to find the dominant ones. Output is a palette of N colors as hex codes plus a CSS variables block ready to paste into a stylesheet. The grouping uses a coarse quantization (each color channel rounded to one of 16 buckets, giving 4096 total bins) followed by frequency counting; this is fast and works well for typical photos and illustrations. Everything runs in your browser.

How to use it

Pick an image. Choose how many colors you want (2 to 20; 5 to 8 is typical for a brand palette). Toggle Ignore near-white and near-black if your image has large solid backgrounds you want to skip (most photos benefit). Press Extract. Each swatch shows the hex code and a small preview; click any swatch to copy its hex value.

Common use cases

  • Sampling colors from a brand reference image to use in CSS or a design tool.
  • Finding the dominant colors of a photo for a matching frame, mat, or background.
  • Producing a CSS variables block from a moodboard image.
  • Checking that a logo's color palette is consistent across exported variants.
  • Quick color inspiration when starting a new design.

Common pitfalls

  • Anti-aliased edges. Smooth edges in an image produce many intermediate colors that may show up in the palette. The 16-bucket quantization helps but does not remove this effect entirely. Crop or use higher color counts if you see too many "bridge" colors.
  • JPEG artifacts. Heavy JPEG compression introduces colors that are not in the original. For brand palettes, prefer a PNG, SVG, or original source over a re-saved JPEG.
  • Frequency vs visual importance. A small but striking accent color may be visually important but not appear in the top frequency-ranked palette. Increase the color count or crop to the area of interest.

Frequently asked questions

How does this pick the dominant colors?
It samples every pixel, quantizes each color channel to one of 16 buckets (4096 total color bins), counts the frequency of each bucket, and picks the most common ones. Then it filters out near-duplicates so two very-similar shades do not both appear. The result is a fast frequency-based palette that works well for typical photos and illustrations.
Why is this less accurate than k-means clustering?
K-means produces visually-grouped centroids that better represent perceptually-distinct color groups, but it is iterative and slow. The bucketing approach used here runs in milliseconds on any image. For most use cases (matching brand colors, finding accent colors for a moodboard), the bucketing is good enough; for serious color science, use a tool that runs k-means or median-cut.
Why does turning on "Ignore near-white and near-black" change my palette so much?
Many photos have large white or black areas (sky, shadows, page backgrounds) that dominate the frequency count. Filtering them out lets the chromatic colors surface. Logos with bright backgrounds especially benefit; turning the option on usually produces a more useful palette for design work.
Can I get a palette from a transparent PNG?
Yes. The tool ignores fully-transparent pixels (alpha < 128) and only counts opaque ones. The palette comes only from the visible portion of the image, which is what you want for a transparent logo.
Is there a way to match the result to existing brand colors?
Not directly. Run the extractor, get the hex codes, then compare to your brand colors by eye. If a logo brand color is #1a73e8 and the extractor returns #1c70eb, that is the same color through quantization noise. For pixel-perfect match, sample a single pixel with a color picker on the source.
Why does my logo accent color not appear in the palette?
Frequency bias. A small but visually-important accent (5% of the image) loses to a less-important background color (60% of the image). Increase the color count to 12 or 15 and the accent often appears further down the list. Or crop to the accent area and re-extract.

Embed this tool

Free for any use; attribution appreciated. Paste this on your site:

The embed runs the same tool that lives at this URL. No tracking; no ads inside the embed. Resize height as needed for your layout.

Cite this tool

For academic, journalistic, or technical references. Pick a format:

Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.

Embedded tool from glunty.com