Is it possible for node js to encode izobrajenia for the Huffman algorithm?

Tell me what actions need to execute this task.
Coding is performed for the bmp image.

As far as I understand, should be these steps:
1. Get the binary representation of the image. It includes a header image and a set of brightness of pixels.
2. Create a binary tree of combinations of bits.
3. Create a table of encoding based on the tree.
4. The recorded table in the image header.
5. Create a bmp image and write down all the above obtained danyew him.

The main question, as with node js to obtain the binary representation of the image? How to handle this data?
There are examples of such tasks?
March 19th 20 at 09:26
1 answer
March 19th 20 at 09:28
Solution
The main question, as with node js to obtain the binary representation of the image? How to handle this data?


Use Buffer for storing and working with binary data. You can file immediately to read, then convert as you like and write back.

Find more questions by tags Node.js