Data storage and compression (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

An image file is stored in a format that uses 24 bits to represent each pixel. The image is 300 pixels wide and 200 pixels high. Calculate the approximate file size of the image in kilobytes (KB), assuming each colour component is stored using 1 byte.

2.

Consider a file containing a series of numbers: 2, 4, 8, 16, 32, 64. Calculate the compression ratio if the file is compressed using a method that represents the numbers as follows: "2 4 8 16 32 64; 2; 2; 2; 2; 2". Explain why this compression method achieves a higher compression ratio than simply storing the original numbers.

3.

Describe how a run-length encoding (RLE) algorithm works. Provide an example of a file type where RLE is commonly used and explain why it is effective for that type of data.