Average Color Finder: Mean Color of an Image or Area
Find the average color of a whole image or of a rectangle you drag on it. Get the hex, RGB and HSL values, the brightness, and whether black or white text reads better on it. Runs in your browser. Nothing is uploaded.
Drag an image here, paste, or choose
One image, up to 50 MB. PNG, JPEG, GIF, BMP, WebP and AVIF files. Nothing is uploaded.
Want the colors a picture is made of instead of one blend? Try the color extractor.
About the Average Color Finder
The Average Color Finder blends a picture, or part of it, into one color. Choose, drop or paste an image and the tool shows the average color of the whole picture at once, with its swatch, hex code, rgb() value and hsl() value. Drag a rectangle across the image, or type its position and size, and the average follows that area instead. It also tells you how bright the color is and whether black or white text is easier to read on it.
It reads PNG, JPEG, GIF, BMP, WebP and AVIF files up to 50 MB. Your image never leaves your device. Nothing is uploaded, there is no account, and every pixel is read by your own browser.
How to use it
Steps
- Choose an image, drop it on the page or paste it.
- For the whole picture, read the result straight away.
- For one part, drag across the image, or fill in X, Y, Width and Height in image pixels. A dashed outline shows the area. Values outside the image are pulled back inside it.
- Press Use whole image to clear the area.
- Press the copy button beside the hex code to take it.
If every pixel in the area is transparent, the page says "This area is transparent, so it has no average colour." Pick another area or another image.
How the average is worked out
The average is the plain mean of the numbers in the file, taken for each of the red, green and blue channels over the pixels that count:
Here is one channel value from 0 to 255 and is the number of counted pixels. Rounding is half up. Pixels with an alpha value below 25, which are almost fully transparent, are not counted, so a cut-out logo is averaged over the logo and not over the empty space around it.
Take a picture that is half rgb(255, 0, 0) and half rgb(255, 255, 0). The red channel stays , the green channel is , which rounds up to 128, and the blue channel is 0. The average is rgb(255, 128, 0), or #ff8000, an orange that appears nowhere in the picture.
This is a mean of the stored numbers, not a mean of light. Averaging light would need the values converted out of the sRGB curve first, so a very contrasty picture can look a little darker or lighter here than the same blur made by a camera or an editor. For design work such as a placeholder color behind a photo, the plain mean is the usual choice.
Brightness and readable text
Brightness is the luma of the average color, a weighted sum that follows how strongly the eye responds to each channel:
For #ffff00, , so the page shows "226 of 255 (89 percent)".
To advise on text, the tool compares black and white against the color with the WCAG contrast ratio:
where is the relative luminance of the lighter color and of the darker one. It advises whichever of black and white gives the higher ratio, a tie going to black, and shows that ratio. A ratio of at least 4.5 meets the AA level for normal text and at least 7 meets AAA. A mid-tone can have a ratio below 4.5 for both, which means neither plain black nor plain white is a comfortable choice and you should change the color instead.
Choosing an area
- The whole picture is the default, which suits a photo that needs one accent color.
- A small rectangle, such as a logo corner or a title bar, gives the color of just that part.
- A one-pixel area, made by a plain click, gives the exact color of that pixel. For that job the Image Color Picker adds a magnifier and a list of pinned colors.
- The fields use image pixels from the top left corner. A 20 by 10 picture has X from 0 to 19 and Y from 0 to 9.
Photos larger than 16 million pixels are scaled down so the browser can hold them, and the page says so under the file name.
Related tools
When one blended color is too little, the Color Extractor lists the dominant colors of a picture with their shares, and the Color Palette Generator builds matching colors around any hex code.
Limits worth knowing
The tool reports numbers in sRGB as your browser shows them. It does not read embedded color profiles, name colors or remove backgrounds. JPEG compression adds small variations, so the same scene saved as JPEG and PNG can differ by a level or two.
Frequently asked questions
Is my image uploaded anywhere?
No. Your image never leaves your device. The pixels are read and averaged by your browser, nothing is uploaded, and no account is needed.
How is the average color calculated?
It is the plain mean of the red, green and blue values of the counted pixels, each rounded half up. For a picture that is half rgb(255, 0, 0) and half rgb(255, 255, 0), the green channel is (0 + 255) / 2 = 127.5, which rounds to 128, so the average is rgb(255, 128, 0).
Which pixels are counted?
Every pixel with an alpha value of 25 or more. Almost fully transparent pixels are left out, so a cut-out logo is averaged over the logo and not over the empty space around it. If nothing in the area counts, the page says the area is transparent and has no average colour.
How do I find the average of part of an image?
Drag a rectangle across the image, or type X, Y, Width and Height in image pixels from the top left corner. Values outside the image are pulled back inside it. Press Use whole image to go back to the whole picture.
What do the brightness and the text advice mean?
Brightness is the luma 0.299 R + 0.587 G + 0.114 B of the average, from 0 to 255, also shown as a percent. The text advice compares black and white against the color with the WCAG contrast ratio and names the one with the higher ratio. A ratio of 4.5 or more meets AA for normal text and 7 or more meets AAA.
Why does the average look like a color that is not in my picture?
An average blends every pixel into one value. Half pure red and half pure blue average to a purple that appears nowhere in the picture. To see the colors a picture is actually made of, use the Color Extractor, which lists the dominant colors with their shares.
Which image formats and sizes work?
PNG, JPEG, GIF, BMP, WebP and AVIF, one image at a time, up to 50 MB. You can choose the file, drop it on the page or paste it. Pictures above 16 million pixels are scaled down so the browser can hold them, and the page says so.