Dominant Color Extractor
Extract the dominant color from an image.
About this tool
Choose an image and press Process to get one hex colour. It is the average of all the colours in the picture, which is a useful quick tint but not a palette.
How to use
How it works
The image is shrunk to a 32 by 32 sample and the red, green and blue values of all pixels are averaged. The result is formatted as a hex colour such as #8a6f4e. Because it is a mean, a picture of bright red and bright blue averages to a purple that is not in the image.
R = average of all red values (likewise G and B), shown as #RRGGBB
Worked example
A sunset
- Input
- sunset.jpg
- Output
- one hex code such as #8a6f4e
- Walkthrough
- The warm and dark areas are averaged into a single mid-tone.
Limitations
- Returns the mean colour, not the most common colour.
- One colour only; no palette.
- Transparent pixels are averaged as their stored colour values.
Questions
How do I find the main colour of an image?
Is this the most common colour?
Can it give me a palette?
Features
- Average colour as hex
- 32 × 32 sample
- Private, in-browser
Guides
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Reduce image size with srcset
Chrome for Developers
Serving the right resolution—the goal of resize/compress tools.
Watch on YouTubeHow Image Compression Works
Leo Isikdogan
Compression intuition for resize and optimize image tools.
Watch on YouTube
- Use WebP images
web.dev
When next-gen formats beat shipping oversized PNGs.
- Efficiently encode images
Chrome Developers
Lighthouse image budgets that motivate compress tools.