a method of correcting color imbalance in a captured image includes deriving gradient data from a group of pixels in the captured image , determining a compensation value based on the gradient data , and applying that value to at least one pixel . apparatus for correcting color imbalance includes a digital image processor that corrects color imbalance , in an image that is output by an image detector , according to the method . each pixel may represent a color from a set of colors , with one particular color being a selected color , and each pixel to which the compensation value is applied representing the selected color . where the group of pixels forms a rectangular shape , the gradient data may include horizontal and vertical gradients . the classifying may be performed according to a visual characteristic of a portion of the image , where determining the compensation value is based also on the visual characteristic .