| Run-length Encoding |
Shopping Encoding |
Website Links For Encoding |
Information AboutRun-length Encoding |
| CATEGORIES ABOUT RUN-LENGTH ENCODING | |
| lossless compression algorithms | |
| information theory | |
| coding theory | |
|
For example, consider a screen containing plain black text on a solid white background. There will be many long runs of white Pixel s 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: : WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWWIf we apply the run-length encoding (RLE) data compression algorithm to the above hypothetical scan line, we get the following: : 12WB12W3B24WB14WInterpret this as twelve W's, one B, twelve W's, three B's, etc. The run-length code represents the original 67 characters in only 16. 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). Common formats for run-length encoded data include PackBits , PCX and ILBM . 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 that have long sequential runs of bytes (such as lower-quality Sound Samples ) can be RLE compressed after applying a predictive filter such as Delta Encoding . SEE ALSO
EXTERNAL LINKS |
|
|