Section 4.8

Using Bits to Represent Images and Colors

Learning Goals


Objectives and General Description

Bits are grouped together to represent abstractions.  In Section 4.5, students learned that bits can represent numbers.  In Section 4.7, students learned that bits can represent characters.  In this section, students will learn how bits can be grouped to represent images and colors.  The students will use CS Field Guide to help them explore pixel colors and resolution settings while they complete a guided notes handout.  Then students will integrates art and coding by creating PixelArt.  There is an optional activity included as the third activity.  There is a link to a  software program from Georgia Tech that converts an image to a spreadsheet of data.  By manipulating the spreadsheet, students can modify the picture.  This can be done as a demonstration by the teacher if the software can't be installed on school devices.  


Activities

Activity 4.8.1 (30 minutes)


Activity 4.8.2 (budget 15 minutes)

Discover the relationship between RGB and hexadecimal color notation.  Have students go to W3schools color picker.  


Activity 4.8.3 (time varies)

Many students are very familiar with pixel art.  Minecraft is a popular game in which students have learned to create entire worlds using pixel art.  This is an opportunity to bring in a fun, educational element to APCSP.   

There are many ways to make pixel art in the classroom.  Here are some options:

Now for some creative ideas to incorporate art projects:


Activity 4.8.4 (15 minute demo)

Optional extension:  Students at GA Tech developed a tool that will convert an image to a spreadsheet of pixel locations & the RGB value of each pixel.  You can then mathematically manipulate the values on the spreadsheet and reverse the process to show picture manipulation.  For example, you can remove all the red and green from an image which leaves you with the image only in shades of blue.  Students can create grayscale images by averaging the RGB values, etc.  This software needs to be installed on a computer before you can use it.  It is NOT browser based.  I demonstrate this to the class and provide the link if they want to install it at home.  I start the demonstration by asking “Is the data for an image the same as the data for a spreadsheet?”  By the time I finish the demonstration, the students have learned that the same data can be rendered in a spreadsheet format or an image format.  The “data” is location on x, y axis and RGB values.  The tool renders it as an image or as a spreadsheet.  This is usually a powerful demonstration.  This software is free and can be found at Media Computation with Spreadsheets.  I highly recommend trying this out before demonstrating in class.  There is a link at the bottom of their webpage for a user manual.  One thing that I usually forget is that when you create a new spreadsheet, you need to name it differently than the original (use a Save As) and then close it before you upload the new spreadsheet back into the tool.