Science Fair Project Encyclopedia
PackBits
PackBits is a fast, simple compression scheme for run-length encoding of data.
Apple introduced the PackBits format with the release of MacPaint on the Macintosh computer. This compression scheme is one of the types of compression that can be used in TIFF-files.
A PackBits data stream consists of packets of one byte of header followed by data. The header is a signed byte; the data can be signed, unsigned, or packed (such as MacPaint pixels).
| Header byte | Data |
|---|---|
| 0 to 127 | 1 + n literal bytes of data |
| 0 to -127 | One byte of data, repeated 1 - n times in the decompressed output |
| -128 | No operation |
Note that interpreting 0 as positive or negative makes no difference in the output. Runs of two bytes adjacent to non-runs are typically written as literal data.
External links
Apple webpage describing the PackBits format
Last updated: 10-24-2005 09:45:04
09-23-2007 01:00:40
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


