Color Interpolation for Non-Euclidean Color Spaces
Los Alamos National
University of Kaiserslautern
University of Kaiserslautern
University of Kaiserslautern
Los Alamos National Laboratory
Los Alamos National Laboratory
Los Alamos National Laboratory
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
alization techniques—Treemaps; Human-centered computing—
Visualization—Visualization design and evaluation methods
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  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
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 undeﬁned. 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 , Figure 1. In this context, diminishing returns
refers to the phenomenon that when presented with two colors,
and their perceived middle (average/mixture)
, 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 ﬁlter
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 difﬁcult to
correctly interpolate colors.
Figure 1: Visualization of hue-
superimportance and diminish-
Figure 2: From the black
node: 1-neighborhood orange,
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
deﬁnition of a shortest path even though it might not be unique or
ﬁnite. Furthermore, we provide an open source implementation
of the algorithm in the Visualization Toolkit (VTK) [30, 31] and
ParaView  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  describes the setup and the results of the colorimetric
experiments that led to the deﬁnition of the CIE standard observer.
His seminal paper describes the birth of the ﬁrst 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
, which corresponds to constant
CIERGB. It is based on the three primaries from Wright’s experi-
ments  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] deﬁnes 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  regarding the principle
of diminishing returns, and the Nickerson index of fading  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,
[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 fulﬁll the triangle inequality, which
mathematically disqualiﬁes them as a metric . 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 deﬁned in these
spaces in a straightforward way . To overcome some of these
difﬁculties, Pant et al. provide a space that is close to the original
distance measure, but is Riemannian . Zerai and Triki  ex-
tend the deﬁnition of image distortion measures (mean, variance,
mean square error) to color images that are deﬁned in a color space
that satisﬁes the properties of a Riemannian manifold. These spaces
are often used to describe color in a mathematical setting, as by von
Helmholtz , Schr
oedinger  and Stiles . On the other
hand, Urban et al.  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 difﬁculties. 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
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 conﬁgurations 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 ﬂy 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 ﬁnal 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
and its non-Euclidean
are similar for small color
differences. Therefore, we use the classical linear interpolation of
the underlying Euclidean space to ﬁll 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 ﬁnd a shortest
path within the graph of discrete RGB colors as explained earlier.
One particularity of our path ﬁnding algorithm is that the graph is
generated on the ﬂy to minimize the algorithm’s memory footprint,
which can become quite signiﬁcant for larger graph resolutions (i.e.
(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
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
entries, the path is discretized regularly according to the
relative distances of the nodes on the path. Here, for each of the
ﬁnal colormap entries, the closest left and right of the
the graph path are found and interpolated linearly in CIELAB with
its Euclidean metric. This leads to almost equal distances between
the ﬁnal colors of the colormap according to the used color distance
In addition, VTK allows users to set midpoint
parameters for colormaps, changing the way col-
ors are interpolated using a modiﬁed Hermite curve. The midpoint
shifts the average between two colors to the left for
. The sharpness steers the interpolation between
and constant for
. 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 (
and yellow (
). These same two colors are
used throughout our experiments unless mentioned otherwise.
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
is not a good candidate because the principle of diminishing returns
gives a false advantage to coarse paths, i.e., low graph resolution
. A better candidate is the path length in the color space,
because the supremum over all possible sample points
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
in RGB, includes all graph nodes
of our experiments. The evaluation is performed using a version of
Bresenham’s line drawing algorithm . 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-
shows that larger neighborhoods generate shorter graph-theoretical
despite larger actual path lengths
. 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 ﬁt 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 ﬂashier ones. For colormaps with multiple control
points, this often results in sharper transitions at these control points,
Figure 9, with the path forming a ﬂower-like pattern.
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 conﬁguration.
In conclusion, our ﬁndings 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 ofﬁcially 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
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-
ﬁce of Science, Advanced Scientiﬁc Computing Research, through
Figure 8: Shortest paths from four different color spaces and the RGB
color cube embedded in the CIELAB color space
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
J. Ahrens, B. Geveci, and C. Law. Paraview: An end-user tool for
large-data visualization. The Visualization Handbook, p. 717, 2005.
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
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
e de Sherbrooke, 2008.
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.
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.
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.
C. E. Helm. Multidimensional ratio scaling analysis of perceived color
relations. JOSA, 54(2):256–262, 1964.
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.
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.
 D. B. Judd. Ideal color space. Color Engineering, 8(2):37, 1970.
H. Levkowitz. Perceptual steps along color scales. International
Journal of Imaging Systems and Technology, 7(2):97–101, 1996.
H. Levkowitz and G. T. Herman. The design and evaluation of color
scales for image data. IEEE Computer Graphics and Applications,
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.
M. R. Luo, G. Cui, and C. Li. Uniform colour spaces based on ciecam02
colour appearance model. Color Research & Application, 31(4):320–
M. R. Luo, G. Cui, and B. Rigg. The development of the cie 2000
colour-difference formula: Ciede2000. Color Research & Application,
M. R. Luo and C. Li. Ciecam02 and its recent developments. In
Advanced Color Image Processing and Analysis, pp. 19–58. Springer,
D. L. MacAdam. Projective transformations of ici color speciﬁcations.
JOSA, 27(8):294–299, 1937.
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.
D. L. MacAdam. Nonlinear relations of psychometric scale values to
chromaticity differences. JOSA, 53(6):754–757, 1963.
D. L. MacAdam. Smoothed versions of frieles 1965 approximations
for color metric coefﬁcients. JOSA, 56(12):1784 1–1785, 1966.
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.
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.
D. Nickerson and K. F. Stultz. Color tolerance speciﬁcation. JOSA,
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.
 D. Raj Pant and I. Farup. Riemannian formulation and comparison of
color difference formulas. Color Research & Application, 37(6):429–
H. L. Resnikoff. Differential geometry and color perception. Journal
of Mathematical Biology, 1(2):97–131, 1974.
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.
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.
odinger. Grundlinien einer theorie der farbenmetrik im tagesse-
hen. Annalen der Physik, 368(22):481–520, 1920.
W. J. Schroeder, B. Lorensen, and K. Martin. The visualization toolkit:
an object-oriented approach to 3D graphics. Kitware, 2004.
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.
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.
L. Silberstein. Investigations on the intrinsic properties of the color
domain. JOSA, 28(3):63–85, 1938.
R. Sinden. A further search for the ideal color systemi. a new
mechanico-graphical method. JOSA, 27(3):124–131, 1937.
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.
H. Von Helmholtz. Handbuch der physiologischen Optik, vol. 9. Voss,
W. D. Wright. A re-determination of the trichromatic coefﬁcients of
the spectral colours. Transactions of the Optical Society, 30(4):141,
G. Wyszecki and W. S. Stiles. Color science, vol. 8. Wiley New York,
A. Zeileis, K. Hornik, and P. Murrell. Escaping RGBland: selecting col-
ors for statistical graphics. Computational Statistics & Data Analysis,
ı and O. Triki. A differential-geometrical framework for color
image quality measures. Advances in Visual Computing, pp. 544–553,
H. Zhang and E. Montag. Perceptual color scales for univariate and
bivariate data display. The Society for Imaging Science and Technology