Red-eye reduction in VB.NET 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 VB.NET 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 VB.NET

Original photo

ActiveX selecting an image area in VB.NET

Selecting the red-eye

ActiveX removing red eye in a VB.NET image

The final result

<<Previous page

Cookies

This site uses cookies for functionality, traffic analysis and for targeted advertising. Click the Accept button to accept our Cookie Policy. The Cookie Policy page offers configuration for a reduced set of cookies for this site.