1. A method of correcting color imbalance in a captured image, the method comprising: deriving gradient data from a group of pixels in a portion of the captured image; classifying the at least one pixel according to a visual characteristic of the portion of the captured image, wherein the visual characteristic is selected from the group consisting of vertical edge, horizontal edge, busy area and non-edge area; determining a compensation value based on the gradient data and also on the visual characteristic; and applying the compensation value to at least one pixel in the group of pixels.