Is it possible to do this with html canvas?
With this
for (var i = 0; i < data.length; i += 4) {
var grayscale = data[i]*0.2126 + data[i +1]*0.7152 + data[i +2]*0.0722;
data[i] = grayscale; // red
data[i + 1] = grayscale; // green
data[i + 2] = grayscale; // blue
}
I iterate over all pixel and grayscale them. I know how to convert that into a base64 code but waht if I only want the gray values of the image instead of the whole RGB image?