# Lesson 16: Binary Images

## Overview

Though many people think of binary as strictly zeros and ones, students will be introduced to the idea that information can be represented in a variety of binary options. This lesson takes that concept one step further as it illustrates how a computer can store even more complex information (such as images and colors) in binary, as well.

## Purpose

In this lesson students will learn how information is represented in a way such that a computer can interpret and store it. When learning binary, students will have the opportunity to write code and share it with peers to view as images. This can then be related back to how computers read a program, translate it to binary, use the information in some way, then reply back in a way humans can understand. For example, when we type a sentence into a document then press "save", a computer translates the sentence into binary, stores the information, then posts a message indicating the document has been stored.

## Objectives

### Students will be able to:

• Identify methods for encoding images into binary.
• Relate images to a peer using binary encoding.
• Reproduce an image, based on binary code.

## Preparation

• Print one worksheet and assessment per student.
• Make sure every student has a journal.
• (Optional)Gather groupings of items that can show opposites for students to use when coming up with their own binary encodings.

Heads Up! Please make a copy of any documents you plan to share with students.

## Vocabulary

• Binary - A way of representing information using only two options.
• Binary Alphabet - The two options used in your binary code.

# Teaching Guide

## Warm Up (10 min)

### Vocabulary

This lesson has two new terms:

• Binary - Say it with me: Bi-nare-ee

A way of representing information using only two options.

• Binary Alphabet - Say it with me: Bi-nare-ee Al-fa-bet

The two options used in your binary code.

### Introduction to Binary

What if we had a picture like this, where there's only two color options for each square, black or white.

How might we encode this so that someone else could recreate the picture without seeing it?

• Some students might think back to the Graph Paper Programming lesson. While there could be a lot of similarities, let them know that this is different enough that they should not use that lesson to guide this one

You may hear suggestions like: "Say 'white, black, white, black'."

• "That's a great suggestion! Now I'm going to break you up into pairs. Work with your teammate to decide on a binary alphabet."

Decide whether you want your pairs to share their encodings with the other groups ahead of time, and tell them if they will be creating a key, or keeping their methods secret.

• "Now, let's encode some images, just like a computer would!"

## Main Activity (20 min)

### Binary Images - Worksheet

Now it's the students' turn!

#### Activity Directions:

1. Divide students into pairs.
2. Have them choose an image with their partner.
3. Encourage them to figure out what their binary alphabet is going to be.
4. Have them encode their image using their new binary alphabet.
5. Instruct students to trade encodings with another team and see if they can figure out which picture the other worked on.
6. Choose a Level
• Easy: Let the other team know what your encoding method was
• Tough: Have the other team guess your encoding method.

## Wrap Up (10 min)

### Flash Chat: What did we learn?

• What did we learn today?
• What kind of binary alphabet did you create?
• Can you think of how you could encode an image using only your fingers?
• Do you think you could create a binary alphabet out of sounds?

### Journaling

Having students write about what they learned, why itâ€™s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.

#### Journal Prompts:

• What was today's lesson about?
• How do you feel about today's lesson?
• What is a binary alphabet?
• What kind of information can you share using binary?

## Assessment (10 min)

### Binary Images - Assessment

Pass out this assessment for students to do individually. Try to save time at the end to go over answers.

## Extended Learning

Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.

Storing Color Images

• If your class really gets the idea behind storing binary images, they may want to know how to do color images.
• First, you'll need to discuss how color works using binary (as in Binary Baubles - Thinkersmith Lesson, page 21).
• Then, introduce some images that use combinations of those colors
• Encourage your students to come up with ways to code these color images.

• Levels
• 1
• (click tabs to see student view)
View on Code Studio

# Binary Images

Communicate how to recreate an image using just two simple values.

## Standards Alignment

#### CSTA K-12 Computer Science Standards (2017)

AP - Algorithms & Programming
• 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.