The invention relates to photometry application technology, and in particular to a color processing method based on an HGlCl color space with a color appearance attribute.
A calculation of color addition and a calculation of a color difference between colors are important parts in calculations in photometry and its application, and are widely applied in industry, art and digital images.
The existing calculations of color addition are all performed by converting the color data from the existing color spaces such as CIELAB and CIELUV to the CIEXYZ color space, the addition cannot be directly performed in the CIELAB and CIELUV spaces, and the conversion relationship during the conversion is very complicated, which is shown in the below formula:
The result of the color addition is obtained after performing an addition calculation in the CIEXYZ color space, and then the calculated data is converted to the color space CIELAB or CIELUV to be observed or applied. Such method is very troublesome, and meanwhile the above conversion formula is a fitted one, a problem of precision is also brought.
The existing definition of the color difference is a numerical difference, and can be calculated in various color spaces, e.g., the color difference in the CIELAB color space is a scalar numerical value, which is calculated in the following manner:
ΔE=√{square root over ((ΔL)2+(ΔA)2+(ΔB)2)}{square root over ((ΔL)2+(ΔA)2+(ΔB)2)}{square root over ((ΔL)2+(ΔA)2+(ΔB)2)},
where ΔL=L1−L2, Δa=a1−a2, Δb=b1−b2
This numerical value only indicates the value of the color difference and does not indicate a deeper attribute of the color difference, and thus cannot provide a basis for color compensation. It is considered in the new theory that the color difference is also essentially a color and also has its attributes of hue, intensity and degree of saturation. It is imprecise to describe the color difference by simply using a numerical difference, and the color difference should be described using a color.
The CIEXYZ color space is a basic color space in colorimetry and is a basis for describing other color spaces, and the color data in the CIEXYZ color space can be converted to any other color space, e.g., CIELAB and the like. However, for the newly defined color space HGlCl, there does not exist an existing calculation to perform conversion.
Thus, there exists a requirement for a method capable of processing color addition and color difference in a new color space in the prior art.
With respect to the existing technical defects, the invention overcomes the defects in the prior art by processing color data based on an HGlCl color space with a color appearance attribute, achieves direct colored addition and color difference calculations in a color appearance color space, and can obtain more explicitly information of the color difference accurate to three dimensions.
The invention puts forward a mutual conversion method of color data between the CIEXYZ color space and the HGlCl color space, and the conversion method is described in Formula 1 and Formula 2 below.
According to the invention, the color space HGlCl with a color appearance attribute is a color space based on a CIEXYZ cartesian color space, of a color appearance attribute and described by a cylindrical coordinate system; the cylindrical coordinate system is composed of a chromatic plane and a gray axis passing through the origin of the chromatic plane and perpendicular to the chromatic plane, the gray axis describes a gray level Gl of the color, the chromatic plane is a polar coordinate plane and describes a chromatic vector {right arrow over (Cl)} of the color, and the chromatic vector is a vector parallel to the chromatic plane and is composed of a vector polar angle and a vector polar radius expressed within a polar coordinate system, wherein the vector polar angle is a hue angle H of the chromatic vector, and the vector polar radius is a chromatic level Cl of the chromatic vector, i.e., one color C is C=(Gl, {right arrow over (Cl)})=(H, Gl, Cl) within the HGlCl color space with a color appearance attribute;
wherein the chromatic plane is a plane X+Y+Z=K in the CIEXYZ Cartesian color space, and K is a real constant; the axes X, Y, Z in the CIEXYZ Cartesian color space are projected on a plane X+Y+Z=K in a direction of a line X=Y=Z to obtain three projection axes which are at 120° with respect to one another within the chromatic plane, and a unit vector in the direction of the projectioaxis is {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)}; the data of the color C (X, Y, Z) in the CIEXYZ color space is expressed as C (X{right arrow over (i)}, Y{right arrow over (j)}, Z{right arrow over (k)}) within the chromatic plane, wherein X, Y and Z are respectively amplitudes in the three directions {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)}, and the polar angles {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)} are respectively 0°, 120° and 240°; wherein the conversion manner of H, Gl and Cl of the color C and tristimulus values X, Y, Z is given in Formula 1 below:
where Min (X, Y, Z) is the minimum value of X, Y and Z.
In the invention, the color data are numerical values of the color attribute of the colored light, e.g., tristimulus values X, Y, Z or numerical values of hue, intensity and degree of saturation and the like of the colored light; the color is the visual stimulation of the colored light; the gray precipitation refers to that a white light is produced when two different colors are mixed, the process of generating the white light is called gray precipitation, and the gray value obtained by the gray precipitation is a gray precipitation value.
According to one aspect of the invention, a method of processing color data based on an HGlCl color space with a color appearance attribute is provided, the method comprising: acquiring color data in an HGlCl format in the HGlCl color space with a color appearance attribute; selecting two color data in the HGlCl format from the acquired color data in the HGlCl format; performing a color addition and/or color difference operation on the selected two color data in the HGlCl format to acquire one color data in the HGlCl format generated by the operation.
According to another aspect of the invention, a method of processing color data based on an HGlCl color space with a color appearance attribute is provided, the method comprising: acquiring color data in an XYZ format of interest in a CIE XYZ color space; converting the acquired color data in the XYZ format into color data in a HGlCl format according to Formula 1.
Accordingly to a further aspect of the invention, a method for processing color data based on an HGlCl color space with a color appearance attribute is provided, the method comprising: acquiring color data in an HGlCl format of interest in the HGlCl color space; converting the acquired color data in the HGlCl format into color data in an XYZ format according to Formula 2:
The invention puts forward a color processing method in an HGlCl color space, and has advantages of directly performing calculations in a color appearance space and describing and calculating a color difference more precisely.
Based on the requirement for more precise descriptions of the color difference, the invention puts forward performing a calculation using a calculating method capable of describing explicit differences of the colors in three dimensions, i.e., hue, intensity and saturation, and obtains precise descriptions of the color difference of the colors, and thus can provide a precise adjustment basis for the color compensation.
Further detailed descriptions of the specific implementation modes of the invention are given below by taking the figures and the embodiments into consideration. The embodiments below are used for describing the invention rather than limiting the invention.
According to the embodiments of the invention, the calculation of the color addition and the calculation of the difference between the colors can be directly performed in the HGlCl color space with a color appearance attribute, and color difference description information including three dimensions, i.e., hue, intensity and degree of saturation, is calculated.
The chromatic plane is a plane X+Y+Z=K in the CIEXYZ Cartesian color space, and K is a real constant; the axes X, Y, Z in the CIEXYZ Cartesian color space are projected on a plane X+Y+Z=K in a direction of a line X=Y=Z to obtain three projection axes which are at 120° with respect to one another within the chromatic plane, and a unit vector in the direction of the projection axis is {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)}; the data of the color C (X, Y, Z) in the CIEXYZ color space is expressed as C (X{right arrow over (i)}, Y{right arrow over (j)}, Z{right arrow over (k)}) within the chromatic plane, wherein X, Y and Z are respectively amplitudes in the three directions {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)}, and the polar angles {right arrow over (i)}, {right arrow over (j)}, {right arrow over (k)} are respectively 0°, 120° and 240°;
Tristimulus values of one color C in the CIE XYZ color space are X, Y and Z, which respectively express numerical values of the CIE XYZ color space on the coordinate axes X, Y, Z, i.e., (X, Y, Z);
in the HGlCl color space, the following relationship exists between the color data in the HGlCl format of one color and the color data in the XYZ format of this color in the CIE XYZ space:
in the formula, Min (X, Y, Z) is the minimum value of X, Y and Z; the color C is C=(X, Y, Z) in the CIE XYZ color space, is C (X{right arrow over (i)}, Y{right arrow over (j)}, Z{right arrow over (k)}) within a pure chromatic polar coordinate plane, and is a number pair C=(Gl,{right arrow over (Cl)})=(Gl,(Cl,H)) within the HGlCl color space.
In Step 602, the user uses multiple methods to achieve the color data in the HGlCl format in the HGlCl color space with a color appearance attribute. For example, the user can directly specify a plurality of color data in the HGlCl format of interest in the HGlCl color space with a color appearance attribute. Further, for example,
In Step 702, there are multiple manners to acquire the color data of interest in the CIEXYZ color space. For example, the user can directly specify the color data in the XYZ format of interest in the CIEXYZ color space.
Optionally, the color data of interest in the CIEXYZ color space can be also acquired in the manner below. Conversion of a physical color in an RGB format to the CIE XYZ color space can be performed by adopting a conversion method in the prior art, and thus details are omitted herein.
The specific process of performing a color addition and/or color difference operation with respect to the selected two color data in the HGlCl format to acquire one color data in the HGlCl format produced by the operation in Step 606 is described in detail below.
Firstly, the color addition in the HGlCl color space is described. It is assumed that the selected two color data in the HGlCl format are respectively C1=(H1, Gl1, Cl1) and C2=(H2, Gl2, Cl2), and the color data in the HGlCl format generated by the operation is C3=(H3, Gl3, Cl3).
Color addition can be performed with respect to two colors C1, C2 to obtain the color C3 after the addition operation by the following steps:
acquiring a gray precipitation value Glcl
acquiring H, Gl and Cl values C3 (H3, Gl3, Cl3) in the HGlCl format of the color data C3 by Formula 4 below and the gray precipitation value Glcl
Next, the color difference operation in the HGlCl color space is described. It is assumed that the selected two color data in the HGlCl format are respectively C4=(H4, Gl4, Cl4) and C5=(H5, Gl5, Cl5), and the color data in the HGlCl format generated by the operation is C6=(H6, Gl6, Cl6).
A color difference operation can be performed with respect to two colors C4, C5 to obtain the color C6 after the color difference operation by the following steps:
acquiring a color difference C6=(H6, Gl6, Cl6) of the color C4=(H4, Gl4, Cl4) relative to the color C5=(H5, Gl5, Cl5) in the HGlCl color space by the following steps:
acquiring a gray precipitation value Glcl
acquiring H, Gl and Cl values, i.e., C6=(H6, Gl6, Cl6), in the HGlCl format of the color data C6 by Formula 6 below and the gray precipitation value Glcl
In the invention, whether after performing a color addition operation or a color difference operation with respect to the two color data in the HGlCl color space, the produced color data in the HGlCl format can be deemed as one independent color. The user can further convert the color data in the HGlCl format produced by the operation to the CIE XYZ color space by adopting the conversion method of the invention, and further perform the conversion from the CIE XYZ color space to the actual physical color. The conversion from the CIE XYZ color space to the actual physical color can be achieved using the conversion manner in the prior art, and thus details are omitted herein.
Optionally, after Step 606, the color data in the HGlCl format produced by the operation can be further converted into the color data in the XYZ format in the CIE XYZ color space (Step 608). It is assumed that the color data in the HGlCl format produced by the operation is C (H, Gl, Cl), which is C (X, Y, Z) after being converted from the HGlCl color space to the CIE XYZ color space, and then the color data in the HGlCl color space can be converted into the color data in the CIE XYZ color space by Formula 2 below:
According to the second embodiment of the invention, another method of processing color based on an HGlCl color space with a color appearance attribute is provided. Firstly, color data (X, Y, Z) of interest is acquired in the CIE XYZ color space. Secondly, the acquired color data (X, Y, Z) of interest is substituted in Formula 1 to obtain the corresponding color data in the HGlCl format in the HGlCl color space. As mentioned above, the color data in the HGlCl format can be processed or not processed in the HGlCl color space.
In this embodiment, acquiring color data (X, Y, Z) of interest in the CIE XYZ color space can be as follows: directly selecting the color data of interest in the CIE XYZ color space.
In the third embodiment of the invention, a method of performing color processing based on an HGlCl color space with a color appearance attribute is provided. Firstly, color data (H, Gl, Cl) of interest is acquired in the HGlCl color space. Obviously, acquiring color data (H, Gl, Cl) of interest in the HGlCl color space can be as follows: directly selecting the color data in the HGlCl format of interest in the HGlCl color space, or using the color data in the HGlCl format obtained in the second embodiment. Secondly, the acquired color data of interest is substituted in Formula 2 to obtain the corresponding color data in the XYZ format in the CIE XYZ color space. As mentioned above, the color data in the HGlCl format can be processed or not processed in the HGlCl color space.
In the invention, the second embodiment and the third embodiment can be also combined, i.e., the color data in the XYZ format in the CIE XYZ color space being converted into the data color in the HGlCl format according to Formula 1 is mixed with the color data in the HGlCl format being converted into the color data in the XYZ format in the CIE XYZ color space according to Formula 2 to provide a complete processing process from the CIE XYZ format to the HGlCl format and further to the CIE XYZ format.
The contents below verify the color data processing method based on an HGlCl color space of the invention by means of experimental data.
Two groups of random colors are selected using a computer, and the data of the tristimulus values X, Y, Z of the XYZ color space are converted into H, Gl, Cl in the HGlCl color space, which is shown as follows:
After respectively performing addition of the tristimulus values X, Y, Z in the corresponding items in Table 1 and Table 2 in the CIEXYZ color space, conversion is made into the HGlCl values, and Testseq1+Testseq2 is shown in Table 3 below:
In the HGlCl color space, the HGlCl numerical values in the corresponding items in Table 1 and Table 2 are taken to undergo addition according to the color addition method in the HGlCl color space to obtain the added HGlCl values as follows:
It can be seen by comparing the results in Table 3 and Table 4 that the results of performing color addition according to the HGlCl color space in the HGlCl color space are completely consistent with the results of directly adding the tristimulus values X, Y, Z in the CIEXYZ color space.
After respectively performing subtraction of the tristimulus values X, Y, Z in the corresponding items in Table 1 and Table 2 in the CIE XYZ color space, conversion is made into the HGlCl values, and Testseq1-Testseq2 is shown in Table 4 below:
In the HGlCl color space, the HGlCl values in the corresponding items in Table 1 and Table 2 are taken to undergo a subtraction operation according to the color subtraction method of the HGlCl color space to obtain the HGlCl color difference values after the subtraction operation as follows:
It can be seen by comparing Table 4 and Table 5 that the results of performing color subtraction according to the HGlCl color space in the HGlCl color space are completely consistent with the results of directly subtracting the tristimulus values X, Y, Z in the CIE XYZ color space.
Especially, when the color difference operation is performed in the HGlCl color space, if Gl is negative, it indicates that the gray level of the subtracted color Testseq1 is lower than the gray level of the subtracted color Testseq2.
According to the invention, by means of the color addition in the HGlCl color space, the result of adding two known colors can be predicted. The prediction represents that the addition result can be obtained by a machine operation, and the result of the machine operation includes three variables H, Gl, Cl, and these three variables can be subjectively compared with a real operation to obtain unification of the objective operation with the subjective feeling. The traditional color processing method does not possess this function, and people can only perform an inverse operation to the CIEXYZ space from the specific color space used, then obtain the addition result by means of adding of the tristimulus values X, Y, Z, and then further perform a conversion to the specific color space so as to know the subjective visual feeling of the superimposed color.
In the invention, the color difference in the HGlCl color space can achieve the error judgment during the production of the target color as the definitions of the other color differences. Specifically, a vector subtraction is performed between the target color and the actually acquired color, whereby the specific value of the value difference can be acquired. For example, it is allowed to deem C4(H4, Gl4, Cl4) as the actually acquired color, and deem C5=(H5, Gl5, Cl5) as the target color, and then (H6, Gl6, Cl6) is the color difference. The color difference production judgment is achieved with the value Cl of the subtraction result (the Cl is not a vector but a vector module of the color difference {right arrow over (Cl)}) being lower than a certain threshold value.
The color difference and color addition operations in the HGlCl color space in the invention can be further applied to the color prediction and color matching. In order to acquire the target color, an existing color is firstly assumed, and then a difference between the target color and the assumed color is made to obtain the hue value of the second color. Thus, when seeking a color for matching, the color to be matched can be obtained by directly performing a calculation. As long as the target color and an assumed color are known, the second color can be obtained, so that the target color is obtained just when the second color is superimposed with the assumed color. The traditional color processing method is still one that can only perform an inverse conversion to a color acceptable by the machine (e.g., the ideal model of three primary colors), then perform an operation to obtain the difference, and then convert the operation result so as to known the result.
It can be seen from the color data processing methods provided by the above respective embodiments that the color processing method based on an HGlCl color space in the invention involves simple analytical operations all the time in the conversion calculations, greatly simplifies the conversion calculating process, and improves the conversion efficiency. Particularly, the mutual conversion formulae with the color data in the HGlCl format provided in the embodiments of the invention are analytical formulae, and no cumulative errors will occur in the calculations, so the color data obtained by the calculations by the conversion formulae will provide a higher precision of the color data than the conversion formulae in the prior art.
The above contents are only preferred implementation modes of the invention. It should be noted that those skilled in the art can further make some improvements and decorations in the case of not breaking away from the technical principle of the invention, and these improvements and decorations should also be deemed as ones within the scope of protection of the invention.
Number | Date | Country | Kind |
---|---|---|---|
201110254162.4 | Aug 2011 | CN | national |
201210235897.7 | Jul 2012 | CN | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CN2012/080661 | 8/28/2012 | WO | 00 | 4/23/2014 |