How do you convert a color image to black/white using only Javascript?
AND, also make it cross compatible in most browsers because I hear Internet E
i think this code will run perfect with you no need to nested loops or any additional libraries
var image = document.getElementById("image");
var canvas=document.createElement("canvas");
var ctx=canvas.getContext("2d");
canvas.width= image.width;
canvas.height= image.height;
ctx.drawImage(image,0,0);
var imageData=ctx.getImageData(0,0, image.width, image.height);
for (var i=0;i