File Sizes & Storage Requirements
An image has a width in pixels and a height in pixels Start by calculating the number of pixels all up 640 x 480= 640 wide 480 high
An image has a width in pixels and a height in pixels Start by calculating the number of pixels all up 640 x 480= 307,200 pixels 640 wide 480 high
Each pixel in the picture represents a colour. When referring to colours we will either say: X colours X-bit colour
X Colours If the image is plain black and white (no grey) then it uses 1 bit to represent each pixel How many bits are needed to represent 16 colours? How many bits are needed to represent 256 colours?
X Colours If the image is plain black and white (no grey) then it uses 1 bit to represent each pixel How many bits are needed to represent 16 colours? 2 4 = 16 4 bits How many bits are needed to represent 256 colours? 2 8 = 256 8 bits
X-bit Colours 16 bit colour 24 bit colour (We are told the number of bits required to produce the colour)
So to calculate the file size we multiply the number of pixels by the number of bits to represent each pixel 640 x 480= 307,200 pixels Using 16 colours = 4 bits 307,200 x 4 = 1, 228, 800 bits
To convert 1, 228, 800 bits to kilobytes… There are 8 bits in a byte: 1, 228, 800 bits / 8 = 153, 600 bytes There are 1024 bytes in a kilobyte 153, 600 bytes / 1024 = 150 kB To convert megabytes, we would divide by 1024 again.
In MB what is the file size of: An image 640 x 480 in 24 bit colour? An image 1280 x 720 using 1024 colours?
In MB what is the file size of: An image 640 x 480 in 24 bit colour? 640 x 480 x 24 = 7, 372, 800 bits 7, 372, 800 bits /8 = 921, 600 bytes 921, 600 bytes /1024 = 900 KB 900KB /1024 = 0.88MB An image 1280 x 720 using 1024 colours? 1280 x 720 x 10 = 9, 216, 000 bits 9, 216, 000 bits /8 = 1, 152, 000 bytes 1, 152, 000 bytes /1024 = 1125 KB 1125 KB /1024 = 1.1MB
To calculate the size of a sound file we multiply the: Time length of the audio clip: 20 second The rate at which it was sampled: 4 kHz (remember that kilo means 1000!!) The audio quality: 8 bit audio 20 seconds x (4KHz x 1000)hertz x 8 bit =
640, 000 bits 640, 000 bits /8 = 80, 000 bytes 80, 000 bytes /1024 = 78.1 KB
In MB what is the file size of: A 60 second audio clip, sampled at 44KHz, using 16 bit audio? A 1.5 minute audio clip, sampled at 96KHz, using 24 bit audio?
In MB what is the file size of: A 60 second audio clip, sampled at 44KHz, using 16 bit audio? 60 x x 16 = 42, 240, 000 bits 42, 240, 000 bits /8 = 5, 280, 000 bytes 5, 280, 000 bytes /1024 = 5, KB 5, KB /1024 = 5 MB A 1.5 minute audio clip, sampled at 96KHz, using 24 bit audio? 90 x x 24 = 207, 360, 000 bits 207, 360, 000 bits /8 = 25, 920, 000 bytes 25, 920, 000 bytes /1024 = 25, KB 25, KB /1024 = 24.7 MB
Practice calculating file sizes by working through Binary Worksheet 2 in One Note. Notes: Yes you can use a calculator BUT you MUST show each step of the calculations to get full marks!!