Representing images & sound

Computer Science · Foundations

Question 1 of 10

0

    A bitmap image is made up of a grid of:

    Stuck? Read the explanation

    Unlocks at a streak of 5 correct answers in a row.

    Print a free worksheet (PDF)

    Embed this practice on your site or class page

    Paste this HTML into your page. Students practise right there; it is free and needs no account.

    Representing images & sound explained

    Pictures and sounds are stored as numbers. A digital image is a grid of pixels, where each pixel is the smallest square of a single colour. The resolution is the number of pixels across and down, and the colour depth is the number of bits stored for each pixel. Colour depth sets the number of colours, which is 2 to the power of the bit depth.

    Sound is stored in a similar way by taking samples of the sound wave. The sample rate is the number of samples per second, measured in hertz, and the bit depth is the number of bits used for each sample, which sets how finely the loudness is recorded. Stereo stores two channels instead of one.

    For an uncompressed image, the file size in bits is width × height × colour depth. For an uncompressed sound, it is sample rate × bit depth × duration in seconds × channels. Divide the answer by 8 to get bytes. Metadata, such as the date a photo was taken or the camera model, is extra information kept in the file. It is usually small and is not part of these formulas.

    Worked example

    A photo is 1000 pixels wide and 500 pixels high, with a colour depth of 24 bits per pixel. Find its uncompressed file size.

    1. Pixels: 1000 × 500 = 500,000.
    2. Bits: 500,000 × 24 = 12,000,000 bits.
    3. Bytes: 12,000,000 ÷ 8 = 1,500,000 bytes, which is 1.5 MB.

    What you will practise

    105 multiple-choice questions (Easy, Medium, Hard). Each answer is followed by an explanation.

    Example questions

    • What is a pixel?
    • What does the resolution of a bitmap image describe?
    • An image is 1920 pixels wide and 1080 pixels high. How many pixels does it contain?
    • What is the colour depth of an image?
    • A pixel is stored using 1 bit. How many colours can that pixel show?
    • What is metadata?
    • Which of these is metadata stored with a digital photo?
    • What is the sample rate of a sound recording?

    …and 97 more.