Hades logoHades applet banner
Purple fringing reduction

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

The so-called purple fringing image artifact compromises the image quality of many digital cameras. It occurs when dark objects are in front of bright areas, especially in wide-angle lens settings and wide aperture. As you can see in the demo image (a crop of a larger image of Cologne cathedral), the effect manifests itself with bright purple/blue artifacts around the high-contrast zones that completely dominate and destroy the picture.

The simple filter graph shown in the applet demonstrates a simple technique to at least reduce the purple fringing. The role of the special PurpleDetectionFilter is to detect image areas where the blue color component is larger than both the red and green components, with the required level-difference settable via the property-sheet. (Naturally, this filter could also have been constructed from multiple individual filters, but it seemed simpler to just write another Java class.)

The output of the PurpleDetectionFilter is a mask image, where 'purple' pixels in the original image are set to white, and the remaining pixels set to black. The mask image is then multiplied with a constant (blue) color (giving a blue mask image), which is then simply subtracted from the original input image. As you can see, this simple filter cascade reduces the purple fringing by a large amount.

Naturally, the simple algorithm shown here does not work very well when your input image contains purple areas that are real and not just imaging artifacts. A simple strategy to handle such cases are to restrict the PurpleDetectionFilter to a smaller region of the input image. A more complex algorithm would be to try combining the purple-detection with an edge-detection algorithm.

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/00-intro/02-imageprocessing/purple.html