function applyBlur(imageData, width, height, radius) { const kernelSize = radius * 2 + 1; const kernel = new Array(kernelSize).fill(1 / kernelSize); // Simple horizontal + vertical blur (box blur) const tempData = new Uint8ClampedArray(imageData);
If you meant in a general app — here's a simple example in JavaScript (Canvas) : blurrr app codes
for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { let r = 0, g = 0, b = 0; let count = 0; x++) { let r = 0