• 0

LZW Compression


Question

Does anyone know where I can get some C# code that handles LZW compression / Decompression, as I need to use compression in a uni project for compressing files to pass between a client and server app that i need to write.

I don't need to write the compression algorithm myself I just need to use it, i've been searching on the net for it but i've only found things to do with GIF's which i know use that compression method.

Any help is much appriecated :)

Thankyou in advance.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

You should be able to find some code. Look for libgif. It's a GPL gif library. If you can't find any, it's probably because the LZW compression was patented by Unisys.

Why don't you just write your own LZW compression/decomression routine. The LZW is probably the easiest compression algorithm out there appart from RLE. I you want, I can provide a document that outlines the technique very well.

Link to comment
Share on other sites

  • 0

Take a look at SharpZipLib: http://www.icsharpcode.net/OpenSource/Shar...ib/Default.aspx

#ziplib (SharpZipLib, formerly NZipLib) is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language).

Link to comment
Share on other sites

  • 0

actually my assignment specifies Lempel Ziv compression, which is silly as it doesn't work correctly hence the use of LZW, but i'll continue to look about, but if not i'll write it myself :wacko: so MrA if you have a url for that document it might come in handy :)

Link to comment
Share on other sites

  • 0

It's not a URL, but a document that I have on my computer. I have three documents related to GIF. One of them details the LZW algorithm. I've included the doc below. Just look at the top part of the file which is the algorithm. You may or may not find it easy to read. It took me a couple of reads to fully understand it. But, after reading it, I feel like I have a very good understanding of the algorithm.

Oh, and I recommend looking into what figgy and SoftContest suggested. It would be easier to simply use a premade package than writing your own code. If your assignments just says Lempel Ziv, then you could use use #ziplib since the zip (deflate) algorithm uses LZ77 which is an Lempel Ziv one. But keep in mind, zip uses LZ77 AND Huffman encoding, not just plain LZ77.

GIF.TXT

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.