Intro Graphics Assignment 2
Image Processing
Due: September 23, 2004


Overview

In this assignment you will create a simple image processing program. The operations that you implement will be mostly filters which take an input image, process the image, and produce an output image.

Getting Started

You should use the following skeleton code as a starting point for your assignment. We provide you with several files, but you should only change image.cpp.

You can find starter images here, or use Google Image Search.  This assignment only deals with uncompressed 24-bit Windows BMP files.

A sample implementation for Windows is here.

A sample implementation for Linux (compiled on RedHat 9) is here.

How the Program Works

The user interface for this assignment was kept to the simplest possible, so you can concentrate on the image processing issues. The program runs on the command line. It reads an image from the standard input, processes the image using the filters specified by the command line arguments, and writes the resulting image to the standard output. For example, to increase the brightness of the image in.bmp by 10%, and save the result in the image out.bmp, you would type:
% image -brightness 1.1 < in.bmp > out.bmp
For each available image filter there is a corresponding optional argument. To see the complete list of options, type:
% image -help
If you specify more than one option, the options are processed in the order that they are found. For example,
% image -contrast 0.8 -scale 0.5 0.5 < in.bmp > out.bmp
would first decrease the contrast of the input image by 20%, and then scale down the result by 50% in both x and y directions. Another way of doing the same thing would be
% image -contrast 0.8 | image -scale 0.5 0.5 < in.bmp > out.bmp
which uses pipes instead of multiple options per command line. The ability to use pipes can be used to avoid creating temporary files. For example,
% image -contrast 0.8 | image -scale 0.5 0.5 < in.bmp | xv -

does the same thing as the previous command, but it redirects the final output to be the input of xv, which simply shows you the result on the screen, without creating any temporary files in your directory. Another advantage of this kind of interface is that you can combine different filters in shell scripts, and automate image processing steps, which can save you time.

What You Have To Do

The following is a list of features that you may implement (listed roughly from easiest to hardest). The number in front of the feature corresponds to how many points the feature is worth. For any feature that involves resampling (i.e., scale, rotate, "fun," and morph), you have to provide three sampling methods: point sampling, bilinear sampling, and Gaussian sampling.

Submission

You should create a web page with:

Hints