Skip to content
Jellykit

Dominant Color Extractor

Find the main colors in a photo or graphic, with hex and RGB values and how much of the picture each one covers.

  • Runs on your device
  • Works in the background
Loading tool

About Dominant Color Extractor

Drop in a photo, logo or screenshot and get its main colors, from two to sixteen, each with its hex code, RGB value and the share of the picture it covers. A bar shows the proportions at a glance, and every value has a copy button.

The colors can be listed by how much they are used, from light to dark, or by hue, and exported as a hex list, CSS or Sass variables, a Tailwind theme or JSON. Transparent areas are left out of the count, so a logo on a clear background reports only its ink.

How it works

  1. Your browser decodes the picture, and a copy is reduced to at most 250,000 pixels by picking pixels rather than blending them, so every color counted is one that is really in the image.
  2. Pixels that are more than half transparent are skipped; up to 100,000 of the rest are sampled evenly across the picture.
  3. Median cut splits the sampled pixels into groups along the color channel that varies most. The refined method then moves each color to the center of the pixels nearest to it until nothing changes, which gives truer averages.
  4. Each color is the average of its group, and its share is the size of that group out of all sampled pixels. Everything runs in a background worker on your device.

Questions

Why are the colors slightly different from the ones I picked in an editor?

Each result is the average of a group of similar pixels, not one pixel. A blue sky with many shades becomes one blue that represents them all. Ask for more colors to see finer distinctions.

Which method should I choose?

Refined (k-means) is the default and usually gives colors closer to what you see. Fast (median cut) skips the refinement step; it is quicker on very large color counts and can keep small but distinct accents apart.

Why did I get fewer colors than I asked for?

A flat graphic may simply have fewer distinct colors than the number chosen, and two groups that average to the same hex code are reported once.

How large an image can I use?

Files up to 100 MB, as long as your browser can decode the picture. Big photos are reduced before counting, which barely changes the result and keeps it fast.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.