Skip to content

Color Palette Extractor

Pull a balanced color palette from any image, ready as CSS tokens.

Palette extractor

Drop an image here or browse files

Drag an image here, paste from the clipboard (Ctrl+V), or try the studio sample before adding your own. JPG, PNG, WebP, AVIF, GIF, SVG

Field guide for designers

Pulling a usable color system out of an image

A photo holds thousands of slightly different colors. A palette is a handful of decisions. The gap between the two is perception: which colors the eye groups together, which it notices, and which it can actually read text on.

01Why averaging pixels gives muddy palettes

The simplest extractor counts pixels in RGB and returns the most common buckets. RGB, however, is built around how screens emit light, not how people see it. Equal steps in RGB are wildly unequal to the eye: two dark greens that look identical can be far apart numerically, while a yellow and an orange that look clearly different sit close together.

Clustering in RGB therefore merges colors you would keep apart and splits colors you would merge, and averaging a cluster of complementary pixels drifts toward grey. This tool converts every pixel to a perceptual space first, where distance tracks visible difference, and only then groups them.

02OKLab, CIELAB and OKLCH in two minutes

SpaceWhat it isUse it for
CIELABThe 1976 standard: lightness plus two opponent axes (green to red, blue to yellow)Print, color management, Delta E tolerances
OKLabA 2020 refinement with more even hue spacing, especially in blues and purplesClustering, gradients, mixing
OKLCHOKLab in polar form: Lightness, Chroma, HueCSS values, tonal scales, theming

OKLCH is the most practical format for design systems because each number does one job. Keep the hue and chroma, change the lightness, and you get a lighter or darker shade of the same color without the hue shifts HSL is known for. All current browsers support oklch() in CSS.

.button        { background: oklch(62% 0.17 45); }
.button:hover  { background: oklch(55% 0.17 45); }  /* darker, same hue */
.button:focus  { outline-color: oklch(62% 0.17 45 / 0.4); }

03Dominant, accent and neutral roles

Every swatch the tool returns is labelled by role, because color roles matter more than individual values:

  • Dominant colors cover at least 8% of the image. They carry the mood and usually become backgrounds, large surfaces and imagery tints.
  • Accent colors cover little area but are clearly more saturated than the rest. In the source image they are what your eye lands on, which is exactly the job they should do in an interface: buttons, links, highlights.
  • Neutral colors have almost no chroma. Use them for text, borders and quiet surfaces.

A reliable starting split is the classic 60-30-10 rule: roughly 60% dominant or neutral surface, 30% secondary color, 10% accent. The share percentages on each card show how close the source image already is to that balance.

If an important accent is missing, switch the selection bias to Vivid or raise the color count. If you get several near-identical shades, switch to Coverage. Or simply click the exact pixel you want with the loupe.

04From swatches to design tokens

A single hex value is not enough for a real interface. Hover states, disabled states, tinted backgrounds and dark mode all need lighter and darker versions. The export builds an 11-step scale (50 to 950) for every swatch in OKLCH:

  1. The extracted color is placed at the step whose lightness is closest, so a pale sand color becomes sand-100 rather than being forced into 500.
  2. The other steps keep the same hue and spread lightness evenly toward near-white and near-black.
  3. Chroma tapers at the extremes, and any step outside the sRGB gamut has its chroma reduced until it fits, so every token renders the same on every screen.

Name tokens by role (primary, accent, neutral) rather than by hue (orange). Renaming a role later is a one-line change; renaming every orange-500 in a codebase after a rebrand is not. You can edit each token name directly on its card.

05Contrast before beauty

Each card shows the WCAG 2 contrast ratio of the swatch against white and black text, with the levels it passes:

LevelMinimum ratioApplies to
AA4.5 : 1Body text
AA Large3 : 1Text from 24px, or 18.66px bold, and UI components such as icons and input borders
AAA7 : 1Body text, enhanced level

Mid-lightness colors, the oranges and saturated greens images are full of, often fail with both white and black text. Use the generated scale instead: the 700 or 800 step of the same hue usually passes AA with white text while still reading as the brand color.

06Getting better extractions

  • Crop first. Borders, watermarks and large white backgrounds pull the palette toward neutrals.
  • Start with 6 colors. Fewer forces merges; more reveals secondary hues. Ten is the useful ceiling for a UI palette.
  • Use transparent PNGs for logos. Fully transparent pixels are ignored, so only the mark itself is analysed.
  • Sort by Lightness to see the value structure of the image at a glance; sort by Hue to spot gaps in the color wheel.

Questions

Frequently asked

01How does the palette extractor choose its colors?

The image is scaled down, every pixel is converted to the OKLab color space, and a weighted k-means++ clustering groups pixels that look alike to the human eye. Near-duplicate clusters are merged, then swatches are chosen greedily to balance how much of the image a color covers against how different and how saturated it is. That is why a small red detail can survive next to a large blue sky instead of being averaged away.

02What is the difference between dominant and accent colors?

Dominant colors cover a large share of the image, typically 8 percent or more, and usually become backgrounds and surfaces. Accent colors cover little area but are noticeably more saturated than the rest, which is what makes them catch the eye. Neutral swatches have almost no chroma and suit text and borders. Each swatch is labelled so you can map it straight to a role in a 60-30-10 layout.

03Why export OKLCH, and is it safe to use in production CSS?

OKLCH describes a color by perceived lightness, chroma and hue, so changing one value changes only what you expect. That makes it ideal for building tonal scales and consistent hover states. The oklch() function is supported in all current versions of Chrome, Edge, Firefox and Safari, and Tailwind CSS v4 uses OKLCH for its default palette. For older browsers, export HEX instead; both formats describe the same colors.

04Is my image uploaded to a server?

No. The image is decoded and analysed inside your browser tab with the Canvas API. Nothing is sent to Artisanea or anyone else, and the tool keeps working offline once the page has loaded.

05How do I use the exported tokens with Tailwind CSS?

For Tailwind v4, paste the @theme block into your main CSS file and use classes such as bg-primary-500 or text-accent-700. For Tailwind v3, merge the colors object into theme.extend.colors in tailwind.config.js. Each token gets an 11-step scale from 50 to 950 built in OKLCH; the extracted color sits at the step closest to its lightness, and a DEFAULT alias points to it so bg-primary works too.

Keyboard shortcuts

Open an imageO
Load sample artworkS
Paste image from clipboardCtrl V
Fewer / more colors[ ]
Export tab: CSS, v4, v3, JSON1–4
Copy export codeC
Download export fileD
Show / hide markersM
Eyedropper: move / add color←→↑↓ Enter
This panel?