{'fraction_non_alphanumeric': 0.026554999489326932, 'fraction_numerical': 0.0057195383515473396, 'mean_word_length': 5.044135802469135, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Basic Mathematics of Color Space Invariants

– Color management in printing processes has been traditionally based on an analysis of the behavior of tone reproduction curves (TRC) calculated for the initial color channels. The tone curves, as well as, the color channels, are considered separately. This approach does not take into account the mutual influence of colorants when they overlap. We propose replacing two-dimensional tone reproduction curves with threedimensional gradation trajectories in the CIE Lab metric space. When two colors overlap, one considers the space between two gradation trajectories that forms a gradation surface. These objects are described using the apparatus of differential geometry of spatial curves and surfaces, respectively, and are also invariants of color spaces. In this paper, we offer their analytical description. Key-Words: – Color appearance, Gradation trajectories, Gradation surfaces, Printing art Received: January 7, 2020. Revised: February 26, 2020. Accepted: February 28, 2020. Published: February 28, 2020.


Introduction
The color reproduction adjustment is closely related to the fine tuning of the basic print colorants of a particular printing system (i.e. CMYK) gradations. This approach works in conjunction with various color prediction models embedded in color management systems and aims to adjust colors, save amount of inks used and to predict the resulting color in print, as specified by reflectance or models tristimulus values.
There are many different color prediction models applied in color management. Empirical surface models take into account superposition of ink halftones and do not deal with the light propagation and fading within the print. Physically inspired models engage a more detailed analysis of lightprint interaction based on the prediction of how the light paths go within a halftone print and what the resulting fade is. Ink spreading models characterize the effective surface of an ink dot after it has been printed at a given nominal surface coverage compared to the effective surface coverage that forms the physical dot gain. Spectral reflection color prediction models deal with spread-based light propagation-transportation probability and study the impact of different factors influencing the range of printable colors (the inks, substrate, illumination conditions, and halftones), and create the printer characterization profiles for the purpose of color management [1]. These models together with the ink-spreading models take into account physical dot gain and are able to predict the reflectance spectra as a function of ink surface coverage for 2-4 inks (binary and ternary color systems). The models uses multiple tone reproduction (ink spreading) curves to characterize the physical dot gain of the ink halftones on a substrate and in all solid ink superposition conditions [2][3][4].
Color prediction models have been successfully applied to color reproduction management [5][6][7][8][9]. Their major drawback is that all of them are computationally capacious, as colorants require a solution of system of equations; therefore, they might be barely implicated into a real workflow. Moreover, all the proposed approaches require a significant number of measurements, computations and checks, but since most of them are based on empirical relationships, the accuracy of predicting some shades of the reflection spectrum remains low.
The empirical approaches are more promising; however, they also require a substantial amount of print tests to do. Moreover, there is a problem for practitioners that application of the gradation curves in conventional 2D embodiment significantly reduces the quantity and quality of information extracted from them.
In previous works, the gradation trajectories as a three-dimensional treatment of gradation curves in CIE Lab space was introduced [10][11][12]. The initial information for plotting the gradation trajectories is not the optical density of the colorant's raster fields, but the CIE Lab coordinates of the test patch.
Actually, each colorant gradation scale might be corresponded to a certain gradation trajectory.
The CIE Lab color space expresses color as three numerical values: for lightness, for green-red, and for blue-yellow color components. Thus, any color is uniquely described by a three-component vector in 3D Lab space. The metric of the space is the color difference dE (or ΔE), which is defined at least by the root squared sum of color components differences. The presence of a metric in the sense of the method of measuring distances turns the color space into a metric one. It seems wasteful to use a high-grade metric space solely to determine the color difference value. The study of the behavior of special lines and surfaces of the color space allows one to consider color management from a new point. In particular, we have confirmed the gradation trajectories' invariance for a given substrate-ink pare as a consequence of Grassmann's law. Indeed, for any selected substrate-ink pair, the entire possible range of color tones of the colorant will invariably lie on the same path (gradation trajectory) in the CIE Lab color space, no other shades of colors are possible. If we extend this ideology to color pairs, it will become obvious that all possible binary overlaps of a colorants pair also take a strictly fixed series of values lying within a limited surface in the space of CIE Lab, which is a gradation surface.
All «old» predictive models are focused on solving the theoretical problem of establishing a unique correspondence between the recipe and the reflection spectrum (direct problem) and, more important, on determining the recipe by the reflection spectrum (incorrect inverse problem). The approach based on gradation trajectories is somewhat aloof in relation to these problems, since the reflection spectrum is only intermediate information for determining color in the sense of CIE Lab coordinates. We consider this approach more useful from the point of view of practical printing.
The use of gradation trajectories allows carrying the characterization at once in three different quantities: lightness , color difference dE and color coordinates.
The major idea of the gradation trajectories approach implementation is the following. Gradation trajectory's arc length is defined as an integral in the dE units. The arc is split into segments of equal length in order to match them with the same tone increment. The proposed method of gradation trajectories, on the contrary to common color prediction models, is quite simple in description, does not require cumbersome computations, and, thus, can be successfully applied in practice.
It is known that the Maxwell's Color Triangle relies on the Grassmann's law, which is an empirical result about human color perception. However, it works for additive color synthesis only. The major feature of the triangle is the following: by combining equal parts of basic colors, the neutral grey is being obtained. Based on various print standards, it can be argued that this rule does not work for the process colors (CMY). In the case of printing colorants, their paired double overlays (binaries) correspond to additive primary colors (RGB). Since RGB and CMYK spaces are both device-dependent, there has been no simple or general transformation formula that converts between them. We suggest the way to develop such a conversion based on the ideas of gradation trajectories of two colorants and gradation surfaces of binaries as an expansion of the approach for double overlays. To do that, we engage the apparatus of differential geometry.
This work aims to establish the basic mathematics of color space invariants, such as gradation trajectories and gradation surfaces.

Models description
First, we will introduce the notions of gradation trajectories and gradation surfaces in details.

Gradation trajectories
Gradation trajectory is a locus of the points in the CIE Lab space, which coordinates correspond to the CIE Lab coordinates of the individual patches of the initial colorants (Cyan, Magenta, Yellow, Key (Black)) arranged in ascending order of percentage of raster cells coverage in the layout of 0% (unsealed substrate) to 100% (full dye). Tone scales generally comprise no more than two dozen of fields, i.e. in practice; the gradation trajectory is represented by a discrete set of points in CIE Lab space.
Color characteristics (hue, saturation and brightness), as well as the color coordinates, might be assumed as a continuous function of the percentage (proportion) of raster cell filling. In other words, we can expect a nearly continuous change of color characteristics when filling percentage of a raster cell changes continuously.
We assume that the tone part in the layout is denoted as a parameter in the range from zero (paper) to one (full dye). Therefore, the trajectories might be analytically described by polynomials of n th degree in the parametric equation (1) since color changes continuously in accordance with continuous increment of .
Equations (1) for and coordinates, in fact, is the expansion of the coordinate functions in a Taylor series near the point corresponding to the substrate to be printed. The coordinate is a decreasing function on a segment bounded from above (paper is the brightest object) and from below ("ink in a tin" is the darkest object). is visual brightness of a hypothetical continuous ink layer of infinite thickness. The interval for changing the parameter from 0 (unprinted substrate) to 1 (100% fill).
The degree of the polynomial is selected empirically from the following considerations. First, the coefficient error should not exceed the value of the coefficient itself, that is, the degree should not exceed four. Second, to determine the characteristics of the spatial curve (curvature and torsion), a curve of at least third order is needed. The lightness approximation function is actually an empirically corrected Beer-Lambert law, which contains an exponential dependence, so the degree of polynomial used is lower.
Since we assume the functions (1) to be continuous on the segment, then, according to the Weierstrass approximation theorem [13], their analytical form could be given by a polynomial of a certain extent. In words, any continuous function on a closed and bounded interval can be uniformly approximated on that interval by polynomials to any degree of accuracy. In our case, the polynomial of the fourth degree is applied. A gradation trajectory is depicted in Fig. 1a.
Some difficulties with the perception of the mathematical apparatus of differential geometry should not confuse the reader. The basics of applying its methods in an accessible form are described, for example, in [14]. In the future, we plan to describe approaches that greatly simplify calculations.
The analytical description of the gradation trajectory allows the possibility of calculation of such space curve features as the curvature (k) and torsion (τ) [14, p.49]. In our case, the curvature is described by the equation (2).
Curvature of a gradation trajectory may act as a powerful tool regulating, as for instance, the amount of inks applied. The maximum of curvature corresponds to the region of the sharpest bending of the gradation trajectory, i.e. the sharpest change in color tone for a color channel and the sharpest drop in brightness for the other. These are the points that are chosen to limit the maximum ink supply for the specified colorants. This is especially important for inkjet printing systems, which are developing extremely fast up to date.
The torsion parameter is auxiliary for those cases when it is impossible to unambiguously single out the required local maximum of curvature. Basically, the gradation trajectory is a flat curve, and a significant difference in the torsion parameter from zero indicates that it has left the plane.
Further, we may introduce the extension of the gradation trajectories approach for two colorants.

Gradation surfaces
The gradation surface of double colorants overlap is a surface "stretched" on two gradation trajectories of the initial colorants. Extending the concept of gradation trajectories on the two-dimensional case, we define the gradation surface as a locus of points in the CIE Lab space where coordinates correspond to the CIE Lab coordinates of the individual patches of the binary halftone scale from zero (unprinted substrate) to two (full dye of 2 colorants). By analogy with the gradation trajectory, the gradation surface is also expressed by a polynomial of 4-th degree (3).
where , , are some numerical coefficients, , , are CIE Lab coordinates of the unprinted substrate, is visual brightness of a hypothetical continuous ink layer of infinite thickness, ( , ) is the receipt of the binary (in parts, percent, or color "quanta"). Since gradation surfaces use gradation trajectories as boundaries, the degrees of polynomials are chosen from the same considerations as in (1). When zeroing m or n, expression (3) becomes expression (1). A gradation surface is depicted in Fig. 1b.
It should be noted that for each ink-substrate pair, the polynomial coefficients in (1) and (3) are calculated individually.
Such, we designate a binary gradation surface as one "stretched" on the gradation trajectories of generatrix pair of colorants so that it contain them inside. In [17], we showed that the best trajectory of a binary is the geodesic on a gradation surface between 0, 0 and 1, 1 points. In [15] and [16] some relevant studies about Color are presented.
We may find out a geodesics in general form. In our case, we consider a regular piece of the hypothetical surface B (as for instance, Blue that is formed by the pair of Cyan and Magenta initial colorants). The first fundamental form of the surface B is shown in (4). A regular piece of the surface B with the first fundamental form is a twodimensional Riemannian space referred to the coordinates ( , ). If we consider a surface as a Riemannian space, then vectors, tensors, scalar products, and covariant differentiation can be defined on it [18].
The equation of the geodesics is the solution of the special differential equation (4) with two boundary conditions. To reveal the explicit form of the equation it is essential to evaluate the second fundamental form and Christoffel symbols (Γ ) of the gradation surface (5).
Thus, for any geodesic , the corresponding function satisfies the differential equation (6).
Thus, the binary gradation trajectory is a geodesic satisfying equation (6)

Application notes
Solving such an equation (6) is rather laborious. We solved this with the indicated boundary conditions numerically using the Matlab package, which took at least 20 minutes. For the computations, we used the laptop with Intel Core i7 central processor, 8 GB RAM, and nVidia GeForce 930 GPU. At the same time, the obtained numerical solution cannot be considered sustain. In preparing the model, a lengthy procedure for selecting parameters was required, and not every calculation led to a result. This is unacceptable in a real workflow. In addition, the high accuracy achieved during the calculations is not required at all, since in real printing processes there are reproducing and measuring errors, which determines the level of accuracy. Nevertheless, the experiment showed that the surface of double overlays, delineated by geodesics, made it possible to ensure an equal change in tone in any direction. The significance of this result for high-precision colorimetric calculations of the responses of modern and promising printing systems with a wide range of colors and an expanded number (more than four) of initial dyes can be noted. However, for practical use, one may use a simpler approach that uses natural color quantization in digital printing systems.
Recent image processing systems provide color depth of at least 8 bit per color channel; therefore, the grid is composed with 2 8 =256 lines. Such quantity of halftone values is considered enough for continuous halftone perception. Halftone recipes achievable within a given printing system are in virtual grid nodes. This gives 2 16 =65536 possible halftones of a chosen pair of colorants. Actually, the number of halftones is slightly less because a printing system characterization limits the ink supply at the expense of color depth.
Each reproducible tone has its own recipe (m, n) and a set of CIE Lab coordinates. This fact might be accounted in discrete calculations of the color space invariants that would significantly simplify the approach. Moreover, the avalanche-like increase in the number of inkjet-type printing devices raises the question of fine tuning color management parameters "on the fly". The application of the proposed approach either in analytical or in discrete form promises extraordinary convenience and simplicity, and hence the low cost of such decisions.

Conclusion
The work is an attempt to establish relationship between two device-dependent color spaces (CMYK and RGB) accounting natural color creation in print in order to be able to precisely express primaries of additive color synthesis (R, G, B) as binaries of subtractive color synthesis colorants (C, M, Y) by using a universal CIE Lab color space for computations. The shades of one colorant are represented by a gradation trajectory created in CIE Lab color space.
Gradation trajectories are considered as continuous curves, bounded on a given interval, described by the apparatus of differential geometry of curves. The modification of the gradation trajectories as a three-dimensional interpretation of gradation curves in the CIE Lab space, which takes into account the discreteness of the color tone formation in the printing systems is also suggested.
Gradation trajectories introduced in the described manner are global characteristics of the printing process, depending only on the type of the substrate to be printed and the properties of the dyes. They are not affected by the method of rasterization and measurement techniques.
The binary is defined as a gradation surface of two colorants that is "stretched" on the pair of gradation trajectories. The imposition of two colors in print forms the surface of the shades in CIE Lab space, among which a line of the fairly stable tone might be found. We suggest using geodesics of surfaces of double overlays as such lines of stable tone. They are drawn between the colors of the substrate and the full double overlay.
The key advantage of using gradation trajectories and surfaces is that after the linearization process, one can predict the print result of individual colorants in terms of color (CIE Lab), accurate to print and measurement errors, which are also expressed in terms of the color difference of dE. Up to this point, the error in color prediction by various models was determined exclusively empirically and was not quantified in the literature. The benefits of implication of the approach into real workflows might be simplification of printing equipment characterization. Moreover, there is a potential possibility of avoiding the use of raster image processors. Application of this approach in the software of mixing stations can also significantly increase the accuracy of the resulting ink mixtures.
Our further focus is implementation of the approach into EP and ink-jet digital printing devices accounting their natural discretization for the color space invariants computations.