Fast and Efficient Algorithm for Contrast Enhancement of Color Images

Fast and Efficient Algorithm for Contrast Enhancement of Color Images

Zohair Al-AmeenHind N. Saeed Dunya K. Saeed 

Department of Computer Science, College of Computer Science and Mathematics, University of Mosul, Mosul 41002, Nineveh, Iraq

Corresponding Author Email:
5 September 2020
14 September 2020
23 September 2020
Available online: 
30 September 2020
| Citation



The contrast is one image feature that when reduced, it diminishes the visibility of important details in an image. Many captured images are distorted by a low contrast effect, in that this effect should be handled properly to increase the perceived quality of such degraded images. In this study, a simple contrast enhancement algorithm is proposed, in that it comprises of five different stages. The first stage includes the application of a hyperbolic sine function to provide a simple transformation of image contrast, while the second stage includes the application of a modified power-law function to manage the contrast adjustment. The third stage includes the use of a standard sigmoid function to reallocate the intensities in an “S” shape form, which can provide further enhancement, while a cumulative distribution function of Gompertz distribution is used as the fourth processing stage to improve the image brightness. In the ending stage, a contrast stretching function is applied to redistribute the intensities to the standard interval. Rigorous tests proved that the developed algorithm can well-process low contrast color images and can outperform other available methods.


contrast modification, contrast stretching, Gompertz distribution, S-curve, hyperbolic, sigmoid

1. Introduction

In current technology, digital images are considered one of the most important methods in recording and representing information [1]. Different imaging technologies are being used to capture, process, and store images [2]. In many circumstances, captured images do not represent the original view as they are obtained with degradations [3]. The low contrast effect is frequently happening degradation in digital images [4, 5]. To process such degradation, a contrast enhancement (CE) approach is usually applied [6, 7]. CE is a key process that can greatly increase the visual quality of low contrast images [8, 9].

Usually, low contrast images are obtained due to problems with the imaging device, the insufficient experience of the photographer, undesirable environmental factors, and incorrect imaging device settings [10, 11]. CE techniques are often applied to medical, astronomical, satellite, photographic, microscopic, and images from other fields to improve their perceived details for better visualization [12, 13]. The foremost aim of CE is to improve the quality without destroying the information content in a given image [14, 15]. Images with proper contrast are seen better by humans and analyzed better by computers [16].

Therefore, improving the image contrast while preserving its brightness and other important image features from being distorted was the focus of many researchers in the past years [17-19]. Early research related to contrast enhancement of color images focused on the generation of a luminance mask from two types of local contrast namely, color contrast and luminance contrast. After that, enhancement errors are investigated and the results are further refined using a distinct scheme [20]. Many years later, different algorithms were proposed for this purpose, which owns advanced processing schemes.

Poddar et al. [21] developed a non-parametric modified histogram equalization (NMHE) algorithm, in that it begins by computing the histogram and the clipped histogram for the distorted image. Then, the measure of un-equalization and spike-free histogram are obtained to modify the original histogram. Next, a distinct alteration function is applied to produce the outcome. Another histogram-based algorithm was introduced by Singh and Kapoor [22] named exposure sub-image histogram equalization (ESIHE), in that it begins by computing the histogram, the clipped histogram, and the clipping threshold of the input image. Then, the clipped histogram is divided into two parts by a pre-computed thresholding parameter. After that, each part is processed with histogram equalization and then joined together to produce the final output. Moreover, a different algorithm named median-mean based sub-image clipped histogram equalization (MMSICHE) is developed [23], in that it begins by computing the average and median measures of the original image. Next, a plateau limit is used for histogram clipping. After that, the clipped histogram is divided and each part is processed by histogram equalization depending on the predetermined average and median values. Finally, all parts are combined to produce the output image.

