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 freeBrowser tool
Color palette generator
Upload an image to extract a dominant color palette with HEX, RGB, and approximate share. Processing stays in your browser.
How to use
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.
Set palette size
Move the slider to choose between 5 and 10 colors. The palette regenerates in real time as you adjust.
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.
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.
Features
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.
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.
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.
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.
After this task
After this free tool, open Ai Enhance for the next AI editing workflow.
Continue with Ai EnhanceSpecifications
| Palette range | 5–10 colors |
| Color formats | HEX, RGB, HSL |
| Export formats | PNG, CSS, ASE, JSON |
| Algorithm | K-means pixel clustering |
| Input formats | JPEG, PNG, WebP |
| Processing | Client-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 freeMore free tools
Explore our other limited free edits after sign-in photo and image tools.
Design linear, radial, and conic gradients with multiple color stops. Copy the CSS code or download as a PNG image.
Convert colors between HEX, RGB, HSL, HSB, CMYK, and CSS named formats. See a live preview, copy any value, and export a color card.
Convert HEX color codes to RGB values and vice versa. Live preview, one-click copy, and CSS snippet output. works in your browser.
Pick any color from an uploaded image and get its HEX, RGB, and HSL codes instantly. Build palettes from photos for web design, branding, and illustration.
Generate QR codes for URLs, text, WiFi credentials, and vCards. Customize colors, add a center logo, and download as PNG or SVG.
Calculate width, height, or aspect ratio for images and video. Enter any two values and get the third. Preset ratios for social media, film, and print.