1. A method of co Tting color imbalance in a captured image, the method comprising: deriving gradient data from a group of pixels in the captured image; determining a compensation value based on the gradient data; and applying the compensation value to at least one pixel in the group of pixels.