Schedule Readings Labs Assignments Mechanics Reference Contact CSC 151-01, 2008F

# Project: A Procedure is Worth a Thousand Pictures

Due: 10 a.m., Wednesday, 26 Nov 2008

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 `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.

## Preliminaries

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

• write instructions to create images using the GIMP painting tools;
• write instructions for turtle graphics;
• describe images as sequences of simple geometric primitives which you can also generate algorithmically;
• generate and render lists of spots;
• create a new version of an existing image using `image-variant`;
• create interesting patterns and shapes using `image-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);
• use numeric recursion to create string art and other geometric figures;
• create images by recursively dividing and coloring spaces.

You also know a number of other algorithmic techniques that could support creating images, such as various numeric functions, using lists and vectors to store collections of data, and techniques for repetition. It's now time to challenge yourself to use some of these ideas toegether to create images of your own design.

Rather than writing code that creates a single image, however, we want to challenge you to think about algorithmic processes that can create many different images depending on the given parameters. Hence the title, “a procedure is worth a thousand pictures.

## Assignment

Write a procedure, `(image-series n width height)`, that will generate the `n`th image in a series of at least 1000 related images. (Although you may be more successful if you allow a larger range of values, you should be sure your procedure works for at least the integers between 0 and 999, inclusive.) The images should be reproducible: that is, if a user gives the same `n`, width, and height twice, the resulting images should be the same. You should not use randomness to vary the images; instead, the differences should 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 perhaps 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 illusion of depth or motion? The effects of unpredictability 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. Be sure to mention the three (or more) algorithmic techniques you are using.

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, and the other showing how well your procedure scales the images to different sizes. Here's how.

1. From the Desktop, open your home directory. Create a new folder inside that is named after your project group members, e.g., `username1-username2`.
2. Save or copy a `.scm` file containing your Scheme code into this directory.
3. Create your three favorite images at a large size (at least 500x500).
4. Pick an `n` and create images of size 50x50, 100x100, and 200x200 with that `n`.
5. Save each image into the new folder, using a filename of the form `username1-username2.nnn.size.jpg`, 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`).
6. Save your design statement as a text file in this new directory, using the name `username1-username2.design.txt`. Also save your technique statement as a text file.
7. Again, from the desktop, open your home directory. Open your new folder and verify that it contains the images, design statement, and Scheme code. Then close it.
8. From your home directory, right click on your new folder and choose Create Archive.... Without changing any of the settings in the dialog, click the button.
9. Attach the `.tar.gz` file you just created to the email where you turn in your assignment.

## 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, your description of the code, and your success in using multiple techniques together. We may consider following criteria:

• Have you written a procedure that takes as parameters an integer (0 through 999), a width, and a height? Does it produce an image of the given width and height?
• Does your procedure generate at least 1000 distinct images?
• Have you used at least three techniques you learned this semester?
• Are the images reproducible? (Do they vary based solely on `n`? You should not use randomness.)
• Does your procedure scale appropriately? (Do smaller images look similar to larger images produced with the same `n`?)
• Are your statements clear, concise, and accurate?