In our Graphics Studio course, we continue to use Python to create compelling computer artwork.
Before the winter holidays, students learned how to write simple image filters. An image filter is an algorithm that manipulates an input image pixel by pixel, and produces as output a transformed image, typically related to the original image in some way.
Many of our filters changed the colors and/or the contrast of the original image. For example, we wrote filters to convert a color image to grayscale, and to invert the colors of an image (like a photographic negative). Other filters were geometric in nature. Making a vertical reflection about the centerline of a student's face proved to be entertaining, and we also experimented with ways to turn two or more student faces into a single combined image. Finally, a few courageous students worked on writing more complex filters, such as a blur and a sharpen.
Some sample transformed images of Proof School students are shown below:
Students are now learning to write programs in VPython, which is the Python programming language plus a 3D graphics module. VPython makes it easy to write programs to manipulate three-dimensional objects, such as spheres, cubes, cylinders, pyramids, and cones.
As part of our initial work with VPython, students were challenged to create a 3D version of the Proof School "squircle" logo. Screenshots of three student squircles are shown below. VPython is a cloud-based programming environment, and I have placed the student code for these three squircles online.
You can look at the code, run the programs that created the images, and then zoom in, zoom out, and rotate the images to take a closer look at them. Have fun!
-- Steve Gregg