1. A method of image stabilization, comprising: capturing a first image frame using a first set of gain and integration parameters, comprising analog gain and integration time based on image brightness; defining a first sub-part of the first image frame; determining a first sharpness score for the first sub-part; capturing a second image frame using a second set of gain and integration parameters, comprising a maximum analog gain setting; determining a second sharpness score for the second image frame based on at least a second sub-part of the second image frame; comparing the second sharpness score to the first sharpness score; adjusting analog gain and integration time for a next captured image based on the comparison of the second sharpness score to the first sharpness score; and capturing a third image frame using an analog gain setting between the setting for the first image frame and the maximum analog gain.