Skip to content
Free ToolDesign

Extract a color palette from any photograph

Upload a photo and the tool analyzes the pixel data to identify the 5 to 10 most dominant colors. Each swatch displays its HEX, RGB, and HSL values, ready to copy into your design tool, CSS file, or brand style guide. Adjust the number of colors and fine-tune individual swatches before exporting.

Use this tool free

Features

1

Dominant color extraction

A k-means clustering algorithm analyzes every pixel in the image and groups them into 5 to 10 dominant color clusters. The result is a palette that accurately represents the visual mood of the photo.

2

Multiple color formats

Each swatch shows HEX, RGB, and HSL values. Click any value to copy it to the clipboard. Toggle between formats depending on whether you work in CSS, design tools, or print specifications.

3

Adjustable palette size

Use the slider to generate anywhere from 5 to 10 color swatches. Fewer colors produce a bolder, more simplified palette; more colors capture subtle gradients and accent tones.

4

Export options

Download the palette as a PNG swatch card, a CSS custom-properties file, an Adobe ASE swatch file, or a plain JSON array. Each format is ready to import directly into your workflow.

How to use

1

Upload a photo

Drag a JPEG, PNG, or WebP file into the tool. Landscape, portrait, and square images all work — the algorithm samples the entire canvas.

2

Set palette size

Move the slider to choose between 5 and 10 colors. The palette regenerates in real time as you adjust.

3

Copy or refine colors

Click any swatch to copy its HEX code. To fine-tune, click the edit icon on a swatch to open the color picker and shift the hue, saturation, or lightness.

4

Export

Download the palette as a PNG swatch card, CSS variables file, Adobe ASE file, or JSON array. Use the format that fits your design or development workflow.

Specifications

Palette range5–10 colors
Color formatsHEX, RGB, HSL
Export formatsPNG, CSS, ASE, JSON
AlgorithmK-means pixel clustering
Input formatsJPEG, PNG, WebP
ProcessingClient-side (no upload)

Related Magic Eraser Tools

Common questions

How does the tool decide which colors are 'dominant'?

+

The tool uses k-means clustering, which groups all pixels in the image by color similarity and calculates the average color of each cluster. Larger clusters — representing more pixels — rank higher, so the palette reflects the colors that cover the most visual area.

Can I use the extracted colors for my brand style guide?

+

Absolutely. Copy the HEX or RGB codes directly into your style guide. The ASE export also lets you import the palette into Adobe Illustrator, Photoshop, or InDesign as native swatches.

What type of photo produces the best palette?

+

Photos with distinct color regions — sunsets, food photography, fashion flatlays — produce the most vibrant and useful palettes. Low-contrast or monochromatic images will yield swatches that are very similar to each other.

Photo colors looking flat?

AI Enhance can boost color vibrancy and correct white balance before you extract the palette. Richer source colors lead to a more dynamic and usable swatch set.

Try it free