Lably
Skip to content

Run-length encoding

Form of lossless data compression

  • 6 min read
  • 4 chapters

Related on Lably

Through Patent, Icon (computing) and Online service provider

Run-length encoding is most efficient on data that contains many such runs, for example, simple graphic images such as icons, line drawings, games, and animations. For files that do not have many runs, encoding them with RLE could increase the file size.

RLE may also refer to particular image formats that use the encoding. RLE is an early graphics file format supported by CompuServe for compressing black and white images, that was widely supplanted by their later Graphics Interchange Format (GIF). It is also the name of a little-used image format in Windows 3.x that is saved with the file extension rle, consisting of a run-length encoded bitmap; it was used as the format for the Windows 3.x startup screen.

History and applications

Run-length encoding (RLE) schemes were employed in the transmission of analog television signals as far back as 1967. In 1983, run-length encoding was patented by Hitachi. RLE is particularly well suited to palette-based bitmap images (which use relatively few colors) such as computer icons, and was a popular image compression method on early online services such as CompuServe before the advent of more sophisticated formats such as GIF. It does not work well on continuous-tone images (which use very many colors) such as photographs, although JPEG uses it on the coefficients that remain after transforming and quantizing image blocks.

Common formats for run-length encoded data include Truevision TGA, PackBits (by Apple, used in MacPaint), PCX and ILBM. The International Telecommunication Union also describes a standard to encode run-length color for fax machines, known as T.45. That fax color coding standard, which along with other techniques is incorporated into Modified Huffman coding, is relatively efficient because most faxed documents are primarily white space, with occasional interruptions of black.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication