In this letter, we propose a novel contrast enhancement algorithm for optical remote sensing satellite and aerial images. The algorithm is based on multiscale retinex (MSR). Unlike the MSR, however, we first decompose retinex outputs into nearly nonoverlapping spectral subbands. We then apply a space-varying subband gain to each subband-decomposed retinex output by considering its subband characteristic so that the image contrast can be effectively enhanced. In order to improve details in both shadows and highlights, we propose a new hybrid intensity transfer function based on logarithmic functions. In addition, we make the degree of enhancement of details adjustable by introducing a detail adjustment function based on a local standard deviation map of the original image. Experimental results clearly demonstrate that the proposed algorithm effectively distinguishes details in the whole image automatically and greatly enhances the overall contrast in various images.