Red-eye reduction in C# using the csXImage control.

The "Red-Eye" effect spoils many otherwise perfect photos. Even though digital cameras usually have a flash setting that prevents red-eye, how often do we forget to select that option?

Removing the red glare from the eye is very simple in applications that use csXImage. The method is demonstrated in the C# demo program supplied in the csXImage download.

The photo is corrected in two steps.

(1) A region around the eye, usually an ellipse or a circle, is selected. This requires just one line of code.

axImageBox1.MouseSelectEllipse();

(2) After the user completes the selection using the mouse, two further lines of code adjust the red intensity for pixels where it is the dominant colour.

axImageBox1.UseSelection = true;
axImageBox1.ReduceRedEye();

The result is shown below.

ActiveX loading a photograph in C#

Original photo

ActiveX selecting an image area in C#

Selecting the red-eye

ActiveX removing red eye in a C# image

The final result

<<Previous page