In this paper, an optimization algorithm, utilizing a component measure of entropy, is developed for automatically tuning segmentation of mammograms by the Statistical Region Merging technique. The aim of this paper is to improve the mass segmentation in dense backgrounds. The proposed algorithm is tested on a database of 89 mammograms of which 41 have masses localized in dense background and 48 have masses in non-dense background. The algorithm performance is evaluated in conjunction with six standard enhancement techniques: Adjustable Histogram Equalization, Unsharp Masking, Neutrosophy based enhancement, standard CLAHE, Adaptive Clip Limit CLAHE based on standard deviation and Adaptive Clip Limit CLAHE based on standard entropy measure. For a comparison study, same experiments are performed using Fuzzy C-means Clustering technique. The experimental results show that the automatic tuning of SRM segmentation has the potential to produce an accurate segmentation of masses located in dense background while not compromising the performance on masses located in non-dense background.