Quick Gamut mapping for simplified color
correction
Matteo Cereda1, Alessandro Rizzi1, Alice Plutino1
1
Department of Computer Science, University of Milan, Milan, Italy. [email protected],
[email protected], [email protected]
Corresponding author: Alice Plutino ([email protected])
ABSTRACT
This paper presents an alternative simplified method to convert color spaces more quickly than using the
traditional gamut mapping. The conversion is carried out in the two-dimensional xy chromaticity diagram,
through an affine transformation, which remaps the color chromaticity only. The affine transformation applies
to the colors of the original image the values obtained by solving two linear systems of three equations using
the coordinates of the input and output color spaces. Then, these values are applied to each xy coordinate
of the image color obtained from its RGB values.
Purpose of this alternative method is not the colorimetric accuracy, but testing is an oversimplified version
can lead to acceptable results. In image and video editing, the steps of color correction and color grading
are often performed by the expert’s eye using various image editing tools and software. This approach
overshadows the colorimetric aspect, focusing just on the aesthetic enhancement. The proposed alternative
gamut mapping method, named Quick Gamut, will be presented through application examples.
KEYWORDS (Gamut mapping, Color correction, Image processing, Digital image, Colorimetry)
RECEIVED 01/03/2021; REVISED 02/04/2021; ACCEPTED 07/04/2021
79 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209
Quick Gamut mapping for color correction
1. Introduction 2.1 Affine transformation
When talking about color reproduction in digital systems it Quick Gamut uses an affine transformation based on the
is fundamental to define the concept of color gamut. A following formula (Weisstein, 2002):
color gamut is the set of colors that can be reproduced by
𝑋 = 𝑎𝑥 + 𝑏𝑦 + 𝑒
a specific device (e.g., monitor, printer, photographic { (1)
film). Each device or media has a different color gamut, 𝑌 = 𝑐𝑥 + 𝑑𝑦 + 𝑓
so the colors that we see in a monitor cannot be
Where, X and Y are the coordinates of the new color
reproduced by a printer or by a different kind of monitor.
space (output) and x and y are the old coordinates
A common way to compare different color gamut is
(input). Before applying the transformation, it is
through the x y coordinates of the CIE 1931 chromaticity
necessary to know a, b, e, c, d and f values. These
diagram. As defined in (Ramanath, 2014):
values can be obtained by solving two linear systems of
“Gamut Mapping refers to the process of translating three equations, one for x and the other for y, using the
colors in one device’s color space to that of another. This coordinates of the three fundamental components of the
process is performed on colors in images and video so as input and the output color spaces.
to create a rendition of a source image (typically in a
𝑋𝑟 = 𝑎𝑥𝑟 + 𝑏𝑦𝑟 + 𝑒
capture device’s color space) in an output device’s color
space while meeting several rendering intents: absolute {𝑋𝑔 = 𝑎𝑥𝑔 + 𝑏𝑦𝑔 + 𝑒
and relative colorimetric fidelity, perceptual accuracy, and 𝑋𝑏 = 𝑎𝑥𝑏 + 𝑏𝑦𝑏 + 𝑒 (2)
the problem of saturation – each of which trades off one
color property at the expense of another”. 𝑌𝑟 = 𝑐𝑥𝑟 + 𝑑𝑦𝑟 + 𝑓
Since gamut mapping is a current open issue in computer
{𝑌𝑔 = 𝑐𝑥𝑔 + 𝑑𝑦𝑔 + 𝑓
science and color analysis, through the history different 𝑌𝑏 = 𝑐𝑥𝑏 + 𝑑𝑦𝑏 + 𝑓 (3)
methods and approaches to perform it have been
After the values computation from the previous systems,
proposed and this issue has been recognized also by
it is possible to map each pixel of the image from the
CIE (Commission Internationale de l’Éclairage), which set
original color space to the output color space by applying
up the Technical Committee 8-03 on Gamut Mapping.
Formula 1.
The state of the art on gamut mapping is really wide and
complex, therefore in this work we will not report a survey 2.2 Quick Gamut mapping
or a technical comparison among gamut mapping In order to map the colors of the original image in the new
methods, anyway we suggest the works proposed in color space, it is necessary, at first to convert the input
(Morovič, 2001) and (Morovič, 2008) for a detailed survey RGB values into x and y chromaticity coordinates then,
on gamut mapping techniques. apply the affine transformation and at the end convert the
In general, the traditional methods of automatic color new x y coordinates into RGB values.
spaces conversion and gamut mapping from a device to The steps to apply Quick Gamut mapping are listed
another are colorimetrically accurate, but in some cases below:
the result is not perceptually satisfactory, and it needs to
1. Normalize the RGB values over [0, 1];
be edited manually. In this paper, we present an
2. Perform the gamma correction (i.e., raise each
alternative method that implement an oversimplification of
normalized value to gamma);
the classic gamut mapping approach.
3. Multiply the color space transformation matrix by
In contrast to traditional gamut mapping, the proposed the RGB vector;
method applies a geometric simplification, which consists
The product between the transformation matrix and the
in mapping the colors only in the two-dimensional CIE xy
RGB vector is shown below:
chromaticity diagram and applying an affine
transformation that remaps colors chromaticity (Wolf,
1961). In this paper, we propose some preliminary X 𝑅
experiments and applications of this method, called Quick [𝑌 ] = [ 𝑀 ] [ 𝐺 ]
Gamut on some images, to assess if the decrease of
𝑍 𝐵 (4)
computational complexity (which becomes linear) could
provide satisfactory results.
Where, M is the transformation matrix given by:
80 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209
Quick Gamut mapping for color correction
𝑋𝑟 𝑋𝑔 𝑋𝑏 10. Apply the gamma factor (rising the RGB values
to 1 / γ), and multiply the values by 255 to bring
[ 𝑌𝑟 𝑌𝑔 𝑌𝑏 ] them back into range [0,255];
𝑍𝑟 𝑍𝑔 𝑍𝑏 (5) 11. Clamp all the RGB values into the range [0, 255].
The transformation matrix varies according to the color 2.3 Example of Quick Gamut mapping
space (i.e., Adobe RGB (1998), sRGB). applications
4. The values obtained from the above In the examples that will be shown, the sRGB
multiplication have range [0, 1] and are mapped coordinates are obtained by a linear transform with the
in the XYZ color space. matrix reported in Formula 13 and the inverse
5. Convert the XYZ values into xyz coordinates with transformation matrix in Formula 14 (Anderson et al.,
the formulas: 2020).
0.4124564 0.3575761 0.1804375
𝑋 𝑀 = [0.2126729 0.7151522 0.0721750] (13)
𝑥= (6)
𝑋+𝑌+𝑍 0.0193339 0.1191920 0.9503041
𝑌 𝑀−1 =
𝑦= (7) 3.2404542 −1.5371385 −0.4985314
𝑋+𝑌+𝑍
[−0.9692660 1.8760108 0.0415560 ] (14)
𝑍 0.0556434 −0.2040259 1.0572252
𝑧= (8)
𝑋+𝑌+𝑍 New RGB color space
x 0.4
In this case, it is enough to know only the x and y R
y 0.35
coordinates because we are working on a two-
x 0.3
dimensional space. G
y 0.4
6. Apply the affine transformation to the obtained
x 0.27
xyz coordinates (Formula 1); B
y 0.24
7. Map all the pixels in the image to the output color
space with the affine transformation and convert x 0.3093
White
the new coordinates back to XYZ values using y 0.3260
the formulas: Tab. 1 Color space specifications.
𝑥
𝑋= 𝑌
𝑦 (9)
𝑌=𝑌 (10)
1−𝑥−𝑦
𝑍= 𝑌
𝑦 (11)
8. Normalize and clamp the CIE XYZ values in the
range [0, 1];
9. Convert CIE XYZ values to RGB color space
using the inverse transformation matrix:
𝑅 X
[𝐺 ] = [𝑀−1 ] [𝑌]
𝐵 𝑍 (12)
Fig. 1 Input and output RGB color spaces.
81 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209
Quick Gamut mapping for color correction
Fig. 3 (left) Quit Gamut mapping application, (centre) original image and (right) gamut mapping performed
through Photoshop.
Fig. 2 ColorChecker.
In Figure 1 is reported an image of a typical input 2.4 Quick Gamut mapping assessment
RGB color space (sRGB) and the destination color
To evaluate the precision of Quick gamut conversion, we
space computed using Quick Gamut mapping (see
tested this method on a ColorChecker (Figure 3). In Table 2
Table 1).
are reported the CIE L*a*b* values of every patch of the
To show the performances of Quick Gamut applied on ColorChecker after a gamut mapping performed using
an image, in Figure 2 is reported a comparison Photoshop and using Quick Gamut. The differences
between an image mapped using Photoshop and an between CIE L*a*b* values have been computed using ΔE*
image mapped using our method. Here, it can be difference (Mokrzycki and Tatol, 2020). Since Quick Gamut
seen that Quick Gamut offers a perceptually provides a strong geometrical simplification to map the color
satisfactory result without loss of details, in contrast values in a new space, the color difference ΔE* is high for
to Photoshop that produce images with flat colors. some patches. Nevertheless, the linearity of the affine
transform makes this method particularly easy to compute.
82 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209
Quick Gamut mapping for color correction
Quick gamut
Photoshop Δ
Colore mapping
L* a* b* L* a* b* ΔL* Δa* Δb* ΔE*
1 38 8 11 37 4 5 -1 -4 -6 7.28
2 64 11 15 64 8 6 0 -3 -9 9.48
3 53 5 -18 50 3 -6 -3 -2 12 12.53
4 46 -8 14 44 -1 6 -2 7 -8 10.82
5 56 9 -23 55 6 -6 -1 -3 17 17.29
6 74 -17 4 72 -3 -1 -2 14 -5 15.00
7 58 19 22 59 12 17 1 -7 -5 8.66
8 55 13 -27 40 6 -13 -15 -7 14 21.68
9 52 27 11 46 14 6 -6 -13 -5 15.16
10 35 11 -17 30 7 -6 -5 -4 11 12.73
11 82 -11 22 73 -4 16 -9 7 -6 12.88
12 71 5 22 69 8 20 -2 3 -2 4.12
13 49 12 -25 31 5 -12 -18 -7 13 23.28
14 62 -19 16 56 -7 9 -6 12 -7 15.13
15 45 26 17 37 16 9 -8 -10 -8 15.09
16 84 -6 23 80 3 23 -4 9 0 9.85
17 59 22 -12 47 15 -5 -12 -7 7 15.56
18 60 0 -15 53 0 -9 -7 0 6 9.22
19 97 -1 2 97 4 2 0 5 0 5.00
20 81 -1 0 82 5 1 1 6 1 6.16
21 67 0 0 67 4 1 0 4 1 4.12
22 51 0 0 51 3 1 0 3 1 3.16
23 36 0 -1 36 2 0 0 2 1 2.24
24 22 0 -1 22 2 0 0 2 1 2.24
Tab. 2 CIE L*a*b* values obtained from Figure 3. Highlighted in green the values between 0 and 2.99, in yellow the
values between 3 and 4.99, in orange the values between 5 and 9.99, in blue the values greater than 10
3. Conclusion 6. Short biography of the authors
In this work, Quick Gamut, an alternative simplified gamut Matteo Cereda – He graduated in Computer Science for
mapping method has been presented. This method works digital communication at the University of Milano. As a
only on the two-dimensional chromaticity information of great passionate of digital videos and photos, during his
the color spaces involved. university experience he chose to deepen the multimedia
The preliminary tests carried out in this work, showed that field. This allowed him to gain skills in video and image
despite the high color differences between the images processing, image enhancement and color correction.
obtained with traditional gamut mapping and with this
Alice Plutino – She recently obtained the PhD at the
method, the new proposed method can be use to provide
Department of Computer Science, University of Milano.
a quick transformation for the color correction of images
Her research interests are: Colorimetry, Image
and/ or videos.
Processing, Data Digitization and Archiving with a
particular interest in applications on Film Restoration.
4. Conflict of Interest She is author of many scientific works, member of the
The authors declare no conflict of interest. Organizing Committee of AIC2021 and part of different
workshops and conferences.
Alessandro Rizzi – He is Full Professor at the
5. Declaration of funding sources Department of Computer Science at the University of
The authors received no specific funding for this work. Milano, teaching Multimedia, Colorimetry and Film
restoration. He is doing research since 1990 in the field of
digital imaging with a particular interest on color,
visualization, photography, HDR, VR and on the
perceptual issues related to digital imaging, interfaces,
83 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209
Quick Gamut mapping for color correction
and lighting. He is co-chair of the IS&T Conference “Color
Imaging: Displaying, Processing, Hardcopy and
Applications”, Topical Editor for “Applied Color Science”
of the Journal of Optical Society of America A, Associate
Editor of Journal of Electronic Imaging, member of
several program committees of conferences related to
color and digital imaging, and author of about 400
scientific works.
References
Anderson, M., Motta, R., Chandrasekar, S., and Stokes, M. (1996)
'Proposal for a Standard Default Color Space for the Internet - sRGB',
Color Imaging Conference.
Mokrzycki, W. and Tatol, M. (2011) 'Color difference Delta E - A survey',
Machine Graphics and Vision. 20. pp. 383-411.
Morovič, Ján. Color gamut mapping. Vol. 10. John Wiley & Sons, 2008.
Morovič, Ján, and M. Ronnier Luo. "The fundamentals of gamut
mapping: A survey." Journal of Imaging Science and Technology 45.3
(2001): 283-290.
Ramanath R., Drew M.S. (2014) Gamut Mapping. In: Ikeuchi K. (eds)
Computer Vision. Springer, Boston, MA. https://doi.org/10.1007/978-0-
387-31439-6_456
Weisstein, E. (2002) CRC concise encyclopedia of mathematics,
second edition. 2nd edn. New York: Chapman and Hall/CRC, p. 36.
Wolf, E. (1961) Progress in optics. 1st edn. Amsterdam: North-Holland
Pub. Co., pp. 213-214.
84 Color Culture and Science Journal Vol. 13 (1) DOI: 10.23738/CCSJ.130209