COS 426 / Assignment 2


Some results of the 1995 Graphics Class.

An image enhancer

Due 11:59 PM, Tuesday, October 10, 1995

This assignment will allow you to explore a variety of image enhancement, image processing and ``artistic'' ideas. The program will allow you to select a transformation type and then let you explore transformations along the selected axis. There will be two types of transforms, continuous (e.g., gamma), and enumerated (e.g., dithering types). You will have to fill in some code to define each of these filters.

For example, gamma will give you nine selections of various gamma settings to choose from. The original image will be shown at the top of the screen. When you select an image, it will move to the center and nine new choices will be presented. The choices to the left and right of the current choice will be only slightly different from the current one with the top and bottom rows moving more quickly away from the original one. Thus repeated choices should allow you to fully explore the space of possible transforms. This can continue until a new transformation type is selected.


To see a fully working example program, run this:
/u/cs426/bin/tkenhance /u/cs426/Examples/TkEnhance/lightyear2.ppm
Some example images from 1993 are also available.
Each filter is implemented as a separate Unix program. You will copy the directory
/u/cs426/Examples/TkEnhance
Most of the .c files contain empty filter routines which you will fill in.
imgNoise.c
contains a complete working filter, as an example. Your job will be to fill in the various image processing functions, throughout the .c files. Whenever you see the string WORK HERE, you will have some work to do. When you type make, you'll be building a program called imgwish, which contains all the usual Tcl/Tk stuff plus extensions for your image filters. tkenhance is a wish script for imgwish. Each time a new transformation type is selected an entry will be made in a list of transformations. An image script of the chosen transforms and parameters can be written, which can actually be used later to apply your group of filters to a number of images from the command line. You should try to make the code as efficient as you can. Think about operations that are used repeatedly, etc. For example, consider bitwise operations for the quantization, etc. You will also have to submit 12 image scripts (.imgsh). These will be used to see how your filters can work together to produce your final artwork.
The transformations must include the following list plus at least two creative ones of your own making. Note the noise function is already done for you as an example. The following filters are based on the following Web page: Image Processing By Interpolation and Extrapolation. There's some code for this in imgNoise.c which you may want to borrow for the following filters.


You will need to copy all the files from
/u/cs426/Examples/TkEnhance
TkEnhance wants your pictures to be in the PPM format. You can convert an RGB image to a PPM image like so:
toppm me.rgb me.ppm
Initially, you should probably use your 160x120 images, so the image processing algorithms go faster. When you find a filter combination that you really like, you should generate an image script for the filter and run that image script on your larger image. There's more documentation available about this. When you're all done, you should have twelve image scripts and some number of favorite warped, distorted, and disfigured images. Take one or two of your favorites, put them on your Web page, and mention the URL for them in the README file which you submit with your assignment. We'll put our favorites on the class Web page.

You can convert a PPM to a GIF file like so:

ppmquant 256 me.ppm | ppmtogif -interlace > me.gif

You can convert a PPM to a JPEG image like so:

cjpeg me.ppm > me.jpg
If your system doesn't have cjpeg, you can also view your picture with xv and save as a JPEG.

When you're done, please submit:

Please don't submit binaries, images, or core files.