Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
blur(radius) {
const imageData = this.context.getImageData(0, 0, this.canvas.width, this.canvas.height);
const blurred = StackBlur.imageDataRGB(imageData, 0, 0, this.canvas.width, this.canvas.height, radius);
this.context.putImageData(blurred, 0, 0);
}
function blurImage(imageData, blurAmount, width, height) {
StackBlur.imageDataRGB(
imageData,
0,
0,
width,
height,
Math.floor(blurAmount)
);
}