Data representation · GCSE · OCR J277 1.2.4, AQA 8525 3.3.6, Edexcel 1CP2 2.2.2 · about 15 min
Pixels, resolution, colour depth, metadata and file size, from the robot's camera.
[1 mark]An image is 32 × 24 pixels with a colour depth of 8 bits. How many bits is it?
[1 mark]How many colours can a pixel with a colour depth of 4 bits have?
[1 mark]Doubling both the width and height of an image does what to its file size?
[1 mark]What is metadata in an image file?
[1 mark]What is the effect of increasing colour depth?
Capture camera_image(32, 24). Print it as 24 lines of 32 characters, # for a pixel whose average of red, green and blue is below 128, . otherwise. Then print 1-bit size: <bits> and 24-bit size: <bits> for a 32 × 24 image, worked out with a calculation.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() img = camera_image(32, 24)
Plan your program here, then type it in and press Run.
.:-=+*#%@ from light to dark.