Image Palette Extractor

Extract representative image colors and download a palette as JSON, CSS variables or a PNG strip.

Files stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Read the palette controls

Drop your image here

or choose one from your device

One JPEG, PNG or WebP image.

    6

    How many groups to report, largest first. Fewer groups merge similar shades into one.

    Use the center half to leave out a border, a wall or a watermark.

    Skips pixels that are less than half opaque, which suits logos and cut-out PNGs. Turn it off to include them.

    How to use Image Palette Extractor

    1. Choose one JPEG, PNG or WebP picture.
    2. Set how many colors to report, from 2 to 10.
    3. Leave the area on Whole image, or switch to Center half to ignore a border or a watermark.
    4. Select Read the palette. Copy the values, or download the JSON, CSS variables or PNG strip.

    Example: Image Palette Extractor

    Read the main colors from a photograph.

    You add
    One 4000 by 3000 JPEG, Colors to report 6, Area to read Whole image, Ignore see-through pixels left on.
    You get
    A table of six colors ordered by share, each with its hex, RGB and its percentage of the sampled pixels, plus a strip image of the palette and the most common color as a swatch. The summary names the largest color as a share of the sampled pixels rather than of the whole file, and the result explains that the values come from a scaled copy of the picture.

    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 reads everything. Center half reads the middle 50 percent of both sides, which leaves out a border, a frame or a watermark in a corner.
    Ignore see-through pixels
    On by default, so pixels less than half opaque are skipped and a cut-out logo is judged by its visible shape rather than its invisible color. Turn it off to include them.

    Supported inputs and limits

    Input formatsJPEG, PNG or WebP
    File sizeUp to 64 MiB and 40 megapixels
    ColorsWhole numbers from 2 to 10
    One image per run, up to 64 MiB and 40 megapixels, in JPEG, PNG or WebP, returning 2 to 10 colors. The palette is grouped from a scaled copy no larger than 1000 pixels on its longest side, so it describes the picture rather than listing exact pixel values; use the color picker page when you need one exact pixel. At most about 120,000 pixels are read, so a large photo is sampled. Transparent pixels are skipped by default. Grouping can merge two shades that are close together, and a color profile or decoder difference can shift a channel slightly. The result reports the read count and the share of each color. The JSON and CSS contain the same ordered colors as the table. The PNG strip shows equal-width swatches, not pixel shares.

    Where your input is processed

    This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save 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 is the average of a group of similar pixels, taken from a scaled copy of the picture. It is close enough to build a scheme from, but for a value you must match exactly, read that pixel with the color picker page.

    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?

    Switch the area to Center half, which reads the middle 50 percent of each side, or crop the border away first. Both leave the edge color out of the grouping.

    Which number should I choose?

    Around 5 or 6 gives a workable scheme for most photos. Two or three shows only the dominant notes, while nine or ten starts separating shades that look almost identical on screen.

    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.

    Project manager: Tony Hines · Content updated 4 October 2026 · Report a problem