Colour in Computer Graphics
Total Page:16
File Type:pdf, Size:1020Kb
Computer Graphics Unit Manchester Computing Centre University of Manchester Department of Computer Science University of Manchester Colour in Computer Graphics Student Notes C. Lilley F. Lin W.T. Hewitt T.L.J.Howard ITTI Computer Graphics and Visualisation Table of Contents 1 Introduction ............................................................................. 1 1.1 Contents and scope ............................................................ 1 2 Seeing in colour ...................................................................... 3 2.1 The electromagnetic spectrum .......................................... 3 2.2 Spectra ................................................................................ 4 2.3 The eye................................................................................ 5 2.4 The retina ........................................................................... 7 2.5 Receptor cells ..................................................................... 8 2.6 Colour reception ................................................................. 9 2.7 The fovea .......................................................................... 12 3 Measuring colour ................................................................. 13 3.1 Colour matching ............................................................... 13 3.2 A standardised observer .................................................. 14 3.3 Coloured objects ............................................................... 16 3.4 Emissive colour ................................................................ 16 3.5 Illuminants ....................................................................... 18 3.6 Reflective colour ............................................................... 21 3.7 Chromaticity .................................................................... 22 3.8 Atypical colour response .................................................. 26 4 Colour models ........................................................................ 31 4.1 Why use colour models? ................................................... 31 4.2 Primary colours ................................................................ 31 4.3 CIE colour models ............................................................ 34 4.4 Device dependent models ................................................ 38 University of Manchester i 4.5 Other colour models .........................................................42 5 Colour output ........................................................................ 49 5.1 Displaying colour ............................................................. 49 5.2 Colour video...................................................................... 55 5.3 Broadcasting colour ......................................................... 61 5.4 Coping with insufficient colours......................................63 5.5 Printing in colour ............................................................. 69 5.6 Colour photography ......................................................... 73 5.7 Gamut mapping ............................................................... 74 6 Usage of colour ...................................................................... 79 6.1 When to use colour ........................................................... 79 6.2 Selecting a colour model .................................................. 79 6.3 Colour schemes ................................................................ 80 6.4 Interpolation .................................................................... 82 A Gamma correction ............................................................ 83 A.1 Determining gamma ....................................................... 83 A.2 Direct measurement ........................................................ 83 A.3 Visual calibration ............................................................ 84 B Monitor calibration .......................................................... 87 C Glossary ............................................................................... 89 ii Computer Graphics and Visualisation 1 Introduction A good understanding of colour is essential for effective use of computer graphics. This module describes the science of colour as it applies to computer graphics and visualisation. 1.1 Contents and scope This module is divided into five sections. Firstly, we look at how colour is seen. This draws together information from such diverse disciplines as physics, optics, physiology, neurology and psychology to show that colour is an internal, subjective sensation rather than an external, ob- jective entity. This helps explain just what colour is. Given the biological basis of colour, how can it be measured and standardised? The second section explains how colour is measured and introduces the CIE in- ternational standard, used to define colour. This provides the vital link between biological sensation and physical measurement. Examples are also given of how colour measurements can be used and manipulated, such as predicting the result of a colour mixture or designing displays for people with defective colour vision. An abstraction called a colour model is used to specify colour. The third section explains the concept of primary colours and then examines the many colour mod- els that are available, and the particular strengths and weaknesses of each. A colour described in one colour model can often be converted to a description in another. The CIE standard functions as a universal yardstick in this process. The preceding sections have focused on specifying colour without considering how colours are physically produced in a computer graphics context. The fourth section examines how different types of hardware work, emphasising the impact this has on displaying colour. Guidance is given in making best use of the avail- able hardware for portable and effective colour graphics. The final section provides guidelines for using colour. Rather than presenting an arbitrary series of rules, the intention was to show how the guidelines follow di- rectly from the material presented in the preceding sections. There are a three appendices related to displaying standardised colours on a computer graphics screen, and a glossary of terms. All words in bold like this: technical term will be found in the glossary. University of Manchester 1 2 Seeing in colour 2.1 The electromagnetic spectrum Light is a form of energy. Visible light is only one form of electromagnetic en- ergy; other forms include infrared, ultraviolet, radio waves, microwaves and X rays. Electromagnetic energy can be considered to behave like a wave, and the factor that distinguishes these many types of energy is the wavelength. This is illustrated in Figure 1, which uses a logarithmic scale to encompass the wide range of wavelengths. Visible wavelengths are most conveniently measured in nanometres (nm, 10-9 m). Wavelength (m) 4 10 Long wave radio Ultra violet 2 10 300 VHF radio 0 Violet 10 400 Purple -2 Blue 10 500 Radar Green Yellow Microwaves -4 Orange 10 600 -6 Red 10 700 Visible light -8 10 800 X rays Infra red -10 10 -12 Gamma rays 10 Figure 1: The electromagnetic spectrum. University of Manchester 3 The ranges of wavelengths which broadly correspond to the colours of the spec- trum are shown in Table 1 and Plate 25. Range (nm) Colour 380 – 450 Violet 450 – 490 Blue 490 – 560 Green 560 – 590 Yellow 590 – 640 Orange 640 – 730 Red Table 1: Approximate wavelengths of spectral colours. White light consists of a mixture of all the visible wavelengths, which was first described by Sir Isaac Newton in the Optiks (1704). He found that white light could be split by a glass prism into a rainbow of colours, and combined again to form white. He also found that individual colours could not be further subdi- vided. 2.2 Spectra It could be imagined that measuring the intensity of light emitted or reflected from an object at all visible wavelengths would completely define its colour. Such a measurement will indeed define those optical properties which influence the observed colour. An example of such a measurement is given in Figure 2. There is no easy way to predict the visual appearance from this information. The domi- nant wavelength can readily be identified, but what of the contribution from the rest of the spectrum? What will the overall colour be? 0.2 0.1 Relative reflectance 0.0 400 500 600 700 Wavelength (nm) Figure 2: Typical reflectance spectrum of grass. 4 Computer Graphics and Visualisation Seeing in colour The range of wavelengths which are visible varies between species; some snakes can see portions of the infrared, and many insects can see into the ultraviolet. When white light is split by a prism, the wavelengths are separated, but it is the eye and brain that produce the sensation we call colour. 2.3 The eye The function of the eye is to capture a visual image, and convert the light energy into nerve impulses to be interpreted by the brain. The overall structure of the human eye, shown in Figure 3, is analogous to a camera. Table 2 compares the functions of the eye and a video camera. Conjunctiva Zonula Retina Aqueous humour Fovea Lens Pupil Cornea Iris Optic nerve Figure 3: The human eye. University of Manchester 5 Eye Video Camera Function cornea and primary focusing lens bend light to form image aqueous humour lens secondary lens fine focusing iris aperture depth of field & light level adjust zonula auto focus move lens conjunctiva clear daylight filter