D
D
Deathgar2018-03-22 19:32:45
Java
Deathgar, 2018-03-22 19:32:45

How to decrypt LZW in GIF file?

A task is given in which you need to read a GIF file (not animated) and display it on the screen. The catch is that I need to consider it as an array of bytes. It's easy to count. I figured out (more or less) the GIF structure, it remains to decompress the colors that are compressed with LZW. I found an article on Habré about the structure of gifs ( Here ), but there is only compression, and at the same time I don’t understand how to compare the numbers with the grid with the already compressed data. There are many examples with strings, but they are just letters, and GIFs are 16 bytes.
In general, how to decompress colors, please tell me.
P.s. It is difficult to explain the essence of the misunderstanding, but I hope the essence is clear.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-03-22
@demon416nds

https://ru.wikipedia.org/wiki/Lempel's_algorithm_—_Z...
lzw is easy to google
and it's a separate algorithm,
as well as huffman and other algorithms used in different file formats

A
Artem Spiridonov, 2018-03-22
@customtema

Check out the ready-made solutions on github.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question