Image Palette Extractor
Extract the dominant colour palette and hex codes from any image.
Upload an Image
No file selectedExtracted Palette
0 coloursNo palette yet
Upload an image above and the dominant colours, hex codes and the share of the image each colour covers will appear here automatically.
Key colours
—
Source image
Dominant colours click the copy icon to grab a hex code
CSS custom properties
How to extract colours from an image
Upload your picture
Drop a JPG, PNG or WEBP onto the upload zone or tap it to browse your files. Nothing is sent to a server.
Let the palette be calculated
The image is scaled down to a maximum of 300 × 300 pixels, the pixels are grouped into colour buckets and the most common colours are ranked.
Review the swatches
Each swatch shows its hex code and the percentage of the image it covers, next to the exact average colour and the single dominant colour.
Export the palette
Copy one hex code at a time, copy every colour as CSS custom properties, or download the whole palette as a PNG image.
Image palette extractor — frequently asked questions
The picture is drawn to an invisible canvas and every pixel is sampled. Each pixel is quantised into a bucket using four bits per colour channel, which groups 4,096 similar shades together. The buckets are then counted, ranked by how many pixels they contain and merged when two buckets sit close together. The result is a short list of colours that really represent the image instead of a long list of almost identical shades.
The extraction is deterministic — the same image always produces the same palette. A photo that contains thousands of shades (a forest, a crowd, a city skyline) will naturally produce more varied colours than a flat logo or an illustration with a handful of brand colours.
Yes. The “Copy all as CSS variables” button produces a ready-to-paste block such as --color-1: #8b5cf6; for every swatch, plus --color-dominant and --color-average. Add it to your :root block and reference the variables anywhere in your stylesheet.
Never. The file is read with the browser FileReader API, decoded locally and analysed with the HTML5 canvas. There is no server-side processing, no temporary storage and no analytics on the images you choose.
Related Color & Design
Color Converter & Picker
Convert between HEX, RGB, HSL and CMYK with WCAG contrast ratio checks.
Open toolCSS Gradient Generator
Create multi-stop linear and radial gradients and copy the CSS code.
Open toolImage Palette Extractor
Extract the dominant colour palette and hex codes from any image.
Open tool