Color palette from image
Open a photo and this page lists its main colors with HEX and RGB codes you can copy. The picture is decoded and measured inside your browser tab, the same way our background remover keeps your files on your own device.
or pick one from this device. Works with JPEG, PNG, and WebP. Transparent areas of a PNG are left out of the palette.
Pick an image to begin. It is read on this device and never sent to us.
What the palette extractor gives you
Each swatch comes with its HEX code (for CSS, slide templates, and most design apps), its RGB triple, and the rough share of the picture it covers. The list is ordered from the color that fills the most area down to the smallest accent, so the first one or two entries usually describe the overall mood and the last ones are highlights. Choose between three and ten swatches; six is a good middle ground for most photos.
Runs locally, like the background remover
BG Remover Free was built around one rule: your photo stays with you. This palette page follows it. The browser decodes the file, a small script samples the pixels, and the results are drawn on screen. There is no account, no server-side processing, and no paid service behind it. The analysis code is a plain script served from this site, with no machine-learning model to download.
How the colors are chosen
First the picture is drawn onto an off-screen canvas at no more than 200 pixels on its longest side. Shrinking it keeps the work fast on phones while barely changing which colors dominate. Any pixel that is mostly transparent is dropped.
The remaining pixels go through median cut: they start as one group, and the group with the widest spread on its red, green, or blue axis (weighted by how many pixels it holds) is split at its middle value. That repeats until there are as many groups as swatches requested. Next, a few rounds of k-means clustering move every pixel to its nearest group average and recompute the averages, which tightens each swatch around a real color in the photo. Groups that land almost on top of each other are combined, and the averages are rounded to whole RGB numbers.
When a palette from a photo is useful
- Product shots. Match a shop banner, price tag, or social post to the packaging you just photographed, instead of guessing the shade by eye.
- Portraits. Pull skin, hair, and clothing tones out of a headshot to pick a backdrop color that does not clash before you swap the background.
- Cut-outs. After removing a background, load the transparent PNG here to see the subject's own colors, then use one of them as the fill behind it.
- Mood boards. Turn a reference photo from a shoot or a room into a short list of codes you can paste into a document or a design file.
How to extract a palette
- Choose or drag in a JPEG, PNG, or WebP file.
- Set how many colors you want. Changing the number recalculates instantly from the same sample.
- Press Copy HEX next to a swatch, or copy every code at once as a comma-separated list.
- Want only the subject? Run the photo through the free background remover first and open the PNG it gives you.
Questions about image palettes
Why can a HEX value here differ slightly from a color picker in my photo editor?
A color picker reads one pixel. This page reports the average of a whole group of similar pixels from a smaller copy of the picture, so a swatch for a textured sweater or a sunlit wall is a blend of many nearby shades. Editors that show a different color profile can also display numbers that are a little off from the browser's.
How do I get the colors of the subject only, without the backdrop?
Cut the subject out first with the background remover on our home page, download the transparent PNG, then open that PNG here. Pixels that are mostly see-through are skipped, so the empty area around the cut-out never turns into a swatch.
I asked for eight colors and got five. Is something wrong?
No. Flat graphics, logos, and studio shots on plain paper often contain only a few real colors. When two candidate swatches are close enough to look the same, they are merged into one instead of being shown twice.
Does picking colors need an internet connection?
Loading this page does. After that, decoding the picture, sampling it, and grouping the colors all happen in JavaScript inside the tab, and no request carries your image or its pixels anywhere.