Docsity

CS 1316 Image Manipulation Homework: Implementing Image Filters, Assignments of Computer Science

Toggle sidebar
bg1
CS 1316 โ€“ Homework: Image Manipulation
Due: Friday, May 22nd, before 6pm
This is a pair programming problem! You are expected to work with the person you
have been pared with in class, and you are both responsible for submitting the
exact same code to T-Square.
The Problem:
You are new interns at Adobe. They have given you the job of implementing a few simple image filters.
By the end of the week you need to write code that will take an image and do three operations to it.
The first operation is to reduce the green value of every pixel by 50% (divide by 2). This will result in
an image that has will look more Red and Blue.
The second operation is to completely reverse the image. When you reverse an image you are making
the last pixel first and the first pixel last. Visually, this results in both a flip and mirror (upside down
and backwards) of the image.
The third operation is to negate the image. To negate an image you replace each color with its negation.
Remember that images are stored using 8 bits per color, so each color can have a value between 0 and
255. If the red portion of a color is 162, its negation is 255-162 or 93.
A previous intern has done all of the hard work and created a Java class called ImageManipulation that
prompts the user to load an original image, defines three methods to do the three operations, and
displays the resulting image. Unfortunately, they were fired for stealing lunches out of the break room
fridge before they could finish the code. It's up to you to finish the code so that it works.
Download ImageManipulation.java for the scaffolding code. Modify it (be sure to include your name,
email and collaboration statement in the comment at the top!) to complete the assignment.
(Example input image, and result.
Clockwise from the top left: Original
Image, Reduce Green, Negated, and
Reversed)
pf2

Partial preview of the text

Download CS 1316 Image Manipulation Homework: Implementing Image Filters and more Assignments Computer Science in PDF only on Docsity!

CS 1316 โ€“ Homework: Image Manipulation

Due: Friday, May 22

nd

, before 6pm

This is a pair programming problem! You are expected to work with the person you have been pared with in class, and you are both responsible for submitting the exact same code to T-Square.

The Problem:

You are new interns at Adobe. They have given you the job of implementing a few simple image filters. By the end of the week you need to write code that will take an image and do three operations to it. The first operation is to reduce the green value of every pixel by 50% (divide by 2). This will result in an image that has will look more Red and Blue. The second operation is to completely reverse the image. When you reverse an image you are making the last pixel first and the first pixel last. Visually, this results in both a flip and mirror (upside down and backwards) of the image. The third operation is to negate the image. To negate an image you replace each color with its negation. Remember that images are stored using 8 bits per color, so each color can have a value between 0 and

  1. If the red portion of a color is 162, its negation is 255-162 or 93. A previous intern has done all of the hard work and created a Java class called ImageManipulation that prompts the user to load an original image, defines three methods to do the three operations, and displays the resulting image. Unfortunately, they were fired for stealing lunches out of the break room fridge before they could finish the code. It's up to you to finish the code so that it works. Download ImageManipulation.java for the scaffolding code. Modify it (be sure to include your name, email and collaboration statement in the comment at the top!) to complete the assignment. (Example input image, and result. Clockwise from the top left: Original Image, Reduce Green, Negated, and Reversed)

Turn In: Submit to T-Square the ImageManipulation.java file after you have completed the assignment. You do not need to submit any .class or .java~ files. Grading: Followed the Turn-In Procedure correctly. Both partner's files match exactly. 10 pts Reduce Green 30 pts 20 pts โ€“ Reduces the Green value of each pixel by exactly 50% 10 pts โ€“ Reduces only the green color component of pixels Reverse 30 pts 30 pts โ€“ Correctly reverses the image Negate 30 pts 10 pts for each color channel correctly inverted Total Possible: 100 pts Misc Penalties: Program does not compile, or produces an error when running: -90 pt Violation of the CS 1316 programming guidelines (each) -1 pt No collaboration statement -100 pt