Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab Assignment 10: Image Manipulation with Georgia Tech MediaComp, Lab Reports of Computer Science

A laboratory assignment for the computer science i course (cis 201) at georgia tech, where students are required to manipulate images using classes from the mediacomp project. The assignment covers topics such as reading and displaying pictures, negative images, working with pixels in the (x,y) coordinate system, and adding vertical bars to images. Students are expected to compile and run the provided java programs, modify them according to the instructions, and submit the results.

Typology: Lab Reports

Pre 2010

Uploaded on 08/09/2009

koofers-user-ct3
koofers-user-ct3 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CIS 201 Computer Science I
Laboratory Assignment 10
Introduction
In this lab you will manipulate images using classes from the Georgia Tech MediaComp project.
See
http://coweb.cc.gatech.edu/mediaComp-plan/101
for more information on this project.
Files from this project can be found in
/home/student/Classes/MediaComp
and the documentation for the Java class used in this project can be found by following the
Documentation
link on the CS homepage.
Reading and displaying a picture
Copy the file
/home/student/Classes/201/Labs/Lab10/Pic.java
into a suitable working directory. You should be able to compile and run this file directly, with a
copy of the raptor picture displayed on your screen.
File other
.jpg
files on your system (use the
locate
command!), or find ones on the web and
download them to your current directory. Modify the program so that the picture to be displayed
is given as a command line parameter, in
args[0]
.
Checkpoint 1
Show us some of your pictures!
Negative images
Copy the file
1
pf3
pf4

Partial preview of the text

Download Lab Assignment 10: Image Manipulation with Georgia Tech MediaComp and more Lab Reports Computer Science in PDF only on Docsity!

CIS 201 – Computer Science I

Laboratory Assignment 10

Introduction

In this lab you will manipulate images using classes from the Georgia Tech MediaComp project. See http://coweb.cc.gatech.edu/mediaComp-plan/101 for more information on this project.

Files from this project can be found in

/home/student/Classes/MediaComp

and the documentation for the Java class used in this project can be found by following the Documentation link on the CS homepage.

Reading and displaying a picture

Copy the file

/home/student/Classes/201/Labs/Lab10/Pic.java

into a suitable working directory. You should be able to compile and run this file directly, with a copy of the raptor picture displayed on your screen.

File other .jpg files on your system (use the locate command!), or find ones on the web and download them to your current directory. Modify the program so that the picture to be displayed is given as a command line parameter, in args[0].

Checkpoint 1

Show us some of your pictures!

Negative images

Copy the file

/home/student/Classes/201/Labs/Lab10/Pic1.java

into your working directory and change the /* FIXME */ part so that it will use the command line parameter args[0] as the filename.

If you compile and run this program, it should display the picture exactly as the previous program, since the “new” pixels defined using setColor have the same red, green, and blue values as the original ones.

To make a “negative image”, you will want to change the values of red, green, and blue values so that they go from 255 to zero instead of from zero to 255. Specifically, given the value r for red, find a simple expression that will evaluate to 255 if r is zero that will evaluate to zero if r is 255, and that will handle values inbetween as well, as illustrated in the following table old r new r 0 255 1 254 · · · · · · 255 0

Then do the same thing for green and blue. Your actual parameters r, g, and b in the new Color(...) constructor should be replaced by these expressions.

Run your modified program with several pictures of your choosing.

(If you wish, you can use the grayscale conversion as described in class to produce a black-and- white “negative” image instead of the color one that we are describing here.)

Checkpoint 2

Show us your work at this point. Your displayed pictures should look like “negatives”.

Working with pixels in the ( x , y ) coordinate system

Instead of treating the image pixels as a one-dimensional array, we can also look at them in the ( x , y ) coordinate system, where (as we do in FANG), the origin ( 0 , 0 ) is at the top-right corner. The height and width of the picture can be obtained using methods defined in the Picture class.

Copy the file

/home/student/Classes/201/Labs/Lab10/Pic2.java

Try something!

Well, try something of your own choosing.

Checkpoint 5

And show us!