- Why are files compressed before they are sent by email?
- Compression makes a file smaller, so it needs less storage space and less bandwidth to send. The total time taken to transmit it is shorter, although the speed of transmission does not change. Many email accounts also set a maximum size for an attachment, and a smaller file keeps within that limit.
- What is the difference between lossy and lossless compression?
- With lossy compression data is permanently lost, so the original cannot be re-created. With lossless compression no data is lost. Lossy reduces the file size more, so it suits a case where the loss of quality will not be noticed. Lossless suits viewers who do not want any loss of quality.
- How does run-length encoding (RLE) compress a bitmap image?
- RLE is a lossless method. It finds consecutive pixels of the same colour and stores the colour and the number of times it repeats. A run written as 3F2 means three pixels of colour F2. It only helps where the same colour repeats in sequence.
- Why does run-length encoding sometimes make an image file bigger?
- RLE only helps where the same colour repeats in sequence. Each run needs its colour and its count, so an image with few repeats can come out larger than before. For example, red, green, blue becomes red 1, green 1, blue 1. Assuming that RLE always makes the file smaller is a common mistake.
- Why must a text file be compressed with lossless compression?
- All the data in a text file is required, so no data can be lost. If any data is lost by lossy compression, the text file is corrupted and does not make sense. RLE is a lossless method that also works on text, replacing repeated characters with a single copy and a count.
- How can a bitmap image be compressed using a lossy method?
- Reduce the bit depth, so each pixel has fewer bits, reduce the colour palette, or reduce the image resolution, which means fewer pixels per unit measurement. Each one stores less binary, and the lost detail cannot be recovered. A vector graphic stores only instructions, so it does not compress well.