A method of image processing for an electronic device (100, 200) comprising a camera module including an image sensor having a first pixel group and a second pixel group, wherein the first pixel group comprises at least one first pixel and the second pixel group comprises at least one second pixel, the method comprising: operating the camera module in a normal AE (auto exposure) mode to acquire an image by exposing the first pixel group and the second pixel group of the image sensor with an exposure time in normal AE mode being automatically adjusted by measuring an appropriate exposure for a target object; analyzing an image brightness histogram of the acquired image; setting a first exposure time of the first pixel group longer than the exposure time in normal AE mode if the image contains an underexposed region; setting a second exposure time of the second pixel group shorter than the exposure time in normal AE mode if the image contains an overexposed region; determining whether the difference between the first exposure time and the second exposure time is greater than or equal to a preset threshold; operating the camera module in a HDR (high dynamic range) mode if the difference between the first exposure time and the second exposure time is greater than or equal to the preset threshold, wherein when the camera module operates in the HDR mode, the method further comprises: starting (901, 951), at the same time, exposure of the first pixel group with the first exposure time and first exposure of the second pixel group, with the second exposure time being shorter than the first exposure time; acquiring (905, 955) a first image at the end of the second exposure time shorter than the first exposure time by using the second pixel group; starting (907, 957) second exposure of the second pixel group with a third exposure time; acquiring (911, 961) a second image at the end of the third exposure time by using the second pixel group; acquiring (911, 967) a third image at the end of the first exposure time by using the first pixel group; generating (913, 963) a fourth image by combining the first image and the second image; and generating (915, 969) a high dynamic range image by combining the third and fourth images. operating the camera module in a normal AE (auto exposure) mode to acquire an image by exposing the first pixel group and the second pixel group of the image sensor with an exposure time in normal AE mode being automatically adjusted by measuring an appropriate exposure for a target object; analyzing an image brightness histogram of the acquired image; setting a first exposure time of the first pixel group longer than the exposure time in normal AE mode if the image contains an underexposed region; setting a second exposure time of the second pixel group shorter than the exposure time in normal AE mode if the image contains an overexposed region; determining whether the difference between the first exposure time and the second exposure time is greater than or equal to a preset threshold; operating the camera module in a HDR (high dynamic range) mode if the difference between the first exposure time and the second exposure time is greater than or equal to the preset threshold, wherein when the camera module operates in the HDR mode, the method further comprises: starting (901, 951), at the same time, exposure of the first pixel group with the first exposure time and first exposure of the second pixel group, with the second exposure time being shorter than the first exposure time; acquiring (905, 955) a first image at the end of the second exposure time shorter than the first exposure time by using the second pixel group; starting (907, 957) second exposure of the second pixel group with a third exposure time; acquiring (911, 961) a second image at the end of the third exposure time by using the second pixel group; acquiring (911, 967) a third image at the end of the first exposure time by using the first pixel group; generating (913, 963) a fourth image by combining the first image and the second image; and generating (915, 969) a high dynamic range image by combining the third and fourth images. starting (901, 951), at the same time, exposure of the first pixel group with the first exposure time and first exposure of the second pixel group, with the second exposure time being shorter than the first exposure time; acquiring (905, 955) a first image at the end of the second exposure time shorter than the first exposure time by using the second pixel group; starting (907, 957) second exposure of the second pixel group with a third exposure time; acquiring (911, 961) a second image at the end of the third exposure time by using the second pixel group; acquiring (911, 967) a third image at the end of the first exposure time by using the first pixel group; generating (913, 963) a fourth image by combining the first image and the second image; and generating (915, 969) a high dynamic range image by combining the third and fourth images.