0.0.1 • Published 10 years ago

ndarray-bit-gif v0.0.1

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

ndarray-1bit-gif

Creates 1-bit GIF-images from an ndarray of bits

Build Status

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:

The Octocat

0.0.1

10 years ago