1.1.6 • Published 4 years ago

npmisgood-ansi-image v1.1.6

Weekly downloads
-
License
CC-BY-ND-4.0
Repository
-
Last release
4 years ago

ATIF, Ansi Two hundred-fifty-six colors Image Format (ANSI-IMAGE)

256 colors image for console.

Usage

Load image:

var ai = require("npmisgood-ansi-image");
var fs = require("fs");
ai(fs.readFileSync("image.atif"),(d)=>console.log(d));

Generate image:

var tmp = new ai.template(10/*width*/,10/*height*/);
tmp.plot(0/*x*/,0/*y*/,1/*number for color of palette*/); //x/y starts at 0
tmp.palette.push(0);
tmp.palette.push(0xFF); //0 is for black, 0xFF(255) is for white
tmp.out2file("image.atif");

Format

Line 1: Symbol for ATIF(7F 41 49)

Line 2~4: Header

  • Line 2: Number for how long is palette, it is often 1
  • Line 3~: Palette
  • Line 3+n~: Number for how long is art

Line 4+n~: Art

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago