weighted average color

multipart project 3
part 2 of, I don't know, like 5

Background:
Suppose you have a transparent PNG. Use the pixel data to figure out an appropriate matte color.
I'm going to be taking the average color across all pixels (weighted by alpha). Highlights and shadows will desaturate this average, so increase the saturation afterwards.

Task:
- find average color
- saturate more...