0.1.2 • Published 10 months ago

rle-data v0.1.2

Weekly downloads
61
License
MIT
Repository
github
Last release
10 months ago

Run-length encoding

A tiny (150 bytes) binary run-length encoding (RLE) packer/unpacker

CircleCI codecov GitHub

The article about Run Length Algorithm is here. My usecase of rle-data is create binary matrix for image segmentation (Canvas) to reduce data size.

Encoding format

Incoming data

[0, 0, 0, 0, 0, 1, 1, 0, 0];

Outgoing data

[5, 0, 2, 1, 2, 0];

Decoding format

Incoming data

[4, 0, 4, 1, 3, 0];

Outgoing data

[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0];

Installation

npm i rle-data

API

let rle = require("rle-data");

rle.encode([0, 0, 0, 0, 0, 1, 1, 0, 0]);
rle.decode([4, 0, 4, 1, 3, 0]);

Roadmap

  • Add other formats to compression
  • Use smart data compression
  • R&D best practices of RLE
0.1.2

10 months ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago