ASSIGNMENT DUE: EXTENDED TO WEDNESDAY APRIL 22, MIDNIGHT
Each of the five programs below is worth
20 points. You may work individually or in groups of two. Submit your programs by
- attaching the .py files to a page on your Google Sites
- copy-pasting the code onto the Google Sites page and providing an explanation of what the program does.
- emailing your instructor the URL to the page.
This assignment must be completed individually. You may discuss the projects with others in the
class, but you may NOT look at or copy their code. You will be asked to
demonstrate and explain your programs, so make sure you do your own
work and understand your programs completely. If you cannot fully
explain the programs you submit, you'll be given a 0 on the assignment.
Black and White
Write
a program to turn a color picture black and white (grayscale). Grayscale a
picture by modifying it so that
each pixel has red, green, and blue values which are the same. Each
pixel will instead be defined by a single number, its intensity:
intensity = (red + green + blue)/3
Take the original image and for each pixel, compute its intensity and
then set the red, green, and blue of the pixel to that number.
You'll need to use the getRed, getBlue, getGreen, setRed, setBlue, and setGreen functions, amongst others.
ScoreboardFind a picture from a jumbo screen or other ball park scoreboard, and write a program that replaces the information on that scoreboard with a personalized message (e.g., Sally, will you marry me?). Your program should:
- Draw color over the text on the original scoreboard.
- Write text or another image over that area.
The first step is to find an image of your favorite ballpark and use the JES Picture tool to determine the coordinates of the scoreboard. Then you can write a nested loop that colors over the current scoreboard contents. Finally, use addText to add your message.
Note that addText doesn't allow for a nice font or text color. If you want to do something that looks really good, you'll need to paint another image over the scoreboard area. However, just writing some text in the area is sufficient.
Picture FrameWrite a program that places a picture within a frame image and saves the resulting image to a file.
Use
Photoshop or Fireworks to create an image which serves as the frame.
The frame image should have some whitespace (e.g., the middle) which is
where the inner picture will go.
Your frame function should work with any inner
picture chosen by the end-user, no matter what its size-- whether it is smaller than the inner area of larger than the entire frame.
You will receive most of the credit for this problem if any inner picture or a portion of it is drawn within the frame and without a error message.
You will receive full credit if you scale or expand the inner picture so that it fits nicely within the inner area.
MirrorWrite
a program that mirrors the left side of an image onto the right-side of the image. Note that the original right-side of the image will be replaced with pixels from the left-side.BEFORE: AFTER:  Artistic AnimationWrite
a Python program which is an artistic animation of your choice. One idea would be to draw a picture in which every other pixel is grayscale. Or a picture that continually loops, modifying pixels in some interesting way. Be creative and do
something cool, and be prepared to show your work at class. Not sure if you're idea is worthy of full credit? Ask your instructor.
|
|