Conference Paper (PDF Available)
Forensic estimation of gamma correction in digital images
Inst. of Inf. Sci., Beijing Jiaotong Univ., Beijing, China
DOI: 10.1109/ICIP.2010.5652701 Conference: Image Processing (ICIP), 2010 17th IEEE International Conference on Source: IEEE Xplore
Get notified about updates to this publication Follow publication 
Fulltext (PDF)
Available from: Gang Cao, Jan 25, 2016FORENSIC ESTIMATION OF GAMMA CORRECTION IN DIGITAL IMAGES
Gang Cao, Yao Zhao, Rongrong Ni
Institute of Information Science, Beijing Jiaotong University
gcaocn@gmail.com, {yzhao, rrni}@bjtu.edu.cn
ABSTRACT
In the digital era, digital photographs become pervasive and
are frequently used to record event facts. Authenticity and
integrity of such photos can be ascertained by discovering
more information about the previously applied operations.
In this paper, we propose a forensic scheme for identifying
and reconstructing gamma correction operations in digital
images. Statistical abnormity on image grayscale histograms,
which is caused by the contrast enhancement, is analyzed
theoretically and measured effectively. Graylevel mapping
functions involved in gamma correction can be estimated
blindly. Experiments both on globally and locally applied
corrected images show the validity of our proposed gamma
estimation algorithm.
Index Terms — Image forensics, forensic estimation,
gamma correction, contrast enhancement
1. INTRODUCTION
Along with the rapid development of digital imaging and
processing techniques, plenty of powerful media editing
softwares emerge and make sophisticated image forgeries
created easily and frequently. As a result, human’s trust on
the integrity and authenticity of digital images could no
longer be ensured. There is a potentially increasing need for
developing techniques to investigate image manipulations
blindly. Digital image forensics is just such a technique.
Generally, image manipulations could be classified into
the contentchanging and contentpreserving manipulations.
Accordingly, prior works on image manipulation forensics
fall into two categories. As the first category, the forensics
methods focus on detecting image tampering such as copy
move [1] and splicing [2], by which the image content is
reshaped arbitrarily according to semantic content. In the
other category, common manipulations, as compression [3],
blur [4] and contrast enhancement [5~7, 10] are detected
passively. These contentpreserving manipulations are often
applied as postprocessing to conceal the residual trail of
malicious tampering operations and create realistic forgeries.
Detection of common image operations can certainly throw
in doubt both originality and integrity of digital images.
Gamma correction, the widely used contrast enhancement
operation, is just a sort of contentpreserving manipulation.
Blind detection of the contrast enhancement including
gamma correction is of the second category techniques. In
ref. [5, 6], blind forensic algorithms have been proposed to
detect the globally and locally applied contrast enhancement
manipulations in digital images. However, such detection
algorithms fail to estimate the graylevel mapping function
including gamma mapping. As for application, the mapping
estimation is significant in image inverse engineering and
refined forensics, because more information known about
manipulation can help to investigate the image’s life history.
In the simultaneous work [7], an iterative algorithm is
designed to estimate any contrast enhancement mapping as
well as the pixel value histogram of the unenhanced image.
Although this algorithm is highly effective for mapping
reconstruction, its computational complexity might not be
low enough because a large number of repeated iterations
are employed. In ref. [8], in the case of preknowing gamma
correction has been applied, the gamma amount is estimated
by minimizing the higherorder correlations in frequency
domain via bispectral analysis.
Different from such existing solutions, in this paper, a
costeffective estimation scheme is proposed to reconstruct
the gamma mapping via fast recognition of the peakgap
fingerprinting in graylevel histograms. In such a scheme, we
address formulating and measuring the unique characteristic
of the peakgap distribution, which is just caused by gamma
correction. Histogram peakgap fingerprint patterns and the
methodology of pattern matching are employed to achieve
fast gamma estimation. The influence of image quality and
image size on the gamma estimation is considered in detail.
The rest of this paper is organized as follows. In Section
2, we formulate and analyze the histogram peakgap artifact
which is caused by gamma correction operations, followed
by the presentation of gamma mapping estimation algorithm
in Section 3. Performance evaluation results are reported in
Section 4. Finally conclusions are drawn in Section 5.
2. ANALYSIS OF PEAKGAP FINGERPRINT
In this section, we will analyze the statistical fingerprints
unique to contrast enhancement manipulations. Particularly,
we focus on gamma correction in this paper, which is one of
the most popular operations used to adjust the contrast of a
digital image. Generally, gamma correction could often be
formulated by a simple pointwise operation as follows [8],
20979781424479931/10/$26.00 ©2010 IEEE ICIP 2010
Proceedings of 2010 IEEE 17th International Conference on Image Processing September 2629, 2010, Hong Kong
Page 1
0 50 100 150 200 250
0
1000
2000
3000
4000
5000
0 50 100 150 200 250
0
1000
2000
3000
4000
5000
unaltered
image
1.2
J
p
eak
gap
Fig.1 Left: original image and its gamma correction version. Right: corresponding histogram of each image.
() 2 1)
21
l
l
u
Gu round
J
§·
§·
¨¸
¨¸
¨¸
©¹
©¹
<
(1)
where denotes the pixel intensity of a lbit
grayscale image,
[0,1,..., 2 1]
l
u
J
is the gamma amount and with positive
polarity.
]
x
>
means rounding x to the nearest integer. In this
work, l = 8 is considered illustratively. The Lena image and
its two gamma correction versions are shown in Fig. 1.
We could find that the gamma mapping keeps locally
linear only when the oneorder derivative value takes one.
In this scenario, no expansion or compression occurs. Those
points, denoted by , at which the gamma curve
has slope of one can be located as follows,
11
(,())uGu
1
11
1
(())
{( , ( ))
dGu
PuGu
du
J
`
. (2)
Substituting Eq. (1) into Eq. (2), we can obtain:
1
1
111
{( , ( ))P u G u u round
J
J
JJ
§·
z `
¨¸
¨¸
©¹
<
. (3)
Position of the points in set
P
J
with
[0.1, 3]
J
are shown in
Fig. 2. Because the gamma function is strictly monotone
increasing over the whole field of definitions, regionlevel
mapping M
1
and M
2
can be separated to be as
. (4)
11
11
[0, ] [0, ( )]
[ , 255] [ ( ), 255]
uGu
uGu
0
®
0
¯
The histogram of an unaltered image can be modeled as
a digital function with a smooth envelope [5] which has not
abrupt zero (gap) and protuberant (peak) bins. That can be
seen from the histograms shown in Fig. 1. According to the
mapping relationship in Eq. (4) and
drawer principle, we
can conclude that peaks must occur in the interval as:
11
11
[0, ( )] ( )
[(),255] ()
Gu if u Gu
Gu if u Gu
1
1
!
®
¯
. (5)
It can be easily found that peaks must appear on the left side
of the histogram if
1
J
!
, while be on the right side if
1
J
.
Correspondingly, occurrence of the histogram gaps has the
similar regulation.
Consequently, a peak or gap bin is definitely determined
by the mapping curve’ pointwise slope. In fact, distribution
of the histogram peak and gap bins, called
peakgap pattern
or
peakgap fingerprint, is uniquely determined by gamma
amount
J
and independent of the image’s content. That’s
because the different gamma mapping curves have different
slope everywhere including diverse oneslope points.
3. BLIND ESTIMATION OF GAMMA MAPPING
Based on the analysis of histogram peakgap artifacts, the
peakgap pattern can be considered as statistical fingerprint
for estimating the mapping function which is determined by
the gamma parameter. In practical application, the range of
commonly used gamma parameter is limited (i.e., 0.1~3.0)
and the numerical error caused by rounding operation is
fixed. As a result, the peakgap feature pattern for different
gamma mappings can be precomputed theoretically, which
would be used as priori knowledge for gamma estimation by
pattern matching.
A direct method for building peakgap feature pattern is
to transform the graylevel histogram to be 256dim indicator
vector. Each element in such a vector indicates whether the
located bin is peak, gap or neither. We can foresee that such
feature descriptor could characterize each gamma mapping
2098
Page 2
0 50 100 150 200 250
0
50
100
150
200
250
0
0.5
1
1.5
2
2.5
3
1
()Gu
1
u
J
Fig.2 Positions of points with slope of one on the gamma curves,
here
[0.1, 3]
J
and sampled in increments of 0.1.
curve accurately. However, construction and matching of
the 256dim feature vectors would not be
costefficient. In
order to alleviate the complexity of pattern computation and
matching, only the middle single peak and the middle single
gap, which are the nearest to the point with slope one, are
selected to construct the peakgap pattern. Such two feature
positions on the mapping curve of gamma
J
are denoted
by
(,
and respectively. In this situation,
the prior peakgap feature pattern would be defined as a
twodimensional vector as follow,
())
pp
uGu
JJ
(,())
gg
uGu
JJ
() ( ), ( )]
pg
FGuGu
JJ
J
>
. (6)
Distribution of the discrete peakgap feature patterns for
gamma mapping is shown in Fig. 3, where
[0.1, 3]
J
with a
sampling step 0.001 are considered.
For an image to be investigated, the general peakgap
characteristic which is unique to gamma mapping should be
identified firstly. Actually, there also exist other types of
contrast enhancement operations which can generate the
similar peakgap phenomenon, such as ‘S’ mapping and
histogram equalization. However, we can easily distinguish
them by capturing the accumulating effect of peakgap’s
distribution. For ‘S’ mapping, all peaks or all gaps must
appear at the histogram’s two ends simultaneously while the
others fall into the middle range. Histogram equalization
can be identified by thresholding the distance between an
image’s histogram and a uniform distribution in frequency
domain [5]. It should be pointed out that the feature pattern
designed in Eq. (6) has the risk of being fooled. But the
feature pattern is effective and reliable if only the applied
gamma correction has been identified or made known.
Once the gamma correction is detected, the middle peak
gap pair of the histogram can be located by thresholding
method. Location of such a peakgap pair is denoted by
,
TT
pg
0 50 100 150 200 250
0
50
100
150
200
250
0
0.5
1
1.5
2
2.5
3
J
()
p
Gu
()
g
Gu
Fig.3 Peakgap feature pattern distribution for
[0.1, 3]
J
sampled in increments of 0.001.
Based on the prior feature pattern pool
()F
J
, the amount of
gamma correction can be estimated by searching the nearest
pattern to that extracted from the test image. That is,
ˆ
arg min ( )fF
J
JJ
. (8)
The forensic estimation algorithm can be performed on local
image regions. Then copymove forgeries which may have
employed contrast enhancement locally can be spied out.
4. EXPERIMENTS AND DISCUSSION
Both unaltered and gamma corrected images are prepared
for evaluating our proposed mapping estimation algorithm.
The unaltered image set consists of 1338 uncompressed
TIFF color images (with size of 384x512 or 512x384) from
the popular image dataset UCID [9]. These images cover on
many topics including natural scenes and manmade objects.
The images are converted to YCbCr format and only the Y
channel image is used for test. In the following experiments,
gamma correction defined in the Eq. (1) is used to generate
enhanced image samples. Gamma is limited in [0.3, 2.5] and
sampled in increments of 0.1.
Estimation precision for the globally applied gamma
correction on images of different quality is shown in Fig. 4.
Herein, the precision refers to the ratio of the batch image
samples on which the estimated gamma values are equal or
sufficiently close to the actual gamma values. Those with
errors lower than 0.02 are regarded as precise estimation.
We can see from Fig. 4 that the number of estimable images
relates to the image quality. The more heavily an image has
been compressed, the harder the gamma estimation becomes.
However, even for the moderate JPEG (Q=70) images, the
precision higher than 0.90 can still be gained except the
cases
[0.9,
J
a@
. Correspondingly, the distribution
of practical estimation errors from those gammaprecisely
estimated samples is shown in Fig. 5. The error falls into the
]
f
uu >
. (7)
2099
Page 3
J
0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
TIFF ( lossless )
JPEG ( Q = 90 )
JPEG ( Q = 70 )
JPEG ( Q = 50 )
precision
Fig.4 Estimation precision for globally applied gamma correction.
0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4
0.015
0.01
0.005
0
0.005
0.01
0.015
0.02
J
J
J
Fig.5 Error between the estimated and actual gamma value,
stat. from samples on which
J
is estimated precisely.
range of [0.01, 0.018], which demonstrates the accuracy of
our proposed gamma estimation algorithm once the image is
detected to be gamma corrected.
The estimation precision for the locally applied gamma
correction on original TIFF images is plotted in Fig. 6. Here
different size (300
u
300, 200
u
200, 100
u
100 respectively)
of central region in each original image is treated as test
samples. The test results indicate that estimation precision
degrades along with the decrease of local region size. Such
an exhibition can attribute to the absence of smoothness for
original images’ local histograms. In this case, estimation
error statistic is the same as that shown in Fig. 5.
It should be noted that the proposed gamma estimation
algorithm is not robust against even weak noise disturbance.
Such deficiency might be inherent for the histogrambased
forensics methods [10].
5. CONCLUSION
In this paper, we propose an effective forensic estimation
algorithm to identify the gamma correction operation, which
is usually applied in inverse image engineering and forgery
creation. Histogram characteristics of a gamma corrected
image is analyzed and measured by peakgap feature pattern.
The amount of gamma correction is estimated by matching
J
0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2 2.4
0
0.2
0.4
0.6
0.8
1
Size = 300 x 300
Size = 200 x 200
Size = 100 x 100
precision
Fig.6 Estimation precision for locally applied gamma correction.
the peakgap feature pattern extracted from test images to
those precomputed ones. Validity of the designed forensic
estimation scheme has been verified by experiments on both
globally and locally contrast enhanced images.
6. ACKNOWLEDGEMENT
This paper is supported in part by National 973 program
(No. 2006CB303104), National Natural Science Foundation
of China (No. 60702013, No. 60776794), Beijing Natural
Science Foundation (No. 4073038).
7. REFERENCES
[1] S. Bayram, H. T. Sencar and N. Memon, “An Efficient and
Robust Method for Detecting Copymove Forgery,” in Intl. Conf.
on Acoustics, Speech and Signal Processing, Taipei, 2009.
[2] Y.F. Hsu and S.F. Chang, “Image Splicing Detection Using
Camera Response Function Consistency and Automatic Segmen
tation,” in Intl. Conf. on Multimedia and Expo, Beijing, 2007.
[3] Z. Fan and R. L. Queiroz, “Identification of Bitmap Compre
ssion History: JPEG Detection and Quantizer Estimation,” IEEE
Trans. on Image Processing, vol. 12, no. 2, pp. 230–235, 2003.
[4] D. Hsiao and S. Pei, “Detecting Digital Tampering by Blur
Estimation,” 1st Intl. Workshop on Systematic Approaches to Dig
ital Forensic Engineering, Washington, 2005.
[5] M. Stamm and K. J. R. Liu, “Blind Forensics of Contrast En
hancement in Digital Images,” in Intl. Conf. on Image Processing,
San Diego, 2008.
[6] M. Stamm and K. J. R. Liu, “Forensic Detection of Image
Tampering Using Intrinsic Statistical Fingerprints in Histograms,”
in Proc. APSIPA Annual Summit and Conference, Sapporo, 2009.
[7] M. Stamm and K. J. R. Liu, “Forensic Estimation and Recon
struction of a Contrast Enhancement Mapping,” in Intl. Conf. on
Acoustics, Speech and Signal Processing, Texas, 2010.
[8] H. Farid, “Blind Inverse Gamma Correction,” IEEE Trans. on
Image Processing, vol. 10, no. 10, pp. 14281433, 2001.
[9] G. Schaefer and M. Stich, “UCID  An Uncompressed Colour
Image Database,” in Proc. SPIE, Storage and Retrieval Methods
and Applications for Multimedia, San Jose, 2004.
[10] Gang Cao, Yao Zhao and Rongrong Ni, “AntiForensics of
Contrast Enhancement in Digital Images”, ACM Multimedia and
Security Workshop, Roma, 2010.
2100
Page 4
Data provided are for informational purposes only. Although carefully collected, accuracy cannot be guaranteed. The impact factor represents a rough estimation of the journal's impact factor and does not reflect the actual current impact factor. Publisher conditions are provided by RoMEO. Differing provisions from the publisher's actual policy or licence agreement may be applicable.

 "In [13], the authors estimate whether an image is contrast enhanced and reconstruct the original image. Other histogram based CE detectors involve [14] and [15]. A lot of antiforensic strategies have been proposed against such first order statistics based CE detectors. "
