I need to load a png file from my computer and loop through each pixel value. I tried canvas, but it breaks with the cross-domain stuff I dont understand...
var img = new Image();
img.src = "map.png";
var canvas = document.getElementById("secondaryCanvas");
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, 30, 30);
console.log(ctx.getImageData(0,0,1,1));
...Sometimes it works, sometimes it doesnt?... Im absolutely lost