0.1.2 • Published 2 years ago

rle-data v0.1.2

Weekly downloads
61
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago