A tiny (150 bytes) binary run-length encoding (RLE) packer/unpacker
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.
[0, 0, 0, 0, 0, 1, 1, 0, 0];[5, 0, 2, 1, 2, 0];[4, 0, 4, 1, 3, 0];[0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0];npm i rle-datalet rle = require("rle-data");
rle.encode([0, 0, 0, 0, 0, 1, 1, 0, 0]);
rle.decode([4, 0, 4, 1, 3, 0]);- Add other formats to compression
- Use smart data compression
- R&D best practices of RLE