I have a canvas and an image on it and I am trying to apply a blur effect on it.I know the form of the convolution matrix for blurring, but I do not know how to make the mathematical operations with it and with the pixels. Could someone help, please?
convM=[1/9, 1/9, 1/9,1/9, 1/9, 1/9,1/9, 1/9, 1/9];
var imgE = ctx.getImageData(0,0,300,200);
var pix = imgE.data;
for (var i = 0;i < pix.length; i += 4) {
//for each color channel
}
imgE.data=pix;
ctx.putImageData(imgE, 0,0);