OCR J277 GCSE Computer Science · 1.2 Memory and Storage

Stretch tasks Storing Images

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each term card to its meaning card.

  • 12 cards: each term has a meaning
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

Task 4

Sort It

Sort each statement into the right box, like the tick-box tables in the exam.

  • 12 cards to sort into 3 boxes
  • Drag a card, tap a box or press its number
  • Combo points for cards sorted in a row

12 cards, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Storing Images

Storing Images: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. What is a pixel?

    • The smallest single point of colour in a bitmap image
    • A unit of storage
    • A type of image file
    • The number of colours in an image
  2. What is resolution?

    • The number of colours in an image
    • The file size of an image
    • The brightness of the screen
    • The number of pixels in an image
  3. How many colours can a colour depth of 4 bits give?

  4. A colour depth of 4 means the image can use 4 colours.

    • True
    • False
  5. Doubling both the width and the height of an image makes the file about...

    • Four times larger
    • Twice as large
    • The same size
    • Eight times larger
  6. Which TWO are examples of image metadata?

    Tick 2.

    • Colour depth
    • The colour of the first pixel
    • The grid of pixels
    • The brightness of the monitor
    • Width and height
  7. Why is metadata needed?

    • To add more colours
    • To compress the image
    • So software can rebuild the grid of pixels correctly
    • To make the image smaller
  8. An image is 10 x 10 pixels with a colour depth of 1 bit. How many bits is the pixel data?

  9. Changing the colour depth from 8 to 24 bits makes the file...

    • The same size
    • Three times larger
    • Twice as large
    • 16 times larger
  10. Order these colour depths by how many colours they give, fewest first.

    Number these 1 to 4.

    • 24 bit
    • 1 bit
    • 4 bit
    • 8 bit
  11. An image looks blocky when it is enlarged. What is this called?

    • Pixelated
    • Compressed
    • Sampled
    • Encoded
  12. 24-bit colour uses 8 bits each for red, green and blue.

    • True
    • False

Quiz Challenge, round 2: Quick Fire

  1. Explain the effect of increasing the resolution of an image. [2 marks]

  2. Explain why metadata must be stored with a bitmap image. [2 marks]

  3. An image can use 256 colours. State its colour depth and explain how you know. [2 marks]

  4. Give one effect on quality and one effect on file size of reducing the colour depth of an image. [2 marks]

Quiz Challenge, round 3: Big Think

  1. An image is 500 pixels wide and 400 pixels high, with a colour depth of 8 bits. The metadata is 1 KB. Calculate the total file size in kilobytes. Show your working. [4 marks]

  2. Explain how the resolution and the colour depth of a bitmap image affect its quality and its file size. [6 marks]

This or That: tick the right answer

  1. Which gives more colours?

    • 8-bit colour
    • 4-bit colour
  2. How many colours does 1-bit colour give?

    • 2
    • 1
  3. Which change makes an image file four times bigger?

    • Doubling the colour depth
    • Doubling width and height
  4. A hex colour code such as #FF8800 has six digits. Why?

    • Two hex digits for each of red, green and blue
    • One digit for each of six colours
  5. What can image metadata include?

    • The pixels themselves
    • The camera model used
  6. Is resolution a measure of how good an image looks?

    • Yes: it is a quality score
    • No: it is a count of pixels
  7. An image has a colour depth of 3 bits. How many colours can it use?

    • 8
    • 6
  8. Which holds more detail?

    • 640 x 480 pixels
    • 1920 x 1080 pixels

Memory Match: match each term to its meaning

TermMeaning
A Pixel1 Bits used for each pixel's colour
B Resolution2 An image stored as a grid of pixels
C Colour depth3 The number of pixels in an image
D Metadata4 One point of colour in a bitmap
E Bitmap5 Blocky when enlarged too far
F Pixelated6 Data about the data, such as width

Sort It: tick one box in each row

Does each change make the image file bigger, smaller or no different?

StatementBiggerSmallerNo change
Adding metadata
Cropping it to half its width
Raising the colour depth from 8 to 24 bits
Reducing the colour depth from 24 to 8 bits
Halving the width and the height
Zooming in on it
Copying it to a memory stick
Going from 1-bit to 2-bit colour
Doubling the resolution
Printing it
Converting it to 1-bit black and white
Viewing it on a bigger screen
Answers

