Color Palette Extractor
Upload a photo β get dominant HEX swatches ranked by prominence
Click to upload or drag & drop
PNG, JPG, WEBP, GIF supported
Dominant Palette
How to Extract a Color Palette from Any Photo (Step-by-Step)
Every great design starts with the right colors. Whether you are building a brand identity, designing a social media post, or picking paint for a room inspired by a vacation photo, knowing the exact colors inside an image is invaluable. A color palette extractor does this automatically β it analyzes every pixel in your photo and distills it down to the 5β10 colors that define its visual feel.
In this tutorial you will learn exactly how to use our browser-based Color Palette Extractor, what the results mean, and how to apply those HEX codes in real design work.
Step 1: Choose the Right Source Image
The quality of your palette depends heavily on the photo you start with. A few things to keep in mind before uploading:
- High contrast images produce more distinct swatches. A photo of a sunset with deep oranges against dark blues will give you a palette with clear, usable contrast.
- Busy, noisy images (crowded street scenes, patterned textiles) can produce many similar muddy mid-tones. If you want a clean palette from a busy image, try cropping to the most visually interesting region first.
- Product photos on white backgrounds will always produce white as the dominant color. Crop to the product itself for more useful swatches.
- Any common format works β JPG, PNG, WEBP, and even animated GIFs (the first frame is used). The tool works entirely in your browser, so your image never leaves your device.
Step 2: Upload Your Photo
Click the upload zone or drag and drop your file directly onto it. The tool accepts images from your computer, phone gallery, or even a screenshot. Once the file loads, a small preview appears so you can confirm you selected the right image.
You do not need to resize your image beforehand. Internally, the extractor scales it down to a smaller working copy for processing speed β but it reads the full color data from the original before doing so.
Step 3: Pick How Many Swatches You Want
Use the "Swatches" dropdown to choose between 5, 7, or 10 colors. Here is a simple guide for when to use each:
- 5 swatches β Best for brand palettes, logos, or when you need a tight, harmonious set. Fewer colors means the algorithm focuses on the most dominant hues only.
- 7 swatches β The default, and a good all-purpose choice. You get the dominant colors plus a few interesting accent tones you might not have noticed.
- 10 swatches β Ideal for detailed illustrations, paintings, or fashion photography where subtle color variations matter. You may see near-duplicate shades, which is actually useful when you need to pick between similar tones for typography or borders.
Step 4: Extract the Palette
Click the "Extract Palette" button. The tool runs a mathematical algorithm called K-Means clustering directly in your browser using JavaScript and the HTML5 Canvas API. Here is what happens under the hood:
- The image is drawn onto an invisible canvas element.
- Every few pixels, the tool samples the RGB color value (red, green, blue channels).
- All sampled colors are grouped into clusters β pixels with similar colors end up in the same cluster.
- The algorithm repeatedly recalculates the "center" of each cluster (the average color) until the centers stop moving significantly.
- Each cluster center becomes one swatch, and the cluster size determines the prominence percentage.
The whole process takes under a second for most images. No data is sent to any server.
Step 5: Read the Results
Once the palette is ready, you will see two output sections:
The swatch grid shows each extracted color as a colored tile with its HEX code below it (for example, #3B82F6) and the percentage of the image that color accounts for. Swatches are arranged from most dominant to least dominant.
The prominence bars give you a quick visual comparison of how much space each color occupies. A wide bar means that color is everywhere in the photo. A narrow bar means it is an accent β visible but not dominant.
Step 6: Copy HEX Codes and Use Them
Click any swatch card to copy its HEX code to your clipboard instantly. The card briefly shows "Copied!" so you know it worked. Then paste the code wherever you need it:
- Figma / Adobe XD: Press K to open the color picker, paste the HEX into the field at the bottom.
- CSS: Use directly as
color: #3B82F6;orbackground: #3B82F6; - Canva: Click "Brand Kit" β "Add a color" β paste the HEX.
- PowerPoint / Keynote: Shape fill β More colors β paste into the HEX field.
- Tailwind CSS: Extend your config with the exact HEX as a custom color token.
Pro Tips for Better Palettes
Use photography that matches your brand mood. If you are building a calm, wellness brand, upload a photo of misty forests or ocean waves. The extracted palette will naturally have the calming greens, greys, and blues that match that feeling.
Try multiple crops of the same image. The sky portion of a landscape gives you one palette; the foreground gives you another. Together, they form a complete, cohesive system.
Check accessibility. Once you have your HEX codes, paste them into a contrast checker tool to make sure your text colors are readable against your background colors. Good design is both beautiful and accessible.
Save palettes for consistency. When you find a palette you love, write down all the HEX codes in a shared document or design system file. Consistent color use across all your materials is what makes a brand look professional and intentional.
Why HEX Codes Instead of RGB or HSL?
HEX is the most universally accepted color format across web tools, design apps, and front-end code. Every design tool in existence accepts HEX codes, which is why this tool outputs them. If you need RGB or HSL instead, the conversion is simple: RGB splits the HEX into three two-character groups and converts each from base-16 to base-10. HSL can be derived from RGB with a short formula β many online converters handle this in seconds.
By starting with HEX from this tool, you always have a clean baseline to convert from as needed.