University of Leicester

computer science

CO2016 Worksheet 2 (Image Manipulation)

The main outcome of this worksheet is to learn how to do image manipulation. In this worksheet you will write two image manipulation methods.

Note: The worksheet is assessed and counts for 20% of your coursework mark.

Exercise 1

You are asked to complete the ImageManipulation class that allows manipulation of an image via two static methods in Java. The first method should add a constant to the rgb values. The second method should swap two of the three rgb values (e.g. swap the red with the blue or the green with the blue).

The applet below demonstrates how your finished work should function:-

Additional hints

Throughout your work you may find it useful to write private methods to:-

  • convert from a single RGB pixel value to an array of 4 integers and back (Hint: Read your lecture notes)
  • add the RGB value to a single pixel value

Consult the javadoc for the ImageManipulation class.

| [University Home]|[Faculty of Science]|[MCS Home]|[CS Home]|UCAS|[University Index A-Z]|[University Search]|[University Help]|

Author: Stuart Kerrigan (sk223@mcs.le.ac.uk).
© University of Leicester 19th January 2006. Last modified: 10th February 2006, 15:11:23.
CS Web Maintainer. This document has been approved by the Head of Department.