The performances of the multivariate techniques are directly related to the variable selection process, which is time consuming and requires resources for testing each possible parameter to achieve the best results. Therefore, optimization methods for variable selection process have been proposed in the literature to find the optimal solution in short time by using less system resources. Contrast enhancement is the one of the most important and the parameter dependent image enhancement technique. In this study, two optimization methods are employed for the variable selection for the contrast enhancement technique. Particle swarm optimization (PSO) and artificial bee colony (ABC) optimization methods are implemented to the histogram stretching technique in parameter selection process. The results of the optimized histogram stretching technique are compared with one of the parameter independent contrast enhancement technique; histogram equalization. The results show that the performance of the optimized histogram stretching is better not only in distorted images but also in original images. Histogram equalization degraded the original images while the optimized histogram stretching has no effect due to being an adaptive solution.