Sponsored Links
-->

Wednesday, October 17, 2018

What is the difference between RGB and CMYK? - YouTube
src: i.ytimg.com

The difference or distance between two colors is a metric of interest in color science. It allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color critical. Common definitions make use of the Euclidean distance in a device independent color space.


Video Color difference



Euclidean

As most definitions of color distance are distances within a color space, the standard means of determining distances is the Euclidean distance. If one presently has an RGB (Red, Green, Blue) tuple and wishes to find the color difference, computationally one of the easiest is to call R, G, B linear dimensions defining the color space.

d i s t a n c e = ( R 2 - R 1 ) 2 + ( G 2 - G 1 ) 2 + ( B 2 - B 1 ) 2 {\displaystyle \mathrm {distance} ={\sqrt {(R_{2}-R_{1})^{2}+(G_{2}-G_{1})^{2}+(B_{2}-B_{1})^{2}}}}

When the result should be computationally simple as well, it is often acceptable to remove the square root and simply use:

d i s t a n c e 2 = ( R 2 - R 1 ) 2 + ( G 2 - G 1 ) 2 + ( B 2 - B 1 ) 2 {\displaystyle \mathrm {distance} ^{2}={(R_{2}-R_{1})^{2}+(G_{2}-G_{1})^{2}+(B_{2}-B_{1})^{2}}}

This will work in cases when a single color is to be compared to a single color and the need is to simply know whether a distance is greater. If these squared color distances are summed, such a metric effectively becomes the variance of the color distances.

There have been many attempts to weight RGB values to better fit human perception, where the components are commonly weighted (red 30%, green 59%, and blue 11%), however these are demonstratively worse at color determinations and are properly the contributions to the brightness of these colors, rather than to the degree to which human vision has less tolerance for these colors. The closer approximations would be more properly coefficients of 2, 4, and 3

2 × ? R 2 + 4 × ? G 2 + 3 × ? B 2 {\displaystyle {\sqrt {2\times \Delta R^{2}+4\times \Delta G^{2}+3\times \Delta B^{2}}}} ,

one of the better low-cost approximations (using a color range of 0-255),

r ¯ = C 1 , R + C 2 , R 2 {\displaystyle {\bar {r}}={{C_{1,R}+C_{2,R}} \over 2}}
? R = C 1 , R - C 2 , R {\displaystyle \Delta R=C_{1,R}-C_{2,R}}
? G = C 1 , G - C 2 , G {\displaystyle \Delta G=C_{1,G}-C_{2,G}}
? B = C 1 , B - C 2 , B {\displaystyle \Delta B=C_{1,B}-C_{2,B}}
? C = ( 2 + r ¯ 256 ) × ? R 2 + 4 × ? G 2 + ( 2 + 255 - r ¯ 256 ) × ? B 2 {\displaystyle \Delta C={\sqrt {\left({2+{{\bar {r}} \over {256}}}\right)\times \Delta R^{2}+4\times \Delta G^{2}+\left({2+{{255-{\bar {r}}} \over {256}}}\right)\times \Delta B^{2}}}}

This formula can be re-written as

? C = 2 × ? R 2 + 4 × ? G 2 + 3 × ? B 2 + r ¯ × ( ? R 2 - ? B 2 ) 256 {\displaystyle \Delta C={\sqrt {2\times \Delta R^{2}+4\times \Delta G^{2}+3\times \Delta B^{2}+{{{\bar {r}}\times (\Delta R^{2}-\Delta B^{2})} \over {256}}}}}

There are a number of color distance formulae that attempt to use color spaces like HSV with the hue as a circle, placing the various colors within a three dimensional space of either a cylinder or cone, but most of these are just modifications of RGB without accounting for differences in human color perception they will tend to be on par with a simple Euclidean metric.


Maps Color difference



CIELAB ?E*

The International Commission on Illumination (CIE) calls their distance metric ?E*ab (also called ?E*, or, inaccurately, dE*, dE, or "Delta E") where delta is a Greek letter often used to denote difference, and E stands for Empfindung; German for "sensation". Use of this term can be traced back to Hermann von Helmholtz and Ewald Hering.

Perceptual non-uniformities in the underlying CIELAB color space have led to the CIE refining their definition over the years, leading to the superior (as recommended by the CIE) 1994 and 2000 formulas. These non-uniformities are important because the human eye is more sensitive to certain colors than others. A good metric should take this into account in order for the notion of a "just noticeable difference" to have meaning. Otherwise, a certain ?E that may be insignificant between two colors in one part of the color space while being significant in some other part.

