0.1.0 • Published 10 years ago
butter.js v0.1.0
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
0.1.0
10 years ago