|
Four years ago, before I entered college, I knew that I wanted to study computer science. The only programming I had done at that time was on a TI calculator that began as an assignment in high school geometry class. There was no question in my mind though; computer science was what I wanted to do. Ironically, I didn’t choose Wittenberg based on its computer science department. I chose to attend Wittenberg because of its reputation for providing students with a strong liberal arts background and when I glanced over the course offerings, I saw a large number of art classes too.
Computer science is important to me, but I would never go as far to say that nothing else matters (i.e. my goal in life is not to get a Ph.D. and teach at MIT). I’m a bigger person than that; and if I have learned anything at Wittenberg it is that it takes many unique pieces to make a well-built whole. To that end, the most interesting dichotomy I see within myself is that of the computer scientist and the artist. At times art becomes almost as important to me as computer science. It appears to be the balancing force in my life and allows me to think differently than a conventional programmer. In the end I believe the two interests compliment each other; each part is better off because the other exists.
The Problem
An image filter can be thought of as ‘something’ applied to one image in order to produce another image. A common application of filters is in photography. For example, there are filters that go over the lens of a camera to help the photographer produce a different image than one that the camera would normally see. For example a polarizing filter helps to eliminate reflections, which is a desired effect in many instances. Filters may also be used in a darkroom setting to increase or decrease the contrast of a poor negative [HOUG91:114-117].
For a computer, an image ‘filter’ is an algorithm. The computer applies a number of operations on the pixels of a digital image in order to produce a new image based upon the first. This sort of image manipulation is approximately 40 years old [PITA00:1]. In the past, this processing has been used in image restoration or image enhancement. Images tend to be degraded in the digital conversion process, for example in errors in the CCD sensor of a digital camera or in dust interfering with the scanning of a photograph or photographic negative [PITA00:2-3]. Previously, the most common use of a digital image filter was to ‘clean-up’ these errors or possibly to enhance certain details of an image. I however, chose to research digital image filtering because it seemed a natural way to merge computer science and art.
I have been using Adobe® Photoshop® (an advanced image creation and editing software package aimed at digital artists) for about five years in the creation of my own artwork. One of the most powerful features in Photoshop® is its wide range of filters allowing an image, or part of an image, to be completely altered with a few mouse clicks. To name a few of these possible effects, Photoshop® can: make an image look like it was drawn with colored pencil, chalk and charcoal, or painted with watercolor; create film grain, a mosaic, or color halftone; blur an image; render lens flares; sharpen edges; remove noise; et cetera, et cetera.
An artist, digital or otherwise, would never use one of these filters on a scanned snapshot and call it a piece of art, but would use a few select filters, in select parts of a composition to enhance the overall image. For example, in my own work I use many different scanned, cut-out, images—usually even my own handwriting—built up on top different layers. Rarely will anything end up looking like I cut out a photograph and collaged it with other cut-out photographs. I remove the photographic quality in a number of different ways in a movement toward abstraction; one of those ways is through filters.
With the use of these filters at an essential base to my digital artwork, the computer scientist finally asked the artist: “Yeah, they’re cool, but do you know how they’re done?” The artist answered quietly, “No, but neither do you.” And so, the dichotomy fused. I decided that I needed to learn how at least some of the basic filters worked, and if possible, write my own.
Recently, the computer has been viewed by some as a powerful extension of the photographic darkroom, and in many instances, an entire art medium in itself. This research investigates both the technical and non-technical sides of digital image filtering, illustrating a recent ‘blur’ between the once disjoint lines of computer science and art. Image filters are the basic bridge that binds the computer science and art worlds. The true digital artist may soon be known not only by his or her compositions but also the ability to write the code that produces the effects he or she desires.
Getting Started
Initially, I learned that Photoshop® had its own simplified programming language that allowed users to create their own filters. I found a few resources ([STRE98], [ADOBFF]) and a few Internet sites with filters that had been created using the Photoshop® Filter Factory. However, I found the programming syntax to be somewhat cryptic and the limitations of the programming language a major downfall. The largest limitation was the absence of some sort of looping construct (i.e. there was nothing equivalent to C++’s for, while, or do…while). The only advantage I found in using Filter Factory to study image filtering algorithms was that I would be able to use the filters in Photoshop®. Understanding the limitations, however, I put down the Filter Factory literature.
Implementing filter algorithms and, literally, seeing the results I felt was the best way to learn about them. I decided to write a small application, which I call FilterExplorer, that would allow me to open images, view them on the screen, apply a filter algorithm, and see the results. The implementation of a Windows® GUI program that would simply open an image quickly became a large hurdle to jump before I could even think about filter implementation. (In fact, a large amount of time while conducting this research dealt with implementation issues. I found this a welcome ‘problem’ as it forced me to learn some Visual C++® techniques that up until now I had not had the opportunity to use.) Fortunately, I found a great resource on the Internet, [SMAL00], that gave code to open and save JPEG and BMP images in a MFC (Microsoft® Foundation Class) Visual C++® application. Combining this code with that of code from filter implementation resources (mostly, [PITA00]), I had a base application that would open color images in which I could then manipulate each red-green-blue component, of each pixel, individually.
Filter Type Descriptions
According to [LIND91:299] there are four categories of image filtering, or processing, algorithms: point processes, area processes, frame processes, and geometric processes. Point processes alter each pixel in an image based only on the original value of the pixel. Area processes alter each pixel based on the values of the original pixel and the values of the surrounding pixels. The surrounding pixels are usually defined by choosing a radius and a square ‘kernel’ of pixels (with the chosen radius) around a center pixel. All pixels inside the kernel are processed in order to get a new value for the center pixel. Frame processes are used to combine images; new pixel values are determined by that pixel’s relationship to one or more other images’ corresponding pixel values. Geometric processes are like point processes (i.e. only one pixel value is used to determine a new pixel value) but the new pixel value is based upon some geometric transformation.
This report and FilterExplorer include examples of all the above types except the frame processes. By definition frame filters involve use of more than one image, and while that could have been implemented, for simplicity, it was not considered.
By nature of the above definitions, point filters will only alter the color, or value, of an image, for example, in converting a color image to grayscale or inverting the colors in an image (like a photographic negative). Area filters usually leave the basic image ‘shape’ intact but usually alter an image more than just modifying its color. Many artistic filters are based on area filters due to their versatility. Examples of these filters range from a simple blur, to an oil paint effect, to creating an edge outline. Geometric filters usually leave the color of an image alone but move its pixels. A simple geometric filter would be a 180-degree rotation.
I have divided the filter descriptions in this report and their implementation in FilterExplorer into four sections: point filters, area filters, geometric filters, and artistic filters. All conform to the definitions given above; the artistic filters are either strict area filters or use a combination of techniques (some not specifically defined here).

Figure 1: Area Filter Processing, modified from [LIND91:368]
In the next section I will look at the implementation of the FilterExplorer application, including the straightforward manner in which images are stored and manipulated and the image support functions that lay a foundation for filter implementations. A detailed description of the image filters I have implemented follows the program description. The reader is encouraged to try FilterExplorer
(downloadable here) with a sample image along with reading this report.
Go to Implementation & Support
Functions
Return to top and the table of contents
|