I'm trying to send a 2D array of RGB values to PHP from the array of values from the getImageData().data method:
for (var i=0;i<imgData.data.length;i+=4){
// If you want to know the values of the pixel
var r = imgData.data[i + 0];
var g = imgData.data[i + 1];
var b = imgData.data[i + 2];
var a = imgData.data[i + 3];
//[...] do what you want with these values
}
From this, how would I create a 2D array of RGB values of an entire canvas?