For example, consider a screen containing plain black text on a solid white background. There will be many long runs of white pixels in the blank space, and many short runs of black pixels within the text. Let us take a hypothetical single scan line, with B representing a black pixel and W representing white:
If we apply the run-length encoding (RLE) data compression algorithm to the above hypothetical scan line, we get the following:
Interpret this as twelve W's, one B, twelve W's, three B's, etc.
The encoding data is quite longer.
The run-length code represents the original 67 characters in only 18. Of course, the actual format used for the storage of images is generally binary rather than ASCII characters like this, but the principle remains the same. Even binary data files can be compressed with this method; file format specifications often dictate repeated bytes in files as padding space. However, newer compression methods such as DEFLATE often use LZ77-based algorithms, a generalization of run-length encoding that can take advantage of runs of strings of characters (such as BWWBWWBWWBWW).
Run-length encoding performs lossless data compression and is well suited to palette-based iconic images. It does not work well at all on continuous-tone images such as photographs, although JPEG uses it quite effectively on the coefficients that remain after transforming and quantizing image blocks.
Run-length encoding is used in fax machines (combined with other techniques into Modified Huffman coding). It is relatively efficient because most faxed documents are mostly white space, with occasional interruptions of black.
Data compression: making something out of nothing. (What's the Code?) (run-length encoding, Huffman coding, Ziv-Lempel compression) (Technical) (Tutorial)
Dec 01, 1993; This month, we're going to explore one of my favorite subjects and a much-requested topic: data compression. In essence, the...
US Patent Issued to Thomson Licensing on April 19 for "Method for Run-Length Encoding of a Bitmap Data Stream" (German Inventors)
Apr 21, 2011; ALEXANDRIA, Va., April 21 -- United States Patent no. 7,929,792, issued on April 19, was assigned to Thomson Licensing...
US Patent Issued to Thomson Licensing on March 22 for "Method for Run-Length Encoding of a Bitmap Data Stream" (German Inventors)
Mar 23, 2011; ALEXANDRIA, Va., March 23 -- United States Patent no. 7,912,305, issued on March 22, was assigned to Thomson Licensing...