image-blur-gaussian
v0.0.115
Published
very fast gaussian image blur functions originally by Ivan Kutskir and Wojciech Jarosz
Downloads
6
Readme
image-blur-gaussian
very fast gaussian image blur functions originally by Ivan Kutskir and Wojciech Jarosz.
works with [r,g,b,a ... ]
data array.
for best results, use images with power-of-2 dimensions.
Installation
npm i image-blur-gaussian
Usage
Here we load pixel data from a PNG file, blur it, then save the result.
See results below.
var blur = require('image-blur-gaussian');
var img = require('image-sync').read('./cat.png'); //{width, height, data, saveAs}
//img.data has format [r,g,b,a, r,g,b,a ... ]
//blur the image
var radius = 16;
img.data = blur.blurImage(img.data,img.height,img.width,radius);
//save the result
img.saveAs(`./output.png`);
original
blurred 4 pixels
blurred 8 pixels
blurred 16 pixels
See Also
- image-dilate - dilate image pixels by color
- image-sync - synchronous image reader/writer