Skip to content

Palette extractor

A logo, a photo or a screenshot — and its dominant colours with the share of each. Export as CSS variables, Tailwind, SCSS or JSON.

  • File · drag · paste · link
  • K-Means++
  • HEX · RGB · OKLCH
  • 3 credits per image

Image

Drop an image hereor paste it from the clipboard — Ctrl+V / ⌘VPNG, JPG, WebP, GIF, AVIF, SVG · up to 20 MB

3 credits per image — charged only once the picture has loaded. Your file never leaves the browser.

Palette

The image's colours will appear here — with the share of each and ready-to-use values.

Paste a screenshot straight onto the page: Ctrl+V / ⌘V.

How it works

From pixels to tokens

  1. Step 1. Upload an image

    Drop it, pick it or paste it — the file is read straight into the page and never leaves your device. A link is the exception: that address is fetched through our server.

  2. Step 2. K-Means clustering

    The algorithm groups the pixels into 4–12 dominant clusters, merging shades that are too similar.

  3. Step 3. Export and use

    Copy single HEX values or the whole palette — CSS variables, Tailwind, SCSS, JSON tokens or a PNG sheet.

FAQ

About palette extraction

How does K-Means color clustering work?

K-Means clustering is a machine learning algorithm that groups pixels into K color clusters. It starts by picking K random centroids (initial color guesses), assigns each pixel to its nearest centroid, then recalculates each centroid as the average of all its assigned pixels. This repeats until centroids stabilize. We use K-Means++ initialization to pick more diverse starting points, improving color coverage and reducing the chance of getting duplicate clusters.

What does the percentage shown next to each color mean?

The percentage represents that color's coverage across the image — how much of the image's total pixels belong to that color cluster. A 40% value means roughly 40% of the image's non-transparent pixels are closest to that color. These percentages are re-normalized after merging very similar colors, so they always sum to 100%.

How do I use the CSS variables export?

The CSS export generates a :root block with custom properties like --color-1, --color-2, etc. Paste this into your global CSS file and reference the variables anywhere in your stylesheet with var(--color-1). This is the fastest way to use extracted colors in a web project without manually copying hex values.

Is my image uploaded to a server?

Not the file you upload. Your image is read as a data URL, rendered onto an off-screen canvas and analysed locally — it never leaves your device, and working from files the tool keeps going with no network at all. The one exception is the URL field: a browser is not allowed to read the pixels of an image hosted on another site, so that address is fetched through our server and handed to the page. The image itself is not stored anywhere.

Can I use extracted colors to create a harmonious palette?

Extracted colors reflect the actual image content, not necessarily a harmonious color theory scheme. For branding work, use the dominant colors as inspiration — take the 1–2 most prominent colors and use the Color Converter tool to explore complementary, analogous, or triadic relationships. The extracted percentages help identify which colors are primary (brand colors) vs secondary (accent colors) vs neutral (backgrounds).

What types of images work best?

Photos with rich color diversity (nature, food, travel photography) produce the most interesting palettes. Logos and brand imagery tend to produce clean, focused palettes with 2–4 dominant colors. Screenshots work well for extracting a website's color scheme. Heavily compressed JPEG images may introduce artifacts that slightly affect color accuracy. For best results, use PNG or high-quality JPEG images.

What does the JSON export look like and how do I use it?

The JSON export is an array of objects with hex, rgb, oklch and coverage fields. This format works directly as design tokens in tools like Style Dictionary, Theo, or Cobalt. Import it into Figma via the Design Tokens plugin, or use it in JavaScript/TypeScript to programmatically apply colors to generated UI components.
Keep going

Other UIXColors tools that pair well with the Image Color Palette Extractor.

Guide for this tool

Related

Or browse a curated palette

PastelSunsetOceanForestEarth TonesRetro
Copied