1. A method of using an image sensor and processing circuitry in an electronic device to generate an auto-exposed high-dynamic-range image, the method comprising: with the image sensor, capturing a first image; with the processing circuitry, generating a first exposure time and a second exposure time based on the captured first image, wherein generating the first exposure time and the second exposure time comprises generating statistics associated with the captured first image and determining an exposure level of the captured first image based on the generated statistics, and wherein determining the exposure level of the captured first image comprises identifying a target exposure level and a clipping exposure level of the captured first image and computing the exposure level as a linear combination of the target exposure level and the clipping exposure level; with the image sensor, capturing a second image having long-exposure image pixel values and short-exposure image pixel values, wherein the long-exposure image pixel values are captured using the first exposure time and wherein the short-exposure image pixel values are captured using the second exposure time; with the processing circuitry, generating a long-exposure image and a short-exposure image from the captured second image; and with the processing circuitry, generating the auto-exposed high-dynamic-range image using the long-exposure image and the short-exposure image.