Color Palette from Image
Drop a photo to extract its main colors with HEX and RGB codes. The image never leaves your browser.
No image yet.
Last updated:
How to get a color palette from an image
- Choose a photo. Drag an image onto the drop zone or click to choose a JPG, PNG, WebP or GIF.
- Pick a color count. Choose how many colors to extract, from 5 to 10.
- Copy the palette. Click a swatch for HEX, RGB or HSL, copy all as CSS variables, or open the colors in the palette generator.
Tips: crop to the subject first so a large sky or wall doesn’t dominate, and check text contrast on the extracted darks and lights with the contrast checker.
Frequently asked questions
Does my image leave this device?
No. The image is drawn onto a canvas on this page and analysed by JavaScript in your browser. Nothing is uploaded to a server.
How are the colors chosen?
The image is scaled down to at most 160 pixels on its longest side, then the pixels are grouped with k-means clustering into the number of colors you choose (5–10). Each swatch is the average color of one group, sorted by how much of the image it covers.
Why do the results look muddy?
Busy photos mix many hues, so averages can drift toward grey or brown. Crop to the subject first, or raise the color count to 8–10 to separate more hues.