Image Color Palette Extractor

Extract harmonious color palettes from images with OKLab & sRGB K-Means++, export to CSS/Tailwind/JSON/SVG, and test live across real UI mockups.

INPUT WORKSPACE & PARAMETERS IMG PALETTE

Drop IMG Files Here

Processed strictly inside your browser memory. Files never leave your device.

Select Local Files or paste from clipboard: Ctrl + V
Engine Settings
IMG PALETTE
Image Color Palette Extractor

Local Execution Pipeline (Step-by-Step)

01

Drop or Paste Your Image

Drag and drop a PNG, JPG, WEBP, or screenshot into the workspace, or paste directly from your clipboard with Ctrl+V.

02

Configure Clustering & Export

Pick color count (3–10), extraction mode (Balanced, Vibrant, Pastel, High Contrast), notation (HEX/RGB/HSL/OKLCH), and OKLab or sRGB under Advanced Settings.

03

Export Code or Preview Live

Copy or download as CSS Variables, Tailwind, JSON, SCSS, Text, SVG, or PNG strip — and click "Try Color Palette" to preview on 5 interactive UI templates.

Perceptual OKLab K-Means++ Clustering Architecture

Naive RGB clustering ignores human perceptual uniformity and lets large neutral areas drown out vibrant brand accents. This engine downsamples your image locally in browser RAM via HTML5 Canvas, transforms pixels into the perceptual OKLab color space (L, a, b), and runs deterministic K-Means++ clustering in under 15 milliseconds. You can also switch to classic sRGB K-Means anytime from Advanced Settings.

Multi-Format Developer Exports & Design Tokens

Every extracted swatch includes exact HEX, RGB, HSL, and CSS Color 4 OKLCH notations alongside cluster pixel dominance (%) and WCAG 2.1 contrast ratings. Switch instantly between CSS Variables (:root), Tailwind CSS (@theme), JSON Design Tokens, SCSS, plain text, vector SVG, or a high-DPI PNG swatch strip.

Interactive Live Design Playground & Zero-Upload Privacy

Click Try Color Palette to apply your palette live onto 5 real templates: SaaS Dashboard, Landing Page Hero, Social Media Posts, Mobile App Cards, and a full Typography & WCAG Contrast Matrix. Shuffle semantic roles, reassign individual slots, and copy semantic CSS variables with zero server uploads.

Technical Frequently Asked Questions

What is the difference between OKLab K-Means++ and classic sRGB K-Means?

OKLab is a modern perceptual color space where Euclidean distance matches human vision, producing cleaner, more harmonious clusters without muddy mid-tones. You can switch to classic sRGB K-Means inside Advanced Settings for direct RGB clustering.

Are my images uploaded to a server during palette extraction?

Never. Canvas sampling, OKLab conversion, K-Means++ clustering, and live UI previews execute 100% inside your local browser memory.

Which code and visual export formats are supported?

You can copy or download CSS Variables (:root), Tailwind CSS (@theme), JSON Design Tokens, SCSS Variables, Plain Text lists, vector SVG swatch cards, and high-resolution PNG palette strips.

Can I customize which palette color maps to background or accent in the live preview?

Yes. Inside "Try Color Palette", you can shuffle roles automatically, toggle Light/Dark/Palette surface modes, or click any role slot (Background, Surface, Primary, Secondary, Accent) to assign a specific swatch manually.