1. A method for processing images, the method comprising: setting for each pixel in a pixel array one of a plurality of integration times and one of a plurality of signal gains; generating corresponding digital data for each pixel in the pixel array; and grouping into a superpixel the corresponding digital data for adjacent pixels for the same color plane, wherein each pixel has associated with it a different combination of integration time and signal gain.