CS 100 - Computer Literacy, Spring 2005
Lab 14
Due: Thursday 4/28/2005 by 11:59 pm
This lab will have you modify the posterize() function
in posterize.py to
change the effect produced by this code.
You may (but are not required) to
upload an image created by this assignment to
Lab 14
web page on the
CS 100 Swiki.
Posterizing an image
Posterizing reduces the number of colors used by an image. The
name reflects how posters were created prior to today's color
printing capabilites. The following two images show the effect
of this posterization.
The original image:
The posterized images:
Lab Assignment 14
Due: Thursday 4/28/2005 by 11:59 pm
Write a function named posterize (and save it in a file named
posterize.py).
This function is to allow the user to select an image file,
posterize it (reduce the number of colors), display the
image and allow the user to save the posterized version of the
image.
You'll do this by changing the picture's pixels as follows:
- If the red value is greater than or equal to 128, set it to 200.
- If the red value is less than 128, set it to 100.
- If the green value is greater than 128, set it to 200
- If the green value is greater than 50 and less than or equal to 128, set it to 100
- If the green value is less than or equal to 50, set it to 0.
- If the blue value is greater than or equal to 192, set it to 255.
- If the blue value is less than 192, set it to 0.
The above images reflect the use of this postering definition.
You must submit the code that you used to posterize your
image by emailing it to the CS 100 course account at
i100@cs.uic.edu.