CS 100 - Computer Literacy, Spring 2005
Lab 12
This lab assignment will have you write a jython program
that will posterize an image with 8 colors.
Reminder
The program Jython Environment for Students (or JES) is the
development environment that we will use for this lab.
In the ACCC Labs that have JES, it can be found by:
- Clicking on Start
- Then click on All Programs
- Then click on Class Applications
- Then click on Engineering
- Finally click on Jython Environment for Students
Posterization
Posterization is a technique that reduces the amount of color used in
an image. There is an example of this
in the examples from lecture 4/06. This example uses if statements
for reduce an image to 64 colors. For this lab, we will want to reduce
an image to the following 8 colors:
Black r = 0 g = 0 b = 0
| Red r = 255 g = 0 b = 0
| Green r = 0 g = 255 b = 0
| Blue r = 0 g = 0 b = 255
| Yellow r = 255 g = 255 b = 0
| Magenta r = 255 g = 0 b = 255
| Cyan r = 0 g = 255 b = 255
| White r = 255 g = 255 b = 255
|
Note that the red, green and blue values for each image is either
0 or 255. So when doing this, you will need to check the intensity level
for each of the three colors at every pixel.
If the intensity level for a color is 127 or less,
set the intensity of that color to 0.
If the intensity level for a color is 128 or more,
set the intensity of that color to 255.
Lab Assignment 12
Due: Friday 4/14/2006 by 12:00 noon
Create a file using JES that will:
- Contain a comment indicating
- your Name,
- Net-ID,
- Course Name,
- Assignment Name and
- a short description of
the assignment
- Contain a JES function that will
- allow the user to pick an image using pickAFile().
- change the selected image to an eight color posterized
image.
- display the posterized image.
- allow the user to save the image where the name of the
file is determined by using pickAFile().
This function may call other functions that are built-in to JES or
that you have written.
On the ACCC lab computers, the H: drive is a permanent
storage area for you. Saving files to this drive on one
computer can be accessed from another computer (even another
computer in a different lab). It is suggested that you save
your python programs to the H: drive.
You are to submit the file containing the JES function
that you created to make the black and white image
by emailing it to the CS 100 course account at
i100@cs.uic.edu.