L
LLLOS.ai
Learn
L

Ask Your Tutor · Computer Science

How do computers convert images and music into bits?

General knowledge In depth Asked by Anonymous 22 Oct 2026, 12:44 PM IST Updated

In one line

Computers turn images and music into bits by breaking them into tiny pieces and giving each piece a number that can be written in binary (0s and 1s).

Claude Shannon — American mathematician (1916–2001)
Claude Shannon — American mathematician (1916–2001)
Claude Shannon, who showed how all information can be turned into bits (0s and 1s).
Image: Wikipedia

The rule

Computers represent all data, including images and music, using binary code (bits: 0 and 1). They do this by sampling (measuring small parts) and assigning a numeric value to each part, which is then stored as binary.

Let's understand it simply

Imagine you want to tell a friend about a beautiful Diwali rangoli (colourful pattern) without showing it. You could describe each colour and its place: "Red in the middle, blue on the side, yellow dots." Now, imagine splitting the rangoli into tiny squares and telling your friend the colour of each square. Each colour can be given a number: red = 1, blue = 2, yellow = 3, and so on. Your friend can now draw the same rangoli using just your list of numbers.

Computers do something similar. For images, they break the picture into a grid of tiny dots called pixels (picture elements). For music, they break the sound into thousands of tiny time slices and measure the loudness at each slice. Each colour or sound level is given a number, and computers store these numbers as bits.

How images and music are digitized
ImagesMusic
What is broken into pieces?Pixels (tiny dots)Samples (tiny time slices)
What is measured?Colour valueLoudness (amplitude)
How is it stored?Numbers for each pixelNumbers for each sample
How is it written?Binary (0s and 1s)Binary (0s and 1s)

How it works

  1. Breaking into pieces:
  • For images: The computer divides the picture into a grid of pixels.
  • For music: The computer splits the sound into very short time intervals (samples).
  1. Measuring each piece:
  • For each pixel, it measures the colour (using numbers for red, green, blue).
  • For each sound sample, it measures the loudness (amplitude).
  1. Assigning numbers:
  • Each colour or sound level is given a number (e.g., 0 to 255 for colours).
  1. Converting to binary:
  • These numbers are turned into binary (0s and 1s). For example, 5 becomes 00000101.
  1. Storing the bits:
  • The computer stores all these bits in memory or on disk. When needed, it reads the bits and turns them back into images or music.
How a computer stores an image and music
  1. Break image into pixels / music into samples
  2. Measure colour or loudness at each point
  3. Assign a number to each value
  4. Convert numbers to binary (0s and 1s)
  5. Store all bits in memory or file

The story behind it

The idea of turning pictures and sounds into numbers began in the 20th century. Claude Shannon, an American mathematician, showed in the 1940s how all information could be represented using just two symbols: 0 and 1. This made it possible for computers to handle any kind of data. The first digital images were created in the 1950s for space research. Digital music started becoming popular in the 1970s and 80s, with the invention of CDs.

Where you see it in real life

  • Mobile photos: Your phone camera turns a scene into millions of pixel values, each stored as bits.
  • MP3 songs: The music you play is stored as a long list of sound samples, each a number in binary.
  • WhatsApp voice notes: Your voice is broken into samples, turned into numbers, and sent as bits.
  • Television: Each frame is a grid of pixels, sent as bits to your TV.
  • ATM security cameras: The video is stored as bits, frame by frame.
  • Digital X-rays: Hospitals store X-ray images as grids of numbers, making them easy to share.

Why it matters

  • Universal language: Binary makes it possible for computers to store, process, and share any kind of data.
  • Easy copying: Digital data can be copied, sent, or edited without losing quality.
  • Compression: Images and music can be made smaller (compressed) for faster sharing (like JPEG, MP3).
  • Security: Digital data can be encrypted (locked) for privacy.

Worked example

Let's see how a small black-and-white image is stored:

Suppose you have a 2×2 image:

  • Top left: black (0)
  • Top right: white (1)
  • Bottom left: white (1)
  • Bottom right: black (0)
Step 1: Assign numbers to each pixel (0 = black, 1 = white)
Step 2: Write the numbers in order: 0, 1, 1, 0
Step 3: Convert each number to binary (already 0 or 1)
Step 4: Store as bits: 0 1 1 0

For music: Suppose you record a sound and measure its loudness at 3 times:

  • First: 2
  • Second: 5
  • Third: 3
Step 1: Assign numbers to each sample: 2, 5, 3
Step 2: Convert to binary: 2 = 10, 5 = 101, 3 = 11
Step 3: Store as bits: 10 101 11

Common mistakes

  • Thinking images/music are stored as pictures or waves: They are actually stored as lists of numbers (bits).
  • Forgetting about sampling: Computers do not record everything; they measure at tiny steps (samples or pixels).
  • Mixing up file size and quality: More bits mean better quality, but also bigger files.
  • Assuming all images/music use the same method: There are many formats (JPEG, PNG, MP3, WAV), each with its own way of storing bits.

Remember it

Bits are just numbers. Computers turn pictures and music into bits by measuring small parts and giving each part a number, then writing those numbers in binary.

Check yourself

What is a pixel in a digital image?

A tiny dot in the image, each with its own colour value.

Why do computers use binary (0s and 1s) to store data?

Because computers' circuits can easily represent two states: on (1) and off (0).

How does a computer turn a song into bits?

It breaks the sound into small time samples, measures the loudness at each, and stores those numbers in binary.

Why does increasing the number of pixels or samples improve quality?

Because it captures more detail, making the image or sound closer to the original.

Quick recap

  • Computers store images and music as numbers, not as actual pictures or sounds.
  • Images are split into pixels; music is split into tiny time samples.
  • Each pixel or sample is measured and given a number.
  • All numbers are written in binary (0s and 1s), called bits.
  • This method allows easy copying, sharing, and editing of digital data.
Written by the LLOS.ai tutor. Asked by Anonymous on 22 Oct 2026, 12:44 PM IST