这是测试https://jsfiddle.net/mgevlich/fqxbntyj/22/
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
var pix = ctx.getImageData(0, 0, img.width, img.height).data;
var ind = (y * img.width + x) << 2;
return [pix[ind], pix[ind + 1], pix[ind + 2], pix[ind + 3]];
如果触摸绿色区域,则会在FF的R通道中找到1,但没有1值,只有绿色!它仅在FF中发生。有人猜出这张图片有什么问题吗?)) 预先感谢!