Lab 8: Image Manipulation
Due: 10pm Thursday April 5
Purpose: In this lab, you will learn the basic concepts of image manipulation. You will use 2-D arrays to store an image and use array concepts that you already know to change the image pixel by pixel. Have fun creating your own image effects!
You will write methods to create various image effects. An image is stored as an 2-D array of integers, where each element in the array corresponds to a picture element (pixel) in the image. For this lab, you will be reading in pictures in the JPEG format (.jpg files).
You will create the following effects on the image:
Your effect could be a color changing effect or pixel re-ordering effect. Just make sure your idea is original and has not been covered in class or discussion section.
To help you get started with the program we have provided the scaffolding in template.zip.
You will be modifying Transformations.java. This file already has the signature for the methods to rotate am image to the left, to adjust its brightness, and to mosaic the image. Also, for the last two we have some simple guidelines in the form of comments. You will need other methods to create other effects. You will also be modifying the main method to display your changed images. Notice that your methods must work on copies of the initial image so that the initial can be used by the various transformations.
We have provided a sample original image. Checkout the images after:
Original Image | Increase of brightness by 32 | Decrease of brightness by 32 | |
Replicate image 4 times | Left symmetry | Mosaic | |
Rotation to the left | Color inversion | Gray scale |
You need not match these exactly, but these should help visualize the changes required.
In addition to the testcase provided, you will need to submit your own testcase (picture.jpg). You can use a personal photo or one you find on the internet (try the Google image library or you favorite artist's web site).
Don't forget to document your effect in comments in your source file.
Extra Credit (20 units):
Implement two more transformations:
Include your names, slip days, and a comment at the top of your Transformations.java file. Answer the questions below in your header too.
/**
* @author name 1: discussion section time:
* CS account user name:
* Section Unique Number:
* slip days used on this assignment: ??/4
* total slip days used: ??/6
*
* @author name 2: discussion section time:
* CS account user name:
* Section Unique Number:
* slip days used on this assignment: ??/4
* total slip days used: ??/6
*
* On our honor, we followed the pair programming rules of splitting
* keyboard time evenly and 80% or more joint development, and we have
* neither read nor copied code, nor have we shown or given our code to
* others.
*
* @version Date
*
* Extra Credit attempted (Yes/No):
*
* Describe your image effect algorithm.
*/
For this lab, you will turn in a zipped folder containing all the source files and your testcase(.jpg file). You can create the zipped folder by Right-Clicking on the project you created in BlueJ and choosing "Send To" and then "Compressed (Zipped) Folder". Please make sure that all the files you need to turn in are in this folder BEFORE you zip it.
You then turnin this .zip file using the turnin program. If you need help goto turnin program help.
10% of your score will come from providing a testcase file.
60% of your score will come from "external correctness" which means you implemented all the effects that are required and at least one effect not covered in the lab or the discussion section.
30% of your score will come from "internal correctness" which means you used the specified Java constructs correctly, you captured the redundancy and structure correctly, you commented the header and code appropriately, and you followed the basic Java style guidelines.