Run Length Encoding (RLE)
A type of lossless compression is run length encoding. Instead of the image being recorded in many 0’s and 1’s it is compressed so that it instead records the number of how many zeros and how many ones there are to take up less space.
Once something is compressed using RLE it can be restored because RLE is like a set of instructions that you can use to get the original coding.Run Length Encoding is needed because once the item is compressed the quality of the item may be significantly reduced. Run Length Encoding saves space for storing digital images and is done by reducing the amount of space that the 0’s and 1’s that make up the image, audio, or file take up. So, for an example a plain black and white image where 0 means white and 1 means black. Each pixel is represented by either a 0 or a 1. If the first small bit of the image is 0110011101010001 this would become 1,2,2,3,1,1,1,1,3,1. Instead of reading the 0’s and 1’s individually we change it to one 0 or two 1’s.
You always start this with a white pixel at the beginning but if the image does begin with a black pixel you just begin with a 0, so what we wrote before would become 0,1,2,2,3,1,1,1,1,3,1. This makes the coding easy for the computer to change back to how it was originally coded therefore replacing its original quality.
As you can see the original number of bits is 225 but is then reduced to 123 due to the use of RLE.