1. A method of processing a digital image, comprising: receiving a plurality of images; converting the plurality of images into histograms; setting a first of the plurality of images as a reference image; setting a second of the plurality of images as a comparison target image; generating an adjusted reference image based on the reference image and the comparison target image; generating a masking image based on the adjusted reference image and the comparison target image; generating an adjusted comparison target image by applying the masking image to the comparison target image; and combining the reference image and the adjusted comparison target image to generate a high dynamic range (HDR) image.