Gu et al. [24] introduced a robust image contrast enhancement (RICE) algorithm, in that it begins by computing the histogram of the input image followed by modifying it with different histogram modification approaches. The modified histograms are then compromised using a quality metric of contrast (QMC). If the desired QMC result is reached, this histogram is applied and the output image is created. Likewise, a BIQME-optimized image enhancement method (BOIEM) was introduced by Gu et al. [25], in that this method is simply the combination of RICE and another algorithm called AGCWD. BOIEM begins by filtering the input image with AGCWD and then sends the output to RICE to further refine the contrast. The variables of both AGCWD and RICE are decided by applying a special assessment method. In addition, the method introduced by Wang and Chen [26] tries to improve the contrast by modifying the original histogram equalization method, in that it begins by calculating the standard deviation and the sum of the histogram for the degraded image. Next, a gamma adjustment scheme is implemented to create an altered histogram. Then, the original histogram equalization is utilized with the altered histogram to produce the outcome.

The approach in the atusy [27] improves the contrast using the fuzzy concept in the HSI domain, in that the histogram of the fuzzy dissimilarity is initially computed for each intensity value from its adjacent intensities. Next, an expert mapping function which is built based on fuzzy dissimilarity is applied to improve the contrast. Lastly, a specified gamma-correction method is used to improve the intensity of dark regions and generate the result. Using the knowledge gained from the reviewed methods, most of the available methods are histogram-based, wherein histogram-based methods are known to have problems related to processing efficiency and brightness amplification. It is promising to introduce low-complexity algorithms that do not have the problems of the histogram-based methods. Thus, a simple-structure enhancement algorithm is proposed for rapid and efficient contrast enhancement without generating any unwanted distortions. The proposed algorithm was developed based on a previous algorithm that has been used to process grayscale images [28]. The proposed algorithm consists of five distinct steps, for which each step provides a certain contribution to the enhancement process.

Likewise, the enhancement of contrast is controlled using one parameter, while the enhancement of brightness is controlled using another parameter. Accordingly, the introduced algorithm is evaluated with different natural contrast-degraded images gathered from many internet sites. Moreover, the quality of the comparison results is assessed using two well-known image quality assessment metrics. From the recorded results, many indications show that the introduced algorithm achieved satisfying outcomes, and its performances surpass other advanced algorithms in terms of the observed quality. The other sections of this article are arranged in the following manner: Section 2 describes the developed algorithm concisely, while Section 3 reports on the results of experiments and comparisons along with their correlated discussions. Finally, a brief conclusion is stated in Section 4.

2. Proposed Algorithm

In this study, the algorithm described in the study [28] is being further improved to process color images efficiently. It begins by applying the hyperbolic sine function in Eq. (1) as an initial processing stage, followed by a modified power-law function in Eq. (2) to control the enhancement amount. Then, the standard sigmoid function is applied in Eq. (3) for further enhancement followed by a contrast stretching function in Eq. (4) to remap the image pixels into their natural interval. The cascaded use of these equations yielded the resulting image.

$s=\frac{\exp (x)-\exp (-x)}{2}$      (1)

$y=s^{\lambda}$      (2)

$w=\frac{1}{1+\exp (-y)}$      (3)

$f=\frac{w-\min (w)}{\max (w)-\min (w)}$      (4)

where, (x) is the input color image, (λ) is a variable that controls the enhancement of contrast, in that it must satisfy (λ > 0), where a higher (λ) value leads to a less bright yet contrast improved result, min and max are the minimum and maximum pixel values, respectively and (f) is the final output. This algorithm works well when processing grayscale images. However, when this algorithm is tested with various color images with contrast distortions, the output always owns a dimmed appearance when good contrast is reached. Thus, different statistical methods have been investigated to solve this problem. Among such, the cumulative distribution function of Gompertz distribution (CDFGD) did a great job in increasing the brightness when (η > 0) and (γ = 1). The CDFGD method is computed using Eq. (5) [29].

$w=1-\exp \left(-\frac{\eta}{\gamma}(\exp (\gamma w)-1)\right)$     (5)

where, η is a parameter responsible for brightness enhancement, in that a higher value leads to more brightness presentation. This equation is applied as the fourth processing step, in that its input w is obtained from the standard sigmoid function in Eq. (3), while its output w becomes the input of the contrast stretching function in Eq. (4). In conclusion, the developed algorithm receives the degraded color image, and the values of λ and η. Then, Eq. (1) is implemented followed by the application of Eq. (2) and Eq. (3). Next, the CDFGD method in Eq (5) is computed and then its output is processed using Eq. (4). Lastly, the framework diagram of the developed algorithm is given in Figure 1 to truly comprehend how this algorithm functions.

