Color Palette Extractor
Pull the main colors out of any image and export them as HEX codes, CSS variables or a PNG.
Drag & drop, paste, or click to choose an image
PNG, JPG or WebP - the palette appears instantly
The palette extractor finds the main colors in any image - a photo, a logo, a screenshot or a painting - and gives you their HEX, RGB and HSL codes, ready to copy as CSS variables, SCSS, Tailwind or JSON. Use it to build a website color scheme from a brand photo or match a design to an illustration. The image never leaves your browser.
How to extract a color palette
- Drop, paste or choose a PNG, JPG or WebP image.
- Pick how many colors you want, from 2 to 12. The palette updates instantly.
- Click any swatch to copy its HEX code, or copy and download the whole palette in the format you need - including a PNG image of the swatches to share.
How the colors are chosen
The tool groups every pixel into clusters of similar color using the k-means algorithm, and each swatch is the average color of one cluster. The grouping works in the CIELAB color space, which measures color difference the way people perceive it, so the palette reflects the colors you actually notice rather than tiny shifts in dark shadows. The percentage under each swatch shows how much of the image it covers. Fully transparent areas are ignored.
The result is the same every time you open the same image. If you ask for more colors than the image really contains, near-identical shades are merged instead of being shown as duplicates.
Using the palette in a design
- Use the most common colors for large areas like backgrounds, and the rarer, more saturated ones as accents for buttons and links.
- Each swatch shows its code in black or white, whichever contrasts better - a quick hint for which text color works on it.
- Check that text and background pairs are readable with the Color Contrast Checker.
Frequently asked questions
Is my image uploaded?
No - the image is analysed inside your browser with the Canvas API. Nothing is sent to a server.
Why don't I see a color that's in the image?
Small details don't cover enough of the image to get their own cluster. Increase the number of colors, or crop the image to the part you care about first with the Image Resizer & Cropper.
How is this different from the Image Color Picker?
The Image Color Picker gives you the exact color of one pixel you click on. This tool summarises the whole image into its main colors automatically.
Related tools
Convert colors between formats with the Color Converter, build a gradient from your palette with the CSS Gradient Generator, or browse all Graphics & Media tools.
Runs entirely in your browser - nothing you enter or upload is sent to a server.
Need it to do something else? Request a tool