FormatterHQ

Image Average Color Finder

Get one colour that represents an image: the plain average, a gamma-correct average and the dominant colour, each ready to copy as HEX; the plain average is also listed as RGB, HSL, HSV, OKLCH, Lab and CMYK.

Loading tool…
Ready.

How to use the Image Average Color Finder

  1. Upload, drop or paste an image, or click Use sample image.
  2. Compare the three results: Average (sRGB), Average (linear light) and Dominant colour.
  3. Click a value to copy it, or copy all three as CSS variables from the code panel.

Find the average color of an image

A single representative colour is useful in many places: as a placeholder while an image loads, as the background of a card behind a photo, or as a theme colour for a music or video player. This tool computes the average color of an image in two ways and also finds its dominant colour.

Three results, three purposes

  • Average (sRGB): the arithmetic mean of all red, green and blue values. Quick and familiar, but it tends to look darker and muddier than the picture feels.
  • Average (linear light): the pixel values are converted to linear light before averaging and back to sRGB afterwards. This matches what you would see if you blurred the image heavily, so it usually looks more natural.
  • Dominant colour: the largest colour cluster found with k-means. It is an actual colour from the image rather than a blend, which makes it better for accents.

Example

For an image that is half pure red and half pure blue, the sRGB average is #800080 territory — a dark purple — while the linear-light average is a noticeably brighter magenta. Neither colour appears in the picture, which is why the dominant colour is shown as well.

Using it as a placeholder

<img src="photo.jpg" width="1200" height="800"
     style="background:#a87ca8" alt="…">

Setting the average colour as the image background, together with width and height attributes, avoids a white flash and layout shift while the file downloads.

For a full palette instead of one colour, use the image color extractor; to read a single pixel, use the image color picker.

More uses

Streaming and music apps tint their player backgrounds with the average colour of the album art; you can do the same with a gradient from the dominant colour to transparent. Image galleries use it for "blur-up" placeholders, and e-commerce sites use it to pick a matching card background for each product photo. When the average colour is used behind text, check that your text colour still has enough contrast, since averages of busy photos often land in a mid-grey that works poorly with both black and white text. The formats panel gives HEX, RGB, HSL, HSV, OKLCH, Lab and CMYK values for the average.

Getting an average color in code

If you need the same value in a build step or an app, there are quick approximations. In the browser, drawing the image onto a 1 × 1 canvas and reading that single pixel gives a rough average, although the result depends on how the browser scales images down. On the command line, ImageMagick can do the same: magick photo.jpg -resize 1x1 txt:- prints one averaged pixel. Both work on gamma-encoded values, so they match the sRGB average here rather than the linear-light one.

Privacy

Everything happens locally in your browser with JavaScript and the Canvas API. Your images are never uploaded to our servers, so the tool also works with confidential screenshots and personal photos.

Frequently asked questions

Why does the simple average look too dark?
sRGB values are gamma-encoded, so averaging them directly underweights bright colours. The linear-light average corrects for this and looks closer to a blurred version of the image.
Are transparent pixels included?
No. Pixels that are more than half transparent are ignored, so a logo on a transparent background gives the logo colour.
Which result should I use for a loading placeholder?
The linear-light average usually matches the overall impression of the photo best, so it creates the smoothest transition when the image appears.
Does image size affect the result?
The image is scaled to about 320 px on its longest side before analysis. This changes the result only marginally and keeps the tool fast.
Can I get the average color of only part of an image?
The tool analyses the whole image. Crop the area you care about first with the image cropper, for example the sky or a product, and then load the cropped file here.

Last updated October 3, 2026

Related tools

Color Name Finder Find the name of a colour: the closest CSS colour names to any HEX, RGB or HSL value, with a plain-English description. Tailwind CSS Color Finder Find the closest Tailwind CSS colour class to any HEX, RGB or HSL colour and browse the full default palette with one-click copy. JSON Path Finder Click any value in a JSON tree to get its path as JSONPath, JavaScript, Python, PHP, jq or JSON Pointer — or list every path. Image Color Palette Extractor Extract the dominant colours of any photo or screenshot as a palette with percentages, then copy HEX codes or export CSS variables. Image Color Picker Pick exact pixel colours from an uploaded image with a zoom loupe. Get HEX, RGB and HSL values and keep a list of picked colours. Base64 to Image Preview and download images from Base64 strings or data URIs. Detects PNG, JPEG, GIF, WebP, BMP, ICO and SVG. RGB to CMYK Converter Convert RGB colour values to CMYK instantly, with a live colour swatch preview, colour picker and copy buttons. RGB to Colortone Converter Generate the tints, shades and tones of a RGB colour as a palette with swatches and ready-to-copy codes. RGB to HEX Converter Convert RGB colour values to HEX instantly, with a live colour swatch preview, colour picker and copy buttons. RGB to HSL Converter Convert RGB colour values to HSL instantly, with a live colour swatch preview, colour picker and copy buttons. RGB to HSV Converter Convert RGB colour values to HSV instantly, with a live colour swatch preview, colour picker and copy buttons. RGB to RGBA Converter Convert RGB colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons.