1. An image processing method for constructing a composite image with extended depth of field, from a plurality of source images of a scene stored in at least one image stack, the plurality of source images being taken at substantially identical fields of view, the method comprising: aligning the images in the image stack such that every image in the image stack is aligned with other images in the stack; performing illumination and color correction on the aligned images in the image stack; generating an energy matrix for each pixel of each illumination and color corrected image in the image stack by computing energy content for each pixel; generating a raw index map that contains the location of every pixels having maximum energy level among all the images in the image stack; generating degree of defocus map by comparing the energy content at a particular pixel in all the images against a reference signal and repeating the process for all the pixels; constructing the composite image using raw index map and degree of defocus map.