On June 17th Barbara Ericson will be presenting a workshop on "Making cool pictures with Python" at the CAS National Conference (Bham). Barbara is the Director of Computing Outreach for the Institute for Computing Education (ICE) for the College of Computing at Georgia Tech in the US. She is passionate about increasing both the quality and quantity of secondary computing students and the quantity and diversity of computing students. In this conference blog series Barbara suggests using images, and specifically manipulating images programmatically, as a motivation for learning new programming skills and techniques.
Many programming textbooks have students write programs to calculate a sales tax or convert a temperature from Celsius to Fahrenheit. Most students don’t find these programs very interesting and they don’t allow students to be creative. Female students in particular value the opportunity to be creative. One approach that most students have found interesting and that allows students to be creative is having the students create programs to manipulate pictures. This is part of an approach called media computation, which was developed by Dr. Mark Guzdial at the Georgia Institute of Technology (Georgia Tech). In media computation students can create interesting visual affects while learning about how to work with loops, conditionals, objects, lists, and two-dimensional arrays. Working with the pixels in a picture is more concrete and interesting than working with numbers that don’t have any meaning.
Figure 1. A Python program that switches the colors in a picture
Our team at Georgia Tech in the United States has created a free interactive ebook with embedded Python programs to help teachers learn to teach the new Advanced Placement (AP) Computer Science Principles (CSP) course in the United States. That course is a broad introductory course that covers several big ideas in computing: creativity, abstraction, data and information, algorithms, programming, the Internet, and global impact. See http://tinyurl.com/TeacherCSP. This ebook was created for teachers with no programing experience and contains pedagogical content knowledge (PCK - how to teach computing concepts) as well as answers to the end of chapter exercises. There is also a companion ebook for students, which does not contain the PCK and answers to the end of chapter exercises. See http://tinyurl.com/StudentCSP. Both of these books include runnable and editable Python code that allows students to manipulate pictures. Students can mirror pictures, negate them, modify the colors, combine pictures, do edge detection, create image collages, and much more. See http://coweb.cc.gatech.edu/ice-gt/632 for examples of the types of picture manipulation people have done with media computation.
Figure 2. Combining two pictures
Teachers and students can also download a free integrated development environment, called JES, and do media computation in Python on their own machines. See http://coweb.cc.gatech.edu/mediaComp-teach#Python. This website contains materials for teachers such as slides, the code, and a solution manual.
One of the Advanced Placement exemplar labs for the A course, which is equivalent to a college level first course for computer science majors, is Picture Lab. I created this lab and the materials can be accessed at http://tinyurl.com/GT-PicLab. The materials include a teacher guide, which you might find useful if you decide to use picture manipulation in your courses.