sobel-es6

0.0.3 • Public • Published

sobel-es6

Sobel Algorithm in ES6. DEMO

NPM

Install

npm install sobel-es6

or just include the JS file: build/sobel.js

Usage

var canvas = document.getElementById('canvas'),
    ctx = canvas.getContext('2d'),
    image = new Image()
 
image.src = "../images/cherry.png"
image.onload = function() {
    var w = canvas.width = image.width,
        h = canvas.height = image.height
 
    ctx.drawImage(image, 0, 0)
    var result = sobel(ctx.getImageData(0, 0, w, h))
    ctx.putImageData(result.imageData(), 0, 0)
}

Contribute

Environment

npm install -g babel

Development

The command below will compile the JS file as long as it is modified.

npm start

build

npm run build

Readme

Keywords

Package Sidebar

Install

npm i sobel-es6

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • jerryzou