Contrast enhancement plays an important role in the field of image processing. Histogram equalization (HE) is a simple and automatic technique for contrast enhancement. Other conventional contrast techniques, such as histogram specification and contrast stretching, need some manual parameters to achieve satisfactory results. In order to automatically produce better results for low-contrast images, a new histogram-based optimized contrast enhancement technique, called gray-level grouping (GLG), was proposed. GLG works well for some dark and low-contrast images, and always raises their contrast values as high as possible. As is well-known, extravagant contrast enhancement usually sacrifices the visual effects of an image. Through scrutinizing the implementing procedure of GLG, we find out some potential limitations and discover that an extra constraint on GLG can effectively produce pleasing appearances and preserve its contrast as high as possible. Experimental results show that a simple idea can make a big difference to visual effects.