CIE76

The 1976 formula is the first formula that related a measured color difference to a known set of CIELAB coordinates. This formula has been succeeded by the 1994 and 2000 formulas because the CIELAB space turned out to be not as perceptually uniform as intended, especially in the saturated regions. This means that this formula rates these colors too highly as opposed to other colors.

Given two colors in CIELAB color space, ( L 1 * , a 1 * , b 1 * ) {\displaystyle ({L_{1}^{*}},{a_{1}^{*}},{b_{1}^{*}})} and ( L 2 * , a 2 * , b 2 * ) {\displaystyle ({L_{2}^{*}},{a_{2}^{*}},{b_{2}^{*}})} , the CIE76 color difference formula is defined as:

? E a b * = ( L 2 * - L 1 * ) 2 + ( a 2 * - a 1 * ) 2 + ( b 2 * - b 1 * ) 2 {\displaystyle \Delta E_{ab}^{*}={\sqrt {(L_{2}^{*}-L_{1}^{*})^{2}+(a_{2}^{*}-a_{1}^{*})^{2}+(b_{2}^{*}-b_{1}^{*})^{2}}}} .

? E a b * ? 2.3 {\displaystyle \Delta E_{ab}^{*}\approx 2.3} corresponds to a JND (just noticeable difference).

CIE94

The 1976 definition was extended to address perceptual non-uniformities, while retaining the CIELAB color space, by the introduction of application-specific weights derived from an automotive paint test's tolerance data.

?E (1994) is defined in the L*C*h* color space with differences in lightness, chroma and hue calculated from L*a*b* coordinates. Given a reference color ( L 1 * , a 1 * , b 1 * ) {\displaystyle (L_{1}^{*},a_{1}^{*},b_{1}^{*})} and another color ( L 2 * , a 2 * , b 2 * ) {\displaystyle (L_{2}^{*},a_{2}^{*},b_{2}^{*})} , the difference is:

? E 94 * = ( ? L * k L S L ) 2 + ( ? C a b * k C S C ) 2 + ( ? H a b * k H S H ) 2 {\displaystyle \Delta E_{94}^{*}={\sqrt {\left({\frac {\Delta L^{*}}{k_{L}S_{L}}}\right)^{2}+\left({\frac {\Delta C_{ab}^{*}}{k_{C}S_{C}}}\right)^{2}+\left({\frac {\Delta H_{ab}^{*}}{k_{H}S_{H}}}\right)^{2}}}}

where:

? L * = L 1 * - L 2 * {\displaystyle \Delta L^{*}=L_{1}^{*}-L_{2}^{*}}
C 1 * = a 1 * 2 + b 1 * 2 {\displaystyle C_{1}^{*}={\sqrt {{a_{1}^{*}}^{2}+{b_{1}^{*}}^{2}}}}
C 2 * = a 2 * 2 + b 2 * 2 {\displaystyle C_{2}^{*}={\sqrt {{a_{2}^{*}}^{2}+{b_{2}^{*}}^{2}}}}
? C a b * = C 1 * - C 2 * {\displaystyle \Delta C_{ab}^{*}=C_{1}^{*}-C_{2}^{*}}
? H a b * = ? E a b * 2 - ? L * 2 - ? C a b * 2 = ? a * 2 + ? b * 2 - ? C a b * 2 {\displaystyle \Delta H_{ab}^{*}={\sqrt {{\Delta E_{ab}^{*}}^{2}-{\Delta L^{*}}^{2}-{\Delta C_{ab}^{*}}^{2}}}={\sqrt {{\Delta a^{*}}^{2}+{\Delta b^{*}}^{2}-{\Delta C_{ab}^{*}}^{2}}}}
? a * = a 1 * - a 2 * {\displaystyle \Delta a^{*}=a_{1}^{*}-a_{2}^{*}}
? b * = b 1 * - b 2 * {\displaystyle \Delta b^{*}=b_{1}^{*}-b_{2}^{*}}
S L = 1 {\displaystyle S_{L}=1}
S C = 1 + K 1 C 1 * {\displaystyle S_{C}=1+K_{1}C_{1}^{*}}
S H = 1 + K 2 C 1 * {\displaystyle S_{H}=1+K_{2}C_{1}^{*}}

and where kC and kH are usually both unity and the weighting factors kL, K1 and K2 depend on the application:

Geometrically, the quantity ? H a b * {\displaystyle \Delta H_{ab}^{*}} corresponds to the arithmetic mean of the chord lengths of the equal chroma circles of the two colors.

CIEDE2000

Since the 1994 definition did not adequately resolve the perceptual uniformity issue, the CIE refined their definition, adding five corrections:

  • A hue rotation term (RT), to deal with the problematic blue region (hue angles in the neighborhood of 275°):
  • Compensation for neutral colors (the primed values in the L*C*h differences)
  • Compensation for lightness (SL)
  • Compensation for chroma (SC)
  • Compensation for hue (SH)
? E 00 * = ( ? L ? k L S L ) 2 + ( ? C ? k C S C ) 2 + ( ? H ? k H S H ) 2 + R T ? C ? k C S C ? H ? k H S H {\displaystyle \Delta E_{00}^{*}={\sqrt {\left({\frac {\Delta L'}{k_{L}S_{L}}}\right)^{2}+\left({\frac {\Delta C'}{k_{C}S_{C}}}\right)^{2}+\left({\frac {\Delta H'}{k_{H}S_{H}}}\right)^{2}+R_{T}{\frac {\Delta C'}{k_{C}S_{C}}}{\frac {\Delta H'}{k_{H}S_{H}}}}}}
Note: The formulae below should use degrees rather than radians; the issue is significant for RT.
The kL, kC, and kH are usually unity.
? L ? = L 2 * - L 1 * {\displaystyle \Delta L^{\prime }=L_{2}^{*}-L_{1}^{*}}
L ¯ = L 1 * + L 2 * 2 C ¯ = C 1 * + C 2 * 2 {\displaystyle {\bar {L}}={\frac {L_{1}^{*}+L_{2}^{*}}{2}}\quad {\bar {C}}={\frac {C_{1}^{*}+C_{2}^{*}}{2}}}
a 1 ? = a 1 * + a 1 * 2 ( 1 - C ¯ 7 C ¯ 7 + 25 7 ) a 2 ? = a 2 * + a 2 * 2 ( 1 - C ¯ 7 C ¯ 7 + 25 7 ) {\displaystyle a_{1}^{\prime }=a_{1}^{*}+{\frac {a_{1}^{*}}{2}}\left(1-{\sqrt {\frac {{\bar {C}}^{7}}{{\bar {C}}^{7}+25^{7}}}}\right)\quad a_{2}^{\prime }=a_{2}^{*}+{\frac {a_{2}^{*}}{2}}\left(1-{\sqrt {\frac {{\bar {C}}^{7}}{{\bar {C}}^{7}+25^{7}}}}\right)}
C ¯ ? = C 1 ? + C 2 ? 2  and  ? C ? = C 2 ? - C 1 ? where  C 1 ? = a 1 ? 2 + b 1 * 2 C 2 ? = a 2 ? 2 + b 2 * 2 {\displaystyle {\bar {C}}^{\prime }={\frac {C_{1}^{\prime }+C_{2}^{\prime }}{2}}{\mbox{ and }}\Delta {C'}=C'_{2}-C'_{1}\quad {\mbox{where }}C_{1}^{\prime }={\sqrt {a_{1}^{'^{2}}+b_{1}^{*^{2}}}}\quad C_{2}^{\prime }={\sqrt {a_{2}^{'^{2}}+b_{2}^{*^{2}}}}\quad }
h 1 ? = atan2 ( b 1 * , a 1 ? ) mod 360 ? , h 2 ? = atan2 ( b 2 * , a 2 ? ) mod 360 ? {\displaystyle h_{1}^{\prime }={\text{atan2}}(b_{1}^{*},a_{1}^{\prime })\mod 360^{\circ },\quad h_{2}^{\prime }={\text{atan2}}(b_{2}^{*},a_{2}^{\prime })\mod 360^{\circ }}
Note: The inverse tangent (tan-1) can be computed using a common library routine atan2(b, a?) which usually has a range from -? to ? radians; color specifications are given in 0 to 360 degrees, so some adjustment is needed. The inverse tangent is indeterminate if both a? and b are zero (which also means that the corresponding C? is zero); in that case, set the hue angle to zero. See Sharma 2005, eqn. 7.
? h ? = { h 2 ? - h 1 ? | h 1 ? - h 2 ? | <= 180 ? h 2 ? - h 1 ? + 360 ? | h 1 ? - h 2 ? | > 180 ? , h 2 ? <= h 1 ? h 2 ? - h 1 ? - 360 ? | h 1 ? - h 2 ? | > 180 ? , h 2 ? > h 1 ? {\displaystyle \Delta h'={\begin{cases}h_{2}^{\prime }-h_{1}^{\prime }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|\leq 180^{\circ }\\h_{2}^{\prime }-h_{1}^{\prime }+360^{\circ }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{2}^{\prime }\leq h_{1}^{\prime }\\h_{2}^{\prime }-h_{1}^{\prime }-360^{\circ }&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{2}^{\prime }>h_{1}^{\prime }\end{cases}}}
Note: When either C?1 or C?2 is zero, then ?h? is irrelevant and may be set to zero. See Sharma 2005, eqn. 10.
? H ? = 2 C 1 ? C 2 ? sin ( ? h ? / 2 ) , H ¯ ? = { ( h 1 ? + h 2 ? ) / 2 | h 1 ? - h 2 ? | <= 180 ? ( h 1 ? + h 2 ? + 360 ? ) / 2 | h 1 ? - h 2 ? | > 180 ? , h 1 ? + h 2 ? < 360 ? ( h 1 ? + h 2 ? - 360 ? ) / 2 | h 1 ? - h 2 ? | > 180 ? , h 1 ? + h 2 ? >= 360 ? {\displaystyle \Delta H^{\prime }=2{\sqrt {C_{1}^{\prime }C_{2}^{\prime }}}\sin(\Delta h^{\prime }/2),\quad {\bar {H}}^{\prime }={\begin{cases}(h_{1}^{\prime }+h_{2}^{\prime })/2&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|\leq 180^{\circ }\\(h_{1}^{\prime }+h_{2}^{\prime }+360^{\circ })/2&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{1}^{\prime }+h_{2}^{\prime }<360^{\circ }\\(h_{1}^{\prime }+h_{2}^{\prime }-360^{\circ })/2&\left|h_{1}^{\prime }-h_{2}^{\prime }\right|>180^{\circ },h_{1}^{\prime }+h_{2}^{\prime }\geq 360^{\circ }\end{cases}}}
Note: When either C?1 or C?2 is zero, then H? is h?1+h?2 (no divide by 2; essentially, if one angle is indeterminate, then use the other angle as the average; relies on indeterminate angle being set to zero). See Sharma 2005, eqn. 7 and p. 23 stating most implementations on the internet at the time had "an error in the computation of average hue".
T = 1 - 0.17 cos ( H ¯ ? - 30 ? ) + 0.24 cos ( 2 H ¯ ? ) + 0.32 cos ( 3 H ¯ ? + 6 ? ) - 0.20 cos ( 4 H ¯ ? - 63 ? ) {\displaystyle T=1-0.17\cos({\bar {H}}^{\prime }-30^{\circ })+0.24\cos(2{\bar {H}}^{\prime })+0.32\cos(3{\bar {H}}^{\prime }+6^{\circ })-0.20\cos(4{\bar {H}}^{\prime }-63^{\circ })}
S L = 1 + 0.015 ( L ¯ - 50 ) 2 20 + ( L ¯ - 50 ) 2 S C = 1 + 0.045 C ¯ ? S H = 1 + 0.015 C ¯ ? T {\displaystyle S_{L}=1+{\frac {0.015\left({\bar {L}}-50\right)^{2}}{\sqrt {20+{\left({\bar {L}}-50\right)}^{2}}}}\quad S_{C}=1+0.045{\bar {C}}^{\prime }\quad S_{H}=1+0.015{\bar {C}}^{\prime }T}
R T = - 2 C ¯ ? 7 C ¯ ? 7 + 25 7 sin [ 60 ? ? exp ( - [ H ¯ ? - 275 ? 25 ? ] 2 ) ] {\displaystyle R_{T}=-2{\sqrt {\frac {{\bar {C}}'^{7}}{{\bar {C}}'^{7}+25^{7}}}}\sin \left[60^{\circ }\cdot \exp \left(-\left[{\frac {{\bar {H}}'-275^{\circ }}{25^{\circ }}}\right]^{2}\right)\right]}

CMC l:c (1984)

In 1984, the Colour Measurement Committee of the Society of Dyers and Colourists defined a difference measure, also based on the L*C*h color model. Named after the developing committee, their metric is called CMC l:c. The quasimetric has two parameters: lightness (l) and chroma (c), allowing the users to weight the difference based on the ratio of l:c that is deemed appropriate for the application. Commonly used values are 2:1 for acceptability and 1:1 for the threshold of imperceptibility.

The distance of a color ( L 2 * , C 2 * , h 2 ) {\displaystyle (L_{2}^{*},C_{2}^{*},h_{2})} to a reference ( L 1 * , C 1 * , h 1 ) {\displaystyle (L_{1}^{*},C_{1}^{*},h_{1})} is:

? E C M C * = ( L 2 * - L 1 * l S L ) 2 + ( C 2 * - C 1 * c S C ) 2 + ( ? H a b * S H ) 2 {\displaystyle \Delta E_{CMC}^{*}={\sqrt {\left({\frac {L_{2}^{*}-L_{1}^{*}}{lS_{L}}}\right)^{2}+\left({\frac {C_{2}^{*}-C_{1}^{*}}{cS_{C}}}\right)^{2}+\left({\frac {\Delta H_{ab}^{*}}{S_{H}}}\right)^{2}}}}
S L = { 0.511 L 1 * < 16 0.040975 L 1 * 1 + 0.01765 L 1 * L 1 * >= 16 S C = 0.0638 C 1 * 1 + 0.0131 C 1 * + 0.638 S H = S C ( F T + 1 - F ) {\displaystyle S_{L}={\begin{cases}0.511&L_{1}^{*}<16\\{\frac {0.040975L_{1}^{*}}{1+0.01765L_{1}^{*}}}&L_{1}^{*}\geq 16\end{cases}}\quad S_{C}={\frac {0.0638C_{1}^{*}}{1+0.0131C_{1}^{*}}}+0.638\quad S_{H}=S_{C}(FT+1-F)}
F = C 1 * 4 C 1 * 4 + 1900 T = { 0.56 + | 0.2 cos ( h 1 + 168 ? ) | 164 ? <= h 1 <= 345 ? 0.36 + | 0.4 cos ( h 1 + 35 ? ) | otherwise {\displaystyle F={\sqrt {\frac {C_{1}^{*^{4}}}{C_{1}^{*^{4}}+1900}}}\quad T={\begin{cases}0.56+|0.2\cos(h_{1}+168^{\circ })|&164^{\circ }\leq h_{1}\leq 345^{\circ }\\0.36+|0.4\cos(h_{1}+35^{\circ })|&{\mbox{otherwise}}\end{cases}}}

CMC l:c is designed to be used with D65 and the CIE Supplementary Observer. The formula is not a metric but rather a quasimetric because it violates symmetry, parameter T is based on the hue of the h 1 {\displaystyle h_{1}} alone. This reference color means that the color difference from the first color to the second color is different than the color distance from the second color is to the first.

Tolerance

Tolerancing concerns the question "What is a set of colors that are imperceptibly/acceptably close to a given reference?" If the distance measure is perceptually uniform, then the answer is simply "the set of points whose distance to the reference is less than the just-noticeable-difference (JND) threshold." This requires a perceptually uniform metric in order for the threshold to be constant throughout the gamut (range of colors). Otherwise, the threshold will be a function of the reference color--cumbersome as a practical guide.

In the CIE 1931 color space, for example, the tolerance contours are defined by the MacAdam ellipse, which holds L* (lightness) fixed. As can be observed on the adjacent diagram, the ellipses denoting the tolerance contours vary in size. It is partly this non-uniformity that led to the creation of CIELUV and CIELAB.

More generally, if the lightness is allowed to vary, then we find the tolerance set to be ellipsoidal. Increasing the weighting factor in the aforementioned distance expressions has the effect of increasing the size of the ellipsoid along the respective axis.



The Chemical Difference Between Red, Yellow, and Green Bell ...
src: mentalfloss.com


See also

  • CIELAB

Gray or Grey? It Depends on Where You Live | Grammarly
src: www.grammarly.com


Footnotes


website design - Need help understanding the difference between ...
src: i.stack.imgur.com


Further reading

  • Robertson, Alan R. (1990). "Historical development of CIE recommended color difference equations". Color Research & Application. 15 (3): 167-170. doi:10.1002/col.5080150308.
  • Melgosa, M.; Quesada, J. J.; Hita, E. (December 1994). "Uniformity of some recent color metrics tested with an accurate color-difference tolerance dataset". Applied Optics. 33 (34): 8069-8077. doi:10.1364/AO.33.008069. PMID 20963027.
  • McDonald, Roderick, ed. (1997). Colour Physics for Industry (second ed.). Society of Dyers and Colourists. ISBN 0-901956-70-8.

Vector Chart Explaining Difference Between CMYK And RGB Color ...
src: thumbs.dreamstime.com


External links

  • Bruce Lindbloom's color difference calculator. Uses all metrics defined herein.
  • The CIEDE2000 Color-Difference Formula, by Gaurav Sharma. Implementations in MATLAB and Excel.

Source of article : Wikipedia