Figure 1. The block diagram of the developed algorithm

3. Results and Discussion

This part of the article contains information related to the utilized dataset of images, comparable methods, and image evaluation metrics. The images used in this study are all real-contrast degraded gathered from different internet sites, in that more than 50 images were collected for empirical purposes. Moreover, the work proposed in this study is compared with six different methods, which are: the original algorithm [28], NMHE [21], ESIHE [22], MMSICHE [23], RICE [24], and BOIEM [25].

Moreover, two image evaluation metrics are used, which are: blind image quality measure of enhanced images (BIQME) [25] and No-reference image quality metric for contrast distortion (NIQMC) [30]. The BIQME metric considers many image features including brightness, sharpness, colorfulness, contrast, and naturalness to produce its score, whereas the NIQMC considers the local contrast, entropy, and saliency detection to produce its score. Both metrics are No-reference, meaning they only require one image as an input, as well as, they both produce a number that is greater than zero, wherein a greater value indicates reaching better visual quality.

Figure 2. The attained results by the developed algorithm. (1st row): real contrast degraded images; (2nd row) from left to right: recovered images with (λ=2.3, η=6), (λ=2, η=7), (λ=2.5, η=5), respectively

Figure 3. The attained results by the developed algorithm. (1st row): real contrast degraded images; (2nd row) from left to right: recovered images with (λ=1.5, η=6), (λ=2, η=5.5), (λ=2.25, η=4), respectively

Figure 4. The attained results by the developed algorithm. (1st row): real contrast degraded images; (2nd row) from left to right: recovered images with (λ=1.6, η=8), (λ=2.7, η=7), (λ=1.9, η=8), respectively

Figure 5. The attained results by the developed algorithm. (1st row): real contrast degraded images; (2nd row) from left to right: recovered images with (λ=2, η=5), (λ=2, η=5.5), (λ=1.8, η=4), respectively

Figure 6. The attained results by the developed algorithm. (1st row): real contrast degraded images; (2nd row) from left to right: recovered images with (λ=1.5, η=5), (λ=2, η=6), (λ=2.8, η=5.5), respectively

Different experiments were conducted, in that Figure 2 to Figure 6 illustrate samples of the attained results by the developed algorithm when processing real contrast degraded images. As seen in Figures 2 to 6, the developed algorithm performed well in recovering adequate visibility for the processed images as the colors perceived better, the contrast is noticeably enhanced, and the brightness became acceptable. Likewise, the proposed algorithm did not introduce any processing artifacts to the resulting images.

Such findings are substantial because results own high visible details, and are obtained with a properly improved low-complexity algorithm. Besides, Figures 7 and 8 demonstrate specific results of the achieved comparisons. Likewise, Table 1 displays the scored accuracies of the achieved comparisons using two metrics. Figure 9 and Figure 10 depict the graphical charts of Table 1. Regarding the outcome of the comparison, varying results are obtained. The results of the original algorithm reached good contrast, but their brightness is deficient as the results appear darker than the original images, which justifies the good performance in BIQME and the moderate readings in NIQMC. Still, it was the fastest among the competitors.

The NMHE, on the other hand, produced results with unusual colors and a slight contrast enhancement, which explains the moderate BIQME and the above moderate NMHE scores. The MMSICHE generated processing errors as seen in Figure 8 (e), which explains it’s less than high scores according to the used evaluation metrics. RICE and BOIEM performed almost the same as they both only provided slight contrast enhancement, since the differences from the pristine images are barely visible. This explains the performances according to the used evaluation metrics. In addition to that, BOIEM was the slowest method among the competitors.

