
Product
Introducing Immutable Scans
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.
Canvas convolution filter.

Return a new convolution Filter with the given matrix.
Change the factor to n, defaults to 1.
Change the bias to n, defaults to 0.
Canvas width.
Canvas height.
Apply the convolution filter to the input ImageData, populating
the result ImageData. This is a lower-level method, you most
likely want to apply to the entire canvas, in which case use below:
Apply the convolution filter to the entire canvas
and immediately draw the results.
var convolve = require('convolve');
var canvas = document.querySelector('canvas');
var ctx = canvas.getContext('2d');
var img = new Image;
img.onload = draw;
img.src = 'maru.jpg';
var sharpen = [
[-1, -1, -1],
[-1, 9, -1],
[-1, -1, -1]
];
var blur = [
[0, .2, 0],
[.2, .2, .2],
[0, .2, 0],
];
// factor 1 / 7
var motionBlur = [
[1, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 1, 0],
[0, 0, 0, 0, 0, 0, 1]
];
var edges = [
[0, -1, 0],
[-1, 4, -1],
[0, -1, 0]
];
function draw() {
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0);
convolve(motionBlur)
.factor(1 / 7)
.canvas(canvas);
}
MIT
FAQs
Canvas convolution filters
The npm package convolve receives a total of 39 weekly downloads. As such, convolve popularity was classified as not popular.
We found that convolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.