# Class 36: Algorithmic Art

Back to Complete Scripts. On to Input and Output.

Held: Friday, 4 April 2003

Summary: Today we consider a number of ways to use algorithms to generate or modify art.

Related Pages:

Assignments

Notes:

• We may have admitted students visiting today.
• I know that there are a number of questions on exam 2. We'll go over them for awhile.
• We can hold today's class in one of two ways: We can do a normal lab session or we can use the startegy we used on Wednesday.

Overview:

• Algorithmically generating and modifying images.
• Lab.

• Each image that the Gimp creates is effectively just a two-dimensional grid of color values.
• Hence, we can do interesting things using those color values.
• We can generate those color values using some formula.
• We can modify those color values using some formula.
• We can move those color values around.
• I call the use of algorithms to accomplish those and similar purposes algorithmic art.
• I've built a number of procedures to help with those purposes
• The procedure `(gsfu-create-image width height func)` creates a new image of the specified width and height by applying `func` at every position.
• `func` takes x and y as parameters and returns a color value (list of red, green, blue)
• The procedure `(gsfu-load-image filename)` loads an image.
• The procedure `(gsfu-map-image image layer func)` creates a new image by applying `func` at ever position.
• `func` should be a function from color to color.
• The procedure `(gsfu-map-coordinates image layer func)` creates a new image by applying `func` at every position. (Do you notice a trend here?)
• `func` takes many too many parameters for me to mention here.

## Lab

• Do the lab.
• Be prepared to reflect.

## History

Thursday, 16 January 2003 [Samuel A. Rebelsky]

• First version, created mostly automatically from previous course.

Back to Complete Scripts. On to Input and Output.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Tue May 6 09:30:08 2003.
The source to the document was last modified on Thu Jan 16 13:46:00 2003.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2003S/Outlines/outline.36.html`.

You may wish to validate this document's HTML ; ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu