Get the latest tech news
LZW and GIF explained
s a way of compressing data that takes advantage of repetition of strings in the data. Since raster data usually contains a lot of this repetition, LZW is a good way of compressing and decompressing it.
I hope this little document will help enlighten those of you out there who want to know more about the Lempel-Ziv Welch (LZW) compression algorithm, and, specifically, the implementation that GIF uses. In part of the header of a GIF file, there is a field, in the Raster Data stream, called "code size". The packaging of codes into a bitsream for the raster data is also a potential stumbling block for the novice encoder or decoder.
Or read this on Hacker News