Lets say i have:
Img = new Image();
img.src = 'test.png';
Is there a way to check a pixel from that image say x= 10; y = 16; And return its RGBA data back ? Or do you have to create the pixel array to enquire a specific pixel… I’m unsure if the pixel array is created when you setup the image src or not ?
You have to draw it to a
<canvas>first. This will only work if the image is from the same domain (which it is in the example you gave)Then you can call the function on the image: