So I have my canvas and I take some image data from it like so:
// assume canvas already has an image on it
var data = ctx.getImageData(0, 0, 20, 20);
now in the data I have a lot of nonsense of which I have no idea what any of it really is because I have an array of 1600 items? Not sure what that's all about..
I want to get the average RGB value for the entire 20x20 block. How would I even go about getting that from the image data?