0.0.3 • Published 10 years ago

sobel-es6 v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

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
0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago