# Class 35: Manipulating Images with Script-Fu

Back to Algorithmic Art: Lab. On to Drawing with Script-Fu.

This outline is also available in PDF.

Held: Tuesday, 31 October 2006

Summary: Today we consider some procedures for manipulating existing images.

Related Pages:

Notes:

• EC for attending the Dragstravaganza on Friday.
• There are some reports that CSC151 students have been asking TCs and Tutors questions pertaining to the exam. I will be working to resolve this issue.
• Happy Halloween!
• There were some serious typos in the sample code on the exam. I think they've all been fixed.

Overview:

• Primary image-manipulation procedures.
• Lab.

## Manipulating Images Programmatically

• 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 `(get-color-at image x y)` gets a color from an image.
• The procedure `(set-color-at! image x y color)` sets a color in an image.
• The procedure `(modify-image! transform image)` applies `transform` to every point in the image.

## Lab

Back to Algorithmic Art: Lab. On to Drawing with Script-Fu.

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 Thu Nov 30 21:43:31 2006.
The source to the document was last modified on Mon Sep 4 08:43:34 2006.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2006F/Outlines/outline.35.html`.

You may wish to validate this document's HTML ; ;

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright © 2006 Samuel A. Rebelsky. This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit `http://creativecommons.org/licenses/by-nc/2.5/` or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.