Fundamentals of Computer Science I (CS151.02 2007S)

Homework 13: Transforming Portrait Photographs

This homework assignment is also available in PDF.

Assigned: Friday, April 13, 2007
Due: Tuesday, April 17, 2007
No extensions!

Summary: In this assignment, you will further explore the manipulation of existing images in the GIMP.

Purposes: To give you the opportunity to play a bit.

Expected Time: One to two hours.

Collaboration: You may work in a group of any size between one and four, inclusive. You may consult others outside your group, provided you cite those others. You need only submit one assignment per group.

Submitting: Email me your work, using a subject of CSC151 Homework 13.

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


As you may recall from class time during the lab on image manipulation, I tried (unsuccessfully) to come up with an interesting modification to make to our teaching assistant's picture.

Among other things, I tried rotating colors (not very interesting), scaling colors (not very interesting), finding the browns in the image and changing them to red (the test I wrote to identify browns was wrong), and a few other things.


Now it's your turn. Write a procedure, transform-portrait-color, that, given the color of one pixel from a typical portrait (say, one from a StalkerNet picture), generates another. Your procedure should be such that when applied to a full portrait, it gives an interesting result.

Your procedure should have at least one conditional (e.g., something to represent if the color is a shade of brown, remove the red component).

You may find it helpful to write a procedure that, given two colors, determines how close one color is to another.

Copyright Issues

As far as I know, Grinnell College owns the copyright in your StalkerNet photos. However, I also believe that academic fair use permits you to use those photos for this purpose, provided you do not post your results to the Web or make profit from those results. If you are uncomfortable using your StalkerNet photo, you are free to pick another portrait (e.g, a portrait of a current or past president) whose copyright is such that you are comfortable using it. If you cannot find such a photo, please speak with me (or email me) at your earliest convenience.



Thursady, 12 April 2007 [Samuel A. Rebelsky]


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 Sep 13 20:54:11 2007.
The source to the document was last modified on Thu Apr 12 22:04:35 2007.
This document may be found at

You may wish to validate this document's HTML ; Valid CSS! ; Creative Commons License

Samuel A. Rebelsky,

Copyright © 2007 Samuel A. Rebelsky. 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.