The invention concerns a method for mapping colors of a source color gamut into a target color gamut that is adapted to the cusp colors of the source and target color gamut.
The aim of a color gamut mapping is to redistribute the source colors belonging to a source color gamut (for example the extended color gamut of a film) into a target color gamut (for example the color gamut of a standard television monitor). As the shape and boundaries of a target color gamut are generally different from those of the source color gamut, at least some of the target colors that are obtained after such a mapping are different from their corresponding source colors.
An application area of color gamut mapping is notably video content production and post-production. For example, an original version of a video content need to be converted into specific versions adapted for different types of reproduction or transmission: for example, a specific version for cinema, another for television, and a third one for internet. These different versions can be prepared by manual color correction or/and by application of gamut and tone mapping algorithms.
Among the requirements for color gamut mapping are notably:
Color gamut mapping is generally carried out on colors that are represented in a color space. Each color is hereby defined by the set of its color coordinates in this color space. Usually, color spaces used for color gamut mapping are generally three-dimensional, however, the below invention is not limited to this. Different types of color spaces may be used to represent colors. A first type are device-based color spaces. One of them is the RGB color space with three color coordinates R,G,B for red, green and blue, respectively. In device-based color spaces, colors are defined by the color device they are related to. For example for a trichromatic color monitor device, a color defined by its device-based color coordinates R,G,B is the color that this monitor will reproduce when a signal corresponding to these coordinates R,G,B is input to the device. Other device-based color spaces exist. Other device-based color spaces are characterized in that they are directly derived from existing device-based color spaces. For display devices and cameras, YCbCr color spaces are well known with luminance coordinate Y and chrominance coordinates Cb and Cr, for example according the standard ITU-R BT.709 called in there E′Y, E′C
Another type of color spaces are device-independent color spaces. For example, the well known XYZ color space defined by the CIE in 1931 has coordinates X,Y,Z for red, green and blue, respectively. The definition of color is absolute and does not depend on any real device. In order to transform coordinates of a given color from device-dependent color spaces to device-independent color spaces and vice versa, the behavior of the device needs to be known. While XYZ color space is defined such that the values of X,Y,Z coordinates correspond linearly to flux of light, other device-independent color spaces are designed to correspond to perception of human observers. For example, the Lab color space defined by the CIE in 1976 and called originally L*a*b* color space is a color-opponent space that is perceptually uniform, with dimension L for lightness and a and b for the color-opponent dimensions. The red/green opponent primary colors are represented along the a axis, with green at negative a values and red at positive a values. The yellow/blue opponent secondary/primary colors are represented along the b axis, with blue at negative b values and yellow at positive b values. Other device-independent appearance-based color spaces are for instance the JCh space according to CIECAM-02 or the IPT color space.
In order to define a color gamut mapping, a gamut boundary description (GBD) of the source color gamut and of the target color gamut is generally used. Such a GBD of a color gamut defines the boundary surface of this color gamut in a color space. GBDs comprise generally explicit, generic 3D representations such as triangle meshes or volume models. For instance, a GBD of a color gamut can be based on a mesh of triangles, each triangle being defined by its three vertices in the color space of this GBD. These vertices are colors located on the boundary of the color gamut. The article entitled “Gamut boundary determination for a colour printer using the Face Triangulation Method”, by Pellegri and Schettini, published in 2003 in the Proceedings of SPIE Vol. 5008 on “Color Imaging: Device-Independent Color, Color Hardcopy, and Applications VII”, presents a method to determine GBDs.
As illustrated by dotted lines on
As illustrated by solid lines on
On
When trying to define a method of color gamut mapping (or Gamut Mapping Algorithm “GMA”) source colors inside a source color gamut (having its own source cusp colors and source rims) into target colors such that they are located inside a target color gamut (having its own target cusp colors and target rims), in order to take advantage of the whole range of colors in the target color gamut, it is known to define the GMA according to different conditions among which the following cusp mapping condition: any source cusp color should be mapped into a target cusp color. Such color mapping methods are known as “cusp color gamut mapping”.
US2007/236761 discloses a mapping method using the cusp colors of a color gamut. Cusp colors are interpolated from primary and secondary colors of the color gamut. In the disclosed method, a color ([0104] “point A”) is mapped (([0104] ‘chroma dependent lightness mapping”) to a mapped color ([0104] “point B”). The mapped color has a lightness that is closer to the lightness of a cusp point of the constant-hue leaf of the color to map ([0104] “lightness compression toward primary cusp point”). This cusp point is that of a target gamut and is identical to the cusp point of a source gamut of the same hue leaf (
A drawback of the color mapping method disclosed in US20070236761 is to be based on a unique cusp point and not at least on two different points, those of source and target color gamuts.
US2005/248784 discloses a color gamut mapping method called shear mapping that maps in a constant-hue LC leaf the cusp of the source gamut to the cusp of the target gamut. However, after the shear mapping, other colors that the cusp colors may still lie outside of the target color gamut. For such a situation, US2005/248784 discloses to further map colors that lie outside the target color gamut to the closest colors of the target color gamut, see
As a whole, the main drawback of all known cusp color gamut mapping methods operating within a constant-hue leaf is the mismatch between a linear propagation of the mapping of the cusp colors (mapping of cups colors being generally used for the definition of a mapping function for other colors of this leaf) and the non-linearity, i.e. the curvature, of the boundaries of the source and target color gamuts in non-linear device-independent color spaces in which the mapping is performed.
An object of the invention is to avoid the aforementioned drawbacks.
For this purpose, a subject of the invention is a method of color gamut mapping source colors into targets colors from the source color gamut of a source color device towards a target color gamut in a non-linear gamut mapping color space,
This source color device can be any real or virtual device for the reproduction of color images, as a monitor, a TV set, a tablet or a smartphone.
It will be explained in the embodiments that the source plane intersects indeed two times a source cusp line.
In summary, for the mapping in a non-linear color space of each source color, a source cusp color and a target cusp color are defined in a linear device-based color space and used to define a cusp lightness condition that the lightness mapping function used for the mapping should satisfy. Generally, the source and target cusp colors do not have the same hue as the source color to map.
Generally, the hue of said source color to map is different from the hue of said source cusp color and/or from the hue of said target cusp color.
In a first variant, source cusp color associated with said source color to map corresponds to the intersection of said source cusp line with said source plane which is closer to said white point than to said black point when said source color is closer to said white point than to said black point, or corresponds to the intersection of said source cusp line with said source plane which is closer to said black point than to said white point when said source color is closer to said black point than to said white point.
In a second variant in which said source cusp color corresponds to a color which is located between said first intersection and said second intersection, the distance from said first intersection is preferably proportional to the distance measured in said linear source device-based color space between said source color and said white point.
In another first variant, said target cusp color is defined as having the same hue as the hue of said source cusp color.
In another second variant where said target color gamut is the color gamut of a target color device defining a linear target device-based color space, said target cusp color corresponds:
An object of the invention is also a color mapping device for mapping source colors of a content which are provided in the source color gamut of a source color device into targets colors of a target color gamut, comprising:
An object of the invention is also a processor readable medium having stored therein instructions for causing a processor to perform the above method of color gamut mapping, and a computer-readable program comprising computer-executable instructions to enable a computer to perform the above method of color gamut mapping.
The cusp-oriented color gamut mapping method according to the invention is notably applicable to professional color processing software, when the colorist needs to be free to choose any chroma variations.
The invention will be more clearly understood on reading the description which follows, given by way of non-limiting example and with reference to the appended figures in which:
The functions of the various elements shown in the figures may be provided through the use of dedicated hardware as well as hardware capable of executing software in association with appropriate software. When provided by a processor, the functions may be provided by a single dedicated processor, by a single shared processor, or by a plurality of individual processors, some of which may be shared. Moreover, explicit use of the term “processor” or “controller” should not be construed to refer exclusively to hardware capable of executing software, and may implicitly include, without limitation, digital signal processor (“DSP”) hardware, read-only memory (“ROM”) for storing software, random access memory (“RAM”), and non-volatile storage. Other hardware, conventional and/or custom, may also be included.
Moreover, the software may be implemented as an application program tangibly embodied on a program storage unit. The application program may be uploaded to, and executed by, a machine comprising any suitable architecture. Preferably, the machine is implemented on a computer platform having hardware such as one or more central processing units (“CPU”), a random access memory (“RAM”), and input/output (“I/O”) interfaces. The computer platform may also include an operating system and microinstruction code. The various processes and functions described herein may be either part of the microinstruction code or part of the application program, or any combination thereof, which may be executed by a CPU. In addition, various other peripheral units may be connected to the computer platform such as an additional data storage unit and a printing unit.
A specific embodiment of the cusp color gamut mapping method according to the invention will now be described in reference to
As mapping color space, the Lab color space is chosen. In this color space, colors can also be represented by polar coordinates, i.e. in a LCh mode, with L for the same lightness, h for a hue angle according to:
corresponding to the angle between a vector having a, b as coordinates and the a-axis, C=√{square root over (a2+b2)} corresponding to the chroma. Chroma reflects the saturation of a color. The higher the C value the more saturated is the color. The hue angle may be also named αH.
Furthermore, the below embodiment concerns a hue-preserving cusp color gamut mapping. This means that the color mapping is not actually carried out in three dimensions in Lab space but in two dimensions in a constant-hue leaf of the Lab space, i.e. in a 2D LC sub-space. The hue defining the constant-hue leaf in which the color mapping is to be performed is chosen to be the hue of the source color to be mapped.
The source GBD used to describe the source color gamut comprising source colors to map is based in a manner known per se on a mesh of triangles, each triangle being defined by the position of its three vertices in the mapping color space, these vertices being source colors located on the boundary of the color gamut. The source color gamut can correspond to a specific or standard display device such as a LCD or an OLED panel, to a specific content to map, to an image capture device such as a camera or a scanner, or to any other color device.
The target GBD used to describe the target color gamut that should comprises all mapped colors is also based in a manner known per se on a mesh of triangles, each triangle being also defined by the position of its three vertices in the mapping color space, these vertices being target colors located on the boundary of the color gamut. The target color gamut can correspond for instance to a specific or standard display device.
Gamut Boundary Descriptions can be convex or non-convex, but in the embodiment below, it is assumed that source and target GBDs are both approximately convex.
Furthermore, the black and white points of the two color gamuts are supposed to be known. In device-based color spaces such as a RGB color space of a reproduction device, when the color coordinates R,G,B of a color to reproduce are small, the color reproduced by the device has usually a small intensity and vice versa. Black and white points in such a color space are defined by having R,G,B color coordinates that are the smallest and the largest, respectively. For example, in normalized RGB color space, the coordinates of respectively the black point BI and the white point Wh are: 0,0,0 and 1,1,1. In an absolute 8 bit encoded RGB space, BI and Wh are usually at 0,0,0 and 255,255,255, respectively. If the range of color coordinates that can be reproduced by the device is reduced, the black point BI and the white point Wh may be at 4,4,4 and 251,251,251, respectively.
1st step: Obtaining Cusp Lines of the Source and Target Color Gamuts
The cusp line of each color gamut is defined by a line joining all cusp colors of this color gamut, where each cusp color is defined to be the color of this color gamut with highest color chroma C (or saturation) compared to all other colors of this color gamut lying in the constant-hue leaf having the same hue as this cusp color. Using GBDs based on triangles represented by their vertices as defined above, the cusp line of a color gamut is then described by a series of vertices of these triangles forming a closed polygon that circumscribes in a certain manner the gamut boundary description.
In the implementation described below, the same method of obtaining the cusp colors is used for the source color gamut and for the target color gamut, namely the method described by Stauder et. al. in their article entitled “Gamut Mapping for Motion Picture” published at the Conference on Colour in Graphics, Imaging and Vision, Jun. 14-18, 2010. In order to obtain the cusp line of each of the source and target color gamuts from their GBDs, the following steps described in this article are implemented:
From the first current cusp vertex up to the last selected vertex of all iterations of the above steps, a succession of cusp vertices defining cusp colors is then obtained, said succession forming a closed polygon that describe the cusp line which circumscribes in a certain manner the color gamut and describes the cusp line of the color gamut.
The same process is applied for the source color gamut and for the target color gamut to get respectively a source cusp line and a target cusp line.
Still in reference to the article from Stauder et al. already quoted above, an example of definition of a quality criterion K will now be given, based on a combination of four sub criteria, which are : a saturation criterion KS, a lightness similarity criterion KI, a hue angle increase criterion KH, and a collinearity criterion KD.
The saturation criterion KS is defined such as to find the most saturated cusp vertices of a neighborhood. The value of the saturation criterion KS of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is defined as follows:
where D=|V-{circumflex over (V)}|=√{square root over ((L-{circumflex over (L)})2+(a-â)2+(b-{circumflex over (b)})2)} is the distance, in the Lab color space, between the neighboring vertex V and the current vertex {circumflex over (V)}, and where the values for the constant coefficients c1, c2 can be for instance c1=150 and c2=50.
The lightness similarity criterion KI is defined such as to find cusp vertices of a neighborhood having a similar lightness L along the cusp line. The value of the lightness similarity criterion KI of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is based on the difference between the intensities of the neighboring vertex L and the current vertex {circumflex over (L)} and is defined as follows:
where the value for the constant coefficient c3 may be for instance c3=100.
The hue angle increase criterion KII is defined such as to find cusp vertices of a neighborhood that increase in hue angle, in order to get a cusp line description formed by a closed and smooth cusp polygon. The value of the hue angle increase criterion KH of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is defined as follows:
where αH is the hue angle of the vertex V, defined as equal to
where {circumflex over (α)}H is the hue angle of the vertex V that is defined in the same manner as αH while using the coordinates â, {circumflex over (b)} instead of a,b, respectively, where the value for the constant coefficient c4 can be for instance c4=90.
The collinearity criterion KD is defined such as to find cusp vertices of a neighborhood in a direction as close as possible to the direction of the previous iteration of the method as defined above to obtain the cusp line, in order to still improve the smoothness of the cusp polygon. The value of the collinearity criterion KD of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} which has been itself selected in a previous iteration in the neighborhood of a previous current cusp vertex V′″ is defined for instance as follows:
K
D=1−αD/C5
where αD=∠{d;{circumflex over (d)}}, i.e. the angle between a first direction vector {circumflex over (d)}={circumflex over (V)}-V′″ and a second direction vector d=V-{circumflex over (V)},
The value of the quality criterion K of a vertex V belonging to the neighborhood of a current cusp vertex {circumflex over (V)} is then calculated for instance according to the formula:
K=c
S
K
S
+c
H
K
H
+c
I
K
I
+c
D
K
D
+c
C
k
C,
where the value for the weight coefficient s are for instance cS=5, cH=5, cI=2 and cD=2.
Still in reference to the article from Stauder et al. already quoted above, an example of definition of a stop criterion to be applied to a “next cusp vertex” will now be given as follows:
Once a cusp line is obtained as described above for the source color gamut, then, for each of the source colors to map having Rs,Gs,Bs color coordinates in a RGB source device-based color space of a source color device having the source color gamut as color gamut, and Ls,as,bs coordinates in a device-independent color space, a source cusp color MCSOURCE associated with each source color will be searched in this device-based color space. As explained below, this source cusp color has generally not the same hue as the source color.
The source cusp color associated with a given source color is searched for instance according to a method comprising the following sub-steps:
If the source color gamut is a RGB cube in the RGB color space as shown on
Note that any straight line in this chromaticity plane xy corresponds to a plane comprising the black point BI of the CIE XYZ or RGB color space. As a matter of fact, replacing x and y by their values in any equation of a straight line in the chromaticity plane (i.e.: x+a.y +b=0) will give the following equation of a plane in the XYZ color space (namely : (1+b).X+(a+b).Y+b.Z=0).
Similarly, any point in the chromaticity plane xy corresponds to a straight line comprising the black point BI of the CIE XYZ or RGB color space. As a matter of fact, having fixed x=x0 and y=y0 in the chromaticity plane will give the following set of two linear equations X=f(Y);Z=f′(Y) defining a straight line in the XYZ color space (therefore in the RGB color space), namely: X.(x0/y0).Y; Z=[(1−x0−y0)/y0]. Y.
Therefore, the source plane defined in the RGB color space as comprising the source color MCSOURCE, the white point Wh and the black point BI corresponds to the straight line passing through MCSOURCE and Wh. As illustrated on
Note that the source plane as defined above is not equal to a hue leaf defined as a surface of constant hue. The fact that the source cusp line intersects two times the source plane (as illustrated on
In a variation of definition of the source cusp color, the source cusp color MCSOURCE is defined as a color located on the source cusp line between the first and second intermediate cusp colors Ic1, Ic2. For instance, this source cusp color MCSOURCE is defined by its distance d1 from the first intermediate cusp 15 colors Ic1, measured on this cusp line. This distance d1 is for instance calculated from the distance d2 between Ic1 and Ic2 measured on this cusp line, from the distance dW between the source color and the white point, and from the distance dB between the source color and the black point. For example, d1 can be calculated by a linear equation according to
but non-linear equations can be used too, for example:
The source cusp color MCSOURCE has generally not the same hue as the source color itself. This can be explained using the following example. In this 25 example, we select a source color different from the yellow secondary color and lying on the yellow rim of the source color gamut, i.e. the rim starting at the white point and ending at the yellow secondary color. According to the main method above (1st and 2nd sub-steps), the yellow secondary color is the source cusp color MCSOURCE associated with this source color lying on the yellow rim. This rim is a straight line in RGB color space, but, as the transformation between RGB color space and Lab color space is non-linear, this yellow rim is a curved line in Lab space. Colors on a curved line in Lab space have different hues. It means that the yellow secondary color (source cusp color MCSOURCE and the source color lying on the yellow rim do not have the same hue.
The searching method above has the advantage of simplicity because, in the device-based color space in which the search method is implemented, the rims and the cusp lines of the source color gamut are often straight lines, such as shown for the RGB color space on
Another example of implementation of the search method above will be described in reference to
Another embodiment of the search method above using the device-based color space of the source color device having the source color gamut is detailed below. Looking at
When there is only one intersection of the boundary of the RGB cube with a straight line going through the source color Rs,Gs,Bs and parallel to the RBG cube diagonal, then this intersection is already the associated source cusp color MCSOURCE. In such a situation, the associated cusp color MCSOURCE corresponds to a vertex of the RGB cube.
When using the main and first searching method above (with two sub-steps), the source cusp color MCSOURCE that is obtained is then located on a cusp line of the source color gamut. The color coordinates RcS, GcS, BcS of this source cusp color MCSOURCE in the RGB color space of the source color device are then transformed in a manner known per se into color coordinates LBSOURCE, aCSOURCE, bCSOURCE in the Lab color space. Such a change of color space can be for instance performed in two steps, a first well known step from the RGB color space to the XYZ color space which depends on the source color device, and a second step from the XYZ color space to the Lab color space using the well-known formulas proposed in 1973 by the CIE. As already shown above, the source color does not generally belong to the same constant-hue leaf as its associated source cusp color.
For colors lying on the straight line between black and white in RGB color space, the 2nd sub-step described above is not applied. Such colors correspond in Lab space usually to colors lying on the L axis. For those colors, no associated source cusp color MCSOURCE is determined. For this reason, no lightness mapping will be applied to those colors as will be described below.
3rd Step: for Each Source Color to Map, Obtaining an Associated Target Cusp Color MCTARGET
A target cusp color MCTARGET associated with the source color, having LBTARGET, aCTARGET, bCTARGET as coordinates is defined as a color located on the target cusp line having the same hue hCTARGET as the hue hCSOURCE of the associated source cusp color MCSOURCE. It means that we have:
hCSOURCE=hCTARGET
The source cusp color MCSOURCE and the target cusp color MCTARGET associated with the same source color that are obtained through the above methods are then positioned on the same constant-hue leaf.
As an alternative for searching a target cusp color, the target cusp color MCTARGET associated with the source color is searched using the method above (second step) of searching the source cusp color, but where the source cusp color MCSOURCE is used as a basis instead of the source color. A target device-based color space of a target color device having the target color gamut as color gamut is defined.
More precisely, the target cusp color associated with a given source color is searched for instance according to a method comprising the following sub-steps:
Contrary to the other method of obtaining a target cusp color above, the hue of the target cusp color MCTARGET obtained through this variation is generally different from the hue of its associated source cusp color MCSOURCE.
Once the source cusp color MCSOURCE and the target cusp color MCTARGET associated with a source color to map are determined as described above, a lightness-mapped color can be defined, for instance using a lightness mapping function as described in the article entitled “Motion Picture Versioning by Gamut Mapping” by J. Stauder et al., published in November 2010 in the Eighteenth Color and Imaging Conference: Color Science and Engineering Systems, Technologies, and Applications, San Antonio, Tex., p. 178-183. A variation of the method described in this article is described below.
In reference to
ƒ(C, L)=L+s (Eq.1),
where the linear lightness offset s is defined as follows:
s=tu(LCTARGET−LCSOURCE) (Eq.2)
where the linear lightness weight t and the linear chroma weight u are defined as follows:
where L and C are respectively the lightness and the chroma of the source color to be mapped, where CCSOURCE is the chroma of the source cusp color MCSOURCE associated with this source color.
The lightness mapping function ƒ(C,L) as defined above in association with the source color to map is then applied to the lightness and chroma of this source color.
In reference to
the resulting mapped color A′ has the coordinates
The amount of lightness mapping of the source color A is controlled by the difference between LCSOURCE and LCTARGET as well as by the chroma C of the source color A compared to the chroma CCSOURCE of the associated source cusp color MCSOURCE.
Still in reference to
To illustrate such a chroma mapping in reference to
and straight lines anchored on this anchor point are chosen as mapping trajectories for the chroma mapping step. In this specific case, the second mapping does not impact the lightness of the colors. Such a chroma mapping can be described as a modification of distance K′ between an intermediate mapped color A′ and the anchor point N0 into a distance K″ between the target color A″ and the same anchor point N0. A′ is then chroma mapped into A″.
Any other known algorithms can be used for this chroma mapping, such as gamut compression, gamut clipping or gamut expansion.
For intermediate mapped colors located within the target color gamut, this 5th step may be optional, notably when these intermediate mapped colors populate regularly the target color gamut.
As a conclusion, the implementation of the second to fifth steps above for each of the source colors using the cusp lines of the source and target color gamuts obtained by the 1st step leads to a global color gamut mapping of all source colors of a content to map from the source color gamut in which they are located to target colors that are located inside the target color gamut. The fourth and fifth steps above can be merged in one step of color gamut mapping impacting both the lightness and the chroma of source colors to map.
The method of cusp color gamut mapping described above propose to compute the mapping on the basis of a source cusp color and of a target cusp color that are specific to each source color to map and that do not belong to the same constant-hue leaf as this source color. Moreover, this method proposes to obtain these source and target cusp colors by a method which circumvents the drawbacks of the non-linear color space in which the mapping is performed, because this obtaining method is implemented in a linear device-based color space. This obtaining method has the advantage of simplicity because, in this device-based color space, the rims and the cusp lines of the source color gamut are generally straight lines.
An advantage of this method is that the geometrical constellation of each source color with respect to the curved source and target color gamut boundaries is taken into account to choose appropriate corresponding source and target cusp colors having a similar geometric constellation and then deriving the mapping function for the source using these cusp colors. In this way the source color is mapped in accordance with cusp colors having a similar geometrical constellation than the source color.
According to a hardware aspect, the invention relates to a device for mapping source colors of a content which are provided in a source color gamut of a source color device having a black point and a white point into targets colors of a target color gamut.
This color mapping device comprises:
The above modules are functional units that may or may not correspond to physically distinguishable units. For example, these modules or some of them can be grouped together in a single component or circuit, or constitute functions of the same software. On the contrary, some modules may be composed of separate physical entities.
This color mapping device is implemented according to a purely hardware embodiment, for example in the form of a dedicated component (for example in an ASIC (application specific integrated circuit) or FPGA (field-programmable gate array) or VLSI (very large scale integration) or of several electronic components integrated into a device or even in the form of a mixture of hardware elements and software elements.
While the present invention is described with respect to a particular embodiment, it is understood that the present invention is not limited to the above embodiments. The present invention as claimed therefore includes variations from the embodiments described herein, as will be apparent to one of skill in the art.
It is to be further understood that, because some of the constituent system components and methods depicted in the accompanying drawings are preferably implemented in software, the actual connections between the system components or the process function blocks may differ depending upon the manner in which the invention is implemented.
Number | Date | Country | Kind |
---|---|---|---|
15306007.4 | Jun 2015 | EP | regional |