Binary 4 File Sizes Calculating File Size Images

Binary 4 File Sizes

Calculating File Size: Images �An image has a width in pixels and a height in pixels �Start by calculating the number of pixels all 640 wide up � 640 x 480= 480 high

Calculating File Size: Images �An image has a width in pixels and a height in pixels �Start by calculating the number of pixels all 640 wide up � 640 x 480= 307, 200 pixels 480 high

Calculating File Size: Images �For each pixel in the picture we need to specify a particular colour from a range of possible colours. �We can give either: • The colour depth �e. g. 24 -bit colour • The number of colours �e. g. 16 million colours (224=16, 777, 216)

Calculating File Size: Images �Number of colours • If the image is plain black and white (no grey) then it uses 1 bit to represent each pixel 1. How many bits are needed to represent 16 colours? 2. How many bits are needed to represent 256 colours?

Calculating File Size: Images �Number of colours • If the image is plain black and white (no grey) then it uses 1 bit to represent each pixel 1. How many bits are needed to represent 16 colours? 24= 16 4 bits 2. How many bits are needed to represent 256 colours? 28 = 256 8 bits

Calculating File Size: Images �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

Calculating File Size: Images �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 1000 bytes in a kilobyte 153, 600 bytes / 1000 = 153. 6 k. B To convert megabytes, we would divide by 1000 again.

Calculating File Size: Images �In MB what is the file size of: 1. An image 640 x 480 in 24 bit colour? 2. An image 1280 x 720 using 1024 colours?

Calculating File Size: Images �In MB what is the file size of: 1. An image 640 x 480 in 24 bit colour? 640 x 480 x 24 = 7, 372, 800 bits /8 = 921, 600 bytes /1000 = 921. 6 k. B 921. 6 k. B /1000 = 0. 92 MB 2. An image 1280 x 720 using 1024 colours? 1280 x 720 x 10 = 9, 216, 000 bits /8 = 1, 152, 000 bytes /1000 = 1152 k. B /1000 = 1. 15 MB

Calculating File Size: Sound �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 k. Hz (remember that kilo means 1000!!) • The audio quality: 8 bit audio 20 seconds x (4 KHz x 1000)hertz x 8 bit =

Calculating File Size: Sound 20 seconds x (4 KHz x 1000)hertz x 8 bit = 640, 000 bits /8 = 80, 000 bytes /1000 = 80 k. B

Calculating File Size: Sound �In MB what is the file size of: 1. A 60 second audio clip, sampled at 44 KHz, using 16 bit audio? 2. A 1. 5 minute audio clip, sampled at 96 KHz, using 24 bit audio?

Calculating File Size: Sound � In MB what is the file size of: 1. A 60 second audio clip, sampled at 44 KHz, using 16 bit audio? 60 x 44000 x 16 = 42, 240, 000 bits /8 = 5, 280, 000 bytes /1000 = 5, 280 k. B / 1000 = 5. 28 MB 2. A 1. 5 minute audio clip, sampled at 96 KHz, using 24 bit audio? 90 x 96000 x 24 = 207, 360, 000 bits /8 = 25, 920, 000 bytes / 1000 = 25, 920 k. B / 1000 = 25. 9 MB
- Slides: 14