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.
/u/cs426/bin/tkenhance /u/cs426/Examples/TkEnhance/lightyear2.ppmSome example images from 1993 are also available.
/u/cs426/Examples/TkEnhanceMost of the .c files contain empty filter routines which you will fill in.
imgNoise.ccontains 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.
Compare your Gamma, Brightness, and Contrast
filters. Can you see the difference? What does it mean in
each case when the filter's value is less than zero or greater
than one?
File: imgContrast.c
/u/cs426/Examples/TkEnhanceTkEnhance 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.ppmInitially, 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.jpgIf 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: