Smallest
bit
Nibble (4 bits)
Byte (8 bits)
kibibyte (KiB, 1024 bytes)
mebibyte (MiB, 1024 KiB)
gibibyte (GiB, 1024 MiB)
tebibyte (TiB. 1024 GiB)
pebibyte (PiB, 1024 TiB)
exbibyte (EiB, 1024 PiB)
Largest
Important*
A kibibyte (1024) is not the same as a kilobyte (1000).
Question 1a)
A photograph is 1024 x 1080 pixels
The colour depth is 32 bits
a) What is the file size of this photograph in bytes?
b) How many photos of this size would fit onto a 64GiB memory stick?
Question 2)
An audio CD has a sample rate of 44100 and a sample resolution of 16 bits.
The music being sampled uses two channels to allow for stereo recording.
Calculate the file size of a 60-minute recording in MiB.
23/9/2022
This is necessary as files can become very large, and there are many unnecessary bits that take up storage space. Compression
Saves storage space on hard disks
Reduces the time taken to transmit files to other computers (uses less bandwidth)
Reduces time taken to stream videos or music
Lossless
Compressed file size without permanently losing the data. This is used when the data cannot be deleted or altered, however it is too large to be processed.
RLE Run-length encoding
Reduces files size of repeating data
Encodes into 2 values, the first being the number of repeated values and the second being the value itself
A flag is used to show repeating values
Lossy
Reduces file size by permanently removing data (e.g reducing resolution, colour depth, or sample rate). Lossy compression may remove data outside of human perception. For example, ultrasonic sounds, certain levels of colour depth, or a certain number of pixels. An algorithm decides what data is necessary and what data is not.
Lossy file formats:
JPEG for images
MP3 for audio
MP4 for videos
Answer 1a)
File size in bits:
1024 * 1080 * 32 = 35389440
35389440 / 8 = 4423680 bytes
4423680 / 1024 = 4320 KiB
4320 / 1024 = 4.21875 MiB
Answer 1b)
65536 / 4.22 = 15530 photos
Answer 2)
File size =
Sample rate (in Hz) x sample resolution (in bits) x length of the sample (in seconds) x number of channels
44100 * 16 * 2 = 1411200 bits
1411200 / 8 = 176400 bytes
176400 * 3600 = 635040000 bytes in a 60 minute video
635040000 / 1048576 = 605.6213379 MiB
As this is still a work in progress, feel free to view the roadmap here to check for future updates.
If you have any features you would like to suggest, or notice any issues with the website, please submit an issue on Github.
If you like the work, consider supporting us by following Madelyn’s Github or checking out Valentina’s personal website!