Content uploaded by Tobias M. Post
Author content
All content in this area was uploaded by Tobias M. Post on May 09, 2019
Content may be subject to copyright.
Color Interpolation for Non-Euclidean Color Spaces
Max Zeyen*
Los Alamos National
Laboratory
University of Kaiserslautern
Tobias Post†
University of Kaiserslautern
Hans Hagen‡
University of Kaiserslautern
James Ahrens§
Los Alamos National Laboratory
David Rogers¶
Los Alamos National Laboratory
Roxana Bujack||
Los Alamos National Laboratory
ABSTRACT
Color interpolation is critical to many applications across a variety
of domains, like color mapping or image processing. Due to the
characteristics of the human visual system, color spaces whose dis-
tance measure is designed to mimic perceptual color differences tend
to be non-Euclidean. In this setting, a generalization of established
interpolation schemes is not trivial. This paper presents an approach
to generalize linear interpolation to colors for color spaces equipped
with an arbitrary non-Euclidean distance measure. It makes use
of the fact that in Euclidean spaces, a straight line coincides with
the shortest path between two points. Additionally, we provide an
interactive implementation of our method for the CIELAB color
space using the CIEDE2000 distance measure integrated into VTK
and ParaView.
Index Terms:
Human-centered computing—Visualization—Visu-
alization techniques—Treemaps; Human-centered computing—
Visualization—Visualization design and evaluation methods
1 INTRODUCTION
Many applications require interpolation between colors, for exam-
ple, color mapping, re-sampling of color images or movies, and
image manipulations, like stitching, morphing, or contrast adaption.
The most popular interpolation method is linear, where values are
taken equidistantly on a straight line connecting the sampling points.
However, the state of the art indicates that human color perception
is non-Euclidean due to the principle called hue superimportance,
Figure 1. Hue superimportance [9] refers to the fact that changes
in hue are perceived stronger than changes in saturation, Figure 1.
The circumference of a circle of constant luminance and saturation
would be estimated to measure about
4π
for its radius, which can-
not be embedded in a Euclidean plane. In non-Euclidean spaces,
the concept of a straight line is in general undefined. For the spe-
cial case of Riemannian manifolds, the generalization of a straight
line is a geodesic, i.e., a shortest path between two points, whose
length coincides with the points’ distance. Furthermore, human
color perception is also non-Riemannian, due to the principle called
diminishing returns [9], Figure 1. In this context, diminishing returns
refers to the phenomenon that when presented with two colors,
A,C
and their perceived middle (average/mixture)
B
, an observer usually
judges the sum of the perceived differences of each half greater than
the difference of the two outer colors
∆(A,B) + ∆(B,C)>∆(A,C)
.
This effect is produced by a natural contrast enhancement filter
*e-mail: mzeyen@lanl.gov
†e-mail: tpost@rhrk.uni-kl.de
‡e-mail: hagen@cs.uni-kl.de
§e-mail: ahrens@lanl.gov
¶e-mail: dhr@lanl.gov
||e-mail: bujack@lanl.gov
that is built into the human perceptual system to adapt to different
viewing conditions. As a result, modern color difference formulas
(e.g. CIEDE1994, CIEDE2000) that were designed to match experi-
mental data produce complicated spaces, in which it is difficult to
correctly interpolate colors.
Figure 1: Visualization of hue-
superimportance and diminish-
ing returns.
Figure 2: From the black
node: 1-neighborhood orange,
2-neighborhood green.
In this paper, we present a novel method for interpolating colors in
arbitrary color spaces equipped with a distance measure. Analogous
to the concept of a geodesic in a Riemannian manifold, we use a
shortest path between the colors to be interpolated with respect to the
given distance measure, even though its length does generally not
coincide with the distance between the colors. To be mathematically
precise, we require a path-connected metric space. That allows the
definition of a shortest path even though it might not be unique or
finite. Furthermore, we provide an open source implementation
of the algorithm in the Visualization Toolkit (VTK) [30, 31] and
ParaView [1] for the special case of CIELAB color space with the
CIEDE2000 distance measure. We also conduct a parameter study
to determine the best resolution and neighborhood with respect to
path lengths and runtime.
The main contributions of this paper in a nutshell are:
•
Presentation of a novel method for the interpolation of colors
in arbitrary path-connected metric color spaces.
•
Release of open an source implementation of the algorithm in
VTK and ParaView.
•
Optimization of the parameters w.r.t. path length and runtime
through experiments to achieve interactivity.
We particularly do not claim that colormaps interpolated in non-
metric spaces are better than the ones interpolated in Euclidean color
spaces. This could only be evaluated through a user study, which is
outside the scope of this paper. We simply provide the functionality.
2 RE LATED WORK
Guild [6] describes the setup and the results of the colorimetric
experiments that led to the definition of the CIE standard observer.
His seminal paper describes the birth of the first modern color space:
(a) Naive VTK implementation. (b) Corrected implementation.
Figure 3: VTK’s implementation of adapting midpoint and sharpness
does not trivially expand to our method because it is applied sep-
arately between all intermediate nodes on a shortest path. This
example shows a sharpness of
s=1
, which corresponds to constant
interpolation.
CIERGB. It is based on the three primaries from Wright’s experi-
ments [37] and all currently used modern color spaces refer to it.
The goal of the CIE back in those days was to embed all visible
colors into one space to allow unambiguous reproduction of every
possible color sensation. A transformation of CIERGB to CIEXYZ
uses three imaginary primaries, which span the complete visible
spectrum [3, 5]. Later, the CIE’s efforts extended to the search of
a color space that would not only hold all colors but also provide
a metric that represents the perceived distances between all colors.
This goal resulted in spaces like CIELAB, CIELUV, and CIECAM,
which are transformations of CIEXYZ that approximate perceived
human color differences [13, 14, 16, 22, 28].
Judd [9, 10] defines the concept of an ideal color space as ”a
three-dimensional array of points, each representing a color, so lo-
cated that the length of the straight line between any two points
is proportional to the perceived size of the difference between the
colors represented by the points.” In his papers, he collects evidence
that such an ideal color space cannot exist. He refers to the experi-
ments of MacAdam [17
–
20], and Helm [7] regarding the principle
of diminishing returns, and the Nickerson index of fading [23] re-
garding the principle of hue-superimportance. Their experiments
all suggest that the perceived color distances cannot be embedded
in a three-dimensional Euclidean space, but that more complicated
mathematical models are needed [26,29, 33, 34, 36].
In order to encompass the non-Euclidean behavior of human color
perception, CIELAB was equipped with other distance measures,
like
∆E1994
and
∆E2000
[8, 15,21]. Many authors agree that a per-
ceptually uniform color space should be used to asses the quality
of colormaps [11, 12, 24, 27, 39, 41] but there are some problems
with the non-Euclidean distance functions. Due to their construction,
they produce singularities between colors whose hues differ by 180
degrees and sometimes do not fulfill the triangle inequality, which
mathematically disqualifies them as a metric [32]. On top of this,
it is not easy to imagine a non-Euclidean space. It, and the paths
of colormaps in it, can’t be visualized easily. Further, concepts like
linearity, or smoothness of a colormap cannot be defined in these
spaces in a straightforward way [4]. To overcome some of these
difficulties, Pant et al. provide a space that is close to the original
distance measure, but is Riemannian [25]. Zerai and Triki [40] ex-
tend the definition of image distortion measures (mean, variance,
mean square error) to color images that are defined in a color space
that satisfies the properties of a Riemannian manifold. These spaces
are often used to describe color in a mathematical setting, as by von
Helmholtz [36], Schr
¨
oedinger [29] and Stiles [38]. On the other
hand, Urban et al. [35] take one step back looking for the Euclidean
space that most closely approximates its non-Euclidean counterpart.
We believe that future color spaces will continue to better ap-
proximate human color perception and embrace its complicated
non-Euclidean structure because our computational capacities will
enable us to work with them despite those difficulties. In this paper,
we describe a contribution to that goal that allows interpolation in
non-Euclidean color spaces.
Figure 4: Average of both path distances and independent path
distances with respect to the resolution used for computing the paths
3 ALGORITHM
In Euclidean color spaces, linear interpolation between two colors
forms a straight line, which corresponds to the shortest path between
those two colors. Our method generalizes linear color interpolation
to non-Euclidean color spaces using this concept of interpolation
along a shortest path connecting two colors. We only assume that the
space is path-connected and has a distance measure (satisfying posi-
tivity, symmetry, and identity of indiscernibles) that approximates
the perceptually correct distance between any two colors. Through
this notion of distance, it is possible to sample the color space and
set up a graph with the color distances as weights on the edges. This
enables us to interpolate between colors by searching a shortest path
on the graph.
Many configurations of placing nodes and edges in different color
spaces are possible. In our implementation, we use the RGB color
space because of its handy cubic shape and because that way, we
can easily guarantee that all graph nodes are within the display’s
gamut. We place the nodes uniformly in all three dimensions, use
a 26 connectivity, and allow the user to choose from different res-
olutions and neighborhoods, Figure 2. In addition to its simplicity,
the uniform grid allows us to compute the graph on the fly while the
Dijkstra algorithm runs. Therefore, we do not have to store it, which
is crucial for higher resolutions.
For a practical use in a visualization environment, the interpo-
lation algorithm must run with an interactive response time. This
restriction makes choosing a resolution in the order of the colors in
the final colormap (typically 256) computationally prohibitive. To
overcome this problem, we make use of the fact that for small color
differences, the paths in different color spaces do not vary much.
Especially in our case, the shortest paths of CIELAB’s Euclidean
∆E1976
and its non-Euclidean
∆E2000
are similar for small color
differences. Therefore, we use the classical linear interpolation of
the underlying Euclidean space to fill the small gaps between the
node points on the coarser shortest path in the graph. By setting the
resolution, the users can choose a trade-off between accuracy and
speed depending on the computational resources at their disposal.
The calculation of a shortest color path is implemented in VTK,
using a version of Dijkstra’s algorithm is used to find a shortest
path within the graph of discrete RGB colors as explained earlier.
One particularity of our path finding algorithm is that the graph is
generated on the fly to minimize the algorithm’s memory footprint,
which can become quite significant for larger graph resolutions (i.e.
>500 MB).
(a) Resolution = 2 (b) Resolution = 16
(c) Resolution = 4 (d) Resolution = 32
(e) Resolution = 8 (f) Resolution = 256
Figure 5: Comparison interpolating the same two colors pink and
yellow with increasing graph resolution and a neighborhood of 1.
Once the graph path
n0, ..., nk
of
k∈N+
nodes is calculated, it
is cached and only updated on demand in the VTK implementation
to achieve a higher run-time performance. To create a colormap
with
n>k
entries, the path is discretized regularly according to the
relative distances of the nodes on the path. Here, for each of the
n
final colormap entries, the closest left and right of the
k
colors on
the graph path are found and interpolated linearly in CIELAB with
its Euclidean metric. This leads to almost equal distances between
the final colors of the colormap according to the used color distance
measure.
In addition, VTK allows users to set midpoint
m∈[0,1]
and
sharpness
s∈[0,1]
parameters for colormaps, changing the way col-
ors are interpolated using a modified Hermite curve. The midpoint
shifts the average between two colors to the left for
m<0.5
or the
right for
m>0.5
. The sharpness steers the interpolation between
linear for
s=0
and constant for
s=1
. Since VTK applies this
Hermite to each pair of neighboring colors in the colormap, its naive
application to our color path produces false results. We correct the
computation using a generalized Hermite curve. The effect is shown
in Figure 3 using the two colors, pink (
R=180
,
G=60
,
B=255
)
and yellow (
R=255
,
G=248
,
B=42
). These same two colors are
used throughout our experiments unless mentioned otherwise.
4 EXPERIMENTS
In this section, we describe the experiments performed to select the
best parameters in terms of path length and path build time. Figure 4
shows that the graph-theoretical path length, i.e., the sum over the
distances between the colors c(ni)of consecutive nodes ni
lg=
k
∑
i=1
∆E(c(ni),c(ni+1)),(1)
is not a good candidate because the principle of diminishing returns
gives a false advantage to coarse paths, i.e., low graph resolution
and small
k
. A better candidate is the path length in the color space,
l=sup
0=t0,...,tn=1
k
∑
i=1
∆E(c(ti),c(ti+1)) (2)
because the supremum over all possible sample points
ti
on the path
is independent from the resolution of the underlying graph used to
generate the path. That makes an unbiased comparison over graphs
of different resolutions possible. For its practical evaluation, we
choose a discrete resolution of
2563
in RGB, includes all graph nodes
of our experiments. The evaluation is performed using a version of
Bresenham’s line drawing algorithm [2]. In our experiments, we
construct all possible colormaps of maximal extension in the graph,
i.e., all combinations of color pairs of the corner colors of RGB, and
average the resulting path lengths and build times.
Figure 4 demonstrates the convergence of the mean path length in
space to the path length in the graph for a neighborhood of 1. It also
(a) Linear Comparison
(b) Log-log Comparison
Figure 6: Average path build time based on resolution and neighbor-
hood size.
shows that larger neighborhoods generate shorter graph-theoretical
path lengths
lg
despite larger actual path lengths
l
. That is due to
the fact that the graph chooses seemingly shorter paths by jump-
ing across regions that can be reached only through large detours
by a continuous path. Note that neighborhood 2 with resolution 1
and neighborhood 3 with resolutions 1 and 2 are not represented
in Figure 4 because the resolutions are too small to fit a full neigh-
borhood and the results are identical to the smaller neighborhoods.
Resolution 256 with neighborhood 3 is missing due to high compute
times. In accordance with the results shown in Figure 4, Figure
5 demonstrates through an example that the interpolation results
from our method barely change at graph resolutions of 16 or higher.
The corresponding timing results can be found in Figure 6. The
colormaps with resolution 16 take 0.1s while resolution 32 takes
around 1s. Our experiments suggest that the optimal settings w.r.t.
build time and interpolation quality are a resolution of 16 and a
neighborhood of 1.
Figure 7 shows two colors linearly interpolated in RGB, HSV,
LAB with CIEDE1976, and LAB with CIEDE2000 color spaces.
The latter was generated using the shortest path from our algorithm
from Section 3. The path lengths depicted in Figure 7 demonstrate
the fact that our interpolation method achieves the shortest path
among all tested color interpolation methods.
Figure 8 visualizes the paths from Figure 7 and the surround-
ing RGB color space embedded in the CIELAB color space. The
CIEDE1976 path is as expected a straight line, whereas the RGB
(a) RGB (path length: 91.438)
(b) HSV (path length: 115.498)
(c) CIEDE1976 (path length: 92.485)
(d) CIEDE2000 (path length:90.156)
Figure 7: Linear interpolation between pink and yellow in four different
color spaces. Path length is measured in CIEDE2000.
path is slightly curved but still follows the CIEDE1976 line closely.
The HSV and CIEDE2000 paths have more extreme deviations.
Whereas the HSV path moves more along the outskirts of the RGB
color space, the CIEDE2000 path moves closer towards its center.
We were able to observe the same behavior with other colors as
well. This phenomenon is in accordance with hue-superimportance
because the human eye perceives desaturated colors as being closer
together than flashier ones. For colormaps with multiple control
points, this often results in sharper transitions at these control points,
Figure 9, with the path forming a flower-like pattern.
5 CONCLUSIONS
During the course of this paper, we discussed the issues regarding
color interpolation in non-Euclidean color spaces. We presented an
approach based on shortest paths in graphs with interactive response
time and demonstrated it applied to the example of the CIELAB
color space with the CIEDE2000 distance measure. We conducted
experiments to select the best default parameters and compared the
interpolation results to other commonly used color spaces. Even
though there is no mathematical proof that a unique shortest path
always exists, it did exist in each tested configuration.
In conclusion, our findings show a robust way of interpolating
non-Euclidean path-connected metric color spaces. This makes our
method extremely valuable for color interpolation in future color
spaces with more complex and accurate models of human perception.
As part of our work on this paper, we provide an extension to
VTK for the CIELAB color space with the CIEDE2000 distance
measure, which is now officially available in the current VTK nightly
build. Additionally, our method is integrated through VTK in the
color map editor menu of ParaView and has been available since
the release of version 5.5 (see Figure 10). As determined by our
parameter study, the ParaView version uses a
163
discretized grid
with a one-neighborhood set up in the RGB color space and mapped
over to the CIELAB color space.
In the future, we would like to extend this work to avoid the sharp
transitions at control points through a generalization of the concept
of smoothness to non-Euclidean color spaces.
ACK NOWLED GM EN TS
This work was funded by the National Nuclear Security Administra-
tion (NNSA) Advanced Simulation and Computing (ASC) Program,
for production visualization, and by U.S. Department of Energy Of-
fice of Science, Advanced Scientific Computing Research, through
Figure 8: Shortest paths from four different color spaces and the RGB
color cube embedded in the CIELAB color space
(a) CIEDE1976
(b) CIEDE2000
Figure 9: Example of our color interpolation method for multiple non-
uniformly distributed control points:
{
[0.0, (0, 0, 0)], [0.4, (255, 0, 0)],
[0.8, (255, 255, 0)], [1.0, (255, 255, 255)]}
Figure 10: Integration of our method in the ParaView nightly build. It
can be chosen in the colormap editor drop down menu as indicated
by the red circle.
Dr. Laura Biven. We would also like to thank Greg Abram for
contributing a resampled version of the meteor impact dataset for
visualization.
REFERENCES
[1]
J. Ahrens, B. Geveci, and C. Law. Paraview: An end-user tool for
large-data visualization. The Visualization Handbook, p. 717, 2005.
LA-UR-03-1560.
[2]
J. E. Bresenham. Algorithm for computer control of a digital plotter.
IBM Systems Journal, 4(1):25–30, 1965. doi: 10.1147/sj.41. 0025
[3]
A. Broadbent. Calculation from the original experimental data of the
cie 1931 rgb standard observer spectral chromaticity coordinates and
color matching functions. Qu
´
ebec, Canada: D
´
epartement de g
´
enie
chimique, Universit´
e de Sherbrooke, 2008.
[4]
R. Bujack, T. L. Turton, F. Samsel, C. Ware, D. H. Rogers, and
J. Ahrens. The good, the bad, and the ugly: A theoretical frame-
work for the assessment of continuous colormaps. IEEE transactions
on visualization and computer graphics, 24(1):923–933, 2018.
[5]
H. S. Fairman, M. H. Brill, H. Hemmendinger, et al. How the cie 1931
color-matching functions were derived from wright-guild data. Color
Research & Application, 22(1):11–23, 1997.
[6]
J. Guild. The colorimetric properties of the spectrum. Philosophical
Transactions of the Royal Society of London. Series A, Containing
Papers of a Mathematical or Physical Character, 230:149–187, 1932.
[7]
C. E. Helm. Multidimensional ratio scaling analysis of perceived color
relations. JOSA, 54(2):256–262, 1964.
[8]
R. Huertas, M. Melgosa, and C. Oleari. Performance of a color-
difference formula based on OSA-UCS space using small-medium
color differences. JOSA A, 23(9):2077–2084, 2006.
[9]
D. B. Judd. Ideal color space: Curvature of color space and its implica-
tions for industrial color tolerances. Palette, 29(21-28):4–25, 1968.
[10] D. B. Judd. Ideal color space. Color Engineering, 8(2):37, 1970.
[11]
H. Levkowitz. Perceptual steps along color scales. International
Journal of Imaging Systems and Technology, 7(2):97–101, 1996.
[12]
H. Levkowitz and G. T. Herman. The design and evaluation of color
scales for image data. IEEE Computer Graphics and Applications,
12(1):72–80, 1992.
[13]
C. Li, Z. Li, Z. Wang, Y. Xu, M. R. Luo, G. Cui, M. Melgosa, M. H.
Brill, and M. Pointer. Comprehensive color solutions: Cam16, cat16,
and cam16-ucs. Color Research & Application, 42(6):703–718, 2017.
[14]
M. R. Luo, G. Cui, and C. Li. Uniform colour spaces based on ciecam02
colour appearance model. Color Research & Application, 31(4):320–
330, 2006.
[15]
M. R. Luo, G. Cui, and B. Rigg. The development of the cie 2000
colour-difference formula: Ciede2000. Color Research & Application,
26(5):340–350, 2001.
[16]
M. R. Luo and C. Li. Ciecam02 and its recent developments. In
Advanced Color Image Processing and Analysis, pp. 19–58. Springer,
2013.
[17]
D. L. MacAdam. Projective transformations of ici color specifications.
JOSA, 27(8):294–299, 1937.
[18]
D. L. MacAdam. Visual sensitivities to color differences in daylight
∗
.
J. Opt. Soc. Am., 32(5):247–274, May 1942. doi: 10.1364/JOSA.32.
000247
[19]
D. L. MacAdam. Nonlinear relations of psychometric scale values to
chromaticity differences. JOSA, 53(6):754–757, 1963.
[20]
D. L. MacAdam. Smoothed versions of frieles 1965 approximations
for color metric coefficients. JOSA, 56(12):1784 1–1785, 1966.
[21]
M. Mahy, L. Eycken, and A. Oosterlinck. Evaluation of uniform color
spaces developed after the adoption of CIELAB and CIELUV. Color
Research & Application, 19(2):105–121, 1994.
[22]
N. Moroney, M. D. Fairchild, R. W. Hunt, C. Li, M. R. Luo, and
T. Newman. The ciecam02 color appearance model. In Color and
Imaging Conference, vol. 2002, pp. 23–27. Society for Imaging Science
and Technology, 2002.
[23]
D. Nickerson and K. F. Stultz. Color tolerance specification. JOSA,
34(9):550–570, 1944.
[24]
B. Pham. Spline-based color sequences for univariate, bivariate and
trivariate mapping. In Proceedings of the 1st conference on Visualiza-
tion’90, pp. 202–208. IEEE Computer Society Press, 1990.
[25] D. Raj Pant and I. Farup. Riemannian formulation and comparison of
color difference formulas. Color Research & Application, 37(6):429–
440, 2012.
[26]
H. L. Resnikoff. Differential geometry and color perception. Journal
of Mathematical Biology, 1(2):97–131, 1974.
[27]
P. K. Robertson and J. F. O’Callaghan. The generation of color se-
quences for univariate and bivariate mapping. IEEE Computer Graph-
ics and Applications, 6(2):24–32, 1986.
[28]
M. Safdar, G. Cui, Y. J. Kim, and M. R. Luo. Perceptually uniform
color space for image signals including high dynamic range and wide
gamut. Optics express, 25(13):15131–15151, 2017.
[29]
E. Schr
¨
odinger. Grundlinien einer theorie der farbenmetrik im tagesse-
hen. Annalen der Physik, 368(22):481–520, 1920.
[30]
W. J. Schroeder, B. Lorensen, and K. Martin. The visualization toolkit:
an object-oriented approach to 3D graphics. Kitware, 2004.
[31]
W. J. Schroeder, K. M. Martin, and W. E. Lorensen. The design
and implementation of an object-oriented toolkit for 3d graphics and
visualization. In Proceedings of the 7th conference on Visualization’96,
pp. 93–ff. IEEE Computer Society Press, 1996.
[32]
G. Sharma, W. Wu, E. N. Dalal, and M. U. Celik. Mathematical
discontinuities in ciede2000 color difference computations. In Color
and Imaging Conference, vol. 2004, pp. 334–339. Society for Imaging
Science and Technology, 2004.
[33]
L. Silberstein. Investigations on the intrinsic properties of the color
domain. JOSA, 28(3):63–85, 1938.
[34]
R. Sinden. A further search for the ideal color systemi. a new
mechanico-graphical method. JOSA, 27(3):124–131, 1937.
[35]
P. Urban, M. R. Rosen, R. S. Berns, and D. Schleicher. Embedding
non-euclidean color spaces into euclidean color spaces with minimal
isometric disagreement. JOSA A, 24(6):1516–1528, 2007.
[36]
H. Von Helmholtz. Handbuch der physiologischen Optik, vol. 9. Voss,
1867.
[37]
W. D. Wright. A re-determination of the trichromatic coefficients of
the spectral colours. Transactions of the Optical Society, 30(4):141,
1929.
[38]
G. Wyszecki and W. S. Stiles. Color science, vol. 8. Wiley New York,
1982.
[39]
A. Zeileis, K. Hornik, and P. Murrell. Escaping RGBland: selecting col-
ors for statistical graphics. Computational Statistics & Data Analysis,
53(9):3259–3270, 2009.
[40]
M. Z
´
era
¨
ı and O. Triki. A differential-geometrical framework for color
image quality measures. Advances in Visual Computing, pp. 544–553,
2010.
[41]
H. Zhang and E. Montag. Perceptual color scales for univariate and
bivariate data display. The Society for Imaging Science and Technology
(IS&T), 2006.