In this paper, a Bayesian framework is proposed for image enhancement. We model the image enhancement problem as a maximum a posteriori (MAP) estimation problem and the posteriori distribution function is formulated based on the local structures and local gradients of the given image. By solving the MAP estimation problem, image contrast gets properly enhanced while image noise gets suppressed at the same time. Moreover, since directly solving an MAP estimation problem is impractical for real-time applications, we further simplify the process to generate an intensity mapping function that achieves comparable performance in image enhancement. Simulation results have demonstrated the applicability of the proposed method in providing a flexible and efficient way for image enhancement.