PK Systems PK Systems
Image Tools

Color Palette Extractor

Drop an image and pull out its dominant colors with HEX, RGB, and HSL values, ready to copy.

Color Palette Extractor

Drop an image here or click to pick PNG, JPG, WebP, or GIF

All processing in your browser — no upload, no tracking.

Palette

What this tool does

Designers steal color palettes from the world all the time — a sunset, a poster, a film still, a screenshot of someone’s app. This tool automates that. Drop any image and get back its dominant colors as a set of swatches, each labeled with HEX, RGB, and HSL values you can copy with a single click. Pick 4 swatches for a tight brand-style palette, 6 for a flexible UI palette, 8 for an illustration set, or 12 to capture nuance in photographs. Beyond per-swatch copy, you can export the whole palette in three formats: CSS variables ready to drop into :root, a Tailwind config snippet for your tailwind.config.js, or JSON with HEX/RGB/HSL for any other tool. The image never leaves your browser. We downsample it to a small canvas, sample every pixel, and bucket nearby colors together — all locally. That means you can extract palettes from internal mockups, NDA’d brand assets, or personal photos without any privacy risk. There’s no upload, no tracking, no temporary copy stored on a server somewhere.

How to use it

  1. Drop the image — Any common format works — PNG, JPG, WebP, GIF. Quality of palette is best with images that have clear color regions; very noisy or grainy images can produce muddy swatches.
  2. Pick the count — 4 for a punchy brand-style palette. 6 is the UI sweet spot. 8–12 capture more subtle shades, useful for illustration references.
  3. Copy individual swatches — Click any swatch to copy its HEX value to the clipboard. The chip flashes “Copied!” to confirm.
  4. Export the whole palette — Use the bottom buttons to copy the palette as CSS variables, a Tailwind colors object, or JSON. Paste straight into your project.

How extraction works

We resize the image to a 200×200 canvas (sampling the whole image, not the corners) and read every pixel via getImageData. Each pixel’s RGB is rounded down to the nearest multiple of 32, producing 512 possible buckets (8×8×8). Buckets are tallied, sorted by count, and we walk the list picking the most frequent colors that aren’t too close to one already chosen (Euclidean distance ≥ 38 in RGB space) so the palette has visual variety. The displayed swatch is the average RGB of all pixels in that bucket, not the bucket’s rounded representative — that gives slightly more accurate colors. Fully transparent and near-transparent pixels are excluded.

Choosing the right count

4 colors works for logos and minimal brand identities — forces a strict hierarchy. 6 colors is what most design systems land on: 1–2 brand, 1 accent, neutrals. 8 colors gives you secondary accents and mid-tone neutrals. 12 colors is for illustration and photography references where you want to capture subtle gradations. Beyond 12 the palette becomes noisy and hard to use as a design constraint.

Frequently asked questions

Why are my palette colors slightly different from a Photoshop eyedropper?
We average colors within a bucket, so a swatch may not exactly match any single pixel — it represents the cluster’s mean. That’s usually closer to the perceived dominant color than picking one arbitrary pixel.
Does the algorithm work like K-means?
It’s a simpler frequency bucketing approach. K-means produces marginally better clusters for tricky images but is much slower and adds a dependency. For 95% of inputs the bucket method gives equally usable palettes in under 50 ms.
Why are some colors missing that I expected?
Small splashes of color get drowned out by background dominance. If a color occupies less than ~1-2% of the image, it likely won’t make it into the palette unless you raise the count. Crop the image to the area you care about for better results.
Are images uploaded?
No. Everything happens in your browser. The only network calls this page makes are for its own assets.
Can I extract palettes from images on a website?
Save or screenshot the image first, then drop it here. We don’t fetch URLs because that would either need a CORS proxy or a server, and we’re strict about staying client-side.
Why does the Tailwind export use brand-1, brand-2?
Generic names you can rename to fit your project. Drop the snippet into tailwind.config.js under theme.extend.colors, then rename the keys to whatever your design tokens call them.