Hello, I have a script that identifies transparent and non-transparent pixels. Currently, the result is displayed from a 100px by 100px rectangle on mouseover:
var data = ctx.getImageData(100,100, canvas.width, canvas.height).data;
During mouseover, it shows results for both opaque and transparent areas.
I want to visualize this rectangle upon loading with a grid overlaying the image. Opaque areas will be green and transparent areas red. Do I need an onload function for this? How should it be implemented?
I am currently stuck and seeking guidance in the right direction.
Check out my progress here: