Skip to content

Image Colour Analyser

Find an image’s average colour and its most-used colours, with hex codes.

Analysed in your browser — the image is never uploaded.

How do you calculate the average colour of an image?

Convert each pixel from sRGB to linear light, average the channels, then convert back. Averaging gamma-encoded sRGB values directly biases the result dark — half black and half white averages to about #bcbcbc perceptually, not the #808080 a naive average gives.

Understanding your result

Averaging gamma-encoded sRGB values directly is one of the most widespread bugs in colour code, and the black-and-white case shows why: the naive average of 0 and 255 is 128, but perceptually the correct midpoint is closer to 188, because sRGB values are not proportional to light intensity. Converting to linear light first, averaging, then converting back gives the result your eye expects. The dominant-colour list is usually more useful than the average for design work: a photograph averages towards mud, whereas its dominant families tell you what the image actually looks like.

Formula and method

Each pixel is converted from sRGB to linear light, averaged, then converted back. Dominant colours are found by bucketing pixels into a coarse colour grid, counting each bucket, and reporting the mean colour of the largest buckets.

Assumptions and limitations

Large images are downscaled before sampling, which is ample for colour statistics but means very small isolated details may not appear in the results. Dominant colours are grouped into coarse families, so two similar shades are reported as one — helpful for a photograph, less so if you need an exact pixel value, in which case use a colour picker. The average of a colourful image is often a muddy brown, which is mathematically correct but rarely useful as a design choice.

Worked example

An image that is half pure black and half pure white averages to roughly #bcbcbc in linear light, not the #808080 a naive average would give — a visibly different and more accurate result.

How to use this tool

  1. Choose your image.
  2. Set how many dominant colours to show.
  3. Copy the hex codes you need.
  4. Use the light/dark text hint when placing text over the colour.

Common mistakes to avoid

  • Averaging sRGB values directly, which biases the result dark.
  • Using the average of a colourful photo as a design colour — it is usually muddy.
  • Forgetting that transparent areas are excluded from the calculation.
  • Expecting exact pixel values from the dominant-colour grouping.

About the Image Colour Analyser

This tool reports an image’s overall average colour and ranks its most-used colours by share. The average is computed in linear light rather than directly on sRGB values, which is what makes it match what your eye actually perceives.

Who should use this tool

Designers building a palette from a photo, developers picking a placeholder background, and anyone matching a colour scheme to an image.

Benefits

  • Gamma-correct average, shown alongside the naive figure for comparison.
  • Dominant colours grouped into families rather than exact pixel values.
  • Tells you whether light or dark text works on the average colour.
  • Ignores transparent pixels, so logos analyse correctly.

Practical use cases

  • Choosing a background colour that matches a hero image.
  • Generating a low-quality colour placeholder while an image loads.
  • Building a brand palette from a photograph.
  • Checking which colours dominate a design.

Explore all Image Tools tools

Frequently asked questions

Why do you show two different averages?

The gamma-correct one matches what your eye perceives; the naive sRGB one is what most simple code produces. Showing both makes the difference visible — it is often substantial.

What is the difference between average and dominant colour?

The average blends every pixel into one colour. Dominant colours are the ones that actually appear most often, which usually describes the image far better.

Why is the average of my colourful photo brown?

Because mixing many different hues tends towards a neutral mid-tone. That is correct, but it is why the dominant-colour list is more useful for design work.

Are transparent pixels included?

No. Pixels that are almost entirely transparent are skipped, so a logo on a transparent background analyses its actual colours rather than being washed out.

Is the image uploaded?

No. It is drawn to a canvas in your browser and the pixels are read locally, so nothing is transmitted.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: