Colour Theory Rob Scharein EECE 478 – Introduction to Computer Graphics 11/13 February 2002 Colour theory — perceptual terms Hue — distinguishes amoung colours such as red, green, yellow, or purple Saturation — refers to how far a colour is from a gray of equal intensity • red vs. pink • pastels relatively unsaturated • vivid colours are highly saturated (red laser pointer • white, gray, and black are unsaturated Lightness — perceived intensity of a reflecting (or emitting) object Colour theory — colorimetric terms Objective, quantitative, way of specifying colours is a branch of physics known as colorimetry. Dominant wavelength — The wavelength that a light source emits most of its energy Excitation purity — Relative amounts of energy emitted at the dominant wavelength compared to the rest of the spectrum Luminance — Amount, or intensity of the light Perceptual term Colorimetric term Hue Saturation Lightness (reflecting objects) Brightness (self-luminous objects) Dominant wavelength Excitation purity Luminance Luminance Tristimulus theory of colour vision • Although a light source can have a very complex spectral distribution, it was found empirically (first by artists, then by Helmholtz & Young) that all colours could be described using only three parameters. • Colours that “look” the same but have different spectral energy distributions are called metamers. • Experimentally verified only recently that this is related to the fact there are three types of cones in the human eye (for most people). • tristimulus theory experimentally verified in the 1930s by doing colour matching experiments with test subjects • it was found that any colour, S(λ), could be matched with three suitable chosen primary colours, A(λ), B(λ), and C(λ). • used monochromatic light of 438.1nm, 546.1nm, and 700nm. • found that colour space was linear if R(λ) ≡ S(λ) then R(λ) + M(λ) ≡ S(λ) + M(λ) and k R(λ) ≡ k S(λ) so it is meaningful to talk about linear combinations of colours: S(λ) ≡ a A(λ) + b B(λ) + c C(λ) S(λ) − a A(λ) ≡ b B(λ) + c C(λ) (here the symbol ≡ means the two colours are metamers) Colour matching functions, r̄λ , ḡλ , and b̄λ , showing amounts of the primaries R, G, and B, needed to match all monochomatic colours of wavelength λ of the visible spectrum. Note negative values for r̄λ . • Negative weights mean that some (monochromatic) colours could not be matched with positive weights of the primaries. • These colours could be matched by adding one of the primaries to the colour itself, F+r R ≡ gG+bB so that F ≡ −r R + g G + b B Important things to note about colour matching functions, r̄λ , ḡλ , and b̄λ : • they are not spectral distributions • they are not sensitivities of anything with respect to wavelength • they are simply the amount of the three standard illuminants R — monochromatic light at 700nm G — monochromatic light at 546.1nm B — monochromatic light at 438.1nm needed to match a monochromatic light of wavelength λ. • Denoting the three standard illuminants by R, G, and B, we can the represent any visible colour as a vector in a vector space where R, G, and B are the basis vectors. • This vector space is the CIE–RGB colour space. • If a given colour, C, is represented by a spectral distribution function, P (λ), then the components of the vector in RGB-space can be found by Z R = P (λ) r̄λ dλ Z G = P (λ) ḡλ dλ Z B = P (λ) b̄λ dλ • These equations follow from the definitions of r̄λ, ḡλ, and b̄λ and linearity of colour space (and linearity of integration). • Don’t confuse all the r , g, and bs! r̄λ ḡλ b̄λ colour matching functions R G B primaries R G B components in RGB-space of a given colour The CIE Chromaticity Diagram • Need for negative weights to specify colours is awkward. • In 1931, the Commission Internationale de l’ Éclairage (CIE) defined three standard primaries, called X, Y, and Z that replace R, G, and B. • Primaries chosen so that all visible colours are positive combinations of X, Y, and Z. • Note that this is the same colour space (CIE-RGB), but with new basis vectors X, Y, and Z, related to R, G, and B by the linear transformation X 2.36460 −0.51515 0.00520 R Y = −0.89653 1.42640 −0.01441 G Z −0.46807 0.08875 1.00921 B Colour matching functions, x̄λ , ȳλ , and z̄λ , showing amounts of the primaries X, Y, and Z, needed to match all monochomatic colours of wavelength λ of the visible spectrum. Note functions are positive everywhere. • Colour matching functions are x̄λ, ȳλ, and z̄λ. • If a given colour, C, is represented by a spectral distribution function, P (λ), then the components of the vector in XYZ-space can be found by Z X = k P (λ) x̄λ dλ Z Y = k P (λ) ȳλ dλ Z Z = k P (λ) z̄λ dλ for some constant k > 0. • These equations follow from the definitions of x̄λ, ȳλ, and z̄λ and linearity of colour space (and linearity of integration). Some things to note about CIE-XYZ colour space: • The primaries X, Y, and Z are not observable by themselves! • The CIE chose Y to correspond to the luminous energy of the lightsource. • Don’t confuse all the x, y, and zs! x̄λ ȳλ z̄λ colour matching functions X Y Z primaries X Y Z components in XYZ-space of a given colour • There is no point at which x̄λ, ȳλ, and z̄λ are all zero (within the visible range). This is related to the first point (why?). Cone of visible colours in CIE-XYZ colour space. • Let (X, Y , Z) be the weights on the CIE primaries to match a given colour C. Then C=X X+Y Y+Z Z • The chromaticity values are defined by normalizing against X+Y +Z, x= X , X +Y +Z y= Y , X +Y +Z z= Z X +Y +Z • Chromaticity depends only on the dominant wavelength and the saturation, and is independent of the luminous energy. • Given (x, y, Y ), we can find X= x Y, y Y = Y, Z= 1−x−y Y. y • Don’t confuse all the x, y, and zs! x̄λ X X x ȳλ Y Y y z̄λ Z Z z colour matching functions primaries components in XYZ-space of a given colour chromaticity values 0.9 525 520 0 CIE 1931 Standard Colorimetric System 53 51 5 54 0 53 5 0.8 55 0 54 5 510 55 5 0.7 56 0 505 57 0 56 5 0.6 Values along the rim of the diagram are wavelength in nanometers (nm). 58 0 57 5 500 58 5 0.5 0 59 495 62 0 61 5 61 0 60 5 60 0.4 5 59 0 y 63 6 0 65 40 0 C 0.3 490 0.2 485 480 Chromaticity coordinates: C = (0.31006, 0.31616) 0.1 475 0 47 5 46 4 45 4 5 5 4340 0 0 0 46 0.0 0.0 0.1 0.2 0.3 0.4 x 0.5 0.6 0.7 0.8 CIE Chromaticity Diagram (1931) Important things to note about CIE diagram: • All visible colours lie within the horseshoe diagram. • Intensity (lightness) of the colour is ignored; two colours with the same hue and saturations, but different lightnesses, project to the same point on the diagram. • Spectral (monochromatic) colours lie along the curved rim of the horseshoe. • The straight line between blue and red is the “purple line”. • Point C is the “white point”. Important things to note about CIE diagram: (cont.) • Because xy-plane is just the projection of a linear space (colour space), colours still combine linearly on the CIE diagram. • Complementary colours are colours that may be combined to form white. • Dominant wavelength is found by extending a line from the “white point” to the curved part of the horseshoe. • Some colours do not have a dominant wavelength, but their complement does. Colours on the chromaticity diagram. Colour gamut for three primaries. CIE Chromaticity Diagram (1931) Important things to note about CIE diagram: • All visible colours lie within the horseshoe diagram. • Intensity (lightness) of the colour is ignored; two colours with the same hue and saturations, but different lightnesses, project to the same point on the diagram. • Spectral (monochromatic) colours lie along the curved rim of the horseshoe. • The straight line between blue and red is the “purple line”. • Point C is the “white point”. Important things to note about CIE diagram: (cont.) • Because xy-plane is just the projection of a linear space (colour space), colours still combine linearly on the CIE diagram. • Complementary colours are colours that may be combined to form white. • Dominant wavelength is found by extending a line from the “white point” to the curved part of the horseshoe. • Some colours do not have a dominant wavelength, but their complement does. Colours on the chromaticity diagram. Colour gamut for three primaries. • If we have N different colours, the set of visible colours that can be represented by (positive) combinations of those colours is the convex hull of the N points projected to the CIE xy-chromaticity diagram. Colour models for computer graphics • Two major types of colour models: additive — colours combine by adding light together; combined colour contains the sum of spectral distributions. subtractive — colours combine by successively subtracting light from previous colour. • We’ve been talking about adding colours together up to now. • Primaries are still somewhat arbitrary: – red, green, blue can be both additive and subtractive primaries (demo) – cyan, magenta, yellow can be both subtractive and addtive primaries – Note the textbook is somewhat misleading on this point! Colour models for computer graphics (cont.) • CIE RGB and XYZ — useful for precise work, but not for everyday use. • Monitor RGB colour — fairly close to CIE RGB (except for possible the green phosphor. • CMY colour — uses complementary colours to RGB, C 1 R M = 1 − G Y 1 B NOTE: different Y !! • Primaries used are somewhat arbitrary, CIE XYZ/RGB, monitor RGB, CMY, are all affine transformations of X 18.5 15.6 Y = 10.3 30.5 Z 1.70 7.44 each other 10.0 R 4.9 G 52.0 B Images courtesy of Adobe. • CMYK model — used in print media (process colour) K = min(C, M, Y ), C = C − K, M = M − K, Y = Y − K. – Black (K) is used to get better blacks and to save on expensive coloured inks. – Caveat: — cyan used in print not exactly the complement of red! – Colour in print media is horribly complicated! – Spot colours are often used to get special effects (colours outside of gamut, colours such as gold or silver, Pantone inks) – Some colour processes use more than four colours (eg. some Epsom printers, facsimile of Book of Kells) – Lupin demo • YIQ model — used in broadcast television in North America and Japan (NTSC) • Y is not yellow but is the same as Y in XY Z (corresponds to luminance) Y 0.299 0.587 0.114 R I = 0.596 −0.275 −0.321 G Q 0.212 −0.528 0.311 B User-oriented colour spaces • HSV colour space — attempts to use perceptually-based notions: hue, saturation, and value (brightness). • Hue is measured as an angle around an axis of a cone. • Complementary colours are 180◦ opposite each other. • Saturation is measured as a distance from the central axis. – white, grays, and black along axis – maximally saturated colours on edge of cone • Value is measured in the vertical dimension. • HSV space is a non-affine transformation of RGB, XYZ, or CMY colour spaces. HSV colour space. • HLS colour space — another distorted version of RGB space. – uses lightness instead of value – represented as a double cone Perceptually uniform colour spaces • Proposed as early as 1896 by Helmholtz who pointed out the importance of an unambiguous definition of the so-called “visually homogeneous colour space”. • A lot of work has been done since then to try to quantify the notion of a perceptually uniform colour space. • Experiments done by Stiles (1939) determined curves of equal hue and satuation on the CIE diagram. • More experiments by MacAdam (1955) determined the nature of just perceptible differences • These experiments have generated a proliferation of perceptually uniform colour spaces (dozens!). • This led the CIE in 1960 to propose some international standards – CIE Luv — complicated non-linear transformation of XYZ – CIE Lab — simplified version of Luv (but still complicated) • Other colour systems: – Pantone – Munsell Colour gamuts • Colour gamut — range of colours that can be produced by adding together a set of primaries. • On CIE diagram, a gamut is convex hull of points corresponding to the primaries. • With only three (or four) primaries, can only cover a subset of visible colours. • Would need six to ten or more primaries to cover the CIE diagram reasonably well. • “Phosphors” on monitors have approximate chromaticities: “Phosphor” x y red 0.6064 0.3379 green 0.2919 0.5693 blue 0.1496 0.0732 Comparison of monitor and print gamuts. • Colour gamut of print media is (generally) smaller than monitor RGB. • Chromaticities of phosphors varies, and must be known to do accurate colour work. • Complexities abound: – gamma correction – inks don’t add linearly like light does (overprinting, smearing, etc.) – many print shops don’t know anything about colour calibration (eg. one starting with a “K”) • All colour representations on computer monitor can be found on the RGB colour cube. The RGB colour cube. Grays are the dotten main diagonal. Other issues in colour theory • Eye-camera analogy is only approximate; the eye has a brain (cortex) attached • Some colour phenomena are not easily explained by colour theory as so far presented. • Land effect — named after Edwin Land, the inventor of “instant photography” and the Poloroid camera, – considers the eye and brain (retina and cortex) to be one optical system, the retinex – showed a remarkable number of colours could be produced by combining only two colours
© Copyright 2024 Paperzz