Drop an image to extract its Tailwind colors
or browse files, or paste with Ctrl+V
Pull the dominant colors from a photo, logo or screenshot and match them to Tailwind CSS shades — 100% private, runs in your browser
or browse files, or paste with Ctrl+V
This image to Tailwind palette generator reads your image, extracts its dominant colors, and tells you which Tailwind CSS shade matches each one best. Instead of guessing between sky-500 and cyan-600, you see the exact hex code, the nearest Tailwind class, a match-accuracy label and a WCAG contrast rating in one place.
Designers use the tool to translate brand logos, mood boards and hero photos into design tokens. Developers use it to paste a ready-made tailwind.config.js or @theme block straight into a project. Everything runs in your browser, so your images stay private.
The tool follows a three-stage pipeline that mirrors how professional color-science software works.
The tool scales your image down to about 150 pixels on its longest side and reads every visible pixel through the HTML Canvas API. It skips transparent pixels and, when you enable the option, near-white and near-black backgrounds.
The tool converts each pixel to the CIELAB color space, where numeric distance reflects how humans perceive color, then groups pixels with k-means clustering. A seeded k-means++ start makes results repeatable: the same image always returns the same palette.
The tool compares every cluster center against all Tailwind shades using the CIEDE2000 color-difference formula and returns the closest one. This approach beats simple RGB distance because it weights lightness, chroma and hue the way the eye does.
| ΔE (CIEDE2000) | Label | What it means |
|---|---|---|
| Below 1 | Exact match | Humans cannot tell the colors apart. Use the Tailwind class directly. |
| 1 to 3 | Very close | Only a trained eye sees a difference. Safe for most UI work. |
| 3 to 6 | Close | A small difference is visible side by side. Review before shipping. |
| Above 6 | Approximate | Export the exact hex as a custom color for brand accuracy. |
@theme, CSS custom properties, JSON and plain hex lists.| Feature | Tailwind v3 | Tailwind v4 |
|---|---|---|
| Custom colors live in | tailwind.config.js under theme.extend.colors | Your CSS file inside an @theme block |
| Variable naming | Nested object keys | --color-name-shade variables |
| Default palette format | sRGB hex | OKLCH (same shade names) |
| Best export from this tool | "tailwind.config.js (v3)" | "@theme CSS (v4)" |
Read the official Tailwind customizing colors guide and the theme variables documentation for the complete reference.
An image to Tailwind palette tool reads the pixels of a photo, logo or screenshot, finds the dominant colors, and maps each one to the closest color in the Tailwind CSS default palette. You get ready-to-use class names such as bg-cyan-600 and the exact hex values side by side.
The tool shrinks your image on a hidden canvas, converts every visible pixel to the CIELAB color space, and groups similar pixels with k-means clustering. Each cluster center becomes one palette color, and the cluster size tells you how much of the image that color covers.
The tool measures the distance between your color and every Tailwind shade with the CIEDE2000 formula, the industry standard for perceived color difference. A distance under 1 looks identical to the human eye, under 3 looks very close, and under 6 looks similar. The tool labels every match so you see the accuracy at a glance.
Yes. Tailwind v4 keeps the same shade names (for example cyan-600) but defines them in OKLCH. The tool matches against the classic sRGB values, so the nearest shade name stays valid, and it also generates a v4 @theme block for your own custom colors.
Yes. The tool always shows the exact extracted hex. Leave the "Output nearest Tailwind shade" option off, and the code panel exports your exact colors as custom tokens for tailwind.config.js, a v4 @theme block, CSS variables or JSON.
No. The tool runs 100% in your browser with the HTML canvas API. Your image never leaves your device, so you can safely analyze client logos, unreleased designs and private photos.
The tool accepts any format your browser can decode, including JPG, PNG, WebP, GIF, AVIF, BMP and SVG. Transparent pixels are ignored, so a logo with a transparent background returns only its real colors.
You can extract between 3 and 12 colors. Use 5 or 6 for a brand palette, 8 to 12 for illustrations and photos with many tones. The palette updates instantly when you move the slider.
Pick the "tailwind.config.js (v3)" or "@theme (v4)" format in the code panel, click Copy, and paste the result into your config or main CSS file. Then use classes such as bg-palette-1 and text-palette-3 in your markup.
Yes. Every swatch shows its WCAG contrast ratio against white and black text and tells you which one passes AA or AAA. That helps you choose readable button and heading colors straight from your image.
Heavy JPEG compression, embedded color profiles and large white or black backgrounds can shift the result. Turn on "Ignore near-white and near-black" to skip backgrounds, raise the color count, or click the image with the eyedropper to sample an exact pixel.