Abstract
In this article, we propose a fast and effective method for digital image contrast enhancement. The gray-level dynamic range of contrast-distorted images is extended maximally via adaptive pixel value stretching. The quantity of saturated pixels is set intelligently according to the perceptual brightness of global images. Adaptive gamma correction is also novelly used to recover the normal luminance in enhancing dimmed images. Different from prior methods, our proposed technique could be enforced automatically without complex manual parameter adjustment per image. Both qualitative and quantitative performance evaluation results show that, comparing with some recent influential contrast enhancement techniques, our proposed method achieves comparative or better enhancement quality at a surprisingly lower computational cost. Besides general computer applications, such merit should also be valuable in low-power scenarios, such as the imaging pipelines used in small mobile terminals and visual sensor network.
Introduction
There are plenty of previous works on digital image CE. In terms of the manipulated data space, existing CE methods could be generally categorized into pixel1–11 and transform12–16 domain ones. The pixel domain CE relies on the direct manipulation of pixel gray levels (namely, pixel values), while the other is implemented in the transformation domain of digital images, such as discrete cosine transform,12–14 wavelet, 15 and curvelet. 16
Histogram equalization (HE) is a classical CE method, which enhances image contrast by redistributing the probability density of pixel values. 1 Although HE is computationally effective, it often incurs excessive enhancement and unnatural artifacts on the images which have peaks in pixel value histograms.4,17 In order to attenuate such deficiency, the improved local HE 2 and brightness-preserving bi-HE 3 have been developed. Then the histogram modification (HM) algorithm is proposed by treating CE as an optimization problem via minimizing a cost function with penalty terms. 4 Huang et al. 5 proposed the method of adaptive gamma correction with weighting distribution (AGCWD) to enhance the contrast of dimmed images, which own low global mean brightness and appear black. Such a method deals well with most dimmed images, but fails for globally bright images and dimmed images with local bright regions. In order to attenuate such deficiency, Cao et al. 6 integrated the strategies of negative image and truncated cumulative distribution function into the design of pixel value mapping function. Celik 7 presented spatial entropy–based contrast enhancement (SECE) to incorporate the spatial distribution characteristics of pixels into the design of pixel mapping function. It could always improve the contrast of any type of input images to some extent, for example, dimmed, bright, or normal ones, without resulting in apparent image quality degradation. Later, Celik 8 proposed another global image CE algorithm based on spatial mutual information and PageRank. Although nearly the state-of-the-art enhancement quality is achieved, such an algorithm runs rather slower than the others. Cao et al. 9 proposed an efficient acceleration scheme to speed it up by selective downsampling. Parihar et al. 10 presented an effective image CE algorithm by exploiting fuzzy contextual information in the spatial domain. Besides, the prior knowledge on human visual perception18,19 and computational intelligence, such as deep learning 20 and big data, 21 is also utilized to design efficient CE algorithms.
We also note that the MATLAB function “imadjust” (ADJ) is also a rather efficient CE method, which extends the dynamic range of pixel values to maximum by saturating a certain percent of pixels. 11 Although ADJ owns the lowest computational complexity among all popular CE algorithms, it is inconvenient in automatic and batch processing applications since the best setting of input parameters is typically variant with images. It requires users to select proper parameters per image manually. As such, it is rather essential to improve ADJ by importing automatic and adaptive parameter configuration via images. Here, we present a cost-effective CE algorithm based on adaptive pixel value stretching and adaptive gamma correction. It can be applied in automatic mode without specially selecting parameters for each image every time. The fundamental idea is to extend the dynamic range of pixel gray levels adaptively through pixel value stretching, and recover the normal global luminance by adaptive gamma correction. Such processing enjoys the significant advantage of low computational complexity.
The remainder of this article is organized as follows. Section “Proposed method” introduces the proposed image CE method detailedly, followed by the experiments and discussions presented in section “Experimental results and discussion.” The conclusions are drawn in the last section.
Proposed method
In this section, we propose a fast and effective image CE technique, which relies on the integration of both adaptive pixel value stretching and adaptive gamma correction.
Problem definition
Let an input grayscale image with
Adaptive pixel value stretching
Pixel value stretching is a simple yet effective method for CE of digital images, which is used in the MATLAB function “
First, we compare average brightness of the input image
where
Note that
Second, a two-element vector [
where
The principle behind such formulation lies in the fact that the gray-level histogram inclines to one end if an image is globally bright or dark. Such a global brightness could be corrected to the normal level by increasing the fraction of pixels to be saturated at the opposite end. Moreover, in order to correct adaptively,
Finally, according to [

Adaptive pixel value stretching.
where
Such pixel value stretching can extend the dynamic range of an image to the theoretically full spectrum [0,255] in linear or non-linear mode. Moreover, certain quantity of saturated pixels is yielded and the global intensity is corrected adaptively in the enhanced images. As a result, the proposed adaptive pixel value stretching method could adjust both image contrast and brightness effectively.
Adaptive gamma correction
Through experiments, we found that the linear pixel value stretching (
Based on such considerations, we propose an adaptive mechanism to automatically determine the gamma parameter as
where
Color image enhancement
As in the prior works,4–9 CE of color images is realized by applying the proposed algorithm to the luminance component and preserving the chrominance components in HSV color space.
Experimental results and discussion
Dataset, algorithms, and performance measures
The test images are collected from three standard databases including Kodak, 22 CSIQ, 23 and BSD500. 24 Kodak has 24 high-quality images with the size of 768 × 512 pixels. CSIQ contains 30 reference images and their global contrast-distorted versions at five levels. BSD500 includes 500 natural images with the resolution of 321 × 481 pixels.
Both classical and state-of-the-art CE algorithms including HE,
1
HM,
4
AGCWD,
5
ADJ,
11
and SECE
7
are compared in performance evaluation. The default parameter settings given in the original literature are used in tests. The parameters in our proposed method are experimentally set as
In both qualitative and quantitative assessments, the metric of patch-based contrast quality index (PCQI) 25 is used as the objective measurement for assessing the quality of enhanced images. We have also noted that another influential metric, namely, gradient magnitude similarity deviation (GMSD), 26 has been used to evaluate SECE. 7 GMSD is a full-reference image quality assessment for measuring the perceptual similarity between two images via gradient comparison. However, we find that GMSD is incapable of capturing the discrepancy on the global average intensity, which determines the perceptual global luminance of images.
PCQI is a prediction on the human perception of contrast variations between the enhanced and reference images. It decomposes image patches into mean intensity, signal strength, and signal structure components and is defined as
where
Qualitative assessments
The qualitative assessment results on example images are shown detailedly in this subsection. CE performance on the images with different levels of brightness is evaluated first. Gamma corrections with

CE results on the Woman image with different brightness levels simulated by gamma correction with (row 1)
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Among ADJ, SECE, and the proposed algorithm, the
We can see that all CE methods can improve the contrast of input images. HE easily suffers over enhancement. Although the highest
Figures 3 and 4 and Tables 2 and 3 show the results on the other two images from Kodak dataset. The same findings can be consistently validated by both the visual inspection of enhanced images and the objective PCQI measurements. In such two examples, the results achieved by our method are nearly comparative to those of SECE and definitely better than those of ADJ in enhancing dimmed images, namely, the case of

CE results on the Tower image with different brightness levels simulated by gamma correction with (row 1)

CE results on the Island image with different brightness levels simulated by gamma correction with (column 1)
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Among ADJ, SECE, and the proposed algorithm, the
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Among ADJ, SECE, and the proposed algorithm, the
Different from the brightness-distorted type, CSIQ dataset provides another type of low-contrast images which have narrow and clipped dynamic range of pixel gray levels. Figure 5(a) displays an undistorted image and its low-contrast versions at five levels. The enhanced images shown in Figure 5(b)–(g) demonstrate that our proposed method can effectively implement the CE task and provides comparative results to those of ADJ and SECE. Note that HE causes apparent color distortion. HM is still unstable and not rather effective on high-level cases, such as Levels 3–5. As shown in Table 4, such a result can also be found from the corresponding low

CE results on the Couple image with different levels of global contrast decrement: (row 1) no decrement (“Level 0”) and (rows 2–6) “Levels 1–5”: (a) input, (b) HE, (c) HM, (d) AGCWD, (e) ADJ, (f) SECE, and (g) Proposed algorithm.
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Another six example images are used to further evaluate the visual quality of enhancement results. As shown in Figure 6(a), the first three images are collected from CSIQ dataset and with Levels 1, 2, and 3, respectively. The fourth and fifth images are collected from BSD500 dataset, and the last one is collected from the dataset used in Brown and Susstrunk. 27 Generally, the enhanced images shown in Figure 6(b)–(g) demonstrate that our proposed method could always achieve high-quality results and outperforms the other methods. Gray-level histogram of the luminance (V) channel is shown below each image. It shows that both ADJ and SECE can always preserve the histogram shape after CE. Our method can also preserve the histogram shape when the gamma correction is not applied, such as the example images shown in rows 1, 3, 4, and 5. In the second and sixth examples, the applied gamma correction actually shifts histograms slightly, but the basic contour could still be preserved by our method.

CE results on six example images. The corresponding gray-level histograms of V channel images are shown below.(a) Input, (b) HE, (c) HM, (d) AGCWD, (e) ADJ, (f) SECE, and (g) Proposed algorithm.
Quantitative assessments
Statistical tests on image databases are enforced to quantitatively evaluate the performance of CE algorithms. Five levels of brightness-distorted low-contrast images are prepared by applying gamma corrections to the unaltered images in databases. Gammas
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Table 7 shows the corresponding test results on CSIQ image database. The nearly identical PCQI values of ADJ, SECE, and the proposed algorithm signify the comparative performance in enhancing the low-dynamic-range images from CSIQ. The same deficiency as that on Kodak and BSD500 datasets still exists in HE. HM fails to well enhance the highly low-dynamic-range images, that is, Levels 4 and 5. The rather low
Average PCQI (
PCQI: patch-based contrast quality index; HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Computation time
Generally, all CE techniques pursuit the same goal of achieving more contrast increment with less image distortion at the cost of less computational resources. A practical CE algorithm typically requires low computational complexity. Here, we evaluate the time complexity of our proposed algorithm which is run on a computer with an Intel Core i5-5200U 2.2 GHz CPU and 8-GB RAM under MATLAB R2013a. The average computation time used for enhancing per test image created from BSD500 is computed.
As displayed in Table 8, the average computation time per image of our proposed method is 5.3 ms, which is remarkably faster than those of the other methods except for ADJ. SECE has the highest time complexity (38.6 ms). Although the histogram-based approaches, HE and HM, are testified to actually own the merit of low complexity, that is, 10.8 and 11.7 ms, respectively, they are still approximately double that of the proposed algorithm. Note that ADJ is the fastest with 1.8 ms per image, which is far below the other methods. Such a result should be attributed to the simplicity of its involved data manipulations, which merely include simple statistic and fixed pixel value stretching. Comparing with ADJ, our method adds the adaptive parameter designations based on the computation and comparison of global mean brightness. As such, the time complexity of the proposed algorithm is higher than that of ADJ, but still remains at a rather low level, that is, far below 10 ms.
Average computation times (ms) of algorithms per test image created from BSD500.
HE: histogram equalization; HM: histogram modification; AGCWD: adaptive gamma correction with weighting distribution; SECE: spatial entropy–based contrast enhancement.
Conclusion
In this article, a fast and effective algorithm is proposed to improve the contrast of digital images. Adaptive pixel value stretching is proposed to extend the dynamic of pixel gray levels automatically, without requiring the complicated manual setting for each input image. Adaptive gamma correction is designed novelly to rectify the naturally normal luminance in enhancing dimmed images. The proposed image CE technique enjoys the advantages of low computational complexity and consistent contrast improvement. Extensive experimental results have verified the effectiveness and efficiency of our proposed method. Comparing with other CE algorithms, the enhanced images generated by our method own comparative or better contrast improvement with less image distortion. Moreover, the computational complexity of our method is verified to be far below those of HE and a latest CE algorithm, SECE. In the future work, we would try to further improve the performance of CE algorithms by integrating more effective and advanced models of contrast perception.
Footnotes
Handling Editor: Jeng-Shyang Pan
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Natural Science Foundation of China (Grant Nos 61772539 and 61401408), the Fundamental Research Funds for the Central Universities (Grant No. 3132018XNG1806), and Scientific Research Common Program of Beijing Municipal Commis-sion of Education (Grant No. KM201510015010).
