The 20 MB limit means the selected image file must be no larger than 20 MB before its average color can be calculated.
The cap applies to the compressed file you select, not to the amount of memory used after decoding and not to the number of pixels in the image. Passing the file-size check is only the first stage: the decoded dimensions and visible pixel content must also pass separate safeguards.

The file-size check in context
The 20 MB restriction is an input-file ceiling. Files at 20 MB are within the stated maximum, while a file larger than 20 MB is outside the supported range. The selected file must also be nonempty, use a browser-supported image MIME type, and have a supported format: PNG, JPEG, WebP, GIF, BMP, or AVIF.
| Check | Supported limit | What it controls |
|---|---|---|
| Selected file size | No larger than 20 MB | Whether the image passes the initial file-size gate |
| Decoded edge length | No more than 20,000 pixels on either edge | Whether the decoded dimensions pass the safety check |
| Decoded source area | No more than 40 million pixels | Whether the decoded source passes the safety check |
| Analysis canvas | At most 1,048,576 pixels | How many sampled pixels can participate in the average |
File size and pixel count describe different properties. A compressed photograph can contain many pixels while remaining below the 20 MB ceiling, while a strongly compressed image can expand into a large decoded pixel buffer. The decoded-dimension limits reduce the risk that a small compressed file will consume excessive canvas memory.
Consequently, “under 20 MB” does not guarantee that the tool will finish successfully. An image can pass the compressed-file check and then exceed 20,000 pixels on an edge, contain more than 40 million decoded pixels, fail to decode, or contain no visible pixels. The 20 MB value is an input limit, not a promise about decoded memory, image quality, or the final color.
Calculate the average color from a qualifying image
The supported local workflow has three main actions:
- Choose a supported PNG, JPEG, WebP, GIF, BMP, or AVIF image that is no larger than 20 MB in the Image Average Color Finder.
- Wait for local decoding, then review the displayed HEX value, decimal RGB value, alpha coverage, and source and sample dimensions.
- Click the visible HEX value to copy it, then verify the resulting swatch in its intended design context.
The copied value contains a hash followed by exactly six lowercase hexadecimal digits. If browser policy denies clipboard access, the value remains visible and selectable rather than being falsely reported as copied.
All decoding, sampling, averaging, and clipboard actions stay in the current browser tab. Neither the source file nor its sampled pixels are uploaded to Lizely or an image-analysis service, and the source file is not altered or exported.
What the average color actually measures
The result is one alpha-weighted arithmetic RGB average, not a dominant-color cluster. For each sampled pixel with nonzero alpha, the red, green, and blue channel values are multiplied by that pixel’s alpha value. The weighted channel totals are then divided by the total alpha and rounded to the nearest integer from 0 through 255.
- A fully transparent pixel contributes nothing because its stored RGB values are invisible and may contain arbitrary encoder data.
- A partially transparent pixel contributes in proportion to its opacity.
- The arithmetic blend can produce a color that does not appear as an individual pixel in the source.
- A small bright accent can be diluted by a much larger neutral background.
Conceptually, the output channel formula is the sum of each channel multiplied by alpha, divided by the sum of alpha, with rounding applied once at the end.
For one worked illustration, suppose the sample contains an opaque pixel with RGB 200, 0, 0 and an opaque pixel with RGB 0, 0, 100. Both pixels have alpha 1. The weighted totals are red 200, green 0, and blue 100, while total alpha is 2. Dividing each total by 2 produces RGB 100, 0, 50. Since 100 is 0x64 and 50 is 0x32, the resulting HEX is #640032. Real images may be downsampled before this rule is applied.
The displayed alpha coverage is the total sampled alpha divided by the maximum possible alpha across the sample. It describes the transparency of the sampled area; it is not the percentage represented by the average color.
The implementation requests canvas pixels as standard 8-bit RGBA data. MDN’s CanvasRenderingContext2D.getImageData documentation and the HTML canvas pixel-manipulation specification describe that browser interface. The alpha-weighting rule, limits, and sampling method are the tool’s own documented product choices.
Why a valid image can still produce a different HEX
Images at or below 1,048,576 decoded pixels are read at their decoded dimensions. Larger images are scaled proportionally so the analysis canvas remains within the pixel budget. The returned color therefore describes a high-resolution sample rather than a byte-for-byte average of every source pixel. Browser interpolation can also cause a slight difference from an offline full-resolution calculation.
The interface reports both source and sample dimensions so this approximation remains visible. A separate program may use full-resolution pixels, a different downsampling method, gamma-aware or perceptual math, another animation frame, or different color management. These differences can produce another HEX value even when both calculations are operating as designed.
Animated files are evaluated from the frame exposed when the browser finishes its initial image decode. The tool does not average every frame or account for frame duration. Browser color management, orientation handling, and wide-gamut conversion can also vary by format and browser, so the 20 MB limit does not guarantee identical output across every software environment.
Choose the right color method for the job
An arithmetic average is useful for rough background matching, placeholder styling, thumbnail summaries, design inventory, and quick visual comparison. It is not designed to find the most frequent colors, separate a palette into swatches, or isolate a subject from its surroundings. For those tasks, use the Color Palette Generator instead.
Do not treat one average as proof of brand compliance, accessibility contrast, print matching, paint matching, or perceptual similarity. Use the Color Contrast Checker to evaluate a text-and-background pair, and the Color Difference Calculator when you need a defined color-difference metric. The preview swatch uses the calculated HEX directly, but its appearance still depends on the display, browser, surrounding theme, and human color adaptation.
Handle errors and keep the result reproducible
Unsupported data, decode failures, unavailable canvas access, invalid dimensions, and an image with no visible pixels produce a clear error and no stale result. The 20 MB rule is therefore only one part of successful completion; check the format, decoded dimensions, and visible content before relying on a result.
For reproducible design work, record the input file, browser, displayed source dimensions, displayed sample dimensions, and returned HEX value. These details are important because downsampling, browser rendering, orientation, animation handling, and color management can affect the output.
In practice, treat 20 MB as the maximum accepted file size rather than a quality setting. Once a file passes that gate, use the reported sample dimensions and local workflow to understand the result. The limit determines whether the image can enter the averaging process; it does not make the result a dominant color, a perceptual match, a print-ready value, or a contrast-safe choice.
Related reading: Best Way to Apply Average Color From an Image.
Related reading: What Result to Expect When Using Average Color From Image.