Below is the base image that you are to manipulate. (You'll need to download this picture and store it in your media directory. Right click on this picture, choose "Save As," then save it in your media directory.)
You are to turn it into this:
You will do this by:
Write a function called exam1 in the file exam1.py which will:
Open the base image (flower.jpg).
Copy it into the canvas 640x480.jpg starting from the source (1,1). Notice that this is an all-gray image, so each pixel should have red=green=blue.
Mirror it left-to-right but only copy the red! Set the green and blue of each copied pixel to zero.
Mirror it top-to-bottom but only copy the blue! Set the red and green of the target pixels to zero.
Now, mirror the all-red square down, but set the green of each target pixel to the red of the source pixel. Set the red and blue of each target pixel to zero.
RETURN the resultant canvas.
This is a NON-COLLABORATIVE ACTIVITY! You may not talk to anyone about their code, nor look at anyone else's code, nor allow anyone to see your code. This is a TAKE HOME EXAM. It is an "open book" exam. You may use your book, any slides, any material in the CoWeb, and any programs you've written (even with others). (
Ask questions on Summer 2004 Take Home Exam 1 Questions Page but be sure to ask questions only about objectives and process. You are welcome to ask questions about any of the programs in the book or in the slides, or any of the topics in the class (e.g., "I don't understand mirroring – can you help me go through it again?") but you cannot ask anyone (even the TA's or teacher) about your own solution. DO NOT POST ANY OF YOUR CODE ONTO THIS PAGE IN ASKING QUESTIONS!
Turn in your program via JES as "exam1". When you turn in your exam, you are to enter into the Comment area the statement: "I did not provide nor receive any aid on this exam." IF YOU CANNOT MAKE THAT STATEMENT TRUTHFULLY, DO NOT SUBMIT YOUR EXAM! ANY EXAM WITHOUT THAT STATEMENT WILL NOT BE GRADED.