Sign in

Intro to Computer Science / Unit 2: Binary and Data Representation

2.4 Images and Sound as Data

3 practice questionsNot yet reviewed

Notes

Pictures and sound are turned into numbers so a computer can store them.

  • An image is a grid of pixels. Each pixel stores a color as numbers. Resolution is the number of pixels, such as 1920 by 1080.
  • RGB color stores red, green and blue amounts. With 8 bits for each, a pixel takes 24 bits, which is 3 bytes.
  • Example: a 10 by 10 image with 24-bit color has 100 pixels x 3 bytes = 300 bytes.
  • A black-and-white image needs just 1 bit per pixel.
  • Sound is sampled: the wave height is measured many times per second. The sample rate is the number of samples per second. More samples and more bits per sample give better quality and bigger files.
  • Example: 1 second of mono sound at 44,100 samples per second and 16 bits (2 bytes) per sample is 88,200 bytes.

Practice

How many bits does one pixel need in a black-and-white (2 color) image?
An image is 20 pixels wide and 10 pixels tall and uses 3 bytes per pixel. How many bytes is it?
What happens to a sound file if the sample rate is increased?

Ready for more? Take the Unit 2 test.