CS 100 - Computer Literacy, Fall 2004

Lab 12

This lab assignment will have you write a jython program that will make a black and white version of a color image.

Reminder

The program Jython Environment for Students (or JES) is the development environment that we will use for this lab.

In the ACCC Labs, JES can be found by:

  1. Click on Start
  2. Then click on All Programs
  3. Then click on Class Applications
  4. Then click on Engineering
  5. Finally click on Jython Environment for Students

Making a Mirrorred Image

To create a mirrorred image, first the mirror point needs to be selected. Normally, the mirror point will cut the image in half. The image could be either cut horizontally to divide the image into a top half and a bottom half, or the image could be cut vertically to divide the image into a left half and a right half. When cutting the image horizontally to divide the image into a top half and bottom half, we must divide the height of the picture by two to find the mirror point. When cutting the image vertically to divide the image into a left half and right half, we must divide the width of the picture by two to find the mirror point.

To create the mirrorred image, the pixels from one side of the mirror point are copied to its corresponding pixel on the other side of the mirror point. If the image is being mirrorred horizontally, the corresponding pixels on either side of the mirror point are at:

    x, mirrorPoint-y for the point in the top half
    and 
    x, mirrorPoint+y for the point in the bottom half

    where the value of 
          x will range from 1 to the width of the image
          mirrorPoint is (height of image)/2
          y will range from 1 to the mirrorPoint
If the image is being mirrorred vertically, the corresponding pixels on either side of the mirror point are at:
    mirrorPoint-x, y for the point in the left half
    and 
    mirrorPoint+x, y for the point in the right half

    where the value of 
          mirrorPoint is (width of image)/2
          x will range from 1 to the mirrorPoint
          y will range from 1 to the height of the image

Lab Assignment 12

Due: Friday 11/19/2004 by 8:00 am

Create a file using JES that will

  1. Contain a comment indicating your Name, Net-ID, Course Name, Assignment Name and a short description of the assignment
  2. Contain a JES function that will 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.

Use the UNIX turnin command to electronically hand-in your python file using the project name of lab12. Note: you will need to transfer your python file to your icarus account before you can use turnin. You can do this by using the file transfer function of SSH or by emailing your python file to your incarus account. To submit the file in <filename>.py for lab12, the turnin command is entered as:

     turnin -c troy -p lab12 <filename>.py

You are invited to post any and all images you create in the discussion board area in blackboard. You can use that area to show the class how creative you are.