Lesson 4 of 5
How pixels and samples become bits, and how big a file gets
One idea at a time. Try the example, then keep going.
Big ideas · 1 of 14
Big ideas
Do this: Read each idea. Then try painting with 1 bit and 2 bits per pixel.
A digital picture is a grid of tiny squares. Each square is a PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words, and each pixel stores its color as bits.
With 1 bit per PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words, each pixel is black or white: we use 0 for white and 1 for black. With 2 bits per pixel, each has 4 choices: 00, 01, 10 and 11. Photos use many more bits per pixel.
With 2 bits per PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words, each pixel can use one of 4 colors: 00, 01, 10 or 11.
Step-through
Do this: Step through the picture. Before each step, guess what the bits will look like.
Here is a small black and white picture. Watch how it turns into bits.
Whole picture, 4 steps
4 steps. Tap a number or Show me how it works.
Try it
Do this: Paint a small picture. Watch each row's bits and the size change as you work.
Tap a pixel to paint it. Each row's bits update as you paint. Then try 4 colors and compare the size. Count pixel data only.
Remember: Width × height × bits per pixel gives the pixel-data bit count. Divide by 8 for bytes; round up only if needed.
Big ideas
Do this: Read each idea. Then follow the picture-size examples.
Count PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words data only; ignore headers (file details), padding (extra space) and compression (ways to shrink files).
For PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words data only, width × height × bits per pixel ÷ 8 gives bytes; ignore headers, padding and compression. Round the total up to whole bytes only when the bits do not divide evenly by 8.
Round up to a whole ByteA group of 8 bits.Exactly: Eight bits handled together. One byte has 256 different patterns, enough for the numbers 0 to 255.Mix-up alert: A byte is 8 bits, not the other way round. A bit is the smaller one.See this in Key words only when the total bits do not divide evenly by 8. Round the total, not each row.
Do this: Follow each step. Then work out the size of a 16 by 16 black and white picture.
An icon is 8 × 8 pixels, black and white, 1 bit per pixel. Pixel data only: ignore headers, padding and compression.
The pixel data needs 8 bytes.
Do this: Follow each step. Then check the answer by working backward.
A picture is 12 × 8 pixels at 8 bits per pixel. Pixel data only: ignore headers, padding and compression.
The pixel data needs 96 bytes.
Do this: Follow each step. Then say why we round up, not down.
A 10 × 6 black and white picture, 1 bit per pixel. Pixel data only: ignore headers, padding and compression.
So it needs 8 whole bytes.
Do this: Say what changes when a picture goes from 2 colors to 4.
More bits per PixelOne tiny square of color in a digital picture.Exactly: The smallest dot in the grid that makes up a digital image. Each pixel's color is stored as one or more bits.Mix-up alert: More bits per pixel means more possible colors, not more pixels. More stored bits do not guarantee a better-looking picture.See this in Key words does not add pixels. It gives each pixel more possible colors. Keep width and height the same: changing from 1 to 2 bits per pixel doubles the pixel-data bit count. A byte total rounded up may not double exactly.
Do this: Explain why file size alone cannot tell you how good a picture looks.
A bigger picture file is not always a better picture. Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words depends on the number of pixels, the bits per pixel and format choices. More stored bits do not guarantee a better-looking picture.
Big ideas
Do this: Read each idea. Then compare the wave with its stored measurements.
A computer measures a sound wave many times a second and stores each measurement as a number written in BitOne 0 or 1. The SMALLEST piece of computer data.Exactly: A binary digit: a single 0 or 1. It records the state of one switch, off or on.Mix-up alert: A bit is not a byte. It takes 8 bits to make 1 byte.See this in Key words. More measurements follow the wave more closely and take more storage.
Using more BitOne 0 or 1. The SMALLEST piece of computer data.Exactly: A binary digit: a single 0 or 1. It records the state of one switch, off or on.Mix-up alert: A bit is not a byte. It takes 8 bits to make 1 byte.See this in Key words for each sound measurement records it more precisely and also takes more storage. This is a different change from taking more measurements.
Try it
Do this: Move the slider from few measurements to many. Say what changes.
The smooth line is a sound wave. The dots are the measurements a computer stores. With few measurements, the stored shape is rough.
Remember: More measurements sound closer to the real wave, but they take more bits.
Big ideas
Do this: Read each idea. Put the storage units in order from smallest to largest.
From smallest to largest, Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words goes bit → byte → KB → MB → GB. KB means kilobyte, MB means megabyte and GB means gigabyte.
A BitOne 0 or 1. The SMALLEST piece of computer data.Exactly: A binary digit: a single 0 or 1. It records the state of one switch, off or on.Mix-up alert: A bit is not a byte. It takes 8 bits to make 1 byte.See this in Key words is one 0 or 1; a ByteA group of 8 bits.Exactly: Eight bits handled together. One byte has 256 different patterns, enough for the numbers 0 to 255.Mix-up alert: A byte is 8 bits, not the other way round. A bit is the smaller one.See this in Key words holds 8 bits. One switch uses one bit. In our letter activities, one capital letter uses one byte.
In this course, 1 KB = 1,000 bytes, 1 MB = 1,000 KB and 1 GB = 1,000 MB.
Some computers count 1,024 instead of 1,000 when showing Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words. That can make the same file show a different size.
Approximate Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words: a short message might use 100 bytes; a page of plain text might use a few KB; real sizes vary.
Approximate Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words: a phone photo or a song might use a few MB; real sizes vary.
Approximate Storage sizeHow much space data takes up, measured in bits, bytes, KB, MB or GB.Exactly: 8 bits make 1 byte. In this course, 1 KB is 1,000 bytes, 1 MB is 1,000 KB and 1 GB is 1,000 MB. Some computers count 1,024 instead of 1,000. For picture calculations, count pixel data only: ignore headers, padding and compression. Divide the total bits by 8 and round up to whole bytes only if they do not divide evenly.Mix-up alert: A bigger file is not always a better picture. Size depends on the number of pixels, the bits per pixel and the file format.See this in Key words: a full-length HD movie might use a few GB; real sizes vary.
Do this: Say how many bytes are in 1 KB in this course.
A size shown using 1,024 bytes per KB does not mean the file changed. In this course, 1 KB = 1,000 bytes; some computers count 1,024 instead.
From other sites
Do this: Pick one to see the same ideas another way.
Code.org, about 6 minutes
Watch from 4:21 to 5:43
Watch for:
Code.org, about 6 minutes
Watch from 0:44 to 4:01
Watch for:
Video not loading? It might be blocked on this wifi. Try it at home.
Ready when you are.
Activity 1 of 7 · 0 of 7 activities done
Try it
Do this: Paint the picture from its rows of bits: 1 is dark, 0 is light. Then check.
Each row of bits is one row of the picture. Paint every 1 dark and leave every 0 light. What picture appears?
Remember: Each row of bits describes one row of pixels: 0 is white and 1 is black.
Try it
Do this: Answer, check, then keep going.
Work out picture sizes and convert between bits and bytes. For pictures, count pixel data only. Show the working if you get stuck.
Streak: 0 correct in a row. This session only.
Write it
Do this: Write two or three sentences, then compare with the key points.
Start here if it helps: The color picture takes more storage because...
Your answer is not saved anywhere. It disappears when you leave the page.
Flashcards
Do this: Work out each answer before you flip. Mark the ones you still need to learn.
Card 1 of 15
0 Know it0 Still learning
Zoom in on a picture.
On the card: Enter or Space flips. Left and Right move. After revealing, 1 marks Still learning and 2 marks Know it. Tab reaches every control.
What is a pixel?
One tiny square of color in a digital picture.
How many bits per pixel does black and white need?
1 bit per pixel: we use 0 for white and 1 for black.
How many bits per pixel give 4 colors?
2 bits: 00, 01, 10 and 11.
Count pixel data only. Ignore headers, padding and compression. How do you find a picture's size in bits?
Width × height × bits per pixel gives bits. Divide the total bits by 8; round up to whole bytes only if they do not divide evenly.
Count pixel data only. Ignore headers, padding and compression. How do you turn a picture's total bits into whole bytes?
Divide the total bits by 8; round up to whole bytes only if they do not divide evenly.
How does a computer store sound?
It measures the sound wave many times a second and stores each measurement as bits.
What happens with more sound measurements?
It sounds closer to the real sound, and the file gets bigger.
How many bytes are in 1 KB in this course?
1,000 bytes. Some computers count 1,024.
Put in order from smallest: GB, bit, MB, byte, KB.
bit, byte, KB, MB, GB.
Count pixel data only. How many bytes does an 8 by 8 picture need at 2 bits per pixel?
16 bytes: 8 × 8 × 2 = 128 bits, and 128 ÷ 8 = 16.
How many bytes are in 1 MB in this course?
1,000,000 bytes: 1,000 KB, each 1,000 bytes.
How many colors can 3 bits per pixel show?
8 colors.
What makes a sound file bigger?
More measurements each second, more bits per measurement, or a longer recording all take more storage when the other choices stay the same.
Count pixel data only. How many bits does a 4 by 4 black and white picture at 1 bit per pixel need?
16 bits, which is 2 bytes.
What does rounding up to whole bytes mean?
If bits ÷ 8 is not a whole number, use the next whole number of bytes.
True or false
Do this: Choose True or False. Work it out before you choose.
Self-test
Do this: Answer every question. Write the multiplication on paper if it helps.
8 questions. One at a time.
Practice, not a grade. No timer. Your best score stays in this browser.
Match
Do this: Choose a word, then choose its meaning.
Connect the ideas
0 / 4 connectedChoose a term, then its meaning. Or drag its grip. Use Tab and Enter or Space; Escape clears.
Classwork
Your next step
Started on another device?
Homework · 10 points
Opening your homework…
Practice it: You did 0 of 7 activities.
You decide when you have finished. This is your study progress, not a grade.
Not marked finished yet.
Two ready posts. Nothing is saved or sent. Make one Classroom assignment for each step you assign, using the points shown below and its own due date. Copy its post and paste it into the assignment's instructions.
Classwork
Worth 10 points.
https://gradebridge-beryl.vercel.app/learn/csc/digital-representation-and-files/pictures-sound-and-size#classwork
Homework
Worth 10 points.
https://gradebridge-beryl.vercel.app/learn/csc/digital-representation-and-files/pictures-sound-and-size#homework
After students turn it in, open Check student work
Download their files from the assignment's Drive folder, then open them in Check student work.