Remove Purple Fringe

The Defringe transformation helps you remove purple fringing from digital images. Purple fringing is a blue to magenta edge surrounding clipped highlights of an image. While I have never seen a satisfactory explanation of the exact cause of this phenomenon, it is not chromatic aberration which has very different characteristics. More likely it is caused by leakage from overexposed pixels into neighboring red and blue pixels. In any case, most digital cameras have this problem to some degree depending on the subject, camera sensor and lens. Commonly it surrounds overexposed highlights in an image (as in the example below) or at the edge between trees or buildings and a very bright or overexposed sky.

  

                                                                Examples of Severe Purple Fringing

The idea behind the defringe transformation is simple -- first locate purple fringe pixels and then desaturate them, i.e. replace the purple color with a neutral gray. Two criteria characterize a purple fringe pixel:

It must be purple as defined by its hue being in a specific range.

It must be within a given distance of a pixel brighter than a given threshold value.

In other words, defringe makes every purple pixel sufficiently near a bright pixel gray.

How to Tell Purple Fringing from Chromatic Aberration

Unlike chromatic aberration, purple fringes are only purple and can be anywhere in the frame. Color fringes from chromatic aberration are most pronounced at the edges and especially the corners of the image. They also come in pairs of complementary colors (red/cyan, magenta/green or blue/yellow), and are usually visible at any sharp edge, not just edges adjacent to overexposed highlights. Here is an example of chromatic aberration from the edge of a much larger image. Chromatic aberration can be removed using the Chromatic Aberration transformation.

Using Defringe

 

Amount

The Amount control works the same as for other transformations. It can scale back the overall effect of the transformation or isolate the effect to specific parts of the image via a mask.

Radius

The Radius slider sets the maximum distance a pixel can be from a bright pixel and still be considered a purple fringe pixel. This should be set to roughly the fringe width in pixels or perhaps a bit larger since the effect falls off gradually as you reach the full radius value. Try to use the smallest value that removes all the fringe so as to minimize the impact on other parts of the image.

Threshold

The Threshold slider defines how bright a pixel must be to qualify pixels within the radius setting as purple fringe pixels. Set the threshold as high as possible while still maintaining the desired effect as this will minimize collateral damage to other parts of the image.

Hue Range

The Hue Range slider defines the range of hues you want to consider as purple. If the selected range is too narrow, the transformation will not remove all the fringe. If the range is too wide it may start affecting other parts of the image.

At the top of the hue range is a color strip that shows you the full range of possible hues with magenta in the center. There is also a gray bar and four sliders - two white ones above the bar and two black ones below it. Moving the white sliders moves the corresponding black slider at the same time. The range of hues between the white sliders is fully selected as indicated by the gray bar between them being white. Moving the black sliders extends the hue range, causing its effect to fall off gradually for pixels whose color is adjacent to the fully selected range. These partially selected hues between the black and white sliders are affected but to a lesser extent than pixels with fully selected hues. Pixels with hues outside the range defined by the black sliders will not be affected by the transformation at all. This range feathering reduces artifacts due to the effect of the transformation suddenly cutting off.