Colour Palette Extractor: Complete Guide
Extract a colour palette from any photo: 3 to 12 swatches, ranked by coverage, with HEX, RGB, HSL, CSS export, JSON, and a palette card download.
Extract a colour palette from any photo in five steps: upload, pick 3–12 swatches, read the percentages, and copy CSS or JSON — free, in your browser.
CompressMyPic Editorial Team · Published Nov 17, 2026 · 10 min read

You have a photo with colors you love, and you need those colors as a palette for a website, a poster, or a brand. Copying them by eye is slow and inaccurate.
This guide walks you through extracting a color palette from an image in five steps: upload, choose the swatch count, read the percentages, and copy or download the result.
The whole process takes under a minute once you know it. No software to install, no account to create, and no file uploaded to any server.
You need the image that holds the colors, in JPG, PNG, or WebP format, up to 20 MB. A photo, a product shot, a screenshot, or a piece of artwork all work.
Know what the palette is for. A website theme needs four to six colors, a brand identity needs a few more, and a mood board can use the full twelve.
A browser is all the software you need. The tool runs on Chrome, Safari, Firefox, and Edge, on desktop and on mobile, with no extension.
Finally, use the cleanest original file you have. A re-compressed copy or a screenshot of the photo can shift pixel values slightly and change the resulting palette.
Open the image color palette extractor and drag your image into the upload area. You can also click the area to choose a file from your device.
If the colors are on your screen right now, take a screenshot and paste it with Ctrl+V. The tool accepts clipboard images directly, so you can extract a palette from any website or app you are looking at.
The palette appears as soon as the image loads, starting with the default of 6 swatches. Each swatch shows its color, its codes, and the percentage of the image it covers.
If you uploaded the wrong file, switch to a different photo from the tool. The old palette is replaced, and you can keep working without reloading the page.
Move the slider to set the swatch count anywhere from 3 to 12. The palette rebuilds instantly each time you move it, so you can compare counts in seconds.
Start with 6 and look at the result. If two swatches look nearly identical, drop the count to 4 or 5 and watch the duplicates merge into one cleaner color.
If an accent color you care about is missing, raise the count toward 12. More swatches give small details their own box, so a tiny neon sign or a small flower can appear.
There is no single right count. A minimal website wants 3 or 4, a rich brand board wants 8 or 10, and the slider exists so you can find the number that fits your project.
Each swatch carries a percentage badge showing how much of the image that color covers. The largest percentage is the dominant color, and the smallest are the accents.
Read the percentages as a hierarchy for your design. The dominant color should take the most space, the secondary color a supporting role, and the smallest colors only the highlights.
Look at the proportional color strip below the swatches. It shows the same hierarchy as a bar, with segment widths matching the percentages, which makes the balance easy to judge.
If the strip is mostly one color, the photo has a strong dominant tone, and your design will feel calm. If the strip is evenly divided, the photo is busy, and your design will need restraint elsewhere.
Click Copy CSS to copy all the swatches as CSS custom properties. The variables are named in order, each holding a HEX value, and they paste directly into a stylesheet.
Click Copy JSON when the palette feeds into code rather than a stylesheet. The JSON includes each color HEX, RGB, and HSL values plus its percentage share, in a form a script can parse.
Change the swatch count and the exports update. You can switch from 6 colors to 4 without re-uploading, and the copied CSS or JSON reflects the new set immediately.
Save the export with the project. A palette that lives only in a browser tab disappears when the tab closes, while a saved file is there when the project resumes.
Click Download Palette PNG to generate a palette card: the original photo with the swatch strip and colors laid out beneath it. It is the visual summary of the extraction.
Share the card with a client or a team. A picture of the palette communicates faster than a list of HEX codes, especially to people who do not read code.
Use the card in mood boards, brand documents, and presentations. It shows where the colors came from, which builds trust, because the client can see the source photo.
Keep the card with the project files. When the palette is questioned months later, the card shows the source and the reasoning in one image.
Photos are the best source for palettes, because their colors already work together in the real world. A sunset, a street scene, or a product shot can supply a whole scheme.
Start with the largest flat areas of the photo. A clear sky, a painted wall, or a piece of clothing gives a stable color that the extractor ranks highly and reliably.
Watch out for mixed lighting. A photo with warm sunlight on one side and cool shade on the other can produce two versions of the same color, which look like duplicates in the palette.
When that happens, pick the version that matches the mood you want. The warm one suits a cozy design, the cool one suits a crisp design, and keeping both usually muddies the palette.
Logos are a precision case, because a brand palette must match exactly. Start with the highest-quality logo file you have, ideally a PNG on a solid background.
Transparent backgrounds are handled by the extractor, which ignores fully transparent pixels. But a logo on a transparent background can still produce odd results if the edges are semi-transparent.
For the cleanest result, place the logo on a white or brand-colored background first and extract from that version. The palette then reflects the logo colors, not the transparency handling.
Verify the key colors with the image color picker afterwards. The picker reads the exact pixel, which confirms the brand color when the extractor value looks slightly off.
Screenshots are the fastest way to capture the palette of a website or an app you admire. Capture the screen, paste it with Ctrl+V, and the palette appears.
The extractor ranks the interface colors by coverage, so the background and the main surfaces dominate, while button and link colors appear as small accents.
Be careful with text. A screenshot full of text produces gray and black swatches from the lettering, which are not part of the design palette and should be ignored.
Remember the originality question. A palette inspired by another site is fine, but copying a competitor brand palette wholesale is a poor choice for client work.
A tiny accent can vanish from a palette because the extractor ranks colors by coverage. A neon sign covering 1 percent of a photo may be folded into a neighboring color.
Raise the swatch count toward 12 first. More swatches give small details their own boxes, so the accent has a better chance of appearing.
If it still does not appear, grab it with the eyedropper. The image color picker reads the exact pixel, and you can add that color to the extracted palette by hand.
Note the accent percentage when you add it manually. A 1 percent accent is a highlight color, not a main color, and using it for large areas will overwhelm the design.
Two swatches that look almost identical usually come from a gradient, such as a sky that shifts gradually from light blue to darker blue. The algorithm splits the gradient into two boxes.
Keep the shade that fits your design better and drop the other. A palette with one blue is cleaner than a palette with two blues nobody can distinguish.
Alternatively, lower the swatch count. At 6 colors the gradient usually falls into a single box, and the duplicate disappears without any manual editing.
When you drop a duplicate, check the percentages. The kept color should carry the combined share in your design, because the two shades together covered that much of the photo.
In Figma, paste each HEX code into a color style. Create one style per swatch, named by its role, such as background, primary, and accent, so the team uses them consistently.
In Canva, paste the HEX codes into the brand kit or into the color picker for each element. The palette then stays available across every design in the account.
In CSS, paste the copied custom properties into your stylesheet and reference the variables everywhere. A variable-based palette is easy to update, because changing one value updates the whole site.
For a design system, store the JSON export as the source of truth. A token pipeline can read it and generate the CSS, the Figma variables, and the documentation from the same file.
You can change the swatch count at any time without uploading the image again. Move the slider and the palette rebuilds from the same image data instantly.
This is useful for comparing counts. Try 4, then 6, then 8, and watch how the palette gains detail and then starts duplicating shades. The right count is usually just before the duplicates appear.
Copy the CSS or JSON after each change if you want to keep several versions. The export always reflects the current count, so a version you liked can be lost if you move the slider again.
Uploading a new image clears the old palette automatically. That keeps the tool tidy, but it means you should save any palette you want to keep before switching images.
Product photos are a special case, because the palette must serve the product, not just the photo. A product shot on a white background gives a palette dominated by white, which tells you little about the product itself.
For product work, extract from a lifestyle shot instead of a studio shot. A product photographed in use, in a room or outdoors, carries the colors of its context, and those colors make a better palette.
When only a studio shot exists, crop the product tightly before extracting. Removing the white background forces the extractor to rank the product colors instead of the empty space around them.
Check the palette against the product colors you know. If the brand color of the product is missing or shifted, verify it with the eyedropper and add it to the palette by hand.
Product palettes feed into listings, packaging, and advertising, so consistency matters more than usual. Save the CSS or JSON export with the product files, and use the same palette across every channel where the product appears.
For a product range, extract a palette from each product and compare them. Products that share a palette family look like a range, while products with unrelated palettes look like a random assortment.
Seasonal products deserve seasonal palettes. A summer product shot gives bright, warm colors, while the winter version of the same product gives deeper tones, and the palette should change with the season.
Finally, test the palette on the marketplace listing itself. A palette that looks good in a design tool can fail against the white background and the interface colors of the marketplace, so check it in place before launch.
Upload the cleanest original, set the swatch count, read the percentages and the strip, then copy CSS or JSON and download the palette card.
Prune near-duplicates, rescue missing accents with the eyedropper, and save the export with the project before closing the tab.
For the full background, read the Colour Palette Extractor: Complete Guide, and for design workflow tips, see Colour Palettes from Photos: Design Workflow Tips.
Extract a colour palette from any photo: 3 to 12 swatches, ranked by coverage, with HEX, RGB, HSL, CSS export, JSON, and a palette card download.
Turn photos into design palettes that actually work: the 60-30-10 rule, dominant vs accent, contrast, brand use, and the mistakes that make palettes muddy.
Base64 strings and image files carry the same picture in different ways. Compare size, speed, caching, and editing, and learn when each one wins.
Convert a Base64 string to an image in four steps: paste, preview, pick Original, PNG, JPG, or WebP, and download. Handles URL-safe strings and line breaks.