This assignment is to be done with your teammate.
This is your chance to practice some basics of image processing. This is a warmup to the next assignment, where you'll do some "green screen"-like special effects.
Create a directory called image1 for this assignment. To
facilitate reading in, storing, and manipulating image files in
"standard" formats (like .jpg, .gif, and .png), we will use a module
called images.py
.
Copy images.py
into your directory from the above link or
from the course website. The documentation for images.py can
be found here.
If you're working on your own computer, you'll also need to install the Python Imaging Library (PIL), which images.py uses. Follow these instructions for installing PIL under Windows XP or Mac OS X. We already have PIL installed on the department Macs.
You'll also need some images to work with.
Download dave.jpg,
and amy.jpg into the same directory
as images.py
, or alternatively use your own image
files.
We'll start out with some basic image manipulations first. Your
task is to write a Python module called photolab.py
. It should
contain the following functions:
onlyRed(image)
negate(image)
main()
imageOriginal = FileImage('dave.jpg') redImage = onlyRed(imageOriginal) redImage.show('Only red',0,300)
Good luck, and have fun! Remember that lab assistants are available in the evenings in CMC 306 to help out if you need it.