The ESIHE performance was somewhat acceptable and it slightly differs from the performance of the proposed algorithm, in that it provided a slight brightness increase and imperfect contrast to the filtered images. On the contrary, the introduced algorithm achieved the best performances in terms of image evaluation methods and quality of details as the output has natural colors, contrast, and adequate brightness. In terms of processing times, it was the second-fastest algorithm among the competitors. Enhancing the contrast of color images to produce satisfactory outcomes is an uneasy assignment. Still, such an assignment is accomplished in this study by introducing a well-developed algorithm with low calculations involvement and simple structure. Some extra work can be made on this algorithm to improve its performance including making it entirely automatic by using specialized optimization methods.

Figure 7. The comparison results. (a) Pristine image; the others are filtered by: (b) Original algorithm; (c) NMHE; (d) ESIHE; (e) MMSICHE; (f) RICE; (g) BOIEM; (h) Proposed algorithm

Figure 8. The comparison results. (a) Pristine image; the others are filtered by: (b) Original algorithm; (c) NMHE; (d) ESIHE; (e) MMSICHE; (f) RICE; (g) BOIEM; (h) Proposed algorithm

Figure 9. The graphical chart of the average BIQME scores

Figure 10. The graphical chart of the average NIQMC scores

Table 1. The recorded accuracy of the achieved comparisons






Degraded Images













Original Algorithm














































































Proposed Algorithm













4. Conclusions

To end with, a simple-structure enhancement method for color images is developed in this article. It basically applies five distinct functions of hyperbolic sine, modified power-law, sigmoid, CDFGD, and contrast stretching. The obtained results were benchmarked with real-degraded images and compared with the six known methods. Furthermore, the accuracy of the comparative methods was measured using two sophisticated methods. From the obtained results, it can be seen the developed algorithm provided satisfying results and outperformed the comparative methods, in which it scored the best in terms of visual appearance and quality metrics. Accordingly, the developed algorithm provided a natural appearance with no visible errors to the processed images. Such acceptable results can highly support the processing ability of the introduced algorithm. Finally, the use of low-intricacy algorithms for contrast enhancement is desirable in many real-world systems with limited resources. As future works, this algorithm can be further adapted to process color images for different existing applications such as remote sensing, medical, biomedical, forensics, and so forth. Moreover, it can be further developed to be completely automated.


The authors would like to thank the Department of Computer Science at the University of Mosul for providing much facilitation that led to the completion of this study.


[1] Selvaraj, P., Varatharajan, R. (2018). Whirlpool algorithm with hash function based watermarking algorithm for the secured transmission of digital medical images. Mobile Networks and Applications, 1-14.

[2] Nakamura, J. (2017). Image Sensors and Signal Processing for Digital Still Cameras. CRC Press.

[3] Kalantari, N.K., Wang, T.C., Ramamoorthi, R. (2016). Learning-based view synthesis for light field cameras. ACM Transactions on Graphics, 35(6): 1-10.

[4] Chang, Y., Jung, C., Ke, P., Song, H., Hwang, J. (2018). Automatic contrast-limited adaptive histogram equalization with dual gamma correction. IEEE Access, 6: 11782-11792.

[5] Gupta, B., Agarwal, T.K. (2017). Linearly quantile separated weighted dynamic histogram equalization for contrast enhancement. Computers & Electrical Engineering, 62: 360-374.

[6] Bhandari, A.K. (2020). A logarithmic law based histogram modification scheme for naturalness image contrast enhancement. Journal of Ambient Intelligence and Humanized Computing, 11(4): 1605-1627.

[7] Celik, T. (2016). Spatial mutual information and PageRank-based contrast enhancement and quality-aware relative contrast measure. IEEE Transactions on Image Processing, 25(10): 4719-4728.

[8] Kim, S.E., Jeon, J.J., Eom, I.K. (2016). Image contrast enhancement using entropy scaling in wavelet domain. Signal Processing, 127: 1-11.

[9] Shakeri, M., Dezfoulian, M.H., Khotanlou, H., Barati, A.H., Masoumi, Y. (2017). Image contrast enhancement using fuzzy clustering with adaptive cluster parameter and sub-histogram equalization. Digital Signal Processing, 62: 224-237.

[10] Arici, T., Dikbas, S., Altunbasak, Y. (2009). A histogram modification framework and its application for image contrast enhancement. IEEE Transactions on Image Processing, 18(9): 1921-1935.

