Fundamentals of Computer Science I: Media Computing (CS151.02 2007F)


Due: 4 p.m., Friday, 30 November 2007

Summary: At this point in your career, you've learned a number of techniques for making images algorithmically. This project is an opportunity for you to pick one and explore it some more depth.

Purposes: To explore some aspect of image generation in depth. To emphasize the more creative components of this course.

Collaboration: We encourage you to work in groups of size three. You may, however, work alone or work in a group of size two or size four. You may discuss this assignment with anyone, provided you credit such discussions when you submit the assignment.

Submitting: Email your answer to . The title of your email should have the form CSC151.02 2007F Project and should contain your answers to all parts of the assignment. Scheme code should be in the body of the message. You will also submit two sets of three images and your design statement following the instructions at the bottom of this assignment.

Warning: So that this assignment is a learning experience for everyone, we may spend class time publicly critiquing your work.


While the primary focus of this course is on learning how to write, describe, text, and analyze algorithms, our secondary focus is on writing algorithms that generate “interesting” images. We have certainly explored a wide variety of techniques for generating images. For example, you can

  • create a new version of an existing image using;
  • create interesting patterns using region.compute-pixels!;
  • specify and modify lists of spots and then present them on the canvas in various ways (as pixels, as square regions, even by drawing dots with different brushes);
  • write instructions to create images using the GIMP painting tools;
  • use numeric recursion to create spirographic and geometric images;
  • create images using text (in one of the sections);
  • describe images as sequences of simple geometric primitives which you can also generate algorithmically;
  • create images by recursively dividing and coloring spaces.

You also know a number of other techniques that support making images, such as the random procedure, various numeric functions, and techniques for repeating actions. It's now time to challenge yourself to do something bigger.


Write a procedure, (image-series n width height), that will generate the nth image in a series of at least 1000 related images. (You will be more successful if you allow many more than 1000, but you should start with 1000.) You should not use randomness to vary the images; instead, the differences will be based solely on the choice of n.

In creating these images, you should strive to use at least three different techniques that we have learned this semester.

Your process should scale appropriately. That is, a 1000x1000 image should look similar to a 100x100 image, just bigger (and slower to compute). We will certainly use your procedure to create relatively large images, images that we could comfortably print or use as a backdrop.

In addition to the procedure that creates a series of images, you should write a two short statements. The first statement, which we call the design statement, is intended for non-programmers and should explain the intent of your series. Are you exploring color? The use of shapes? The effects of limited randomness on an image? Why? The second statement, which we call the technique statement is intended for your peers (that is, folks who know about as much programming as you do) and should explain the programming and algorithmic aspects of your work and how you used code to achieve the result you described in the design statement.

Finally, tell us three values of n that, when given as parameters to your procedure, cause it to produce especially interesting (and distinct) images.

Submitting the Project

Email your program, design statement, technique statement, and representative values of n to . Do not send images.

Because it might take a while to create images, you should also provide us with copies of certain images. We would like two sets of images: One giving the three images you've chosen as particularly nice representatives of your series. The second showing how well your procedure scales the images. Here's how.

  1. Create your three favorite images at a large size (at least 500x500).
  2. Pick an n and create images of size 50x50, 100x100, and 200x200 with that n.
  3. Save each image to your home directory using a name of the form csc151-02.username1-username2.nnn.size.png, where username1, etc., are the usernames of the team members, nnn is the number used to generate the image, and size is the size of the image (e.g., 50x50, 100x100, 200x200, or 500x500).
  4. Save your design statement as a text file to your home directory, using the name
  5. Open a terminal window by clicking the small icon of a computer monitor on the left side of your toolbar.
  6. Type ls to see a list of the files in your home directory.
  7. To copy a file to the dropbox, type a command of the form
    cp filename /home/davisjan/151-web/dropbox/
    Do this for your design statement and for each of the six image files you created.

Important Evaluation Criteria

Professor Kluber will visit our class the week after this project is due to discuss and assess the aesthetics of your work and your success in meeting the criteria you have stated for yourself.

We will assess your code, you description of the code, and your success in using multiple techniques together.

Creative Commons License

Samuel A. Rebelsky,

Copyright 2007 Janet Davis, Matthew Kluber, and Samuel A. Rebelsky. (Selected materials copyright by John David Stone and Henry Walker and used by permission.)

This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.