Palette Extractor from Image.
Extract the dominant colors of an image as hex, RGB and HSL, with CSS variables or a Tailwind palette.
Runs in your browserAbout Palette Extractor from Image
The Palette Extractor finds the main colors in an image so you can build a color scheme from a photo, match a brand from its logo, or pull the exact colors out of a design screenshot. Drop a PNG, JPEG, WebP, GIF or AVIF file and choose how many colors you want, from 2 to 16. The image is scaled down on a canvas, transparent pixels are ignored, and the remaining pixels are grouped with a deterministic k-means clustering that starts from the most common color and then picks the most distinct ones, so the same image always produces the same palette. Each color is listed with its hex, rgb() and hsl() values and the share of the image it covers, and the color-share bar shows the proportions at a glance. You can copy the result as CSS custom properties, a Tailwind colors object, a JSON array or SCSS variables. For example, a sunset photo typically yields a deep blue, two oranges, a pink and a near-black, with the sky taking the largest share. Typical mistakes are asking for too many colors from a simple logo, which splits one brand color into near-duplicates, and expecting anti-aliased edges to vanish; lower the count instead. Check text colors you pick with a contrast checker before using them. The image never leaves your device: decoding and clustering run in your browser.
How to Use
- Choose or drop an image file.
- Set the number of colors and the code format.
- Copy the hex values or the generated CSS, Tailwind, JSON or SCSS.
Frequently Asked Questions
How are the colors chosen?
Pixels are grouped with k-means clustering on a downscaled copy of the image. The first color is the most common one; the others are chosen to be as distinct as possible, then refined.
Why do I get two very similar colors?
The image has fewer distinct colors than you asked for, often because of anti-aliasing or gradients. Lower the number of colors.
Are transparent areas counted?
No. Pixels that are more than half transparent are ignored, so logos on transparent backgrounds give their real colors.
Is my image uploaded?
No. It is decoded on a canvas in your browser and never sent anywhere.
Related Tools
Convert between HEX, RGB, and HSL formats.
Turn one brand color into a Tailwind 50–950 palette, as v4 @theme, v3 config, CSS variables or SCSS.
Check text and UI color contrast against WCAG 2.2 AA and AAA, with the closest passing colors.
Compress PNG and JPEG images with adjustable quality.
Build linear, radial and conic CSS gradients with a live preview, OKLCH interpolation and Tailwind output.
Set each corner radius, including elliptical corners, and copy the shortest CSS or Tailwind classes.