butter.js

0.1.0 • Public • Published

Butter.js

pixel sorting for canvas

general idea

Take a canvas. Define a filter for which pixels get sorted and which don't. Rows and columns of pixels that pass that filter will be sorted based on their color value.

basic use

var canvas = document.getElementById('my-canvas');
var butter = new Butter();
butter.sort(canvas);

For convenience, you can sort multiple times in quick succession

butter.sort(canvas, 3);

By default, the mode is set to black, but you could also set it to bright or white.

var butter = new Butter({mode: 'bright'});

You can also change the threshold for the current mode using butter.setThreshold(newThreshold)

development

$ npm install
$ gulp

Dependents (0)

Package Sidebar

Install

npm i butter.js

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • brandly