Representing images using binary
Unit Representing images using binary
Year level: 5-6 Topic: Data representations Time: 4 hours
Digital images are encoded in binary. Students learn about pixels and the way computers store an image as an array of individual pixels, each of which has a particular colour. Students make connections between the amount of data used by the computer to store, transmit and create an image and the file size of different images (generally, the more pixels and more bits to encode the image, the larger the file size).
Flow of Activities
Coding instructions
Create instructions to shade a grid to explore encoding.Coding an image using binary
Create instructions to shade a grid made up of pixels encoding using 0 or 1.Coding a colour image
Explore the use of RGB represented as three binary digits to create colours.Create an image using binary
Students apply their understanding about how binary is used to create an image.Activity Coding instructions
How can you use code to represent instructions?
Australian Curriculum Alignment
- Representation of data (ACTDIK015)
What's this about?
A grid is a simple way of representing picture elements (pixels). Each square can represent a pixel. Creating instructions to shade a grid gives students an understanding of the ways to represent the square: shaded or not shaded (on/off). On/off state is the basis of the binary system.
Learning tasks
- Introduce the task of shading a grid made up of squares, for example 5 x 5. One student shades the square then comes up with their own code to explain to a partner how to replicate the pattern of shaded squares.
- Students choose from a variety of ways to encode their pattern. There are many ways to represent the command of shading a square: a letter B for black, a scribble, a pen icon, a plus sign, a number.
Supporting Resources
Assessment
Explain how digital systems use whole numbers as a basis for representing a variety of data types.
Suggested approaches may include
- Research plan
- Checklist (digital literacy skills)
Activity Coding an image using binary
How can I encode a black and white image using binary?
Australian Curriculum Alignment
What's this about?
Students create an image made up of only black and white squares. This task introduces them to how binary numbers are used to represent images.
0 represents black and 1 represents white. One binary digit is a bit. This is an example of colouring 1 bit per pixel; it is either black or white.
There is a direct relationship between the width and height of the image and the number of pixels and image detail.
Learning tasks
- Provide students with the task of creating an image based on either a black or white pixel.
- If doing this as an unplugged activity students work in pairs to encode their own image using 0s and 1s and swap with their partner to decode and then compare to the original image.
- Alternatively, use relevant online tools such as Code.org’s pixilation tutorial.
Supporting Resources


Assessment
Explain how digital systems use whole numbers as a basis for representing a variety of data types.
Suggested approaches may include
- Artefact analysis: Represent an image using 1 bit/pixel (0 or 1)
- Explain using Think Aloud
Activity Coding a colour image
How can I encode a colour image using binary?
Australian Curriculum Alignment
What's this about?
On a computer screen a colour image is made by mixing red, green and blue (RGB) light. This mix of light can be represented in binary in three digits. For example, (0,0,0) is no red, no green and no blue (making black). White is represented as (1,1,1). This is an example of RGB colouring 3 bits per pixel and results in 8 colours.
Learning tasks
- Students interested in finding out how to create colours using binary numbers can progress through the Code.org pixilation tutorial, and the colour tutorial.
- Challenge students to create a colour image using up to 8 colours. Explore changing the width and length of the image and the relationship between image detail (quality) and the number of pixels.
Supporting Resources


Assessment
Explore creating pixel images using this Code.org tutorial.
Suggested approaches may include
- Artefact analysis: Represent an image using 3 bits/pixel (RGB)
- Explain using Think Aloud
Assessment Resources
Activity Create an image using binary
How can I design my own pixel image?
Australian Curriculum Alignment
What's this about?
Students apply their understanding about how binary is used to create an image. They create their own image for a particular purpose by encoding a grid of pixels.
Learning tasks
- Set a task of creating a pixel image for a particular purpose; for example, create a character to import into a visual programming software such as Scratch; an avatar to use in safe online environments; a card for a celebration; or a symbol to convey a message to be displayed around the school. Collectively establish the criteria and evaluate the solutions.
Supporting Resources


Assessment
Explain how digital systems use whole numbers as a basis for representing a variety of data types.
Suggested approaches may include
- Rubric: Scope for a range of abilities, skills and understanding (creativity), based on solo taxonomy (above)