Round 1: Quiz Blitz

  1. The smallest single point of colour in a bitmap image Pixel is short for picture element. Each one holds one colour value.
  2. The number of pixels in an image Resolution is a count of pixels, usually width by height, such as 1920 x 1080.
  3. 16 n bits give 2 to the power n colours: 2 to the power 4 is 16.
  4. False Colour depth is bits, not colours. 4 bits give 16 colours.
  5. Four times larger Twice as wide and twice as tall means four times as many pixels.
  6. Width and height; Colour depth Metadata is data about the data: dimensions, colour depth, date, camera and more.
  7. So software can rebuild the grid of pixels correctly Without the width, a long list of colour values could not be arranged into rows.
  8. 100 1 x 10 x 10 = 100 bits.
  9. Three times larger Each pixel needs 24 bits instead of 8, which is three times as many.
  10. 1 bit → 4 bit → 8 bit → 24 bit 2, 16, 256 and 16,777,216 colours.
  11. Pixelated With too few pixels for its size, the individual squares become visible.
  12. True That is why hex colour codes have six digits: two per channel.

Round 2: Quick Fire

    • More pixels, so more detail and better quality
    • A larger file size
    Model answer

    There are more pixels, so the image shows more detail. But there is more data to store, so the file is larger.

    • It records the width, height and colour depth
    • So the software can rebuild and display the pixels correctly
    Model answer

    Metadata records the image's width, height and colour depth, so the software can rebuild the grid of pixels and display the image correctly.

    • 8 bits
    • Because 2 to the power 8 is 256
    Model answer

    Its colour depth is 8 bits, because 2 to the power 8 is 256.

    • Fewer colours, so lower quality or banding
    • A smaller file
    Model answer

    Fewer colours are available, so quality is lower and smooth gradients can show banding. The file is smaller.

Round 3: Big Think

    • 8 x 500 x 400 = 1,600,000 bits
    • Divide by 8: 200,000 bytes
    • Divide by 1000: 200 KB
    • Add the metadata: 201 KB
    Model answer

    8 x 500 x 400 = 1,600,000 bits. 1,600,000 / 8 = 200,000 bytes. 200,000 / 1000 = 200 KB. Adding the 1 KB of metadata gives 201 KB.

    • Resolution is the number of pixels, width by height
    • Higher resolution gives more detail
    • Higher resolution means more data, so a larger file
    • Doubling width and height makes the file four times bigger
    • Colour depth is the number of bits per pixel
    • More bits give more colours: n bits give 2 to the power n
    • More bits per pixel make the file bigger in proportion
    Model answer

    Resolution is the number of pixels in the image, given as width by height. A higher resolution gives more detail, so the image looks sharper and is less likely to look pixelated, but there is more data to store, so it gives a larger file: doubling both the width and the height makes the file four times bigger. Colour depth is the number of bits used to store the colour of each pixel. More bits give more colours, because n bits give 2 to the power n colours, so 24 bits give over 16 million colours and smoother gradients. But every pixel then needs more bits, so the file grows in proportion.

This or That

  1. 8-bit colour 8 bits give 256 colours. 4 bits give 16.
  2. 2 One bit is a 0 or a 1, so two colours, usually black and white.
  3. Doubling width and height Twice as wide and twice as tall is four times the pixels. Doubling the colour depth only doubles the file.
  4. Two hex digits for each of red, green and blue 24-bit colour is 8 bits per channel, and 8 bits is two hex digits.
  5. The camera model used Metadata is data about the image, such as its size, date and camera, not the pixel data.
  6. No: it is a count of pixels Resolution is width x height in pixels. More pixels can show more detail.
  7. 8 2 to the power 3 is 8.
  8. 1920 x 1080 pixels More pixels can describe more detail.

Memory Match

  • A 4 Pixel: One point of colour in a bitmap
  • B 3 Resolution: The number of pixels in an image
  • C 1 Colour depth: Bits used for each pixel's colour
  • D 6 Metadata: Data about the data, such as width
  • E 2 Bitmap: An image stored as a grid of pixels
  • F 5 Pixelated: Blocky when enlarged too far

Sort It

  1. Bigger Adding metadata Metadata is stored in the file too, so it adds a little.
  2. Smaller Cropping it to half its width Half the pixels, so half the pixel data.
  3. Bigger Raising the colour depth from 8 to 24 bits Each pixel now needs three times the bits.
  4. Smaller Reducing the colour depth from 24 to 8 bits Each pixel needs a third of the bits.
  5. Smaller Halving the width and the height A quarter of the pixels means a quarter of the data.
  6. No change Zooming in on it Zooming changes the view, not the stored pixels.
  7. No change Copying it to a memory stick A copy holds exactly the same data.
  8. Bigger Going from 1-bit to 2-bit colour Twice the bits per pixel doubles the pixel data.
  9. Bigger Doubling the resolution More pixels means more data to store.
  10. No change Printing it Printing makes a paper copy and leaves the file alone.
  11. Smaller Converting it to 1-bit black and white One bit per pixel is the smallest colour depth.
  12. No change Viewing it on a bigger screen The file is the same: the screen just displays it larger.