For this machine problem, you are to write a function in JES that will separate an image into 4 parts or quadrants. The quadrants would be created by "cutting" the picture in half vertically and horizontally. In each quadrant of the picture we wish to modify the pixels in a different way.
Look at the table below to understand what should be done.
Quadrant 1 Leave | Quadrant 2 Modify |
---|---|
Quadrant 3 Modify | Quadrant 4 Modify |
When you modify the saturation of a color in each quardant of the image, you may either remove all of that color (set the value of that color to 0) or you may set that amount of that color to the maximum (set the value of that color to 255). Below are three pictures. The first picture is the original picture. The second picture has all of desired color removed from each quadrant of the picture. The third picture has the desired color in each quadrant of the picture set to a maximum value.
Note the second picture. Since the picture is already dark,
the amount of each color is already
low. Thus setting the color value to zero doesn't make that big of a
change in the picture. Now consider the third picture. Setting the
color value to the maximum causes a much larger change in the picture.
Below is another set of three pictures. The first picture
is the original picture. The second picture has all of desired color
removed from each quadrant of the picture. The third picture has
the desired color in each quadrant of the picture set to a maximum
value. Hopefully Google won't mind if
I borrow and modify an image from their web site.
Note the third picture. Since the picture is mostly white,
the amount of each color is already
high. Thus setting the color value to its maximum doesn't make that big of a
change in the picture. Now consider the second picture. Setting the
color value to zero causes a much larger change in the picture.
Your program can either set the appropraite color value in each
quadrant to either zero or to 255. Once you find a picture
you might like to modify, determine which way will give you the
better effect. This choice is completely up to you; however, don't
set one quardant's color value to zero and another quadrant's color
value to 255. If you set one quadrant's color value to zero, set
the other two quadrant's color values to zero.
A few items to note for this project:
Each set of for loops will need an outer for loop and an inner for loop.
The outer loop will be used to determine the column value for each
pixel while the inner loop can be used to determine the row value
for each pixel.
You only need to electronically submit your mp3.py file.
We will use our onw picture for the grading of the assignment.
THe project name to be used with the UNIX turnin command
is mp3.
Since the name of the file will be the same for everyone, the
turnin command for you to use is:
$> turnin -c troy -p mp3 mp3.py
Department of Computer Science
University of Illinois at Chicago