A redeye reduction system creates a first matrix of candidate pixels by
comparing a color-and-brightness parameter of image pixels to a first
threshold. Cohesive groups of candidate pixels are collected into
components, and the component having the pixel with the highest
color-and-brightness parameter is identified as first redeye region. The
average color-and-brightness parameter and the size of the remaining
components are compared to a range dependent on the values of the first
redeye region, and the components having values within the range are
defined as candidate components. The candidate component with the densest
pixel population is defined as a second redeye pupil region. The defined
redeye pupils are dilated and compared with a second threshold lower than
the first threshold to generate a new list of candidate pixels. The new
candidate pixels are colored dark gray and their adjacent pixels are
colored a lighter gray.