LocalExcelTool
Get started

Color Palette Extractor

Extract 8 dominant colors (hex + share) from an image.

Runs in your browserNo account neededFree

What is Color Palette Extractor

The Color Palette Extractor pulls the eight dominant colors out of an uploaded image, listing each as a hex code with its share of the picture. Internally it downsamples to 64×64 and quantizes into an 8×8×8 RGB bucket grid. Great for building color schemes from photos or checking a design's mood. Runs in your browser; the file never leaves your device (5 MB limit).

File

No file chosen

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Size limit
25 MB
Offline
Works with the network disconnected

Dominant colour is a statistical claim

Pixels are sampled and grouped, and the largest clusters are reported with their share. The sampling step matters: averaging every pixel of a photo produces a muddy grey-brown that appears nowhere in the image, which is why cluster-based extraction rather than a mean is what a palette tool must do.

Share percentages are worth reading. A palette where the top colour is 40% is a coherent image; one where five colours are each 8% is a busy image where no single colour will work as a theme.

What a palette does not tell you

It gives you colours present, not colours usable. A dominant pale pastel fails as text on white; a vivid accent may occupy 2% of the pixels and be the only usable brand colour. Ranking by area and ranking by usefulness are different questions.

Perceived colour also drifts in small areas: a 20×20 patch of colour is judged differently from the same colour across a whole wall. Extracted values are accurate samples and poor previews of how the colour will read at scale.

From palette to system

The useful next step is contrast, not more swatches. Each candidate needs its ratio measured against the actual background it will sit on, and the ones that fail are excluded regardless of how well they represent the photo.

For a generated theme, lightness variation matters more than hue: a single hue at four lightness levels gives a coherent UI, while four arbitrary extracted colours give a palette that cannot express states like hover, disabled or muted without inventing new values.

How to use it

  1. 1.Choose an image file
  2. 2.Run to extract the palette
  3. 3.Copy the hex codes into your design

How Color Palette Extractor works under the hood

Every image operation here is decode → transform pixels → re-encode. That order matters: it explains both why resizing is exact and why repeated compression slowly degrades a photo.

  1. 1

    Decode to a pixel buffer

    The browser's own decoder turns the file into RGBA pixels. EXIF orientation is applied at this step so portrait photos are not sideways.

  2. 2

    Draw at the target size

    The pixels are drawn onto a canvas at the requested dimensions with high-quality smoothing, which is where resampling actually happens.

  3. 3

    Encode with a chosen quality

    canvas.toBlob re-encodes to JPEG, WebP or PNG. Quality applies to lossy formats only; PNG ignores it and stays lossless.

  4. 4

    Hand back a Blob

    The encoded bytes become a download link. No network request is involved at any point.

  5. Processing pipeline

Why the file gets bigger sometimes

Re-encoding is not free. Converting a small, well-compressed JPEG to PNG usually makes it several times larger, because PNG is lossless and must store every pixel exactly. The same happens when a JPEG is re-saved at quality 1.0. If size is the goal, keep the format and lower the quality; if transparency is the goal, PNG or WebP is the right choice.

Metadata is dropped on purpose

Camera EXIF can contain GPS coordinates, device serial numbers and timestamps. Re-encoding through canvas writes fresh pixels and no metadata, which is a privacy win but means the location tag is gone. If you need metadata preserved, this pipeline is the wrong tool.

Formats the browser cannot open

HEIC and HEIF (the default on recent iPhones) are not decodable by most browsers, so they cannot be converted client-side. TIFF and some camera RAW formats fail for the same reason. There is no server fallback here by design — the file never leaves your device, so if the browser cannot read it, the tool cannot either.

Verify it yourself

Re-encoding happens locally. Check the network panel while it runs.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

How does extraction work?

The image is downsampled to 64×64, quantized into 512 RGB buckets, and the top 8 buckets are averaged into the colors you see.

What about transparency?

Pixels with alpha below 50% are excluded from the calculation.

What this kind of conversion cannot keep

Image work happens on a canvas: the file is decoded, drawn, re-encoded and handed back as a download. Nothing is uploaded, so a 20 MB photo costs you nothing but a few seconds. Re-encoding always loses a little quality — that is true of every tool, including desktop software.

More in Image