# (Mini-)Project 8 : A procedure is worth a thousand pictures

The starter code for this project is image-series.rkt.

## Preliminaries

While the primary focus of this course is on learning how to write, describe, test, and analyze algorithms, our secondary focus is on writing algorithms that generate “interesting” images. We’ve created images with basic shapes, transformed existing images using color transformations, designed images as functions from positions to colors, and even wrote procedures that work with individual pixels.

At the same time, you’ve learned a variety of techniques for doing complex computations, particularly a variety of kinds of recursion (over lists, arbitrarily nested lists, pair structures, vectors, and numbers). You’ve also considered a variety of ways to store compound/complex data, including lists, vectors, pairs and pair structures, nested lists, and hash tables.

We also hope that you’ve learned a bit about working with other people as well as the different kinds of strengths that people bring to problem solving.

It is now time for you to bring your skills and sknowledge together to create more complex images of your own design, using those images to better understand an extant image.

Rather than having you write code that creates a single image, however, we want to challenge you to consider the algorithmic processes that can create many different (but related) images. Hence, the subtitle of this project, “a procedure is worth a thousand pictures” (a play on the aphorism “a picture is worth a thousand words”).

## Project specification

Identify an image (artistic, informative, …) or collection of images that you would like to use as a starting point. Your goal will be to generate a variety of variants of the image. In part, your goal is to be able to make individualized versions of the image. In part, your goal is to be able to better understand the underlying design ideas in the image.

Write a procedure, (image-series n width height), that takes three non-negative integers as input and generates a width-by-height image that is similar to your source image. Different values of n should give observably different images. You should support values of n between 0 and 999, inclusive. (You may also support other values of n.)

You should find ways to use the following in your project.

• At least two of the four ways we have of thinking about images: shapes, create-bitmap, bitmaps, and transforming images (with image-map).
• At least two kinds of recursion.

### Design plans

Rather than just building whatever comes to mind, you should begin by coming up with a “design document” in which you sketch the goals of your project. Your document will have two parts: A textual description of what you are trying to achieve and how you anticipate doing so as well as a hand-drawn sketch (or sketches) of the kinds of images you hope to make.

### Presentation

Your group will give a 5-minute presentation to the class on your project on Wednesday, 6 December 2023. In your presentation, you should plan to discuss the original image, your design plans, show some images you geneated, and highlight one or more pieces of code you are most proud of. You should also be prepared to answer questions.

You must submit the slide deck for your presentation (PDF or Powerpoint) along with your project file.

### Time log

This project is scheduled for two weeks of class. We ask you to spend about five hours of out-of-class time plus about 2.5 hours of in-class time per team member, which includes planning, writing, development, and presentation preparation. No one should spend less than 6.5 hours. No one should spend more than 10.5 hours. Please keep track of your time as you go in a time log that includes start time, stop time, elapsed time, and activity . Here’s an example.

Taylor  2023-11-19 09:00-09:30  30 min  Met with reference librarian
Taylor  2023-11-19 15:00-15:15  15 min  Found some good images
Taylor  2023-11-20 20:00-21:00  60 min  Discussed project with team
Taylor  2023-11-21 09:00-09:30  30 min  Started designing concentric-circles
Taylor  2023-11-22 11:15-12:00  45 min  Wrote concentric-circles; buggy
...
Toby    2023-11-19 14:00-14:15  15 min  Asked art history friend for ideas
Toby    2023-11-20 20:00-21:00  60 min  Met with team; they chose my idea!
Toby    2023-11-23 09:00-10:00  60 min  Helped Taylor debug concentric-circles
...

### Learning summary

Each group member should individually reflect on what they learned in the project. You might consider what you learned about the work you are studying, programming, teamwork, yourself, etc. You will enter this reflection in the MP8 post assessment.

## What to submit

Your code, saved as image-series.rkt. The file should include your time log, your design discussion, and any notes you have on “outstanding code”.

The original image(s) that you are using as an inspiration.

Your sketch or sketches as you reflect on the original image and how you will generalize it.

Your presentation as a PDF or PowerPoint document. Please pick a team name and name it Team.pdf or Team.pptx, as appropriate.

Four images (at least 600x500, no more than 3000x2000). Please name them Team01.png, Team02.png, Team03.png, and Team04.png, substituting the name of your team.

Learning summary (submitted separately and individually). In two or three paragraphs, summarize what you learned from doing this project. You will enter this on the post-assessment.

## Rubric

This rubric is approximate. Our goal is that if you do the work and follow good habits, you should get at least an M.

There are no redos available for this project.

### Required for M

[ ] Includes all necessary files
[ ] image-series.rkt
[ ] The original images
[ ] The sketch or sketches
[ ] A powerpoint
[ ] Project runs and produces different images for different values of n
[ ] Includes design description
[ ] Time log appears reasonable
[ ] All team members document spending at least 6.5 hours on the project
[ ] Presentation is approximately 5 minutes
[ ] Presentation includes goals and code description
[ ] Code correctly formatted (a few mistakes are permissible)

### Required for E

[ ] At least one of the following, at the discretion of the grader.
[ ] A particularly nice procedure or piece of code (please describe in documentation)
[ ] An outstanding, nearly flawless, presentation
[ ] All procedures documented
[ ] Almost no inefficient or otherwise bad code
[ ] Clear documentation
[ ] Well-organized code file

## Some potential inspirations

• Kazimir Malevich’s Eight Red Rectangles.
• Louise Nevelson’s painted wood pieces.
• Sol LeWitt’s wall drawings, particularly #51, All architectural points connected by straight lines and #273, Lines to points on a grid.
• Sonia Delaunay’s Rhythm colour no. 1076 and others.
• Some of Andy Warhol’s Marilyn images.
• Piet Mondrian’s works, particularly from the De Stijl period.
• Alexander Caulder’s mobiles.
• Fractal broccoli.

Can we load in an existing image?

Yes, provided you cite it. Also, make sure to submit the image along with your work so that we can run the code.

Note that we are relying on the Fair-Use doctrine for copyrighted images. Please do not distribute them to others.

What is image-compute?

The old name for create-bitmap.

Can we use 2htdp/image procedures we have not covered in class?

Certainly.

Do you have hints for computing, say, the height of a star of side-length l?

I’ll admit that I would do so experimentally (at least as a starting point).

(define star-height-scale-factor
(/ 100
(image-height (star 100 "solid" "blue"))))

; A star of height 85
(image-height (star (* star-height-scale-factor 85) "solid" "yellow"))

How do we determine what typefaces are available?

It’s “whatever is on your system”. I’ll be using a fairly stock Macbook Pro.

Should we use the starter code?

Yes.

Can we assume a minimum image width and height?

Yes, provided you document it.