Skip to content

Instantly share code, notes, and snippets.

View alippai's full-sized avatar

Ádám Lippai alippai

View GitHub Profile
const frame = ctx2.getImageData(data.left, data.top, data.width, data.height);
M00 = 0;
M10 = 0;
M01 = 0;
for (var i = 0; i < frame.data.length / 4; i++) {
const r = frame.data[i * 4];
const g = frame.data[i * 4 + 1];
const b = frame.data[i * 4 + 2];
const intensity = 0.2989*r + 0.5870*g + 0.1140*b;
const x = i % data.width;