run length encoding (RLE)
Run Length Encoding (RLE) or Run Length Coding(RLC) is a lossless compression where the encoded digits, characters or letters have a different number of bits. Since the length of the encoded characters is different, the encoding is called run length encoding.
In run-length encoding, a sequence of identical digits, characters or letters is replaced by a single symbol and an indication of the number of identical symbols. In this context, one speaks of a run, which is a sequence of identical characters, and the length of the respective sequence, which is stored in a run counter. Run length coding eliminates redundancies in the form of repetitions and is particularly suitable for graphics and image files with few colors and large color areas. The more detailed the color image, the less suitable it is for RLE encoding. Incomputer graphics, the RLE process is used for memory-intensive raster graphics and is most efficient when dealing with simple graphics with few colors and large color areas. To increase the efficiency of the process, the algorithm can perform path optimization by choosing the most effective path, which can be line-sequential, zig-zag, or meander.
For example, Run Length Encoding replaces the number sequence aaaaaa with 2 bytes: one byte for the letter "a", the other for the number 6. If the letters, digits and characters are in binary form, Run Length Encoding can work even more efficiently.
Run length coding is characterized by its simplicity and speed. In compression, the same values are read in until the value changes. value and the number of equal values is recorded. In decompression, only the value is read and the corresponding number of bytes is output.
Run-length encoding is used with various graphics file formats such as Tagged Image File Format( TIFF), bitmap and TGA file formats, and also with fax transmissions. Another variable length method is Variable Length Coding( VLC).