Run-Length Encoding
Run-Length Encoding (RLE) is a simple data compression technique that reduces the size of data by replacing sequences of repeated characters with a single character followed by the count of its repetitions. For example, the string "AAAABBBCCDAA" would be encoded as "4A3B2C1D2A". This method is particularly effective for data with many consecutive repeated elements.
RLE is commonly used in image compression formats like TIFF and BMP, where large areas of the same color can be compressed efficiently. However, it is less effective for data with high variability, as it may even increase the size in such cases.