Nascent Personality Manifestation
Wondering what’s next for npm?Check out our public roadmap! »

ctx-blur

1.0.2 • Public • Published

ctx-blur

Applies a blur filter to a canvas

Build Status js-standard-style npm version Coverage Status

Usage

var transform = cBlur(options)

  • options (object) - Options for blurring:

    • radius {number} - guassian blur radius
  • returns (function) transform - A function that accepts a canvas and returns it blurred

Examples

javascript (browser)

const cBlur = require('ctx-blur')
 
var canvas = document.getElementById('aCanvas')
 
cBlur({ sigma: 2, radius: 2 })(canvas, function (err, newCanvas) {
  ...
})

Node.js

const cBlur = require('ctx-blur')
 
var Canvas = require('canvas')
var canvas = new Canvas()
 
cIdentity({ sigma: 2, radius: 2 })(canvas, function (err, newCanvas) {
  ...
})

Install

npm i ctx-blur

DownloadsWeekly Downloads

5

Version

1.0.2

License

ISC

Last publish

Collaborators

  • avatar