[Show abstract] [Hide abstract] ABSTRACT: Detecting Contrast Enhancement (CE) in images and antiforensic approaches against such detectors have gained much attention in multimedia forensics lately. Several contrast enhancement detectors analyze the first order statistics such as graylevel histogram of images to determine whether an image is CE or not. In order to counter these detectors various antiforensic techniques have been proposed. This led to a technique that utilized second order statistics of images for CE detection. In this paper, we propose an effective antiforensic approach that performs CE without significant distortion in both the first and second order statistics of the enhanced image. We formulate an optimization problem using a variant of the well known Total Variation (TV) norm image restoration formulation. Experiments show that the algorithm effectively overcomes the first and second order statistics based detectors without loss in quality of the enhanced image. 
 "Let us also remark that none of the singleimage methods, neither the blind gamma estimation [14], [15], [16], nor the CRF estimation ones [10], [17], are capable of improving their performance if extra images are available. III. "
Article: Simultaneous Blind Gamma Estimation
[Show abstract] [Hide abstract] ABSTRACT: Blind gamma estimation is the problem of estimating the gamma function that is applied to a linear image both for perceptual reasons and for the compensation of the nonlinear behavior of displays. Gamma values change both inter and intracamera. In the latter case, the change comes from the use of different scene settings. In this letter we propose a new approach that relies on the use of more than a single image from the same scene. We estimate the gammas for all the different images at the same time with a method based on exploiting the structure of the standard incamera processing pipeline. Our results improve over the stateoftheart. 
 "The prior methods [10]–[12] fail to detect contrast enhancement in the previously middle/low quality JPEGcompressed images. To investigate the reasons behind such ineffectiveness, the impact of JPEG compression on histograms is analyzed. "
[Show abstract] [Hide abstract] ABSTRACT: As a retouching manipulation, contrast enhancement is typically used to adjust the global brightness and contrast of digital images. Malicious users may also perform contrast enhancement locally for creating a realistic composite image. As such it is significant to detect contrast enhancement blindly for verifying the originality and authenticity of the digital images. In this paper, we propose two novel algorithms to detect the contrast enhancement involved manipulations in digital images. First, we focus on the detection of global contrast enhancement applied to the previously JPEGcompressed images, which are widespread in real applications. The histogram peak/gap artifacts incurred by the JPEG compression and pixel value mappings are analyzed theoretically, and distinguished by identifying the zeroheight gap fingerprints. Second, we propose to identify the composite image created by enforcing contrast adjustment on either one or both source regions. The positions of detected blockwise peak/gap bins are clustered for recognizing the contrast enhancement mappings applied to different source regions. The consistency between regional artifacts is checked for discovering the image forgeries and locating the composition boundary. Extensive experiments have verified the effectiveness and efficacy of the proposed techniques.