How to use Image Palette Extractor
- Choose one JPEG, PNG or WebP image.
- Set Colors to report from 2 to 10. This is a maximum; a flat image or merged groups can return fewer.
- Choose Whole image or Center half. The latter reads only the middle half of the width and height, so it excludes content only when that content lies outside the chosen rectangle.
- Select Read the palette. Compare the representative colors with the picture, then copy the values or download JSON, CSS variables or the equal-width PNG swatch strip.
Example: Image Palette Extractor
Read the main colors from a photograph.
Options
- Colors to report
- The number of groups the tool may return, from 2 to 10, largest share first. A small number merges similar shades into one entry, so a photo that looks like six colors can come back as four.
- Area to read
- Whole image samples the complete scaled frame. Center half samples the middle 50% of its width and height, about one quarter of the area. A border or watermark is excluded only if it falls outside that rectangle.
- Ignore see-through pixels
- On by default, it skips sampled pixels with alpha below 128/255. Remaining pixels each count once regardless of their opacity. Turning it off includes fully transparent pixels too; their decoded RGB values may not represent a visible color.
- Copy and downloads
- Copy result copies all reported HEX, RGB, HSL and sampled-share values. The existing JSON, CSS variables and equal-width PNG swatches use the same ordered colors. ASE export is not supported.
Supported inputs and limits
- One JPEG, PNG or WebP up to 64 MiB and 40 megapixels.
- The requested 2–10 colors is an upper bound; flat groups and merging can return fewer.
- Sampling uses a copy no larger than 1,000 pixels on its longest side and a bounded grid of about 120,000 pixels at most, so small features can be missed or blended.
- Center half reads a rectangle, not a detected subject.
- Alpha below 128/255 is skipped when Ignore see-through pixels is on; other included pixels count once, without opacity weighting.
More details
Turning it off includes invisible decoded colors.
Group averages and decoder/color-profile handling can shift values.
JSON, CSS and table colors have the same order;
PNG swatches have equal widths, not widths proportional to shares.
ASE export is unavailable.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
How the colors are grouped
The tool uses median cut. Every sampled pixel starts in one group, and the group with the most pixels is repeatedly split along its widest color channel until the requested number of groups is reached or no group can be split further. Each group is then replaced by the average of the pixels inside it and sorted by how many pixels it holds. Groups whose averages are very close are merged, which is why two similar shades often arrive as one entry.
Why the palette comes from a scaled copy
Reading every pixel of a 40 megapixel photo would need a large buffer and a long wait on a phone. The picture is first drawn onto a copy no larger than 1000 pixels on its longest side, which keeps the work bounded and still samples the whole frame evenly. A thin line or a small object can lose its weight in that copy, which is why the share percentages describe the sampled picture rather than the original file.
Questions about Image Palette Extractor
Are these the exact colors in my file?
No. Each entry averages a group of decoded samples from a scaled copy. Close groups may be merged. Use Color Picker from Image with an explicit row/column when you need one decoded pixel; that still does not recover the file’s original color profile.
Why did I get fewer colors than I asked for?
There were not that many distinct groups to find. The tool stops splitting when every group is a single flat color, and the result says how many groups it returned.
How do I ignore a white border or a logo?
Center half can exclude an edge mark that lies outside the middle half of both dimensions. It does not identify a watermark or remove one from the image. Crop a separate copy first if you need a more specific reading area.
Which number should I choose?
Choose enough groups for the colors you want to reuse. A small maximum combines shades into a simpler palette; a larger maximum can separate more variations. Inspect the reported groups rather than assuming the requested count describes the image exactly.
What do the palette downloads contain?
JSON includes hex, RGB, HSL and sampled share values. CSS defines numbered color variables in :root. The PNG strip uses the same color order with equal-width swatches. These are representative grouped colors, not a list of every original pixel.