In this paper, we present a spatially adaptive approach to image defogging based on edge analysis and gradient-based tone mapping. We adaptively select an atmospheric light- through undesired fog or cloud in the dark channel prior according to the edge information of an image and generate a transmission map based on the selected atmospheric light. We adaptively remove the fog using the estimated transmission map and apply tone mapping using gradient values of the image. The proposed algorithm can overcome the problem of local color distortion, which is known to be the limitations of existing defogging techniques. Experimental results demonstrate that the proposed algorithm can increase technical competitiveness of consumer imaging devices by removing atmospheric artifacts caused by fog, clouds, smoke, and dust to name a few.