High-dynamic-range (HDR) imaging has become more and more popular in recent years, and a number of methods for the realistic representation of natural scenes have been proposed. Gradient domain HDR compression is one of the most popular approaches; however, their results are not satisfactory due to the parameter setting. Motivated by perceptual studies on image quality, we propose a novel HDR compression method to achieve better image quality. In the proposed method, we combine global and local tone-mapping operators, and manipulate the HDR compression in both luminance and gradient domains to improve the appearance and naturalness of results. Moreover, we deal with the parameter setting problem effectively in HDR compression by automatic factor decision. Extensive experiments on various test images demonstrate that the proposed method is very effective in enhancing the overall quality of the image as well as maintaining the details without the loss of naturalness.