There are hundreds of tutorials on the web about using HTML Canvas imageData , which receives canvas RGBA values. Search the canvas canvas image and you will find a lot of information.
All you have to do is:
ctx.drawImage(img, 0, 0); var imgData = ctx.getImageData(x, y, width, height).data;
imgData is now an array where every 4 places are pixels. So, [0][1][2][3]
is the [r][g][b][a]
first pixel.
source share