The file size of an uncompressed image (in bits) is calculated using the following formula:
size (in bits)=width×height×color depth \text{size (in bits)} = \text{width} \times \text{height} \times \text{color depth} size (in bits)=width×height×color depthTo calculate the size in bytes, the number of bits is divided by 8.
The algorithm below is designed to output the size in bytes of an image with a width of 1920 pixels, a height of 1080 pixels, and a color depth of 24 bits.
A subroutine called calcImgSizeBytes has been developed as part of the algorithm.
Complete the program by identifying the correct term from the pool of options to fill each of the six empty gaps.
widthheightdepthsizeBitssizeBytessizeBits / 8sizeBits * 8sizeBits MOD 8RETURNSUBROUTINEOUTPUTcalcImgSizeBytescalcImgSizeBits1920SUBROUTINE calcImgSizeBytes([Gap 1], height, [Gap 2])
[Gap 3] ← width * height * depth
sizeBytes ← [Gap 4]
[Gap 5] sizeBytes
ENDSUBROUTINE
OUTPUT [Gap 6](1920, 1080, 24)
131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.