[11] Salih, A.A.M., Hasikin, K., Isa, N.A.M. (2018). Adaptive fuzzy exposure local contrast enhancement. IEEE Access, 6: 58794-58806.

[12] Yue, H., Yang, J., Sun, X., Wu, F., Hou, C. (2017). Contrast enhancement based on intrinsic image decomposition. IEEE Transactions on Image Processing, 26(8): 3981-3994.

[13] Wang, X., Chen, L. (2018). Contrast enhancement using feature-preserving bi-histogram equalization. Signal, Image and Video Processing, 12(4): 685-692.

[14] Jenifer, S., Parasuraman, S., Kadirvelu, A. (2016). Contrast enhancement and brightness preserving of digital mammograms using fuzzy clipped contrast-limited adaptive histogram equalization algorithm. Applied Soft Computing, 42: 167-177.

[15] Kandhway, P., Bhandari, A. K. (2019). An optimal adaptive thresholding based sub-histogram equalization for brightness preserving image contrast enhancement. Multidimensional Systems and Signal Processing, 30(4): 1859-1894.

[16] Cao, G., Huang, L., Tian, H., Huang, X., Wang, Y., Zhi, R. (2018). Contrast enhancement of brightness-distorted images by improved adaptive gamma correction. Computers & Electrical Engineering, 66: 569-582.

[17] Xiao, B., Tang, H., Jiang, Y., Li, W., Wang, G. (2018). Brightness and contrast controllable image enhancement based on histogram specification. Neurocomputing, 275: 2798-2809.

[18] Gupta, B., Tiwari, M. (2019). Color retinal image enhancement using luminosity and quantile based contrast enhancement. Multidimensional Systems and Signal Processing, 30(4): 1829-1837.

[19] Kansal, S., Purwar, S., Tripathi, R.K. (2018). Image contrast enhancement using unsharp masking and histogram equalization. Multimedia Tools and Applications, 77(20): 26919-26938.

[20] Liu, N., Yan, H. (1994). Improved method for color image enhancement based on luminance and color contrast. Journal of Electronic Imaging, 3(2): 190-198.

[21] Poddar, S., Tewary, S., Sharma, D., Karar, V., Ghosh, A., Pal, S.K. (2013). Non-parametric modified histogram equalisation for contrast enhancement. IET Image Processing, 7(7): 641-652.

[22] Singh, K., Kapoor, R. (2014). Image enhancement using exposure based sub image histogram equalization. Pattern Recognition Letters, 36: 10-14.

[23] Singh, K., Kapoor, R. (2014). Image enhancement via median-mean based sub-image-clipped histogram equalization. Optik, 125(17): 4646-4651.

[24] Gu, K., Zhai, G., Yang, X., Zhang, W., Chen, C.W. (2015). Automatic contrast enhancement technology with saliency preservation. IEEE Transactions on Circuits and Systems for Video Technology, 25(9): 1480-1494.

[25] Gu, K., Tao, D., Qiao, J.F., Lin, W. (2017). Learning a no-reference quality assessment model of enhanced images with big data. IEEE Transactions on Neural Networks and Learning Systems, 29(4): 1301-1313.

[26] Wang, X., Chen, L. (2017). An effective histogram modification scheme for image contrast enhancement. Signal Processing: Image Communication, 58: 187-198.

[27] Veluchamy, M., Subramani, B. (2020). Fuzzy dissimilarity color histogram equalization for contrast enhancement and color correction. Applied Soft Computing, 89: 1-11.

[28] Al-Ameen, Z., Zaman, A.H. (2018). A low-complexity algorithm for contrast enhancement of digital images. International Journal of Image, Graphics and Signal Processing, 11(2): 60-67.

[29] Jafari, A.A., Tahmasebi, S., Alizadeh, M. (2014). The beta-Gompertz distribution. Revista Colombiana de Estadistica, 37(1): 141-158.

[30] Gu, K., Lin, W., Zhai, G., Yang, X., Zhang, W., Chen, C.W. (2017). No-reference quality metric of contrast-distorted images based on information maximization. IEEE Transactions on Cybernetics, 47(12): 4559-4565.