Compress is a fast, simple LZW file compressor. Compress does not have the highest compression rate, but it is one of the fastest programs to compress data. Compress is the defacto standard in the UNIX community for compressing files.
The ncompress code is, and will continue to be, released into the public domain as the original authors intended.
Also note that all existing patents on the LZW algorithm have expired world-wide.
The master branch is tracking the 5.x release series.
We will always support the output of older compress versions (including the compress-2.0 format), and we will never produce files that compress-3.0 is unable to process.
The ncompress-4.2.4 branch was used to track a series of bugfix releases. It is no longer used. See the history section below for more details.
The latest downloads can be found here: https://github.com/vapier/ncompress/releases
Our goal is to remain portable and to rely on the compiler for low level
optimization. In other words, improved algorithms will be considered, but not
compiler-specific tricks or (ab)use of keywords like
If those requirements are too new for your system, older releases of compress are always available for download.
Please use the issue tracker to contact us for bugs, questions, etc…
Current primary maintainer: Mike Frysinger
You can find plenty of info on the LZW algorithm (just use Google), but for fun, here’s some helpful links.
- LZW Wikipedia Entry
- LZW Data Compression by Mark Nelson
- LZW Encoding Discussion and Implementation by Michael Dipperstein
- LZW NIST Reference Page
The compress/ncompress project has a long history, even by computing standards. The interwoven patent history hindered its development significantly.
NB: The history here has been reconstructed by people not directly involved at the time. Any errors/omissions are not intentional, so please feel free to send updates/fixes.
NB: A lot of effort has been made to track down public releases. However, as can be seen below, and from the inline RCS history in the compress file itself, there are many commits that don’t have public information. The actual RCS file appears to have never been published. If people have access to missing pieces, please feel free to pass them along.
NB: Due to the nature of early software sharing & development (i.e. long before VCS was common practice, or code sharing sites like GitHub existed, and many non-standardized architectures & operating systems were in use), many forks of the compress code were developed & posted, but eventually died out. The history below will only focus on the canonical C implementation and its lineage that has been widely integrated into other projects.
- 10 Aug 1981: U.S. Patent 4,464,650 filed for LZ78.
- 20 Jun 1983: U.S. Patent 4,558,302 filed for LZW.
- June 1984: A Technique for High Performance Data Compression published by Terry A. Welch (the “W” in “LZW”) in IEEE Computer Vol 17, No 6. No mention of the pending patent is made in the article.
- 05 Jul 1984: Spencer W. Thomas makes first release of compress (v1.4) on net.sources. It implements the LZW algorithm described in the IEEE paper, unaware of the pending patent coverage.
- 05 Aug 1984: Joseph M. Orost releases a portable update (v1.6) on net.sources.
- 07 Aug 1984: U.S. Patent 4,464,650 granted for LZ78. It isn’t directly related to LZW, so doesn’t impact work.
- 30 Aug 1984: Joseph M. Orost releases an update (v2.0) on net.sources. This version gets integrated into other projects (like early news software).
- 03 Jan 1985: Joseph M. Orost releases v3.0 on mod.sources. It breaks backwards compatibility with earlier versions with compressed outputs.
- 01 Aug 1985: Joseph M. Orost releases v4.0 on mod.sources. This ends up as the last official release and the foundation of all future forks. Many projects integrate this version directly.
- Sep 1985: compress v4.0 is merged into BSD (after the 4.2BSD release, but before 4.3BSD is released).
- 10 Dec 1985: U.S. Patent 4,558,302 granted for LZW. People notice and work is effectively halted.
- Jun 1986: 4.3BSD is released. All future BSD releases/projects derive from this lineage which means they’re all based on compress v4.0. This includes modern day FreeBSD & NetBSD (which forked from 386BSD which forked from 4.3BSD), and all their derivatives like OpenBSD & Darwin.
- 07 May 1987: Chip Salzenberg releases unofficial v4.1. Unclear where it was announced, but some people seem to have picked it up.
- 04 Jun 1987: Chip Salzenberg releases unofficial v4.2 somewhere.
- 18 Jan 1990: Donald Gloistein releases unofficial v4.3. It was supposed to have been published on comp.sources.misc, but instead is distributed via random sites. Many changes are made here, but this fork eventually dies out. It has no relation to Chip’s work, just happens to have a larger version number. A copy of this can be found here (look for “compress.tar” in the image).
- 25 Jun 1991: Dave Mack releases unofficial v4.1 on comp.sources.misc. People are quickly confused by two different releases of “compress 4.1”, both based on v4.0, and without including the other’s changes. Nothing is done about the confusion.
- 29 Jun 1991: Dave Mack releases unofficial v4.1 patch1 on comp.sources.misc.
- 06 Apr 1992: Peter Jannesen submits ncompress v4.2.1 for review. He bases it on Dave Mack’s v4.1p1, but renames the project to “(n)compress” to avoid further confusion with pre-existing unofficial compress v4.2 releases. This version is not made public.
- 23 Jun 1992: Peter Jannesen submits ncompress v4.2.2 for review. This version is not made public.
- 28 Aug 1992: Peter Jannesen releases v4.2.3 on comp.sources.reviewed.
- 05 Oct 1992: Peter Jannesen releases v4.2.4 (as a patch to v4.2.3) on comp.sources.reviewed.
- 31 Oct 1992: GNU gzip is released using code from ncompress v4.2.4.
- 10 Aug 2001: U.S. Patent 4,464,650 for LZ78 expires in the US.
- 20 Jun 2003: U.S. Patent 4,558,302 for LZW expires in the US.
- Jun/Jul 2004: The counterpart patents for LZW expire in other countries. Finally the code is patent-free world-wide.
- 28 Sep 2006: Mike Frysinger starts ncompress maintenance project on sourceforge.net. It is based on the v4.2.4 release and aims to unify patches distros have been carrying for years. A public VCS repository using Subversion is used for development.
- 29 Sep 2006: Mike Frysinger releases v18.104.22.168.
- 07 Sep 2007: Mike Frysinger releases v22.214.171.124.
- 29 Jan 2010: VCS is migrated to Git.
- 29 Jan 2010: Mike Frysinger releases v126.96.36.199.
- 09 Sep 2010: Mike Frysinger releases v188.8.131.52.
- 24 Jun 2015: Mike Frysinger moves hosting to GitHub.
- 04 Jan 2019: Mike Frysinger releases v184.108.40.206.
- 30 Dec 2019: Mike Frysinger releases v220.127.116.11.
- 05 Jan 2020: Mike Frysinger switches to v5.0 series.