ndarray-bit-gif
v0.0.1
Published
Creates 1-bit GIF-images from an ndarray of bits
Downloads
4
Readme
ndarray-1bit-gif
Creates 1-bit GIF-images from an ndarray of bits
Usage
var bitgif = require('ndarray-1bit-gif');
bitgif(ndarray[, options = {}]); // Returns a stream
options
currently has one option:
invert
(boolean) - Inverts the colors
Example
var bitgif = require('ndarray-1bit-gif');
var ndbits = require('ndarray-bit');
var input = [
3758618655,
2481045507,
670087161,
4293984240,
4293984240,
2281244664,
3221455841,
4162838535,
0
];
var octocat = ndbits([16, 16]);
octocat.data.bits.set(input);
var file = require('fs').createWriteStream('octocat.gif');
bitgif(octocat).pipe(file);
Writes something beautiful to octocat.gif
, like this: