NEXT PAGE >
PURPOSE OF COMPRESSION |
1.3.2 | CALCULATING FILE SIZE
Topics from the Cambridge IGCSE (9-1) Computer Science 0984 syllabus 2023 - 2025.
OBJECTIVES
1.3.2 Calculate the file size of an image file and a sound file, using information given
1.3.2 Calculate the file size of an image file and a sound file, using information given
CALCULATING IMAGE FILE SIZE
To calculate the file size of the two images above, firstly although only two colours have been used, lets presume a colour depth of 8 bit for both images.
Image 1 calculation:
Firstly; calculate the total amount of pixels used in the image
8 pixels wide by 8 pixels tall: 8 x 8 = 64 (A total of 64 pixels used to represent the entire image)
Secondly; multiply the total pixels used by the colour depth (8 bits have been used to represent the content of each pixel)
64 pixels in total multiplied by 8(colour depth): 64 x 8 = 512
Answer: Image 1 has a file size of 512 bits
Image 2 calculation:
16 pixel by 16 pixels: 16 x 16 = 256
256 pixels x 8 bit colour depth: 256 x 8 = 2048
Answer: Image 2 has a file size of 2048 bits
In practise images are much larges and the pixel density is much greater than the two example above.
Image 1 calculation:
Firstly; calculate the total amount of pixels used in the image
8 pixels wide by 8 pixels tall: 8 x 8 = 64 (A total of 64 pixels used to represent the entire image)
Secondly; multiply the total pixels used by the colour depth (8 bits have been used to represent the content of each pixel)
64 pixels in total multiplied by 8(colour depth): 64 x 8 = 512
Answer: Image 1 has a file size of 512 bits
Image 2 calculation:
16 pixel by 16 pixels: 16 x 16 = 256
256 pixels x 8 bit colour depth: 256 x 8 = 2048
Answer: Image 2 has a file size of 2048 bits
In practise images are much larges and the pixel density is much greater than the two example above.
Follow the same steps to calculate the file size of image 3, this time convert the file size from bits too Megabytes.
Step 1: Multiply the number of horizontal pixels by the number of vertical pixels: 1600 x 1200 = 1920000 pixels
Step 2: Multiply the total pixels used by the colour/bit depth: 1920000 x 24 = 46080000 bits
Step 3: Divide the answer from step 2 by 8 to give the number of bytes used: 46080000 / 8 = 5760000 bytes
Step 4: Divide the number of bytes used by 1024 to give the value in Kilobytes: 5760000 / 1024 = 5625 Kilobytes
Step 5: Divide the number of kilobytes used by 1024 to give the value in Megabytes: 5625 / 1024 = 5.4 Megabytes
The original image 3 has a file size of 5.2Mb, this value excludes any metadata storage used and was the file size before being compressed for use over the internet
Step 1: Multiply the number of horizontal pixels by the number of vertical pixels: 1600 x 1200 = 1920000 pixels
Step 2: Multiply the total pixels used by the colour/bit depth: 1920000 x 24 = 46080000 bits
Step 3: Divide the answer from step 2 by 8 to give the number of bytes used: 46080000 / 8 = 5760000 bytes
Step 4: Divide the number of bytes used by 1024 to give the value in Kilobytes: 5760000 / 1024 = 5625 Kilobytes
Step 5: Divide the number of kilobytes used by 1024 to give the value in Megabytes: 5625 / 1024 = 5.4 Megabytes
The original image 3 has a file size of 5.2Mb, this value excludes any metadata storage used and was the file size before being compressed for use over the internet
CHECK YOUR KNOWLEDGE
What is the two's complement representation of -5 in an 8-bit binary system?
A) 1111 1011
B) 1111 1101
C) 1000 0101
D) 1111 1001
EXPLAINATION
The correct answer is A) 1111 1011.
To find the two's complement of -5 in an 8-bit system:
To find the two's complement of -5 in an 8-bit system:
- Start with the binary representation of 5: 0000 0101.
- Invert the bits: 1111 1010.
- Add 1 to the result: 1111 1010 + 1 = 1111 1011.
.
IMAGE SIZE
1: An image has the following properties:
2: An image has the following properties:
3: Besides the size and bit depth of an image, what else could have an impact on the total file size?
4:Give two situation where reducing the file size of an image is needed, explain the impact of doing this.
- Dimensions 1024 pixels x 575 pixels
- Bit Depth 24
2: An image has the following properties:
- Dimensions 12 inch x 11 inch
- Bit Depth 16
- 72 pixels per inch
3: Besides the size and bit depth of an image, what else could have an impact on the total file size?
4:Give two situation where reducing the file size of an image is needed, explain the impact of doing this.
|
|
1.1 NUMBER SYSTEMS
☑ 1.1.1 WHY COMPUTERS USE BINARY
☑ 1.1.2 BINARY, HEX AND CONVERTIG BETWEEN NUMBER SYSTEMS
☑ 1.1.3 BENEFITS OF HEX
☑ 1.1.4 BINARY ADDITION AND OVERFLOW
☑ 1.1.5 BINARY SHIFTS
☑ 1.1.6 NEGATIVE NUMBER REPRESENTATION, TWO'S COMPLEMENT
1.2 COLOUR AND SOUND
☑ 1.2.1 HOW COMPUTERS REPRESENT TEXT
☑ 1.2.2 HOW COMPUTERS REPRESENT SOUND
☑ 1.2.3 HOW COMPUTERS REPRESENT IMAGES
1.3 FILE SIZE AND COMPRESSION
☑ 1.3.1 HOW STORAGE IS MEASURED
➩ 1.3.2 CALCULATING IMAGE AND SOUND FILE SIZE
☐ 1.3.3 PURPOSE OF COMPRESSION
☐ 1.3.4 LOSSY AND LOSSLESS COMPRESSION
EXTRAS
☐ END OF TOPIC REVIEW | COMING SOON
☐ TOPIC 1 KEY TERMINOLOGY
☐ REVISION FLIP CARDS
☐ TOPIC 1 ANSWERS
☐ TOPIC 1 TEACHER RESOURCES (CIE)
☑ 1.1.1 WHY COMPUTERS USE BINARY
☑ 1.1.2 BINARY, HEX AND CONVERTIG BETWEEN NUMBER SYSTEMS
☑ 1.1.3 BENEFITS OF HEX
☑ 1.1.4 BINARY ADDITION AND OVERFLOW
☑ 1.1.5 BINARY SHIFTS
☑ 1.1.6 NEGATIVE NUMBER REPRESENTATION, TWO'S COMPLEMENT
1.2 COLOUR AND SOUND
☑ 1.2.1 HOW COMPUTERS REPRESENT TEXT
☑ 1.2.2 HOW COMPUTERS REPRESENT SOUND
☑ 1.2.3 HOW COMPUTERS REPRESENT IMAGES
1.3 FILE SIZE AND COMPRESSION
☑ 1.3.1 HOW STORAGE IS MEASURED
➩ 1.3.2 CALCULATING IMAGE AND SOUND FILE SIZE
☐ 1.3.3 PURPOSE OF COMPRESSION
☐ 1.3.4 LOSSY AND LOSSLESS COMPRESSION
EXTRAS
☐ END OF TOPIC REVIEW | COMING SOON
☐ TOPIC 1 KEY TERMINOLOGY
☐ REVISION FLIP CARDS
☐ TOPIC 1 ANSWERS
☐ TOPIC 1 TEACHER RESOURCES (CIE)