Why is the average color of my photo an ugly brown?
Because averaging opposing hues cancels them. A photo with blue sky and orange sand averages to something near grey-brown, which is mathematically correct and visually useless. The average color is the right tool for a placeholder tint or a dominant-color background blur. For a color you want to design with, use the dominant palette.
What is the average color actually good for?
Low-quality image placeholders, the tinted backdrop behind a poster or album art, deciding whether an overlay's text should be light or dark, and picking a theme-color for a page. In every one of those cases you want one number that summarises the whole frame, which is exactly what a mean gives you.
Does downscaling to 240px change the answer?
Barely. The browser's own downscale is itself an average of the pixels it merges, so the mean of the thumbnail is very close to the mean of the original. What it does change is speed: reading 57,600 pixels instead of 12 million.
How is the dominant palette different from the average?
The average is one number: the arithmetic mean of every visible pixel. The palette groups pixels into color buckets and reports the six most populated, with the percentage of the image each covers. A photo of a red apple on a white table has a pinkish average, but the palette correctly shows you white and red.
Does my image get uploaded?
No. The file is drawn onto a canvas in the page and read back with getImageData. Nothing is sent to any server, which means you can safely drop in client artwork or an unreleased screenshot.
Why do the palette percentages not add up to 100?
They are the six largest buckets, not all of them. A photograph can easily spread across hundreds of buckets, so the six biggest may account for well under half the image. A flat graphic or a logo, by contrast, usually accounts for nearly all of it in six.