Bellingham, Washington USA
Library of Congress Cataloging-in-Publication Data Kang, Henry R.. Computational color technology / Henry R. Kang. p. cm. Includes bibliographical references and index.
ISBN: 0-8194-6119-9 (alk. Paper) 1. Image Processing--Digital techniques. 2. Color. I. Title. TA1637.K358 2006 621.36'7--dc22 2006042243 Published by SPIE—The International Society for Optical Engineering P.O. Box 10 Bellingham, Washington 98227-0010 USA Phone: +1 360 676 3290 Fax: +1 360 647 1445 Email:
[email protected] Web: http://spie.org Copyright © 2006 The Society of Photo-Optical Instrumentation Engineers All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means without written permission of the publisher. The content of this book reflects the work and thought of the author(s). Every effort has been made to publish reliable and accurate information herein, but the publisher is not responsible for the validity of the information or for any outcomes resulting from reliance thereon. Printed in the United States of America.
Contents Preface
xv
Acknowledgments
xix
1 Tristimulus Specification
1
1.1 1.2 1.3 1.4 1.5
Definitions of CIE Tristimulus Values Vector-Space Representations of Tristimulus Values Object Spectrum Color-Matching Functions CIE Standard Illuminants 1.5.1 Standard viewing conditions 1.6 Effect of Illuminant 1.7 Stimulus Function 1.8 Perceived Object 1.9 Remarks References 2 Color Principles and Properties
1 3 5 5 10 13 14 15 15 16 16 17
2.1 Visual Sensitivity and Color-Matching Functions 2.2 Identity Property 2.3 Color Match 2.4 Transitivity Law 2.5 Proportionality Law 2.6 Additivity Law 2.7 Dependence of Color-Matching Functions on Choice of Primaries 2.8 Transformation of Primaries 2.9 Invariant of Matrix A (Transformation of Tristimulus Vectors) 2.10 Constraints on the Image Reproduction References 3 Metamerism
17 19 20 21 21 21 22 22 23 23 24 27
3.1 Types of Metameric Matching 3.1.1 Metameric illuminants 3.1.2 Metameric object spectra 3.1.3 Metameric stimulus functions 3.2 Matrix R Theory v
27 28 28 28 29
vi
Computational Color Technology
3.3 Properties of Matrix R 3.4 Metamers Under Different Illuminants 3.5 Metameric Correction 3.5.1 Additive correction 3.5.2 Multiplicative correction 3.5.3 Spectral correction 3.6 Indices of Metamerism 3.6.1 Index of metamerism potential References 4 Chromatic Adaptation 4.1 Von Kries Hypothesis 4.2 Helson-Judd-Warren Transform 4.3 Nayatani Model 4.4 Bartleson Transform 4.5 Fairchild Model 4.6 Hunt Model 4.7 BFD Transform 4.8 Guth Model 4.9 Retinex Theory 4.10 Remarks References 5 CIE Color Spaces 5.1 CIE 1931 Chromaticity Coordinates 5.1.1 Color gamut boundary of CIEXYZ 5.2 CIELUV Space 5.2.1 Color gamut boundary of CIELUV 5.3 CIELAB Space 5.3.1 CIELAB to CIEXYZ transform 5.3.2 Color gamut boundary of CIELAB 5.4 Modifications 5.5 CIE Color Appearance Model 5.6 S-CIELAB References 6 RGB Color Spaces 6.1 RGB Primaries 6.2 Transformation of RGB Primaries 6.2.1 Conversion formula 6.2.2 Conversion formula between RGB primaries 6.3 RGB Color-Encoding Standards 6.3.1 Viewing conditions
31 37 39 39 39 39 39 40 40 43 43 46 47 48 49 51 52 53 53 54 54 57 57 57 59 60 60 62 62 65 69 73 73 77 77 80 81 83 84 84
Contents
6.3.2 Digital representation 6.3.3 Optical-electronic transfer function 6.4 Conversion Mechanism 6.5 Comparisons of RGB Primaries and Encoding Standards 6.6 Remarks References 7 Device-Dependent Color Spaces 7.1 7.2 7.3 7.4 7.5 7.6
Red-Green-Blue (RGB) Color Space Hue-Saturation-Value (HSV) Space Hue-Lightness-Saturation (HLS) Space Lightness-Saturation-Hue (LEF) Space Cyan-Magenta-Yellow (CMY) Color Space Ideal Block-Dye Model 7.6.1 Ideal color conversion 7.7 Color Gamut Boundary of Block Dyes 7.7.1 Ideal primary colors of block dyes 7.7.2 Additive color mixing of block dyes 7.7.3 Subtractive color mixing of block dyes 7.8 Color Gamut Boundary of Imaging Devices 7.8.1 Test target of color gamut 7.8.2 Device gamut model and interpolation method 7.9 Color Gamut Mapping 7.9.1 Color-mapping algorithm 7.9.2 Directional strategy 7.9.3 Criteria of gamut mapping 7.10 CIE Guidelines for Color Gamut Mapping References 8 Regression 8.1 Regression Method 8.2 Forward Color Transformation 8.3 Inverse Color Transformation 8.4 Extension to Spectral Data 8.5 Results of Forward Regression 8.6 Results of Inverse Regression 8.7 Remarks References 9 Three-Dimensional Lookup Table with Interpolation 9.1 Structure of 3D Lookup Table 9.1.1 Packing 9.1.2 Extraction 9.1.3 Interpolation
vii
84 85 86 86 99 99 103 103 104 105 106 107 108 108 111 112 115 115 120 122 122 124 125 126 129 129 130 135 135 139 141 142 143 146 148 149 151 151 151 152 153
viii
Computational Color Technology
9.2 Geometric Interpolations 9.2.1 Bilinear interpolation 9.2.2 Trilinear interpolation 9.2.3 Prism interpolation 9.2.4 Pyramid interpolation 9.2.5 Tetrahedral interpolation 9.2.6 Derivatives and extensions 9.3 Cellular Regression 9.4 Nonuniform Lookup Table 9.5 Inverse Color Transform 9.6 Sequential Linear Interpolation 9.7 Results of Forward 3D Interpolation 9.8 Results of Inverse 3D Interpolation 9.9 Remarks References 10 Metameric Decomposition and Reconstruction 10.1 Metameric Spectrum Decomposition 10.2 Metameric Spectrum Reconstruction 10.2.1 Spectrum reconstruction from the fundamental and metameric black 10.2.2 Spectrum reconstruction from tristimulus values 10.2.3 Error measures 10.3 Results of Spectrum Reconstruction 10.3.1 Results from average fundamental and metameric black 10.3.2 Results of spectrum reconstruction from tristimulus values 10.4 Application 10.5 Remarks References 11 Spectrum Decomposition and Reconstruction 11.1 11.2
11.3 11.4 11.5 11.6 11.7 11.8 11.9
Spectrum Reconstruction General Inverse Method 11.2.1 Spectrum reconstruction via orthogonal projection 11.2.2 Spectrum reconstruction via smoothing inverse 11.2.3 Spectrum reconstruction via Wiener inverse Spectrum Decomposition and Reconstruction Methods Principal Component Analysis Basis Vectors Spectrum Reconstruction from the Input Spectrum Spectrum Reconstruction from Tristimulus Values Error Metrics Results and Discussions 11.9.1 Spectrum reconstruction from the object spectrum
153 154 155 157 159 161 163 164 165 166 168 170 177 180 180 183 183 189 189 191 194 194 194 199 200 201 202 203 203 204 205 205 209 212 212 214 220 223 224 224 225
Contents
11.9.2 Spectrum reconstruction from the tristimulus values 11.10 Applications References 12 Computational Color Constancy 12.1
Image Irradiance Model 12.1.1 Reflection phenomenon 12.2 Finite-Dimensional Linear Models 12.3 Three-Two Constraint 12.4 Three-Three Constraint 12.4.1 Gray world assumption 12.4.2 Sällströn-Buchsbaum model 12.4.3 Dichromatic reflection model 12.4.4 Estimation of illumination 12.4.5 Other dichromatic models 12.4.6 Volumetric model 12.5 Gamut-Mapping Approach 12.6 Lightness/Retinex Model 12.7 General Linear Transform 12.8 Spectral Sharpening 12.8.1 Sensor-based sharpening 12.8.2 Data-based sharpening 12.8.3 Perfect sharpening 12.8.4 Diagonal transform of the 3-2 world 12.9 Von Kries Color Prediction 12.10 Remarks References 13 White-Point Conversion 13.1 White-Point Conversion via RGB Space 13.2 White-Point Conversion via Tristimulus Ratios of Illuminants 13.3 White-Point Conversion via Difference in Illuminants 13.4 White-Point Conversion via Polynomial Regression 13.5 Remarks References 14 Multispectral Imaging 14.1 Multispectral Irradiance Model 14.2 Sensitivity and Uniformity of a Digital Camera 14.2.1 Spatial uniformity of a digital camera 14.2.2 Spectral sensitivity of a digital camera 14.3 Spectral Transmittance of Filters 14.3.1 Design of optimal filters
ix
228 229 230 233 233 234 236 240 242 243 244 245 246 250 253 255 256 258 259 260 261 264 266 266 268 268 273 273 283 286 295 298 299 301 303 305 306 308 308 309
x
Computational Color Technology
14.3.2 Equal-spacing filter set 14.3.3 Selection of optimal filters 14.4 Spectral Radiance of Illuminant ´ 14.5 Determination of Matrix Æ 14.6 Spectral Reconstruction 14.6.1 Tristimulus values using PCA 14.6.2 Pseudo-inverse estimation 14.6.3 Smoothing inverse estimation 14.6.4 Wiener estimation 14.7 Multispectral Image Representation 14.8 Multispectral Image Quality References 15 Densitometry 15.1
Densitometer 15.1.1 Precision of density measurements 15.1.2 Applications 15.2 Beer-Lambert-Bouguer Law 15.3 Proportionality 15.3.1 Density ratio measurement 15.4 Additivity 15.5 Proportionality and Additivity Failures 15.5.1 Filter bandwidth 15.5.2 First-surface reflection 15.5.3 Multiple internal reflections 15.5.4 Opacity 15.5.5 Halftone pattern 15.5.6 Tone characteristics of commercial printers 15.6 Empirical Proportionality Correction 15.7 Empirical Additivity Correction 15.8 Density-Masking Equation 15.9 Device-Masking Equation 15.9.1 Single-step conversion of the device-masking equation 15.9.2 Multistep conversion of the device-masking equation 15.9.3 Intuitive approach 15.10 Performance of the Device-Masking Equation 15.11 Gray Balancing 15.12 Gray-Component Replacement 15.13 Digital Implementation 15.13.1 Results of the integer masking equation 15.14 Remarks References
310 311 311 312 314 314 315 316 316 317 319 320 325 326 327 329 331 332 334 334 335 335 335 335 335 336 336 338 341 342 343 344 345 346 347 347 349 350 351 353 354
Contents
16 Kubelka-Munk Theory 16.1 16.2 16.3 16.4 16.5 16.6 16.7
Two-Constant Kubelka-Munk Theory Single-Constant Kubelka-Munk theory Determination of the Single Constant Derivation of Saunderson’s Correction Generalized Kubelka-Munk Model Cellular Extension of the Kubelka-Munk Model Applications 16.7.1 Applications to multispectral imaging References
17 Light-Reflection Model 17.1 Three-Primary Neugebauer Equations 17.2 Demichel Dot-Overlap Model 17.3 Simplifications 17.4 Four-Primary Neugebauer Equation 17.5 Cellular Extension of the Neugebauer Equations 17.6 Spectral Extension of the Neugebauer Equations References 18 Halftone Printing Models 18.1 Murray-Davies Equation 18.1.1 Spectral extension of the Murray-Davies equation 18.1.2 Expanded Murray-Davies model 18.2 Yule-Nielsen Model 18.2.1 Spectral extension of Yule-Nielsen model 18.3 Area Coverage-Density Relationship 18.4 Clapper-Yule Model 18.4.1 Spectral extension of the Clapper-Yule model 18.5 Hybrid Approaches 18.6 Cellular Extension of Color-Mixing Models 18.7 Dot Gain 18.8 Comparisons of Halftone Models References 19 Issues of Digital Color Imaging 19.1 Human Visual Model 19.1.1 Contrast sensitivity function 19.1.2 Color visual model 19.2 Color Appearance Model 19.3 Integrated Spatial-Appearance Model 19.4 Image Quality 19.5 Imaging Technology
xi
355 356 357 360 360 362 365 365 366 366 369 369 370 371 373 375 376 382 385 385 387 388 388 390 392 393 394 394 395 396 400 402 407 407 409 410 412 413 413 415
xii
Computational Color Technology
19.5.1 Device characteristics 19.5.2 Measurement-based tone correction 19.5.3 Tone level 19.6 Device-Independent Color Imaging 19.7 Device Characterization 19.8 Color Spaces and Transforms 19.8.1 Color-mixing models 19.9 Spectral Reproduction 19.10 Color Gamut Mapping 19.11 Color Measurement 19.12 Color-Imaging Process 19.12.1 Performance 19.12.2 Cost 19.13 Color Architecture 19.14 Transformations between sRGB and Internet FAX Color Standard 19.15 Modular Implementation 19.15.1 SRGB-to-CIEXYZ transformation 19.15.2 Device/RGB-to-CIEXYZ transformation 19.15.3 CIEXYZ-to-CIELAB transformation 19.15.4 CIELAB-to-CIEXYZ transformation 19.15.5 CIEXYZ-to-colorimetric RGB transformation 19.15.6 CIEXYZ-to-Device/RGB transformation 19.16 Results and Discussion 19.16.1 SRGB-to-CIEXYZ transformation 19.16.2 Device/RGB-to-CIEXYZ transformation 19.16.3 CIEXYZ-to-CIELAB transformation 19.16.4 CIELAB-to-CIEXYZ transformation 19.16.5 CIEXYZ-to-sRGB transformation 19.16.6 Combined computational error 19.17 Remarks References
415 416 417 418 421 423 424 425 425 426 426 427 428 428 430 434 434 436 436 437 438 438 439 439 440 440 441 441 442 443 444
Appendices A1 Conversion Matrices
449
A2 Conversion Matrices from RGB to ITU-R.BT.709/RGB
471
A3 Conversion Matrices from RGB to ROMM/RGB
475
Contents
A4 RGB Color-Encoding Standards A4.1 SMPTE-C/RGB A4.2 European TV Standard (EBU) A4.3 American TV YIQ Standard A4.4 PhotoYCC A4.5 SRGB Encoding Standards A4.6 E-sRGB Encoding Standard A4.7 Kodak ROMM/RGB Encoding Standard A4.8 Kodak RIMM/RGB References A5 Matrix Inversion A5.1 Triangularization A5.2 Back Substitution References
xiii
479 479 480 481 482 483 484 485 486 487 489 489 491 492
A6 Color Errors of Reconstructed CRI Spectra with Respect to Measured Values 493 A7 Color Errors of Reconstructed CRI Spectra with Respect to Measured Values Using Tristimulus Inputs 497 A8 White-Point Conversion Accuracies Using Polynomial Regression 499 A9 Digital Implementation of the Masking Equation
503
A9.1 Integer Implementation of Forward Conversion A9.2 Integer Implementation of Inverse Conversion
503 506
Index
509
Preface Recent developments in color imaging have evolved from the classical broadband description to a spectral representation. Color reproductions were attempted with spectral matching, and image capture via digital camera has extended to multispectral recording. These topics have appeared in a couple of books and scattered across several digital imaging journals. However, there is no integrated view or consistent representation of spectral color imaging. This book is intended to fill that void and bridge the gap between color science and computational color technology, putting color adaptation, color constancy, color transforms, color display, and color rendition in the domain of vector-matrix representations and theories. The aim of this book is to deal with color digital images in the spectral level using vector-matrix representations so that one can process digital color images by employing linear algebra and matrix theory. This is the onset of a new era of color reproduction. Spectral reconstruction provides the means for the highest level of color matching. As pointed out by Dr. R. W. G. Hunt, spectral color matching gives color fidelity under any viewing conditions. However, current color technology and mathematical tools are still insufficient for giving accurate spectral reconstructions (and may never be sufficient because of device variations and color measurement uncertainties). Nevertheless, this book provides the fundamental color principles and mathematical tools to prepare one for this new era and for subsequent applications in multispectral imaging, medical imaging, remote sensing, and machine vision. The intent is to bridge color science, mathematical formulations, psychophysical phenomena, physical models, and practical implementations all in one work. The contents of this book are primarily aimed at digital color imaging professionals for research and development purposes. This book can also be used as a textbook for undergraduate and graduate students in digital imaging, printing, and graphic arts. The book is organized into five parts. The first part, Chapters 1–7, is devoted to the fundamentals of color science such as the CIE tristimulus specifications, principles of color matching, metamerism, chromatic adaptation, and color spaces. These topics are presented in vector-matrix forms, giving a new flavor to old material and, in many cases, revealing new perspectives and insights. This is because the representation of the spectral sensitivity of human vision and related visual phenomena in vector-matrix form provide the foundation for computational color technology. The vector-space representation makes possible the use of the well-developed fields of linear algebra and matrix theory. Chapter 1 gives the definitions of CIE tristimulus values. Each component, such as color matching function, illuminant, and object spectrum, is given in vectorxv
xvi
Computational Color Technology
matrix notation under several different vector associations of components. This sets the stage for subsequent computations. Chapter 2 presents the fundamental principles governing color matching such as the identity, proportionality, and additivity laws. Based on these laws, the conversion of primaries is simply a linear transform. Chapter 3 discusses the metameric matching from the perspective of the vector-matrix representation, which allows the derivation of matrix R, the orthogonal projection of the tristimulus color space. The properties of matrix R are discussed in detail. Several levels of the metameric matching are discussed and metameric corrections are provided. Chapter 4 presents various models of the chromatic adaptation from the fundamental von Kries hypothesis to complex retinex theory. Chapter 5 presents CIE color spaces and their relationships. Color gamut boundaries for CIELAB are derived, and a spatial extension of CIELAB is given. The most recent color appearance model, CIE CAM2000, is also included. Chapter 6 gives a comprehensive collection of RGB primaries and encoding standards and derives the conversion formula between RGB primaries. These standards are compared and their advantages and disadvantages are discussed. Chapter 7 presents the device-dependent color spaces based on the ideal block dye model. The methods of obtaining the color gamut boundary of imaging devices and color gamut mapping are provided. They are the essential parts of color rendering at the system level. The second part of the book, Chapters 8–11, provides tools for color transformation and spectrum reconstruction. These empirical methods are developed purely on mathematical grounds and are formulated in the vector-matrix forms to enable matrix computations. In Chapter 8, the least-square minimization regression technique is given, and the vector-matrix formulation of the forward and inverse color transformations are derived and extended to the spectral domain. To test the quality of the regression technique, real-world color conversion data are used. Chapter 9 focuses on lookup-table techniques, and the structure of the 3D lookup table and geometric interpolations are discussed in detail. Several extensions and improvements are also provided, and real data are used to test the value of the 3DLUT technique. Chapter 10 shows the simplest spectrum reconstruction method by using the metameric decomposition of the matrix R theory. Two methods are developed for spectrum reconstruction; one using the sum of metameric black and fundamental spectra, and the other using tristimulus values without spectral information. The methods are tested by using CIE illuminants and spectra of the “Color Rendering Index” (CRI). Chapter 11 provides several sophisticated methods of the spectrum reconstruction, including the general inverse methods such as the smoothing inverse and Wiener inverse and the principal component analysis. Again, these methods are tested by using CRI spectra because spectrum reconstruction is the foundation for color spectral imaging, utilizing the vector-matrix representations. The third part, Chapters 12–14, shows applications of spectral reconstruction to color science and technology, such as color constancy, white-point conversion, and multispectral imaging. This part deals with the psychophysical aspect of the surface reflection, considering signals reflected into the human visual pathway from
Preface
xvii
the object surface under certain kinds of illumination. We discuss the topics of surface illumination and reflection, including metameric black, color constancy, the finite-dimensional linear model, white-point conversion (illuminant mapping), and multispectral image processing. These methods can be used to estimate (or recover) surface and illuminant spectra, and can be applied to remote sensing and machine vision. Chapter 12 discusses computational color constancy, which estimates the surface spectrum and illumination simultaneously. The image irradiance model and finite-dimensional linear models for approximating the color constancy phenomenon are presented, and various constraints are imposed in order to solve the finitedimensional linear equations. Chapter 13 describes the application of fundamental color principles to white-point conversion. Several methods are developed and the conversion accuracy is compared. Chapter 14 discusses the applications of spectrum reconstruction for multispectral imaging. Multispectral images are acquired by digital cameras, and the camera characteristics with respect to color image quality are discussed. For device compatibility and cross-media rendering, a proposed multispectral image representation is given. Finally, the multispectral image quality is discussed. The fourth part, Chapters 15–18, deals with the physical model accounting for the intrinsic physical and chemical interactions occurring in the colorants and substrates. This is mainly applied to the printing process, halftone printing in particular. In this section, physical models of the Neugebauer equations, the Murray-Davies equation, the Yule-Nielsen model, the Clapper-Yule model, the Beer-Lambert-Bouguer law, the density-masking equation, and the Kubelka-Munk theory are discussed. These equations are then reformulated in the vector-matrix notation and expanded in both spectral and spatial domains with the help of the vector-matrix theory in order to derive new insights and develop new ways of employing these equations. It is shown that this spectral extension has applications in the spectral color reproduction that greatly improve the color image quality. Chapter 15 describes densitometry beginning with the Beer-Lambert-Bouguer law and its proportionality and additivity failures. Empirical corrections for proportionality and additivity failures are then developed. The density-masking equation is then presented and extended to the device-masking equation, which can be applied to gray balancing, gray component replacement, and maximum ink loading. Chapter 16 reformulates the Kubelka-Munk theory in the vector-matrix form. A general Kubelka-Munk model is presented using four fluxes that can be reduced to other halftone printing models. Chapter 17 presents the Neugebauer equations, extending them to spectral domain by using the vector-matrix notation. This notation provides the means to finding the inverse Neugebauer equations and to obtaining the amounts of primary inks. Finally, Chapter 18 contains various halftone printing models such as the Murray-Davies equation, the Yule-Nielsen model, and the Clapper-Yule model. Chapter 18 also discusses dot gain and describes a physical model that takes the optical and spatial components into account. The last part, Chapter 19, expresses my view of the salient issues in digital color imaging. Digital color imaging is an extremely complex phenomenon, in-
xviii
Computational Color Technology
volving the human visual model, the color appearance model, image quality, imaging technology, device characterization and calibration, color space transformation, color gamut mapping, and color measurement. The complexity can be reduced and image quality improved by a proper color architecture design. A simple transformation between sRGB and Internet FAX is used to illustrate this point. Henry R. Kang March 2006
Acknowledgments In the course of writing this book, I received assistance from many people in the collection of materials. I want to thank Addison-Wesley Longman, Inc., AGFA Educational Publishing, Commission Internationale de l’Éclairage (CIE), the International Society for Optical Engineering (SPIE), John Wiley & Sons, Inc., the Optical Society of America (OSA), and the Society for Imaging Science and Technology (IS&T) for allowing me to use their publications and figures. I am indebted to the staff of the Palos Verdes Public Library, Joyce Grauman in particular, for helping me to search, allocate, and acquire many books and papers that were essential in the writing of this book. I am also grateful to Prof. Brian V. Funt (Simon Fraser University), Dr. Jan Morovic (Hewlett-Packard Company, Spain), Prof. Joel Trussell (North Carolina State University), and Prof. Brian Wandell (Stanford University) for providing me with their publications so that I could gain a better understanding of the topics in their respective fields to hopefully present a correct and consistent view throughout this book. I want to thank the reviewers for their comments, suggestions, and corrections. Finally, I want to thank Cassie McClellan and Beth Huetter for obtaining permission from the original authors and publishers to use their figures, and Timothy Lamkins for managing the publication of this book.
xix
Chapter 1
Tristimulus Specification Colorimetry is the method of measuring and evaluating colors of objects. The term “color” is defined as an attribute of visual perception consisting of any combination of chromatic and achromatic contents. This visual attribute has three components: it can be described by chromatic color names such as red, pink, orange, yellow, brown, green, blue, purple, etc.; or by achromatic color names such as white, gray, black, etc.; and qualified by bright, dim, light, dark, etc., or by combinations of such names.1 The Commission Internationale de l’Éclairage (CIE) was the driving force behind the development of colorimetry. This international organization is responsible for defining and specifying colorimetry via a series of CIE Publications. The foundation of colorimetry is the human visual color sensibility, illuminant sources, and spectral measurements that are described in the context of a color space. The backbone of colorimetry is the tristimulus specification.
1.1 Definitions of CIE Tristimulus Values The trichromatic nature of human color vision is mathematically formulated by CIE to give tristmulus values X, Y , and Z. The CIE method of colorimetric specification is based on the rules of color matching by additive color mixture. The principles of additive color mixing are known as the Grassmann’s laws of color mixtures:2 (1) Three independent variables are necessary and sufficient for specifying a color mixture. (2) Stimuli, evoking the same color appearance, produce identical results in additive color mixtures, regardless of their spectral compositions. (3) If one component of a color mixture changes, the color of the mixture changes in a corresponding manner. The first law establishes what is called “trichromacy”—that all colors can be matched by a suitable mixture of three different stimuli under the constraint that none of them may be matched in color by any mixture of the others. If one stimulus is matched by the other two, then the stimulus is no longer independent from the other two. The second law means that stimuli with different spectral radiance distributions may provide the same color match. Such physically dissimilar stimuli that elicit the same color matches are called “metamers” and the phenomenon is 1
2
Computational Color Technology
said to be “metamerism” because an identical color match may consist of different mixture components. The third law establishes the proportionality and additivity of the stimulus metric for color mixing:3 (1) Symmetry law—If color stimulus ηA matches color stimulus ηB , then color stimulus ηB matches color stimulus ηA . (2) Transitivity law—If ηA matches ηB and ηB matches ηC , then ηA matches ηC . (3) Proportionality law—If ηA matches ηB , then αηA matches αηB , where α is any positive factor by which the radiant power of the color stimulus is increased or reduced, while its relative spectral distribution is kept the same. (4) Additivity law—If ηA matches ηB , ηC matches ηD , and the additive mixture (ηA + ηC ) matches the additive mixture (ηB + ηD ), then the additive mixture (ηA + ηD ) matches the additive mixture (ηB + ηC ). The CIE tristimulus specification or CIEXYZ is built on the Grassmann’s laws using the spectral information of the object, illuminant, and color-matching functions. The specification is defined in CIE Publication 15.2.4 Mathematically, CIEXYZ is the integration of the product of three spectra given by the object spectrum S(λ), the spectral power distribution (SPD) of an illuminant E(λ), and the colormatching functions (CMFs) A(λ) = {x(λ), ¯ y(λ), ¯ z¯ (λ)}, where λ is the wavelength. The object spectrum S(λ) can be obtained in reflectance, transmittance, or radiance. X = k x(λ)E(λ)S(λ) ¯ dλ ∼ x(λ ¯ i )E(λi )S(λi )λ, (1.1a) =k (1.1b) Y = k y(λ)E(λ)S(λ) ¯ dλ ∼ y(λ ¯ i )E(λi )S(λi )λ, =k (1.1c) Z = k z¯ (λ)E(λ)S(λ) dλ ∼ z¯ (λi )E(λi )S(λi )λ, =k k = 100 y(λ)E(λ) ¯ dλ ∼ y(λ ¯ i )E(λi )λ . = 100
(1.1d)
The scalar k is a normalizing constant. For absolute tristimulus values, k is set at the maximum spectral luminous efficacy of 683 lumens/watt and the color stimulus function η(λ) = E(λ)S(λ) must be in the spectral concentration unit of the radiometric quantity (watt meter−2 steradian−1 nanometer−1 ). Usually, k is chosen to give a value of 100 for luminance Y of samples with a unit reflectance (transmittance or radiance) spectrum as shown in Eq. (1.1d). Equation (1.1) also provides the approximation of tristimulus values as summations if the sampling rate is high enough to give accurate results. For an equal interval sampling, λi = λ0 + (i − 1)λ,
i = 1, 2, 3, . . . , n.
(1.1e)
Tristimulus Specification
3
and λ = λt /(n − 1), where λt is the total range of the spectrum and λ0 is the short wavelength end of the range. CIE recommends a sampling interval of λ = 5 nanometers (nm) over the wavelength range from 380 to 780 nm. In this case, λ0 = 380 nm and λt = 400 nm, and we have n = 81 samples. However, many commercial instruments use a λ = 10 nm interval in the range of 400 to 700 nm with a sample number n = 31. The summations in Eq. (1.1) sum all sample points. It is obvious that all spectra must be sampled at the same rate in the same range. By making this approximation, the integral for tristimulus values becomes a sum of products in an infinite-dimensional vector space. The sum has the form of an inner (or dot) product of three infinite-dimensional vectors. The approximation from integration to summation affects the computational accuracy, which is dependent on the sampling rate or the interval size. Trussell performed studies of the accuracy with respect to the sampling rate.5,6 Using the 2-nm interval size as the standard for comparison, he computed the color differences of natural objects and paint samples sampled at 4-nm, 6-nm, 8-nm, and 10-nm intervals under three different illuminants: A, D65 , and F2 (see Figs. 1.5 and 1.6 for SPDs of these illuminants). Generally, the color difference increases with increasing interval size. Under illuminants A and D65 , all tested samples have an average color difference of less than 0.3 units and a maximum difference of less than 1.3 units for all sampling rates. Under F2 , the average and maximum color differences can go as high as 13 and 31 units, respectively. He concluded that most colored objects are sufficiently bandlimited to allow sampling at 10 nm for illuminants with slow-varying spectra. The problem lies with a fluorescent illuminant such as F2 , having spikes in the spectrum (see Fig. 1.6). This study assured that the approximation given in Eq. (1.1) is valid and the common practice of using a 10-nm interval is acceptable if fluorescent illuminants are not used. Figure 1.1 gives a graphic illustration using a λ = 10 nm in the range of 400 to 700 nm; the products are scaled by the scalar k (not shown in the figure) to give the final tristimulus values. The 3D nature of color suggests plotting the value of each tristimulus component along orthogonal axes. The result is called tristimulus space, which is a visually nonuniform color space. Often, the tristimulus space is projected onto two dimensions by normalizing each component with the sum of tristimulus values. x = X/(X + Y + Z),
y = Y/(X + Y + Z),
z = Z/(X + Y + Z),
(1.2)
where x, y, and z are called the chromaticity coordinates. Tristimulus values are the nucleus of the CIE color specification. All other CIE color specifications such as CIELUV and CIELAB are derived from tristimulus values.
1.2 Vector-Space Representations of Tristimulus Values The approximation from integration to summation, as given in Eqs. (1.1), enables us to express the tristimulus values and the spectral sensitivity of human vision in
Figure 1.1 Graphic illustration of the CIE tristimulus computation.
4 Computational Color Technology
Tristimulus Specification
5
a concise representation of the vector-matrix form as given in Eq. (1.3), where the superscript T denotes the transposition of a matrix or vector. Υ = k(AT E)S = kÆT S,
(1.3a)
Υ = kAT (ES) = kAT η,
(1.3b)
Υ = k(A S)E = kQ E,
(1.3c)
T
T
k = 100/(y¯ E). T
(1.3d)
The symbol Æ represents the product of the color-matching matrix A and the illuminant matrix E. Equations (1.3a)–(1.3c) are exactly the same, only expressed in different associative relationships with minor differences in vector-matrix forms. In this book, we adopt to the convention that matrices and vectors are denoted by boldface italic capital letters (or symbols) and elements, which are scalars, are denoted as the corresponding lowercase italic letter. Vectors are oriented as a vertical column and viewed as a one-column matrix (or diagonal matrix whenever applicable). For historic reasons, however, there are some exceptions; for example, capital letters X, Y , and Z are used for the elements of the vector Υ to denote the tristimulus values in the CIE system, and vectors of CMF are represented as the boldface lowercase italic letters, x, ¯ y, ¯ and z¯ .
1.3 Object Spectrum The object spectrum S(λ) can readily be measured via various optical instruments such as spectrophotometer or spectroradiometer, whereas the object representation S is a vector of n elements obtained by sampling the object spectrum S(λ) at the same rate as the illuminant and CMF. Usually, the interval between samples is constant and n is the number of sample points; for example, n = 31 if the range is from 400 to 700 nm with a 10-nm interval. S = [s(λ1 ) s(λ2 ) s(λ3 ) · · · s(λn )]T = [s1 s2 s3 · · · sn ]T .
(1.4)
For the purpose of simplifying the notation, we abbreviate s(λi ) as si ; that is, an element and a scalar of the vector.
1.4 Color-Matching Functions In addition to the spectrum of an object, the CIE color specifications require the color-matching functions and the spectrum of an illuminant. The color-matching functions, also referred to as CIE standard observers, are intended to represent an average observer of normal color vision. They are determined experimentally. The experiment involves a test light incident on half of a bipartite white screen. An observer attempts to perceptually match hue, brightness, and saturation of the test ¯ light by adjusting three additive r¯ (λ), g(λ), ¯ and b(λ) primaries shining on the other
6
Computational Color Technology
half of the screen.7 According to the International Lighting Vocabulary, hue is an attribute of the visual sensation in which an area appears to be similar to one of the perceived colors: red, yellow, green, and blue, or to a combination of them; brightness is an attribute of a visual sensation in which an area appears to emit more or less light, and saturation is an attribute of a visual sensation in which the perceived color of an area appears to be more or less chromatic in proportion to its brightness.1 This visual color match can be expressed mathematically as ¯ h = r¯ R + gG ¯ + bB,
(1.5a)
where h is the color of the test light; R, G, and B correspond to the red, green, and blue matching lights (primaries), and r¯ , g, ¯ and b¯ are the relative amounts of the respective light. With this arrangement, some colors, like those in the blue-green region, cannot be matched by adding three primaries, and metamers of spectral colors are physically unattainable because they possess the highest purity, having the highest light intensity of a single wavelength. To get around this problem, one of the primaries is moved to the test side to lower the purity such that the trial side can match; for example, adding the red primary to the test light for matching a blue-green color. ¯ h + r¯ R = gG ¯ + bB.
(1.5b)
Mathematically, moving the red to the test light corresponds to subtracting it from the other two primaries. ¯ h = −¯r R + gG ¯ + bB.
(1.5c)
¯ Figure 1.2 depicts the CIE 1931 color-matching functions r¯ (λ), g(λ), ¯ and b(λ), showing negative values in some portions of the curves. The relationships between the r¯ , g, ¯ b¯ and x, ¯ y, ¯ z¯ are specified in the CIE Pub8 ¯ ¯ b(λ) are converted to chrolication No. 15. First, tristimulus values r¯ (λ), g(λ), maticity coordinates r(λ), g(λ), b(λ) using Eq. (1.6); the resulting curves are plotted in Fig. 1.3.
¯ i ) i = 1, 2, 3, . . . , n, ¯ i ) + b(λ r(λi ) = r¯ (λi )/ r¯ (λi ) + g(λ
¯ i ) i = 1, 2, 3, . . . , n, g(λi ) = g(λ ¯ i )/ r¯ (λi ) + g(λ ¯ i ) + b(λ
¯ i )/ r¯ (λi ) + g(λ ¯ i ) i = 1, 2, 3, . . . , n. ¯ i ) + b(λ b(λi ) = b(λ
(1.6a) (1.6b) (1.6c)
Then, the chromaticity coordinates r(λ), g(λ), b(λ) are converted to chromaticity coordinates x(λ), y(λ), z(λ) via Eq. (1.7).
Tristimulus Specification
7
Figure 1.2 CIE rgb spectral tristimulus values.3
x(λ) = [0.49000r(λ) + 0.31000g(λ) + 0.20000b(λ)]/ [0.66697r(λ) + 1.13240g(λ) + 1.20063b(λ)],
(1.7a)
y(λ) = [0.17697r(λ) + 0.81240g(λ) + 0.01063b(λ)]/ [0.66697r(λ) + 1.13240g(λ) + 1.20063b(λ)],
(1.7b)
z(λ) = [0.00000r(λ) + 0.01000g(λ) + 0.99000b(λ)]/ [0.66697r(λ) + 1.13240g(λ) + 1.20063b(λ)].
(1.7c)
Finally, chromaticity coordinates x(λ), y(λ), z(λ) are converted to the colormatching functions x(λ), ¯ y(λ), ¯ z¯ (λ) by scaling with the photopic luminous efficiency function V (λ) established by CIE in 1924 for photopic vision.9,10 The plot of the photopic luminous efficiency function with respect to wavelength gives a bell shape with a peak at 555 nm and a half width of about 150 nm, indicating that the visual system is more sensitive to wavelengths in the middle region of the
8
Computational Color Technology
Figure 1.3 The chromaticity coordinates of r(λ), g(λ), and b(λ).3
visible spectrum. This weighting converts radiometric quantities to photometric quantities.
and
x(λ) ¯ = [x(λ)/y(λ)]V (λ),
(1.8a)
y(λ) ¯ = V (λ),
(1.8b)
z¯ (λ) = [z(λ)/y(λ)]V (λ).
(1.8c)
This projective transformation makes all color-matching functions positive across the visible spectrum. CIE has recommended two standard observers: CIE 2◦ (1931) and CIE 10◦ (1964) observers. The CMFs of these two observers are depicted in ¯ y(λ), ¯ z¯ (λ) were derived from spectral trisFig. 1.4. CIE 1931 2◦ observer x(λ), ¯ timulus values r¯ (λ), g(λ), ¯ b(λ) using the spectral matching stimuli (R), (G), (B) at wavelengths 700.0, 546.1, and 435.8 nm, respectively, whereas CIE 1964 10◦ observer x¯ 10 (λ), y¯10 (λ), z¯ 10 (λ) were derived from spectral tristimulus values referring to matching stimuli (R10 ), (G10 ), (B10 ). These are stimuli specified in terms of wave numbers 15500, 19000, and 22500 cm−1 corresponding approximately to wavelengths 645.2, 526.3, and 444.4 nm, respectively.8
Tristimulus Specification
9
Figure 1.4 CIE 1931 2◦ and CIE 1964 10◦ observers.8
The matrix representation of color-matching functions A is a sampled standard observer with a size of n × 3, where the column number of three is due to the trichromatic nature of the human vision and the row number n is the number of sample points; for example, n = 31 if the range is from 400 nm to 700 nm with a 10-nm interval.
x(λ ¯ 1) x(λ ¯ 2) ¯ 3) A = x(λ ... ... x(λ ¯ n)
y(λ ¯ 1) y(λ ¯ 2) y(λ ¯ 3) ... ... y(λ ¯ n)
z¯ (λ1 ) x¯1 y¯1 z¯ 1 z¯ (λ2 ) x¯2 y¯2 z¯ 2 z¯ (λ3 ) = x¯3 y¯3 z¯ 3 . ... ... ... ... ... ... ... ... z¯ (λn ) x¯n y¯n z¯ n
(1.9)
¯ i ), and z¯ (λi ) are the values of the CMF sampled at the waveThe terms x(λ ¯ i ), y(λ ¯ i ) as x¯i , length λi . For the purpose of simplifying the notation, we abbreviate x(λ y(λ ¯ i ) as y¯i , and z¯ (λi ) as z¯ i .
10
Computational Color Technology
1.5 CIE Standard Illuminants Standard illuminant is another parameter in the CIE color specification. In this book, we use the symbol E(λ) for representing the spectrum of an illuminant and the vector E is a sampled spectral power distribution E(λ) of an illuminant. In Eq. (1.3), the vector E is represented as a diagonal matrix with a size of n × n,
0 e(λ1 ) 0 e(λ2 ) 0 E= 0 ... ... ... ... 0 0 0 e1 0 0 e2 0 0 e3 = 0 ... ... ... ... ... ... 0 0 0
0 0 e(λ3 ) ... ... 0 ... ... ... ... 0 ... ... ... ... ... ... ...
... ... 0 ... ... ...
... ... ... ... ... 0
0 0 0 ... ... e(λn )
... 0 ... 0 ... 0 . ... ... ... ... 0 en
(1.10)
Again, we abbreviate e(λi ) as ei . There are many standard illuminants such as Sources A, B, and C, and daylight D Illuminants. CIE Source A is a gas-filled tungsten lamp operating at a correlated color temperature of 2856 K. Sources B and C are derived from Source A by combining with a filter that is made from chemical solutions in optical cells. Different chemical solutions are used for Sources B and C. The CIE standards committee made a distinction between the terms illuminant and source. Source refers to a physical emitter of light, such as a lamp or the sun. Illuminant refers to a specific spectral power distribution, not necessarily provided directly by a source, and not necessarily realizable by a source. Therefore, CIE illuminant A is calculated in accordance with Planck’s radiation law.8 P e (λ, T ) = c1 λ−5 [exp(c2 /λT ) − 1]−1 W m−3 ,
(1.11)
where c1 = 3.7415 × 10−16 W m2 , c2 = 1.4388 × 10−2 mK, and the temperature T is set equal to 2856 K for the purpose of matching Source A. The relative SPD of CIE standard illuminant A has been calculated using Planck’s equation at a 1-nm interval between 300 to 830 nm and the standard recommends using linear interpolation for finer intervals. CIE D illuminants are the mathematical simulations of various phases of natural daylight. These illuminants are based on over 600 SPDs measured at different global locations and under various combinations of the irradiation from sun and sky. Judd, MacAdam, and Wyszecki analyzed these measurements of the combinations obtained in natural daylight and found that there is a simple relationship between the correlated color temperature (the color temperature of a blackbody radiator that has nearly the same color as the light source of
Tristimulus Specification
11
interest) of daylight and its relative SPD.11 Therefore, D illuminants are designated by the color temperature in hundreds Kevin; for example D50 is the illuminant at 5003 K. Figure 1.5 depicts the relative SPDs of several standard illuminants and Fig. 1.6 gives the relative SPDs of two fluorescent illuminants. SPDs of fluorescent illuminants have many spikes that lower the computational accuracy if the sampling interval is increased. Among them, the most frequently used illuminants are D50 , which is selected as the standard viewing illuminant for the graphic arts industry, and D65 (6504 K), which is the preferred illuminant for colorimetry when daylight is of interest. Based on the work of Judd et al.,11 CIE recommended that a phase of daylight other than the standard D65 be defined by three characteristic functions E0 (λ), E1 (λ), and E2 (λ) as E(λ) = E0 (λ) + m1 E1 (λ) + m2 E2 (λ),
(1.12a)
m1 = (−1.3515 − 1.7703x d + 5.9114y d )/md ,
(1.12b)
m2 = (0.0300 − 31.4424x d + 30.0717y d )/md ,
(1.12c)
md = 0.0241 + 0.2562x d − 0.7341y d .
(1.12d)
The component E0 (λ) is the mean function (or vector), E1 (λ) and E2 (λ) are characteristic vectors; they are plotted in Fig. 1.7. The multipliers m1 and m2 are related
Figure 1.5 Relative spectral power distributions of CIE standard illuminants.3
12
Computational Color Technology
Figure 1.6 Relative spectral power distributions of two fluorescent illuminants.8 Table 1.1 Values of multipliers for four daylight illuminants.
Tc
xd
yd
m1
m2
5000 5500 6500 7500
0.3457 0.3325 0.3128 0.2991
0.3587 0.3476 0.3292 0.3150
−1.040 −0.786 −0.296 0.144
0.367 −0.195 −0.688 −0.760
to chromaticity coordinates x d and y d of the illuminant as given in Eq. (1.12); the values for D50 , D55 , D65 , and D75 are computed and tabulated in Table 1.1. Equation (1.12) can be expressed in the matrix-vector form as given in Eq. (1.13). E = [ E 0 E 1 E 2 ][ 1 m1 m2 ]T or
e0 (λ1 ) e0 (λ2 ) E = e0 (λ3 ) ... ... e0 (λn )
e1 (λ1 ) e1 (λ2 ) e1 (λ3 ) ... ... e1 (λn )
e2 (λ1 ) e01 e2 (λ2 ) e 1 02 e2 (λ3 ) m = e03 ... 1 ... m ... 2 ... e2 (λn ) e0n
e11 e12 e13 ... ... e1n
(1.13a) e21 e22 1 e23 , (1.13b) m1 ... . . . m2 e2n
Tristimulus Specification
13
Figure 1.7 The characteristic vectors of the daylight illuminant.8
m1 = (md )−1 [ −1.3515 m2 = (md )−1 [ 0.0300 md = [ 0.0241
0.2562
−1.7703
5.9114 ][ 1 x d
y d ]T ,
(1.13c)
−31.4424
30.0717 ][ 1 x d
y d ]T ,
(1.13d)
−0.7341 ][ 1
xd
y d ]T .
(1.13e)
The vectors [E 0 , E 1 , E 2 ] sampled at a 10-nm interval from 300 to 830 nm are given in Table 1.2.8 For smaller sampling intervals, the CIE standard recommends that intermediate values be obtained by linear interpolation. This definition leads to the discrepancy between the computed illuminant D65 and original measured data. Moreover, the first derivative of the D65 SPD is not a smooth continuous function, which increases the computational uncertainty using interpolation. To minimize these problems, a new recommendation is proposed to interpolate the original 10-nm D65 data by a cubic spline function. An alternative and preferred approach is to interpolate the vectors [E 0 , E 1 , E 2 ], instead of D65 , using the cubic spline, and then calculate the D65 SPD or any other daylight SPD.12 1.5.1 Standard viewing conditions The reflection and transmission measurements depend in part on the geometry of illumination and viewing. CIE has recommended four conditions for opaque reflecting samples. These conditions are referred to as 45/0, 0/45, d/0, and 0/d.
14
Computational Color Technology Table 1.2 Values of three characteristic vectors sampled at a 10-nm interval.7
λ E0 (nm)
E1
E2
300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490
0.02 4.5 22.4 42.0 40.6 41.6 38.0 42.4 38.5 35 43.4 46.3 43.9 37.1 36.7 35.9 32.6 27.9 24.3 20.1
0.0 2.0 4.0 8.5 7.8 6.7 5.3 6.1 3.0 1.2 1.1 −0.5 −0.7 −1.2 −2.6 −2.9 −2.8 −2.6 −2.6 −1.8
0.04 6.0 29.6 55.3 57.3 61.8 61.5 68.8 63.4 65.8 94.8 104.8 105.9 96.8 113.9 125.6 125.5 121.3 121.3 113.5
|| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
λ E0 (nm)
E1
E2
500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690
16.2 13.2 8.6 6.1 4.2 1.9 0 −1.6 −3.5 −3.5 −5.8 −7.2 −8.6 −9.5 −10.9 −10.7 −12 −14 −13.6 −12
−1.5 −1.3 −1.2 −1 −0.5 −0.3 0 0.2 0.5 2.1 3.2 4.1 4.7 5.1 6.7 7.3 8.6 9.8 10.2 8.3
113.1 110.8 106.5 108.8 105.3 104.4 100 96 95.1 89.1 90.5 90.3 88.4 84 85.1 81.9 82.6 84.9 81.3 71.9
|| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
λ E0 (nm)
E1
E2
700 710 720 730 740 750 760 770 780 790 800 810 820 830
−13.3 −12.9 −10.6 −11.6 −12.2 −10.2 −7.8 −11.2 −10.4 −10.6 −9.7 −8.3 −9.3 −9.8
9.6 8.5 7 7.6 8 6.7 5.2 7.4 6.8 7.0 6.4 5.5 6.1 6.5
74.3 76.4 63.3 71.7 77 65.2 47.7 68.6 65.0 66.0 61.0 53.3 58.9 61.9
The 45/0 and 0/45 conditions have a reversed geometry relation. For 45/0 geometry, the sample is illuminated by one or more beams whose axes are at an angle of 45 ±5 deg from the normal to the sample. Viewing should be normal to the sample surface or within 10 deg of the normal. For 0/45 geometry, the sample is illuminated at normal position and viewed at 45 deg. Similarly, d/0 and 0/d have a reversed geometry relation. The designation d/0 is the abbreviation of diffuse/normal, a geometry in which the sample is illuminated with diffused light by an integrating sphere, and viewed through a port in the sphere at the normal or near-normal position. For 0/d geometry, the sample is illuminated at the normal position. The reflected flux is collected by an integrating sphere, and the viewing is directed toward an inner wall of the sphere. The integrating sphere may be of any size, provided that the total area of its ports does not exceed 10% of the inner surface area of the sphere to minimize the loss of reflected light.
1.6 Effect of Illuminant The associative relationship of ( ÆT = AT E) in Eq. (1.3a) defines the human visual subspace (HVSS) under an illuminant E or can be viewed as a weighted CMF, Æ, called the color object matching function by Worthey.13 It represents the effect of the illuminant to modify the human visual space by transforming the color-
Tristimulus Specification
15
matching matrix A. It gives a 3 × n matrix, containing the elements of the products of the illuminant and CMF. It has three rows because the CMF has only three components and n columns given by the number of samples in the visible region for illuminant as well as CMF.
x¯2 y¯2 z¯ 2
x¯1 Æ = A E = y¯1 z¯ 1 T
T
e1 x¯1 = e1 y¯1 e1 z¯ 1
e1 . . . x¯n 0 . . . y¯n 0 ... . . . z¯ n . . . 0
x¯3 y¯3 z¯ 3
e2 x¯2 e2 y¯2 e2 z¯ 2
e3 x¯3 e3 y¯3 e3 z¯ 3
... ... ...
0 0 e2 0 0 e3 ... ... ... ... 0 ...
... ... 0 ... ... ...
... 0 ... 0 ... 0 ... ... ... ... 0 en
en x¯n en y¯n . en z¯ n
(1.14)
1.7 Stimulus Function For the associative relationship of (η = ES) in Eq. (1.3b), we obtain a vector η , a color stimulus function or color signal received by the eyes. It is the product of the object and illuminant spectra, having n elements.
e1 0 η = ES = 0 ... ... 0
0 0 e2 0 0 e3 ... ... ... ... 0 0
... ... 0 ... ... ...
... ... ... ... ... ...
... 0 s1 e1 s1 . . . 0 s2 e2 s2 . . . 0 s3 = e3 s3 . ... ...... ... ... ...... ... 0 en sn en sn
(1.15)
1.8 Perceived Object The expression (QT = A T S) in Eq. (1.3c) does not contain the illuminant; it is an object spectrum weighted by color-matching functions. s1 s . . . x¯n 2 . . . y¯n .s.3. . . . z¯ n . . . sn s3 x¯3 . . . sn x¯n s3 y¯3 . . . sn y¯n . s3 z¯ 3 . . . sn z¯ n
x¯1 Q = A S = y¯1 z¯ 1 T
T
s1 x¯1 = s1 y¯1 s1 z¯ 1
x¯2 y¯2 z¯ 2
x¯3 y¯3 z¯ 3
s2 x¯2 s2 y¯2 s2 z¯ 2
(1.16)
16
Computational Color Technology
1.9 Remarks Equation (1.3) shows that the tristimulus values are a linear combination of the column vectors in A. The matrix A has three independent columns (the color-mixing functions); therefore, it has a rank of three, consisting of a 3D color-stimulus space. Any function that is a linear combination of the three color-mixing functions is within the tristimulus space.
References 1. CIE, International Lighting Vocabulary, CIE Publication No. 17.4, Vienna (1987). 2. C. J. Bartleson, Colorimetry, Optical Radiation Measurements: Color Measurement, F. Grum and C. J. Bartleson (Eds.), Academic Press, New York, Vol. 2, pp. 33–148 (1980). 3. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, p. 118 (1982). 4. CIE, Recommendations on uniform color spaces, color-difference equations and psychonetric color terms, Supplement No. 2 to Colorimetry, Publication No. 15, Bureau Central de la CIE, Paris (1978). 5. H. J. Trussell and M. S. Kulkarni, Sampling and processing of color signals, IEEE Trans. Image Proc. 5, pp. 677–681 (1996). 6. H. J. Trussell, A review of sampling effects in the processing of color signals, IS&T and SID’s 2nd Color Imag. Conf., pp. 26–29 (1994). 7. F. W. Billmeyer and M. Saltzman, Principles of Color Technology, 2nd Edition, Wiley, New York, Chap. 2 (1981). 8. CIE, Colorimetry, Publication No. 15, Bureau Central de la CIE, Paris (1971). 9. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, p. 395 (1982). 10. M. D. Fairchild, Color Appearance Models, Addison-Wesley Longman, Reading, MA, pp. 79–81 (1997). 11. D. B. Judd, D. L. MacAdam, and G. Wyszecki, Spectral distribution of typical daylight as a function of correlated color temperature, J. Opt. Soc. Am. 54, pp. 1031–1040 (1964). 12. J. Schanda and B. Kranicz, Possible re-definition of the CIE standard daylight illuminant spectral power distribution, Color Res. Appl. 21, pp. 473–475 (1996). 13. J. A. Worthey, Calculation of metameric reflectances, Color Res. Appl. 13, pp. 76–84 (1988).
Chapter 2
Color Principles and Properties The vector-space representation opens the doors for utilizing the well-developed mathematical fields of linear algebra and matrix theory. Cohen, Horn, and Trussell, among others, have elegantly put forth the fundamental properties of the vectorspace color representation. They showed the existence of the color match, the color additivity, the identity, the transformation of primaries, the equivalent primaries, the metameric relationship, the effect of illumination, and many imaging constraints.1–5 The abilities of representing spectral sensitivity of human vision and related visual phenomena in matrix-vector form provide the foundation for a major branch of computational color technology, namely, the studies of the phenomenon of surface reflection. This approach deals with signals reflected from an object surface under a given illumination into a human visual pathway; it has no interest in the physical and chemical interactions within the object and substrate. On the other hand, the physical interactions of the light with objects and substrates form the basis for another major branch of the computational color technology, namely, the physical color-mixing models that are used primarily in the printing industry. With the vector-space representation and matrix theory, in this chapter, we lay the groundwork for these computational approaches by revisiting the Grassmann’s law of color mixing and reexamining color matching as well as other properties.
2.1 Visual Sensitivity and Color-Matching Functions Visual spectral sensitivity of the eye measured as the spectral absorption characteristics of human cones is given in Fig. 2.1.6,7 The sampled visual spectral sensitivity is represented by a matrix of three vectors V = [V 1 , V 2 , V 3 ], one for each cone type, where V i is a vector of n elements. Compared to the CMF curves of Fig. 1.2, they differ in several ways: first, the visual spectral sensitivity has no negative elements; second, the overlapping of green (middle-wavelength) and red (long-wavelength) components is much stronger. The sensor responses to the object spectrum η(λ) can be represented by Υ = V T η. 17
(2.1)
18
Computational Color Technology
Figure 2.1 Relative spectral absorptances of human cone pigments measured by microspectrophotometry. (Reprinted with permission of John Wiley & Sons, Inc.)7
The existence of a color match can be understood by an imaginary visual experiment. Conceptually, we can imagine a set of ideal monochromatic spectra δi (λ) for i = 1, 2, 3, . . . , n. Each δi is viewed as a vector of n elements with a value 1, the full intensity of light, at the ith wavelength and zero elsewhere (a truncated delta function). Now, we perform the color-matching experiment to match this set of ideal spectra by the linear combination of three primary spectra ¯ Φ(λ) = [¯r (λ), g(λ), ¯ b(λ)]. If the sampled primary spectra have the same interval as the ideal spectra, we get a 3 × n matrix Φ = [r, g, b], where vectors r, g, and b are linearly independent, giving a rank of three to the matrix Φ. As pointed out in the color-matching experiment, spectral colors are physically unattainable. Therefore, one of the primaries is moved to the test side to lower the purity. If the relative intensities of the primaries to match one ideal spectrum δi is a i = [a1i , a2i , a3i ]T , then we have V T δ i = V T Φa i . For matching all ideal monochromatic spectra, Eq. (2.2) becomes i = 1 V T [1 0 0 0 . . . 0]T = V T [r g b][a11 a21 a31 ]T , i=2
V T [0 1 0 0 . . . 0]T = V T [r g b][a12 a22 a32 ]T ,
(2.2)
Color Principles and Properties
19
i = 3 V T [0 0 1 0 . . . 0]T = V T [r g b][a13 a23 a33 ]T , ...
...
...,
...
...
...,
i = n V T [0 0 0 0 . . . 1]T = V T [r g b][a1n a2n a3n ]T .
(2.3)
By combining all components in Eq. (2.3) together, we obtain V T I = V T ΦAT .
(2.4)
The combination of the ideal monochromatic spectra δ i gives the identity matrix I with a size of n × n, and the combination of the relative intensities of the primaries gives the color matching function A with a size of n × 3, thus we have V T = V T Φ AT . (2.5) Equation (2.5) indicates that the matrix V is a linear transformation of the colormatching matrix A. The conversion matrix (V T Φ) has a size of 3 × 3 because V T is 3 × n and Φ is n × 3. And the product (V T Φ) is nonsingular because both V and Φ have a rank of three; therefore, it can be inverted. As a result, the human visual space can be defined as any nonsingular transformation of vectors in V . −1 AT = V T Φ V T
(2.6)
−1 A = V Φ TV .
(2.7)
or
Equation (2.7) shows that the color-matching matrix A is determined solely by the primaries and the human visual sensitivity. This result is well known; the beauty is the conciseness of the proof.5 Another way to describe Eq. (2.6) or Eq. (2.5) is that the color-matching function is a linear transform of the spectral visual sensitivity, or vice versa. Indeed, Baylor and colleagues have shown the property of Eq. (2.5) experimentally by finding a linear transformation to convert their cone photopigment measurements to the color-matching functions after a correction for absorption by the lens and other inert pigments in the eye.8,9 The linearly transformed pigment data match well with the color-matching functions.
2.2 Identity Property For a color-matching matrix A derived from a set of primaries Φ = [¯r (λ), ¯ g(λ), ¯ b(λ)], the transformation of the primaries by the matrix A is an identity matrix I .4 AT Φ = I .
(2.8)
20
Computational Color Technology
The proof of the identity property is attained by rearranging Eq. (2.5) and multiplying both sides of the equation by Φ , and we get V T ΦAT Φ = V T Φ.
(2.9)
As given in Eq. (2.6), the product (V T Φ) is nonsingular and can be inverted. Therefore, we multiply both sides of Eq. (2.9) by (V T Φ)−1 . −1 T T −1 T T V Φ A Φ = V TΦ V Φ . V Φ
(2.10)
Note that T −1 T V Φ V Φ = I.
(2.11)
Substituting Eq. (2.11) into Eq. (2.10) gives the identity property of Eq. (2.8).
2.3 Color Match Any visible spectrum S can be matched by a set of primaries, having a unique three-vector a A that controls the intensity of the primaries, to produce a spectrum that appears the same to the human observer. From Eq. (2.2), we have V T S = V T Φa A .
(2.12)
The existence of a color match is obtained simply by inverting Eq. (2.12) a A = (V T Φ)−1 V T S
(2.13)
because (V T Φ) is nonsingular. The uniqueness is shown by assuming that two intensity matrices a A and a B both match the spectrum S, and we have V T Φ(a A − a B ) = V T Φa A − V T Φa B .
(2.14)
By substituting Eq. (2.13) for a A and a B , we obtain −1 −1 V T Φ V T Φ V T S − V T Φ V T Φ V T S = V T S − V T S = 0. This means a A must be equal to a B .
(2.15)
Color Principles and Properties
21
2.4 Transitivity Law Because the color-matching matrix A is a linear transform of the human visual sensitivity, we can represent the spectral sensitivity of the eye by the matrix A. And the response of the sensors to the color stimulus η gives a tristimulus value.5 AT η = Υ .
(2.16)
This transform reduces the dimension from n to 3, and causes a large loss in information, suggesting that many different spectra may give the same color appearance to the observer. In this case, two stimuli ηA (λ) and ηB (λ) are said to be a metameric match if they appear the same to the human observer. In the vector-space representation, we have A T η A = AT η B = Υ .
(2.17)
Now, if a third stimulus ηC (λ) matches the second stimulus ηB (λ), then AT ηB = AT ηC = Υ . It follows that AT ηA = AT ηC = Υ . This proves that the transitivity law holds.
2.5 Proportionality Law If ηA matches ηB , then αηA matches αηB , where α is a scalar. AT (αηA ) = α(AT ηA ) = αΥ = α(AT ηB ) = AT (αηB ).
(2.18)
Thus, αηA must match αηB and the proportionality law holds.
2.6 Additivity Law For two stimuli ηA and ηB , we have AT ηA = Υ A
and
AT η B = Υ B .
(2.19)
If we add them together, we have AT η A + AT η B = Υ A + Υ B ,
(2.20a)
AT (ηA + ηB ) = Υ A + Υ B .
(2.20b)
Moreover, if ηA matches ηB , ηC matches ηD , and (ηA + ηC ) matches (ηB + ηD ), then (ηA + ηD ) matches (ηB + ηC ). AT ηA = Υ A = Υ B = AT ηB
and
A T η C = Υ C = Υ D = AT η D ,
(2.21)
22
Computational Color Technology
AT (ηA + ηC ) = Υ A + Υ C = Υ B + Υ D = AT (ηB + ηD ),
(2.22)
A (ηA + ηD ) = A ηA + A ηD = Υ A + Υ D = A ηB + A ηC T
T
T
T
T
= AT (ηB + ηC ).
(2.23)
This shows that the additivity law holds.
2.7 Dependence of Color-Matching Functions on Choice of Primaries Two different spectra ηA and ηB can give the same appearance if and only if AT ηA = AT ηB . V T ηA = V T ηB
iff AT ηA = AT ηB .
(2.24)
Applying Eq. (2.6), AT = (V T Φ)−1 V T , to the constraint AT ηA = AT ηB , we have
V TΦ
−1
−1 V T ηA = V T Φ V T ηB .
(2.25)
Multiplying both sides of the equation by (V T Φ), Eq. (2.25) becomes −1 T T −1 T V Φ V Φ V ηA = V T Φ V T Φ V T ηB .
(2.26)
Applying the identity relationship of Eq. (2.11), we prove Eq. (2.24) is valid if and only if the constraint is true.
2.8 Transformation of Primaries If a different set of primaries Φj is used in the color-matching experiment, we will obtain a different set of the color-matching functions Aj , but the same color match. Applying Eq. (2.5) to any input spectrum η, we obtain T T V Φ A η = Υ = V T Φj AjT η.
(2.27)
This gives the relationship of T T T T V Φ A = V Φj Aj .
(2.28)
Multiplying both sides by (V T Φ)−1 , we have
V TΦ
−1 T T T −1 T T V Φ A = V Φ V Φj Aj .
(2.29)
Color Principles and Properties
23
Utilizing the identity relationship on the left-hand side of Eq. (2.29), and substituting Eq. (2.6) into the right-hand side of Eq. (2.29), we obtain −1 (2.30) AT = V T Φ V T Φj AjT = AT Φj AjT . The product (AT Φj ) is nonsingular with a size of 3 × 3 because AT is a 3 × n matrix and Φj is an n × 3 matrix. By inverting (AT Φj ), we obtain −1 T AjT = AT Φj A .
(2.31)
Equation (2.31) shows that two sets of primaries are related by a 3 × 3 linear transformation, just like the color-matching functions are related to visual spectral sensitivity by a 3 × 3 linear transformation.
2.9 Invariant of Matrix A (Transformation of Tristimulus Vectors) If Υ i and Υj are two tristimulus vectors obtained from an input spectrum S under two different sets of primaries Φi and Φj , respectively, we have Υ i = ATi S and Υj = AjT S. Applying Eq. (2.31) to AjT , we have −1 T −1 Υj = AjT S = ATi Φj Ai S = ATi Φj Υi .
(2.32)
Again, the equation shows that two tristimulus vectors of a spectrum under two different sets of primaries are related by a 3 × 3 linear transformation.
2.10 Constraints on the Image Reproduction Extending the theoretical proofs for visual sensitivity and color matching discussed in this chapter, Horn has proposed a series of constraints on the image sensors, light sources, and image generators for accurate image capture, archive, and reproduction. These constraints are presented as theorems, corollaries, or lemmas in the original paper.4 They provide the guidance to digital color transform, white-point conversion, and cross-media color reproduction. Constraint 1. The spectral response curves of the image sensors must be linear transforms of the spectral response curves of the human visual system. Constraint 1.1. Metameric spectral distributions produce identical outputs in the camera. In practice, Constraints 1 and 1.1 are difficult to meet, if not impossible; the next best thing is to design sensor response curves closest to the linear transform of the human visual responses. The nearest approximation can be obtained in the leastsquare sense.
24
Computational Color Technology
Constraint 2. The mapping of image sensor outputs to image generator inputs can be achieved by means of a linear 3 × 3 matrix transform. Constraint 2.1. The spectral response curves of the image sensors must be linearly independent, and the spectral distributions of the light must also be linearly independent. Constraint 2.2. The light-source spectral distributions need not be linear transforms of the spectral response curves of the human visual system. Constraint 2.3. In determining the transfer matrix, we can use matrices based on the standard observer curves, instead of the matrices based on the actual spectral response curves of the human visual system. This is the natural consequence of Eq. (2.5)—that standard observer curves are a linear transform away from visual sensitivity curves. Constraint 3. The gain factors used to adjust for chromatic adaptation should be introduced in the linear system after the recovery of the observer stimulation levels and before computation of the image generator control inputs. Constraint 3.1. Applying the gain factors to image sensor outputs or image generator inputs will not, in general, result in correct compensation for adaptation. Constraint 4. The set of observer stimulation levels that can be produced using nonnegative light-source levels forms a convex subset of the space of all possible stimulation levels. Constraint 4.1. The subset of stimulation levels possible with arbitrary nonnegative spectral distribution is, itself, convex and bounded by the stimulation levels produced by monochromatic light sources. Constraint 5. The problem of the determination of suitable image generator control inputs when there are more than three light sources can be posed as a problem in linear programming. For the given stimulation levels of the receptors of the observer, only three of the light sources need be used at a time. Constraint 6. For the reproduction of reproductions, the spectral response curves of the image sensors need not be linear transforms of the spectral response curves of the human visual system.
References 1. J. B. Cohen and W. E. Kappauf, Metameric color stimuli, fundamental metamers, and Wyszecki’s metameric blacks, Am. J. Psychology 95, pp. 537– 564 (1982). 2. J. B. Cohen and W. E. Kappauf, Color mixture and fundamental metamers: Theory, algebra, geometry, application, Am. J. Psychology 98, pp. 171–259 (1985). 3. J. B. Cohen, Color and color mixture: Scalar and vector fundamentals, Color Res. Appl. 13, pp. 5–39 (1988).
Color Principles and Properties
25
4. B. K. P. Horn, Exact reproduction of colored images, Comput. Vision Graph Image Proc. 26, pp. 135–167 (1984). 5. H. J. Trussell, Applications of set theoretic methods to color systems, Color Res. Appl. 16, pp. 31–41 (1991). 6. J. K. Bowmaker and H. J. A. Dartnall, Visual pigments of rods and cones in a human retina, J. Physiol. 298, pp. 501–511 (1980). 7. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, pp. 623–624 (1982). Original data from J. K. Bowmaker and H. J. A. Dartnall, Visual pigments of rods and cones in a human retina, J. Physiol. 298, pp. 501–511 (1980). 8. D. A. Baylor, B. J. Nunn, and J. L. Schnapf, Spectral sensitivity of cones of the monkey Macaca Fascicularis, J. Physiol. 390, pp. 145–160 (1987). 9. B. A. Wandell, Foundations of Vision, Sinauer Assoc., Sunderland, MA, p. 96 (1995).
Chapter 3
Metamerism Grassmann’s second law indicates that two lights or two stimuli may match in color appearance even though their spectral radiance (or power) distributions differ. This kind of condition is referred to as “metamerism” and the stimuli involved are called metamers. More precisely, metamers are color stimuli that have the same color appearance in hue, saturation, and brightness under a given illumination, but a different spectral composition. Metamers and color mixing are at the heart of CIE colorimetry. The CMFs that specify the human color stimulus derive from the metameric color matching by the fact that many colors are matched by additive mixtures of three properly selected primaries. This makes it possible for the tristimulus specifications of colors such as the one given in Eq. (1.1). Note that metamers of spectral colors are physically unattainable because they possess the highest intensity. To get around this problem, a primary is added to the reference side to lower the intensity so that the trial side can match. This is the reason that there are negative values in the original CMF, before transformation to have all positive values (see Section 1.4). This chapter presents the types of metameric matching, the vector-space representation of the metamerism, and Cohen’s method of object spectrum decomposition into a fundamental color stimulus function and a metameric black, often referred to as the spectral decomposition theory or matrix R theory. In addition, several other metameric indices are also reported.
3.1 Types of Metameric Matching A general description of the metameric match for a set of mutual metamers with η1 (λ), η2 (λ), η3 (λ), . . . , ηm (λ) stimulus functions can be expressed as follows:1 ¯ dλ = η2 (λ)x(λ) ¯ dλ = · · · = ηm (λ)x(λ) ¯ dλ = X, (3.1a) η1 (λ)x(λ) ¯ dλ = η2 (λ)y(λ) ¯ dλ = · · · = ηm (λ)y(λ) ¯ dλ = Y, (3.1b) η1 (λ)y(λ) η1 (λ)¯z(λ) dλ = η2 (λ)¯z(λ) dλ = · · · = ηm (λ)¯z(λ) dλ = Z. (3.1c) For the convenience of the formulation, we drop the constant k as compared to Eq. (1.1), where the constant k is factored into function η. 27
28
Computational Color Technology
3.1.1 Metameric illuminants The stimulus functions may differ in many ways. For example, they may represent different illuminants.1 η1 (λ) = E1 (λ),
η2 (λ) = E2 (λ),
...,
ηm (λ) = Em (λ).
(3.2)
This happens in a situation where two lights have the same tristimulus values but one is a full radiator with smooth and continuous spectral distribution (e.g., tungsten lamps) and the other has a highly selective narrowband emissivity distribution (e.g., fluorescent lamps). When two light sources are metameric, they will appear to be of the same color when the observer looks directly at them. However, when two metameric sources are used to illuminate a spectrally selective object, the object will not necessarily appear the same. 3.1.2 Metameric object spectra Another possibility is that they may represent different objects illuminated by the same illuminant, such as different substrates under the same light source. η1 (λ) = E(λ)S1 (λ),
η2 (λ) = E(λ)S2 (λ),
...,
ηm (λ) = E(λ)Sm (λ). (3.3)
In this case, metamers with different spectral power distributions give the same colorimetric measure, but the appearance will look different if a different illuminant is used.1 3.1.3 Metameric stimulus functions The most complex case is where the stimulus functions represent different objects illuminated by different illuminants as given in Eq. (3.4).1 η1 (λ) = E1 (λ)S1 (λ), ηm (λ) = Em (λ)Sm (λ).
η2 (λ) = E2 (λ)S2 (λ),
..., (3.4)
Typically, a metameric match is specific to one observer or one illuminant. When either illuminant or observer is changed, it is most common to find that the metameric match breaks down. There are some instances in which the metameric match may hold for a second illuminant. Usually, this will be true if peak reflectance values of two samples are equal at three or more wavelengths. Such samples will tend to be metameric under one light source, and if the wavelength locations of intersections are appropriate, they may continue to provide a metameric match for a second illuminant. In all cases, the resulting color sensation given by Eq. (3.1) is a set of tristimulus values. As stated by Cohen, the principle purpose of color science is the establishment of lawful and orderly relationships between a color stimulus and the evoked
Metamerism
29
color sensation. A color stimulus is radiation within the visible spectrum described invariably by radiometric function depicting irradiance as a function of wavelength, whereas the evoked color sensation is subjective and is described by words of color terms such as red or blue.2 Color stimulus is the cause and color sensation is the effect. Color science is built on psychophysics, where the color matching represented by the tristimulus values as coefficients is matched psychologically.
3.2 Matrix R Theory As early as 1953, Wyszecki pointed out that the spectral power distribution of stimuli consists of a fundamental color-stimulus function η(λ) ´ (or simply “fundamental”) intrinsically associated with the tristimulus values and a metameric black function κ(λ) (or simply “residue”) unique to each metamer with tristimulus values of (0, 0, 0), having no contribution to the color specification.3,4 He further noted that the metameric black function is orthogonal to the space of the CMF. Utilizing these concepts, Cohen and Kappauf developed the method of the orthogonal projector to decompose visual stimuli into these two components, where the fundamental metamer is a linear combination of the CMF such as matrix A, and the metameric black is the difference between the stimulus and the fundamental metamer.2,5,6 This method was named the matrix R theory and has been thoroughly examined by Cohen, where several definitions of transformation matrices were added to the theory.7 Recall that the color-matching matrix A is an n × 3 matrix defined as
x¯1 x¯2 x¯ A= 3 ··· ··· x¯n
y¯1 z¯ 1 y¯2 z¯ 2 y¯3 z¯ 3 , ··· ··· ··· ··· y¯n z¯ n
(3.5)
where n is the number of samples taken in the visible spectrum. A transformation matrix M a is defined as the CMF matrix A right multiplied with its transpose.7 The resulting matrix M a is symmetric with a size of 3 × 3.
x¯1 M a = A A = y¯1 z¯ 1 T
x¯2 y¯2 z¯ 2
2 x¯ i = x¯i y¯i x¯i z¯ i
x¯1 x¯ x¯3 · · · x¯n 2 x¯ y¯3 · · · y¯n 3 ··· z¯ 3 · · · z¯ n ··· x¯n x¯ y¯ x¯ z¯ i 2i i i y¯ y¯ z¯ . i i2i y¯i z¯ i z¯ i
y¯1 y¯2 y¯3 ··· ··· y¯n
z¯ 1 z¯ 2 z¯ 3 ··· ··· z¯ n (3.6)
30
Computational Color Technology
The summation in Eq. (3.6) carries from i = 0 to i = n. The inverse of the matrix M a is called M e . M e = M −1 a .
(3.7)
Table 3.1 gives the values of M a and M e for both CIE 1931 and 1964 standard observers using the color-matching functions with the range from 390 to 710 nm at 10-nm intervals. For a set of mutual metamers, η1 (λ), η2 (λ), η3 (λ), . . . , ηm (λ) that are sampled in the same rate as the color-mixing function A, we have a set of vectors, η1 , η2 , η3 , . . . , ηm , where each ηi is a vector of n elements. Using the vector-space representation, we can represent Eq. (3.1) in a matrix-vector notation, regardless of the content of stimulus functions. AT η1 = AT η2 = · · · = AT ηi = · · · = AT ηm = Υ .
(3.8)
Vector Υ represents the tristimulus values (X, Y, Z). Next, a matrix M f is defined as M e right multiplied into matrix A. T −1 . M f = AM e = AM −1 a =A A A
(3.9)
Matrix M f has a size of n × 3 because A is n × 3 and M e is 3 × 3. By multiplying each term in Eq. (3.8) with M f , we have M f AT η 1 = · · · = M f AT η i = · · · = M f AT η m −1 ´ = M f Υ = A AT A Υ = η,
(3.10)
where η´ is the sampled fundamental function η(λ). ´ It is a vector of n elements because M f is an n × 3 matrix and Υ is a 3 × 1 vector. Cohen defined matrix R as the orthogonal projector projecting ηi into the 3D color-stimulus space. −1 T T T R = A AT A AT = AM −1 a A = AM e A = M f A .
(3.11)
Table 3.1 Values of M a and M e of CIE 1931 and 1964 standard observers.
CIE 1931 standard observer Ma
Me
7.19376 5.66609 2.55643 0.36137 –0.25966 –0.05020
5.66609 7.72116 0.84986 –0.25966 0.31696 0.02816
CIE 1964 standard observer 2.55643 0.84986 14.00625 –0.05020 0.02816 0.07885
8.38032 6.60554 3.09762 0.34187 –0.26363 –0.03987
6.60554 8.34671 1.44810 –0.26363 0.32491 0.02038
3.09762 1.44810 16.98368 –0.03987 0.02038 0.06441
Metamerism
31
As shown in Eq. (3.11), matrix R is the matrix M f left multiplied into matrix AT . Matrix R has a size of n × n because M f is n × 3 and AT is 3 × n. But it has a rank of three because it is derived solely from matrix A, having three independent columns. As a result, matrix R is symmetric. It decomposes the spectrum of the stimulus into two components, namely, the fundamental η´ and the metameric black κ, as given in Eqs. (3.12) and (3.13), respectively. η´ = Rηi ,
(3.12)
κ = ηi − η´ = ηi − Rηi = (I − R)ηi .
(3.13)
and
The vector κ is a sampled metameric black function κ(λ) and I is the identity matrix. The metameric black has tristimulus values of zero. AT κ = [0, 0, 0]T .
(3.14)
Equations (3.12) and (3.13) show that any group of mutual metamers has a common fundamental η´ but different metameric blacks κ. Inversely, the stimulus spectrum can be expressed as ηi = η´ + κ = Rηi + (I − R)ηi .
(3.15)
Equation (3.15) states that the stimulus spectrum can be recovered if the fundamental metamer and metameric black are known.1,8
3.3 Properties of Matrix R There are several interesting properties of the matrix R: (1) The fundamental metamer η´ depends only on matrix A and the common tristimulus values. (2) The fundamental metamer η´ is a metamer of ηi . They have the same tristimulus values. −1 AT η´ = AT (Rηi ) = AT A AT A AT ηi = I AT ηi = AT ηi = Υ . (3.16) (3) The matrix R is symmetric and idempotent; therefore, ´ R(Rη) = R η´ = η.
(3.17)
When matrix R operates on a fundamental color stimulus, it simply preserves the fundamental. In other words, η´ has no metameric black component.
32
Computational Color Technology
(4) The fundamental metamer η´ can be obtained from tristimulus values, η´ = M f Υ [see Eq. (3.10)], without knowing the spectral distribution of the stimulus because M f is known for a given CMF. (5) The fundamental metamer η´ given in Eq. (3.12) is a linear combination of the CMF that constitutes matrix A because matrix R depends only on matrix A, having three independent components. Therefore, matrix R has a rank of three, meaning that we can reconstruct every entry in the entire matrix by knowing any three rows or columns in the matrix. (6) The fundamental metamer η´ is independent of the primaries selected for obtaining the data in matrix A. Thus, it is invariant under any transformation of A to a new Ap , which is based on a different set of primaries. Using the invariant property of matrix A, that two different sets of primaries are related by a linear transformation (see Chapter 2.9), we can set Ap = AM,
(3.18)
where M is a nonsingular 3×3 transformation matrix. From the definition of the matrix R [see Eq. (3.11)], we have −1 R p = Ap ATp Ap ATp .
(3.19)
Substituting Eq. (3.18) into Eq. (3.19), we get
−1 −1 T T A M . R p = AM (AM)T AM (AM)T = AM M T AT AM (3.20) Since
M T AT AM
−1
−1 T −1 M = M −1 AT A ,
(3.21)
we thus have −1 T −1 T T −1 M M A = AI AT A I AT R p = AMM −1 AT A −1 = A AT A AT = R. (3.22) This proves that R is invariant under transformation of primaries. Hence, η´ is invariant. This property means that matrix R may be computed from any CMF matrix A or any linear transformation of matrix A (moreover, it may also be computed from any triplet of fundamental stimuli).2 For example, we may start with the CIE 1931 r¯ , g, ¯ b¯ or 1931 x, ¯ y, ¯ z¯ colormatching functions and end with the same matrix R, even though they have very different M a , M e , and M f matrices (see Table 3.1 for comparisons). Figure 3.1 gives the 3D plot of matrix R. There are three peaks in the diagram. The first peak is approximately 443–447 nm, the second peak
Metamerism
33
Figure 3.1 Three-dimensional plot of matrix R.2
is approximately 531–535 nm, and the third peak is around 595–605 nm; they coincide with the peaks of the CIE r¯ , g, ¯ b¯ color-matching functions for both 1931 and 1964 standard observers.9 These peak wavelengths have appeared frequently in the literature of the color sciences, such as the theoretical consideration of the color-processing mechanism,10,11 photometric relationships between complementary color stimuli,12 modes of human cone sensitivity functions,13 color film sensitivities,14–18 and invariant hues.19 (7) If η is a unit monochromatic radiation of wavelength λi , then Rη or η´ becomes a simple copy of the ith column of R. This indicates that each column or row of the matrix R (R is symmetric) is the fundamental metamer of a unit monochromatic stimulus. Therefore, η´ is a weighted sum of the fundamental metamers of all the monochromatic stimuli that constitute η. Moreover, the unweighted sum of columns or rows in matrix R gives the fundamental of an equal-energy color stimulus as shown in Fig. 3.2. (8) Given two color stimuli η1 and η2 , each has its own fundamentals η´ 1 and η´ 2 . The combination of the two fundamentals (η´ 1 + η´ 2 ) is the fundamental of the combined stimuli (η1 + η2 ). This result is the basis of the Grassmann’s additivity law.
34
Computational Color Technology
Figure 3.2 Fundamental spectrum of an equal-energy color stimulus.6
(9) When two color stimuli η1 and η2 are metamers, they have the same fundamental η´ but different metameric black κ 1 and κ 2 . The difference between the spectra of two metamers is the difference between their metameric blacks, which is still a metameric black. η1 − η2 = (η´ + κ 1 ) − (η´ + κ 2 ) = κ 1 − κ 2 .
(3.23a)
Let κ = κ 1 − κ 2 .
(3.23b)
Applying Eq. (3.14) to Eq. (3.23b), we obtain AT (κ) = AT (κ 1 − κ 2 ) = AT κ 1 − AT κ 2 = [0, 0, 0]T − [0, 0, 0]T = [0, 0, 0]T .
(3.23c)
Equation (3.23c) proves that the difference between the spectra of two metameric blacks is still a metameric black. Moreover, metameric blacks may be created from other metameric blacks, such as the addition or subtraction of two metameric blacks, or the multiplication of a metameric by a positive or negative factor. This provides the means to generate an infinite number of residues; thus, an infinite number of metamers. (10) For any set of primaries Φj , the projection of the primaries onto the visual space can be derived by the color-matching matrix A.2,8 −1 −1 RΦj = A AT A AT Φj = A AT A = M f.
(3.24)
Metamerism
35
This is because AT Φj = I . The matrix M f is comprised of the fundamental primaries and is depicted in Fig. 3.3 for both CIE 1931 and 1964 standard observers with 33 samples from 390 to 710 nm at 10-nm interval. Note that the sum of XYZ fundamentals is exactly equal to the fundamental of an equal-energy stimulus (see Fig. 3.2 for comparison). With the means to derive the fundamentals of primaries, Cohen stated:2 “The color-matching equation has historically been written with tristimulus values as coefficients, but so written the equation balances only psychologically. When the stimuli of the color-matching equation are replaced by the fundamentals processed by the visual system (after the residuals are ejected by matrix-R operations), the equation balances psychologically, physically, and mathematically.”
(11) Complementary color stimuli can be computed directly using matrix R operations.2 First, the white or gray stimulus ηw is decomposed to its fundamental η´ w and metameric black κ w . Then, any color stimulus η is decomposed to η´ and κ. The difference between the fundamentals, ´ is the complementary fundamental. Metameric blacks may n˜ = η´ w − η, be added to the complementary fundamental n˜ to create a suite of complementary metamers. As shown in Property 10, the sum of all three XYZ fundamentals is an equal-energy stimulus; it follows that each primary fundamental is com-
Figure 3.3 Fundamental primaries of CIE standard observers obtained by matrix R decompositions.
36
Computational Color Technology
plementary to the sum of the other two primaries. Thus, complementary color stimuli are a special case of the color-matching equation.2 (12) For a given set of primaries Φ and its associated matching functions A, any set of primaries Φj that have the same projection onto the visual subspace as Φ will have the same color-match functions. This gives the equivalent primaries. The condition for equivalent primaries is that their tristimulus values are equal based on the identity relationship. AT Φ = AT Φj = I .
(3.25)
The primaries Φj are decomposed as follows: Φj = η´ + κ = RΦj + (I − R)Φj .
(3.26)
The primaries Φj have the same projection onto the visual subspace as Φ; therefore, Eq. (3.26) can be rewritten as Φj = RΦ + (I − R)Φj .
(3.27)
Since the visual spectral sensitivity V and the color-matching function A define the same 3D visual subspace, the orthogonal project operator R can be written in terms of V . −1 −1 T R = A A T A AT = V V T V V .
(3.28)
Substituting Eq. (3.28) into Eq. (3.27), we have −1 T −1 T V Φ + I − V V TV V Φj . Φj = V V T V
(3.29)
Recall that the color-matching matrix is a linear transform of the visual spectral sensitivity [see Eq. (2.7)]; thus, any arbitrary set of primaries Φj will have a corresponding color-matching function Aj as given in Eq. (3.30). −1 Aj = V ΦjT V .
(3.30)
Substituting Eq. (3.29) into Eq. (3.30), we obtain
−1 T −1 T −1 Φ TV V TV V + ΦjT I − V V T V V . V (3.31) The second term of Eq. (3.31) is zero because V (V T V )−1 V T = I ; this null space component has an important implication in that it has nothing to do with the primaries used; any set of primaries or any function can Aj = V
Metamerism
37
be used, for that matter. By using the same identity relationship, the first term becomes Φ T V . −1 . Aj = V Φ T V
(3.32)
Comparing Eq. (3.32) to Eq. (2.7) A = V (Φ T V )−1 , it is clear that Aj = A. This proof implies that all primary sets generate equivalent colormatching functions and it is only the projection of the primaries onto the visual space that matters. The result provides the means to generate a set of equivalent primaries, having the same projection but different null space components, which can be chosen in such a way as to make primaries with better physical properties.8 (13) Matrix R operations can also be used to derive the monochromatic orthogonal color stimuli. With a 300 × 300 size of matrix R (300 sample points in the visual spectrum), Cohen and Kappauf have found triplets of spectral monochromatic stimuli on the spectral envelope that are orthogonal to extremely close tolerances.6 These stimuli are 457, 519, and 583 nm for the CIE 1931 standard observer and 455, 513, and 584 nm for the CIE 1964 standard observer. The three metameric blacks of these orthogonal monochromatic stimuli are also mutually orthogonal.
3.4 Metamers Under Different Illuminants Trussell has developed a method for obtaining metamers under different illuminations such as the scenario given in Eq. (3.4).8 For two illuminants, we have the following equivalence in tristimulus values: A T E 1 S 1 = AT E 1 S 2
and
AT E 2 S 1 = A T E 2 S 2
(3.33a)
ÆT1 S 1 = ÆT1 S 2
and
ÆT2 S 1 = ÆT2 S 2 .
(3.33b)
or
We can apply the orthogonal projection by modifying matrix R with the color object-matching function Æ (see Section 1.6 for Æ). ˇ = Æ ÆT Æ −1 ÆT . R We obtain the fundamentals and metameric blacks −1 ˇ 1 S 1 and nˇ 11 = Æ1 ÆT1 Æ1 ÆT1 S 1 = R −1 ˇ 1 S 2 and nˇ 12 = Æ1 ÆT1 Æ1 ÆT1 S 2 = R
(3.34)
ˇ 1 )S 1 κ´ 11 = (I − R
(3.35a)
ˇ 1 )S 2 κ´ 12 = (I − R
(3.35b)
38
Computational Color Technology
−1 ˇ 2S 1 nˇ 21 = Æ2 ÆT2 Æ2 ÆT2 S 1 = R −1 ˇ 2S 2 nˇ 22 = Æ2 ÆT2 Æ2 ÆT2 S 2 = R nˇ 11 = nˇ 12 For two illuminants, we can set n × 3 matrices Æ1 and Æ2 . e1,1 x¯1 e1,2 x¯2 e x¯ Æa = [Æ1 Æ2 ] = 1,3 3 ··· ··· e1,n x¯n
and
ˇ 2 )S 1 κ´ 21 = (I − R
(3.35c)
and
ˇ 2 )S 2 κ´ 22 = (I − R
(3.35d)
and
nˇ 21 = nˇ 22 .
(3.35e)
up an n × 6 augmented matrix Æa from the two e1,1 y¯1 e1,2 y¯2 e1,3 y¯3 ··· ··· e1,n y¯n
e1,1 z¯ 1 e1,2 z¯ 2 e1,3 z¯ 3 ··· ··· e1,n z¯ n
e2,1 x¯1 e2,2 x¯2 e2,3 x¯3 ··· ··· e2,n x¯n
e2,1 y¯1 e2,2 y¯2 e2,3 y¯3 ··· ··· e2,n y¯n
e2,1 z¯ 1 e2,2 z¯ 2 e2,3 z¯ 3 , ··· ··· e2,n z¯ n (3.36)
ÆTa S = ÆTa S 1 .
(3.37)
Equation (3.37) defines all spectra that match S 1 under both illuminants. The solution is obtained by applying the matrix R decomposition into fundamental and metameric black in the six-dimensional space, provided that the Æ1 and Æ2 ˇ a of component vectors are independent. Again, we apply the modified matrix R Eq. (3.38) by substituting Æa into Eq. (3.34) to input spectrum S 1 . ˇ a = Æa ÆTa Æa −1 ÆTa . R The resulting fundamental and metameric black are given as −1 ˇ a S 1 and κ´ a,1 = (I − R ˇ a )S 1 . nˇ a,1 = Æa ÆTa Æa ÆTa S 1 = R
(3.38)
(3.39)
The solution for Eq. (3.37) to obtain metamers is given by ˇ a S 1 + α(I − R ˇ a )S 1 . S 2 = nˇ a,1 + α κ´ a,1 = R
(3.40)
Where α is an arbitrary scalar because any positive or negative factor multiplied by a metameric black is still a metameric black (see Property 9). Mathematically, this approach of using an augmented matrix and modified matrix-R operator can be generalized to match arbitrary spectrum under several illuminants as long as the number of illuminants used is no greater than n/3, where n is the number of samples in the visible spectrum. Æa = [Æ1 Æ2 Æ3 · · · Æm−1 Æm ].
(3.41)
The problem of obtaining a realizable spectrum, i.e., one that is nonnegative, will require more constraints.8
Metamerism
39
3.5 Metameric Correction Metameric correction is a process of correcting a trial specimen to metamerically match a standard specimen under a reference viewing condition. Three methods are in use. 3.5.1 Additive correction The additive correction is performed in CIELAB space (see Section 5.3 for definitions of CIELAB space), where the correction in each color channel (L∗c , ac∗ , ∗ , or b∗ ) and standard or bc∗ ) is the difference between the trial specimen (L∗t,r , at,r t,r ∗ ∗ ∗ specimen (Ls,r , as,r , or bs,r ) under the reference viewing condition. Then, the difference is added to the corresponding channel of the trial specimen under the test ∗ , or b∗ ) to give the corrected CIELAB values (L∗ , a ∗ , viewing condition (L∗t,t , at,t t,t t,c t,c ∗ 20 or bc,r ). L∗c = L∗t,r − L∗s,r ,
∗ ∗ ac∗ = at,r − as,r ,
∗ ∗ bc∗ = bt,r − bs,r ,
(3.42)
L∗t,c
∗ at,c
∗ bt,c
(3.43)
= L∗t,t
+ L∗c ,
∗ = at,t
+ ac∗ ,
∗ = bt,t
+ bc∗ .
3.5.2 Multiplicative correction The multiplicative correction is performed in CIEXYZ space. The tristimulus values of the trial specimen in the test viewing condition (Xt,t , Yt,t , Zt,t ) are multiplied by the ratio of the corresponding tristimulus values of the standard (Xs,r , Ys,r , Zs,r ) to the trial specimen (Xt,r , Yt,r , Zt,r ) under the reference viewing condition to give the corrected tristimulus values (Xc , Yc , Zc ).21 Xc = Xt,t (Xs,r /Xt,r ),
Yc = Yt,t (Ys,r /Yt,r ),
Zc = Zt,t (Zs,r /Zt,r ).
(3.44)
3.5.3 Spectral correction The spectral correction utilizes the spectral decomposition in the fundamental metamer and its metameric black. The metameric black of the trial specimen, κ t,r , is added to the fundamental of the standard specimen, η´ s,t , to give the corrected trial spectral power distribution, ηc .22 ηc = η´ s,t + κ t,r = Rηs,t + (I − R)ηt,r .
(3.45)
As one can see, the spectral correction is an application of Property 12.
3.6 Indices of Metamerism A measure of the color difference between two metameric specimens caused by a test illuminant with a different spectral distribution from the reference illuminant
40
Computational Color Technology
is a “special metamerism index” (change in illuminant) for the two specimens. CIE recommended that the index of metamerism mt is set equal to the index of color difference E ∗ between the two specimens computed under the test illuminant. For additive correction, the index is
∗ ∗ 2 ∗ ∗ 2 1/2 mt = (L∗t,c − L∗s,t )2 + (at,c − as,t ) + (bt,c − bs,t ) ,
(3.46)
∗ , b∗ ) is the CIELAB values of the standard specimen under test where (L∗s,t , as,t s,t viewing conditions.
3.6.1 Index of metamerism potential This index is derived from spectral information about the standard and trial specimens in the reference viewing conditions. It characterizes the way in which two particular spectral power distributions differ, and provides an assessment for the potential variation of their colorimetric performance over a wide range of viewing conditions. This index is given by Nimeroff23 as m2t =
(S t,r − S s,t )2 ,
(3.47)
where S is the radiance of the specified specimen. The summation is carried out over the entire range of the visible spectrum. Nimeroff and Billmeyer have pointed out that spectral differences need to be weighted by some colorimetric response function of the eye.24,25 This weighting makes sense because eye sensitivity is not uniform across the whole visible spectrum; it is most sensitive in the center and diminishes at both ends.
References 1. C. J. Bartleson, Colorimetry Optical Radiation Measurements, F. Grum and C. J. Bartleson (Eds.), Academic Press, Inc., New York, Vol. 2, pp. 105–109 (1980). 2. J. B. Cohen, Color and color mixture: Scalar and vector fundamentals, Color Res. Appl. 13, pp. 5–39 (1988). 3. G. Wyszecki, Valenzmetrische Untersuchung des Zusammenhanges zwischen normaler und anomaler Trichromasie, Die Farbe 2, pp. 39–52 (1953). 4. G. Wyszecki, Evaluation of metameric colors, J. Opt. Soc. Am. 48, pp. 451– 454 (1958). 5. J. B. Cohen and W. E. Kappauf, Metameric color stimuli, fundamental metamers, and Wyszecki’s metameric blacks, Am. J. Psychology 95, pp. 537– 564 (1982). 6. J. B. Cohen and W. E. Kappauf, Color mixture and fundamental metamers: Theory, algebra, geometry, application, Am. J. Psychology 98, pp. 171–259 (1985).
Metamerism
41
7. H. S. Fairman, Recommended terminology for matrix R and metamerism, Color Res. Appl. 16, pp. 337–341 (1991). 8. H. J. Trussell, Applications of set theoretic methods to color systems, Color Res. Appl. 16, pp. 31–41 (1991). 9. G. Wyszecki and W. S. Stiles, Color Science: Concept and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, p. 142 (1982). 10. W. A. Thornton, Three color visual response, J. Opt. Soc. Am. 62, pp. 457–459 (1972). 11. R. G. Kuehni, Intersection nodes of metameric matches, Color Res. Appl. 4, pp. 101–102 (1979). 12. D. L. MacAdam, Photometric relationships between complementary colors, J. Opt. Soc. Am. 28, pp. 103–111 (1938). 13. G. R. Bird and R. C. Jones, Estimation of the spectral functions of the human cone pigments, J. Opt. Soc. Am. 55, pp. 1686–1691 (1965). 14. F. E. Ives, The optics of trichromatic photography, Photogr. J. 40, pp. 99–121 (1900). 15. A. C. Hardy and F. L. Wurzburg, The theory of three-color reproduction, J. Opt. Soc. Am. 27, pp. 227–240 (1937). 16. W. T. Hanson and W. L. Brewer, Subtractive color photography: the role of masks, J. Opt. Soc. Am. 44, pp. 129–134 (1954). 17. W. T. Hanson and F. L. Wurzburg, Subtractive color photography: spectral sensitivities and masks, J. Opt. Soc. Am. 44, pp. 227–240 (1954). 18. R. J. Ross, Color Film for Color Television, Hastings House, New York (1970). 19. R. W. Pridmore, Theory of primary colors and invariant hues, Color Res. Appl. 16, pp. 122–129 (1991). 20. A. Brockes, The evaluation of color matches under various light sources using the metameric index, Report 9th FATIPEC Congress, Brussels 1969, Sect. 1, pp. 3–9 (1969). 21. A. Brockes, The comparison of calculated metameric indices with visual observation, Farbe 19(1/6) (1970). 22. H. S. Fairman, Metameric correction using parameric decomposition, Color Res. Appl. 12, pp. 261–265 (1987). 23. I. Nimeroff and J. A. Yurow, Degree of metamerism, J. Opt. Soc. Am. 55, pp. 185–190 (1965). 24. I. Nimeroff, A survey of papers on degree of metamerism, Color Eng. 6, pp. 44–46 (1969). 25. F. W. Billmeyer, Jr., Notes on indices of metamerism, Color Res. Appl. 16, pp. 342–343 (1991).
Chapter 4
Chromatic Adaptation Color space transformations between imaging devices are dependent on the illuminants used. The mismatch of white points is a frequently encountered problem. It happens in situations where the measuring and viewing of an object are under different illuminants, the original and reproduction use different illuminants, and the different substrates are under the same illuminant. Normally, this problem is dealt with by chromatic adaptation in which the illumination difference is treated with an appearance transform. Chromatic adaptation deals with the visual sensitivity regulation of the color vision such as the selective, yet independent, changes in responsivity of cone photoreceptors with respect to surround and stimuli. For example, a photographic scene viewed under different illuminants (e.g., tungsten lamp versus daylight D65 ) looks pretty much the same in spite of the fact that the reflected light is very different under these two illuminants. This is because our eyes have adapted under each condition to discount the illuminant difference. This is known as the “color constancy” of human vision. To understand and, therefore, to predict the color appearance of objects under a different illuminant is the single most important appearance-matching objective. It has many industry applications, such as the cross-rendering between different media. There are two main approaches; one is the chromatic adaptation employing visual evaluations, and the other one is a mathematic computation of the color constancy (or white conversion). The main goal of the computational color constancy is to predict the object’s surface reflectance. If the surface spectrum is known, the correct tristimulus can be computed under any adapted illumination. The computational color constancy will be presented in Chapter 12. This chapter reviews methods of chromatic adaptation with an emphasis on the mathematical formulation. Several models, ranging from the von Kries hypothesis to the Retinex theory, are presented.
4.1 Von Kries Hypothesis There are numerous methods developed for the chromatic adaptation that can be found in many color textbooks.1–3 The most important one is the von Kries hypothesis, which states that the individual components present in the organ of vision are completely independent of one another and each is adapted exclusively according to its own function.4 If the proportionality and additivity hold for adaptations of 43
44
Computational Color Technology
the source and destination conditions, the source and destination tristimulus values, (X s , Y s , Z s ) and (X d , Y d , Z d ), are related by a linear transformation with a 3 × 3 conversion matrix τ due to the invariant of the matrix A of the color-matching functions (see Section 2.9). [X d , Y d , Z d ]T = τ [Xs , Y s , Z s ]T ,
or
Υ d = τ Υ s,
(4.1)
where superscript T denotes the transpose of the vector. The conversion matrix τ can be derived from cone responsivity in many ways, depending on the model used. For the von Kries model, the conversion matrix takes the form1 τ = M −1 DM,
(4.2)
where M is a 3 × 3 matrix that is used to transfer from source tristimulus values to three cone responsivities (Ls , M s , S s ) of the long, medium, and short wavelengths as given in Eq. (4.3), and M −1 is the inverse matrix of M, which is not singular with three independent cone responsivities.
Ls Ms Ss
Xs = M Ys Zs
or
V s = MΥ s .
(4.3)
The transfer matrix τ is dependent on both matrices M and D, but is weighted more heavily on M in the forms of both forward and inverse matrices. Thus, M is critical to the final form of the transfer matrix τ . In theory, there are an infinite number of choices for the M matrix. Therefore, many matrices have been proposed to satisfy the constraints of the trichromacy and color matching. Two frequently used M matrices and their inversions are given in Table 4.1. The source cone responsivity (Ls , M s , S s ) is converted to destination (Ld , M d , S d ) using a D matrix that is a diagonal matrix containing the destination-to-source Table 4.1 Matrix elements of two frequently used M matrices.
| | | Matrix || 0.4002 | | −0.2263 | | 0 | | Inverted | 1.860 | matrix | 0.361 | | 0 |
Matrix M 1 0.7076 1.1653 0 −1.129 0.639 0
−0.0808 0.0457 0.9182 0.220 0 1.089
| | | || 0.3897 | | −0.2298 | | 0 | | | 1.9102 | | 0.3709 | | 0 |
Matrix M 2 0.6890 1.1834 0
−0.0787 0.0464 1.000
−1.1122 0.6291 0
0.2019 0 1.000
Chromatic Adaptation
45
ratios of the cone responsivities.
Ld Md Sd
0 Ls (Lw,d /Lw,s ) = D Ms , D = 0 (M w,d /M w,s ) Ss 0 0
0 , 0 (S w,d /S w,s )
(4.4)
where Lw , M w , and S w are the long-, medium-, and short-wavelength cone responsivities, respectively, of the scene white (or maximum stimulus), and subscripts d and s denote destination and source, respectively. For the transform from tungsten light (illuminant A; XN,A = 109.8, Y N,A = 100, and Z N,A = 35.5) to average daylight (illuminant C; X N,C = 98.0, Y N,C = 100, and Z N,C = 118.1) using Eq. (4.3), we have
Lw,s M w,s S w,s
Lw,d M w,d S w,d
X N,A = M 1 Y N,A Z N,A 0.4002 0.7076 = −0.2263 1.1653 0 0 XN,C = M 1 Y N,C Z N,C 0.4002 0.7076 = −0.2263 1.1653 0 0
−0.0808 0.0457 0.9182
109.8 111.83 100.0 = 93.30 , 35.5 32.60
(4.5a)
98.0 100.44 100.0 = 99.75 . 118.1 108.44
(4.5b)
−0.0808 0.0457 0.9182
Once the cone responsivities for both source and destination illuminants are obtained, we can determine the diagonal matrix D by taking their ratio as shown in Eq. (4.6)
Lw,s D= 0 0
0 M w,s 0
(Lw,d /Lw,s ) = 0 0
0 0 S w,s
Lw,s 0 0
0 (M w,d /M w,s ) 0
0 M w,s 0
0.898 D= 0 0
0 1.069 0
−1
S w,s
0 . 0 (S w,d /S w,s )
In this example,
0 0
0 . 0 3.327
(4.6)
46
Computational Color Technology
The last step is to convert the destination cone responsivity (Ld , M d , S d ) to tristimulus values (X d , Y d , Z d ) under the destination illuminant.
Xd Yd Zd
= M −1 1
Ld Md , Sd
M −1 1
1.860 = 0.361 0
−1.129 0.639 0
0.220 . 0 1.089
(4.7)
These steps can be combined to give a single 3 × 3 transfer matrix τ . τ = M −1 1 DM 1
1.860 = 0.361 0
−1.129 0.639 0
0.400 × −0.226 0
0.220 0 1.089
0.708 1.165 0
0.898 0 0
0 1.0691 0
−0.081 0.942 0.046 = −0.025 0.918 0
0 0 3.327
−0.225 1 0
0.752 . 0 3.327
4.2 Helson-Judd-Warren Transform Helson, Judd, and Warren derived the inverse M matrix from a set of RGB primaries with chromaticity coordinates of (0.7471, 0.2529) for red, (1.0, 0.0) for green, and (0.1803, 0.0) for blue.5 By converting back to tristimulus values and keeping the row sum equal to 1, they derived the inverse matrix M −1 3 for the conversion from the destination cone responsivities to tristimulus values.
Xd Yd Zd
= M −1 3
Ld Md , Sd
2.954 M −1 = 1 3 0
−2.174 0 0
0.220 . 0 1
(4.8)
Knowing the inverse matrix M −1 3 , they obtained the forward matrix M 3 by matrix inversion. The forward matrix, in turn, is used to convert from source tristimulus to source cone responsivities.
Ls Ms Ss
= M3
Xs Ys , Zs
0 M 3 = −0.4510 0
1 1.3588 0
0 0.1012 . 1
(4.9)
Next, the source cone responsivity is converted to destination cone responsivities using a D matrix given by Eq. (4.4), where the cone responsivities of scene white are obtained by the product of M 3 and tristimulus values of the illuminant. If the
Chromatic Adaptation
47
source is illuminant A and the destination is illuminant C, we have
Lw,s M w,s S w,s
Lw,d M w,d S w,d
XN,A = M 3 Y N,A Z N,A 100.0 = 89.95 , 35.5
0 = −0.4510 0
1 1.3588 0
0 0.1012 1
109.8 100.0 35.5
(4.10a)
X N,C 0 = M 3 Y N,C = −0.4510 Z N,C 0 100.0 = 103.63 , 118.1
1 1.3588 0
0 0.1012 1
98.0 100.0 118.1
(4.10b)
and
0 (Lw,d /Lw,s ) D= 0 (M w,d /M w,s ) 0 0
0 1 0 = 0 1.151 0 (S w,d /S w,s ) 0 0
0 . 0 3.327 (4.11)
The conversion to destination tristimulus values is given in Eq. (4.8). For illuminant A (tungsten light) to illuminant C (average daylight), the transfer matrix is τ = M −1 3 DM 3
2.954 = 1 0
1.129 = 0 0
−2.174 0 0
0.220 0 1
−0.446 1 0
0.479 . 0 3.327
1 0 0 1.151 0 0
0 0 3.327
0 −0.451 0
1 1.359 0
0 0.101 1
4.3 Nayatani Model Nayatani and coworkers proposed a nonlinear cone adaptation model to more adequately predict various experimental data from a scaling method of the magnitude estimation.6–9 The model is a two-stage process. The first stage operates in accordance with a modified von Kries transform and the second stage is a nonlinear transform using power functions that perform a compression for each cone
48
Computational Color Technology
response. Ld = δ L [(Ls + Ln )/(Lw,d + Ln )]p L , M d = δ M [(M s + M n )/(M w,d + M n )]
(4.12a) pM
,
S d = δ S [(S s + S n )/(S w,d + S n )] , pS
(4.12b) (4.12c)
where Ln , M n , and S n are the noise terms. These added noise terms take the threshold behavior into account. The adaptation for each channel is proportional to a power function of the maximum cone response by a constant δ. These coefficients δ L , δ M , and δ S are determined to produce color constancy for medium gray stimuli. The exponents p L , p M , and p S of the power function are dependent on the luminance of the adapting field. Nayatani’s nonlinear model provides a relatively simple extension to the von Kries hypothesis . It is also capable of predicting the Hunt effect (increase in colorfulness with adapting luminance),10 the Stevens effect (increase in lightness contrast with luminance),11 and the Helson-Judd effect (hue of nonselective samples under chromatic illumination).12
4.4 Bartleson Transform The Bartleson transform is based on the von Kries hypothesis with nonlinear adaptations. Bartleson chooses the König-Dieterici fundamentals that are linearly related to the CIE 1931 standard observer by a matrix M 4 .13–15 This same matrix is also used to convert tristimulus values to cone responses.
Ls Ms Ss
= M4
Xs Ys , Zs
0.0713 M 4 = −0.3952 0
0.9625 1.1668 0
−0.0147 0.0815 . 0.5610
(4.13)
For the alteration from the source to the destination cone sensitivities, Bartleson believed that the von Kries linear relationship was not adequate to predict the adaptation on color appearance, and has proposed a prototypical form with nonlinear adaptations. Ld = δ L [(Lw,d /Lw,s )Ls ]p L , M d = δ M [(M w,d /M w,s )M s ]
pM
(4.14a) ,
S d = δ S [(S w,d /S w,s )S s ]p S ,
(4.14b) (4.14c)
where the exponent p has the general expression of p = cL (Lw,d /Lw,s )dL + cM (M w,d /M w,s )dM + cS (S w,d /S w,s )dS ,
(4.14d)
Chromatic Adaptation
49
where c L , c M , and c S are constants and the coefficients δ are δ L = Lw,d (1−p L ) ,
δ M = M w,d (1−p M ) ,
δ S = S w,d (1−p S ) .
(4.14e)
When CIE illuminants are used, the general equations for adaptation of cone sensitivities are reduced to Eq. (4.15), where the long and medium wavelengths are the same as the von Kries transform and short-wavelength response (or blue fundamental) is compressed. Ld = (Lw,d /Lw,s )Ls ,
(4.15a)
M d = (M w,d /M w,s )M s ,
(4.15b)
S d = δ S [(S w,d /S w,s )S s ]p S ,
(4.15c)
P S = 0.326(Lw,d /Lw,s )27.45 + 0.325(M w,d /M w,s )−3.91 + 0.340(S w,d /S w,s )−0.45 .
(4.15d)
This gives the following diagonal D matrix:
Ls = D Ms , Ss (Lw,d /Lw,s ) D= 0 0
Ld Md Sd
0 (M w,d /M w,s ) 0
0 . (4.16) 0 δ S (S w,d /S w,s )p S · S s (p S −1)
The conversion to the destination tristimulus values is given as
Xd Yd Zd
= M −1 4
Ld Md , Sd
M −1 4
2.5170 = 0.8525 0
−2.0763 0.1538 0
0.3676 . 0 1.7825
(4.17)
4.5 Fairchild Model In order to predict the incomplete chromatic adaptation, Fairchild modified the von Kries hypothesis to include the ability to predict the degree of adaptation using the adapting stimulus.3,16,17 Fairchild’s Model is designed to be fully compatible with CIE colorimetry and to include the illuminant discount, the Hunt effect, and incomplete chromatic adaptation. The first step of the transform from tristimulus values to cone responses is the same as the von Kries model as given in Eq. (4.3).
Ls Ms Ss
= M1
Xs Ys , Zs
0.4002 M 1 = −0.2263 0
0.7076 1.1653 0
−0.0808 0.0457 . 0.9182
(4.18)
50
Computational Color Technology
It then takes the incomplete chromatic adaptation into account:
L M S
= αs
Ls Ms , Ss
α L,s αs = 0 0
0 α M.s 0
0 0 . α S.s
(4.19)
The coefficients α L,s , α M,s , and α S,s of the diagonal matrix α s are given as follows: α L,s = pL /Lw,s , pL = (1 + Y w,s 1/3 + l e )/(1 + Y w,s 1/3 + 1/ l e ), l e = 3(Lw,s /Le )/(Lw,s /Le + M w,s /M e + S w,s /S e ),
(4.20a)
α M,s = pM /M w,s , pM = (1 + Y w,s 1/3 + me )/(1 + Y w,s 1/3 + 1/me ), me = 3(M w,s /M e )/(Lw,s /Le + M w,s /M e + S w,s /S e ),
(4.20b)
α S,s = pS /S w,s , pS = (1 + Y w,s 1/3 + s e )/(1 + Y w,s 1/3 + 1/s e ), and s e = 3(S w,s /S e )/(Lw,s /Le + M w,s /M e + S w,s /S e ),
(4.20c)
where Y w,d is the luminance of the adapting stimulus (or source illuminant) in candelas per square meter or cd/m2 . Terms with the subscript e refer to the equalenergy illuminant that has a constant spectrum across the whole visible region. The postadaptation signals are derived by a transformation that allows luminancedependent interaction among three cones.
Ld Md Sd
= βs
L M , S
1 βs = βs βs
βs 1 βs
βs βs , 1
(4.21)
and β s = 0.219 − 0.0784 log Y w,s . The β term is adopted from the work of Takahama et al. For the destination chromaticities, one needs to derive the α and β matrices for that condition, then invert and apply them in reverse sequence.
L M S
= β −1 d
Ld Md , Sd
1 βd = βd βd
βd 1 βd
βd βd , 1
(4.22)
Chromatic Adaptation
51
and β d = 0.219 − 0.0784 log Y w,d . Ld L M = α −1 M , d d S Sd
Xd Yd Zd Xd Yd Zd
α L,d αd = 0 0
0 α M,d 0
0 0
,
(4.23)
α S,d
Ld M , = M −1 1 d Sd
(4.24)
−1 −1 = M −1 1 αd β d β sαsM 1
Xs Ys . Zs
(4.25)
Subsequent experiments showed that the β matrix introduced an unwanted luminance dependency that resulted in an overall shift in lightness with luminance level. This shift introduced significant systematic error in predictions for simple object colors, lending Fairchild to revise the model by removing the β matrix.
4.6 Hunt Model Hunt proposed a rather complex model to predict color appearance under various viewing conditions. First, a linear transform using matrix M 2 is performed to convert CIEXYZ to cone responses.
Ls Ms Ss
= M2
Xs Ys , Zs
0.3897 M 2 = −0.2298 0
0.6890 1.1834 0
−0.0787 0.0815 . 1.0
(4.26)
A nonlinear response function, similar to that used by Nayatani and coworkers, is used to predict the chromatic adaptation that is inversely proportional to the purity of the color of the reference light. Hunt’s nonlinear chromatic adaptation model is very comprehensive, having many parameters for various adjustments. It includes the cone bleach factors, luminance-level adaptation factors, chromatic-adaptation factors, discounting the illuminant, and prediction of the Helson-Judd effect. The detail of the formulation is given in the original publications.18–21 Results indicate that the Hunt model provides good predictions for the appearance of colors in the Natural Color System (NCS) hues (which were developed in Sweden and adopted as a national standard in Sweden), Munsell samples, prints, and projected slides.
52
Computational Color Technology
4.7 BFD Transform Like the Bartleson transform, the BFD transform, developed at the University of Bradford, England, is a modified von Kries transform in which the shortwavelength cone signals are nonlinearly corrected by a power function with an exponent that is adaptive to the input cone signal.22–24 The middle- and longwavelength cone signals are the same as the von Kries transform. First, the source tristimulus values are normalized with respect to the luminance Y s then linearly transformed to cone response signals by using the Bradford matrix M B .
Ls Ms Ss
= MB
X s /Y s Y s /Y s , Z s /Y s
0.8951 M B = −0.7502 0.0389
0.2664 1.7135 −0.0685
−0.1614 0.0367 . (4.27) 1.0296
The source cone responsivity is converted to destination cone signals using Eq. (4.28). Ld = [F D (Lw,d /Lw,s ) + 1 − F D ]Ls ,
(4.28a)
M d = [F D (M w,d /M w,s ) + 1 − F D ]M s ,
(4.28b)
τ ) + 1 − F D ]Ssτ , S d = [F D (S w,d /Sw,s
(4.28c)
τ = (S w,s /S w,d )0.0834 ,
(4.28d)
where F D is a factor to discount the illuminant difference. For the complete adaptation, F D = 1 and Eq. (4.28) becomes Ld = (Lw,d /Lw,s )Ls ,
(4.29a)
M d = (M w,d /M w,s )M s ,
(4.29b)
τ )Ssτ . S d = (S w,d /Sw,s
(4.29c)
If there is no adaptation, F D = 0 and we have Ld = Ls , M d = M s , and S d = Ssτ . For incomplete adaptation, 0 < F D < 1, specifying the proportional level of adaptation to the source illuminant, observers are adapted to chromaticities that lie somewhere between the source and destination illuminants. However, the diagonal D matrix, no longer as simple as Eq. (4.4), contains the destination to source ratios of the cone responsivities with the blue channel compression.
Ld Md Sd
(Lw,d /Lw,s ) Ls 0 = D Ms , D = Ss 0
0 (M w,d /M w,s ) 0
0 0
τ )S (τ −1) (S w,d /Sw,s s
.
(4.30)
Chromatic Adaptation
53
The conversion to the destination tristimulus values is given in Eq. (4.31).
Xd Yd Zd
= M −1 B
Ld Y s M dY s , S dY s
0.98699 M −1 = −0.43231 B −0.00853
−0.14705 0.51836 0.04004
−0.15996 0.04929 . 0.96849 (4.31)
The BFD transform is adopted in the CIECAM97s color appearance model.
4.8 Guth Model Guth’s model is derived from the field of vision science rather than colorimetry. Its cone responsivities are not a linear transform of the color-matching functions. Therefore, the model is a significant variation of the von Kries transform and similar in some ways with the Nayatani model25,26 in that it uses a power function with an exponent of 0.7. Ld = Lr {1 − [Lw,d /(Lw,d + σ )]},
and
Lr = 0.66Ls 0.7 + 0.002,
(4.32a)
M d = M r {1 − [M w,d /(M w,d + σ )]},
and
M r = 1.0M s 0.7 + 0.003,
(4.32b)
S d = S r {1 − [S w,d /(S w,d + σ )]},
and
S r = 0.45S s 0.7 + 0.00135. (4.32c)
The σ is a constant that can be thought of as a noise factor. A von Kries-type gain control coefficient can be drawn if the nonlinear relationship is ignored.3
4.9 Retinex Theory Edwin Land, founder of Polaroid, and his colleagues developed the retinex theory. Land coined the term “retinex” from “retina” and “cortex” to designate the physiological mechanisms in the retinal-cortical structure, where elements with the same wavelength sensitivity cooperate to form independent lightness images.27 Land recognized that although any color can be matched by three primaries with proper intensities, a particular mixture of these primaries does not warrant a unique color sensation because the color of an area changes when the surrounding colors are changed. To demonstrate this phenomenon and his theory that a particular wavelength-radiance distribution can produce a wide range of color sensation, Land developed “Color Mondrian” experiments. The Color Mondrian display uses about 100 different color patches arranged arbitrarily so that each color patch is surrounded by at least five or six different color patches.28 The display is illuminated by three projectors; each projector is fitted with a different interference filter to give red, green, and blue, respectively, and is equipped with an independent voltage control for intensity adjustments. The observer picks an area in the Mondrian, then the experimenter measures the three radiances coming from that
54
Computational Color Technology
area. A second area of a different color is picked by the observer, the experimenter then adjusts the strengths of the three projectors so that the radiances that come from the second patch are the same as the first patch. The interesting result is that the observer reports the same color appearance even though the radiance measurements show that the light reaching the eye is identical to the first color patch. Land suggested that color appearance is controlled by surface reflectances rather than by the distribution of reflected light. The theory states that each color is determined by a triplet of lightnesses, and that each lightness, in a situation like the Color Mondrian, corresponds to the reflectance of the area measured with a photoreceptor having the same spectral sensitivity as one of the three cone pigments.29 The output of a retinex is three arrays of computed lightnesses that are determined by taking the ratio of the signal at any given point in the scene and by normalizing it with an average of the signals in that retinex throughout the scene.30 The theory acknowledges the color change due to the changes in surrounding colors, where the influence of the surrounding colors can be varied by changing the spatial distribution of the retinex signals. Therefore, the key feature of the retinex theory is that it takes the spatial distribution of colors into consideration for the purpose of modeling the visual perceptions in a complex scene.
4.10 Remarks Chromatic adaptation is the single most important property in understanding and modeling color appearance. There are similarities in these models, such as the initial linear transform from tristimulus values to cone responses. The general form can be summarized as (i) the tristmulus values to cone responsivity transform that is usually linear except in the Guth model, (ii) the cone responsivity transform between source and destination illumination that is the central part of the chromatic adaptation and uses a variety of functions, and (iii) the conversion from the destination cone responsivity to tristimulus values, which is usually a linear transform. As far as the computational cost is concerned, the linear models based on the von Kries hypothesis are only a matrix transform between the source and destination tristimulus. In addition, there are many zeros in the transfer matrices that further lower the cost of computation. For nonlinear transforms, having more complex equations and power functions, the computational cost is much higher. However, if all parameters and exponents are fixed, the transfer matrix may be precomputed to lower the computational cost and enhance the speed.
References 1. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, pp. 429–449 (1982). 2. B. A. Wandell, Foundations of Vision, Sinauer Assoc., Sunderland, MA, pp. 309–314 (1995).
Chromatic Adaptation
55
3. M. D. Fairchild, Color Appearance Models, Addison-Wesley Longman, Reading, MA, pp. 173–214 (1998). 4. J. von Kries, Chromatic adaptation, (1902), Translation: D. L. MacAdam, Sources of Color Science, MIT Press, Cambridge, MA (1970). 5. H. Helson, D. B. Judd, and M. H. Warren, Object-color changes from daylight to incandescent filament illumination, Illum. Eng. 47, pp. 221–233 (1952). 6. K. Takahama, H. Sobagaki, and Y. Nayatani, Analysis of chromatic adaptation effect by a linkage model, J. Opt. Soc. Am. 67, pp. 651–656 (1977). 7. Y. Nayatani, K. Takahama, and H. Sobagaki, Estimation of adaptation effects by use of a theoretical nonlinear model, Proc. of 19th CIE Session, Kyoto, Japan (1979), CIE Publ. No. 5, pp. 490–494 (1980). 8. Y. Nayatani, K. Takahama, and H. Sobagaki, Formulation of a nonlinear model of chromatic adaptation, Color Res. Appl. 6, pp. 161–171 (1981). 9. Y. Nayatani, K. Takahama, and H. Sobagaki, On exponents of a nonlinear model of chromatic adaptation, Color Res. Appl. 7, pp. 34–45 (1982). 10. R. W. G. Hunt, Light and dark adaptation and the perception of color, J. Opt. Soc. Am. 42, pp. 190–199 (1952). 11. J. C. Stevens and S. S. Stevens, Brightness functions: Effects of adaptation, J. Opt. Soc. Am. 53, pp. 375–385 (1963). 12. H. Helson, Fundamental problems in color vision, I: The principle governing changes in hue, saturation, and lightness of non-selective samples in chromatic illumination, J. Exp. Psych. 23, pp. 439–477 (1938). 13. C. J. Bartleson, Changes in color appearance with variations in chromatic adaptation, Color Res. Appl. 4, pp. 119–138 (1979). 14. C. J. Bartleson, Predicting corresponding colors with changes in adaptation, Color Res. Appl. 4, pp. 143–155 (1979). 15. C. J. Bartleson, Colorimetry, Optical Radiation Measurements, Color Measurement, F. Grum and C. J. Bartleson (Eds.), Academic Press, New York, Vol. 2, pp. 130–134 (1980). 16. M. D. Fairchild, A model of incomplete chromatic adaptation, Proc. 22nd Session of CIE, CIE, Melbourne, pp. 33–34 (1991). 17. M. D. Fairchild, Formulation and testing of an incomplete-chromaticadaptation model, Color Res. Appl. 16, pp. 243–250 (1991). 18. R. W. G. Hunt, A model of colour vision for predicting colour appearance, Color Res. Appl. 7, pp. 95–112 (1982). 19. R. W. G. Hunt, A model of colour vision for predicting colour appearance in various viewing conditions, Color Res. Appl. 12, pp. 297–314 (1987). 20. R. W. G. Hunt, Revised colour-appearance model for related and unrelated colours, Color Res. Appl. 16, pp. 146–165 (1991). 21. R. W. G. Hunt, An improved predictor of colourfulness in a model of colour vision, Color Res. Appl. 19, pp. 23–26 (1994). 22. M. R. Luo, M.-C. Lo, and W.-G. Kuo, The LLAB (l:c) color model, Color Res. Appl. 21, pp. 412–429 (1996).
56
Computational Color Technology
23. M. R. Luo, The LLAB model for color appearance and color difference evaluation, Recent Progress in Color Science, R. Eschbach and K. Braum (Eds.), IS&T, Springfield, VA, pp. 158–164 (1997). 24. C. Li, M. R. Luo, and R. W. G. Hunt, CAM97s2 model, IS&T/SID 7th Imaging Conf.: Color Science, System, and Application, pp. 262–263 (1999). 25. S. L. Guth, Model for color vision and light adaptation, J. Opt. Soc. Am. A 8, pp. 976–993 (1991). 26. S. L. Guth, Further applications of the ATD model for color vision, Proc. SPIE 2414, pp. 12–26 (1995). 27. E. H. Land, The retinex, Am. Sci. 52, pp. 247–274 (1964). 28. E. H. Land, The retinex theory color vision, Proc. R. Inst. Gt. Brit. 47, pp. 23– 58 (1975). 29. J. J. McCann, S. P. McKee, and T. H. Taylor, Quantitative studies in retinex theory, Vision Res. 16, pp. 445–458 (1976). 30. E. H. Land, Recent advances in retinex theory, Vision Res. 26, pp. 7–21 (1986).
Chapter 5
CIE Color Spaces Different color-imaging devices use different color spaces; well-known examples are the RGB space of televisions and cmy (or cmyk) space of printers. Colors produced by these devices are device specific, depending on the characteristics of the device. To ensure a proper color rendition in various devices, a device-independent color space, such as CIE color spaces using colorimetry to give a quantitative measure for all colors, is needed to serve as a reliable interchange standard. CIE color spaces are the colorimetric spaces that are device-independent. The nucleus of the CIE color space is the tristimulus values or CIEXYZ space that is discussed in Chapter 1. In this chapter, we present derivatives and modifications of the CIEXYZ space and the related topics of the gamut boundary, color appearance model, and spatial domain extension.
5.1 CIE 1931 Chromaticity Coordinates Chromaticity coordinates are the normalization of the tristimulus values X, Y , and Z; they are the projection of the tristimulus space to the 2D x-y plane.1 Mathematically, they are expressed as x = X/(X + Y + Z),
(5.1a)
y = Y/(X + Y + Z),
(5.1b)
z = Z/(X + Y + Z),
(5.1c)
x + y + z = 1,
(5.1d)
and
where x, y, and z are the chromaticity coordinates. 5.1.1 Color gamut boundary of CIEXYZ The color gamut boundary in CIEXYZ space is well defined in chromaticity diagrams as the spectrum locus enclosed by spectral stimuli. The gamut boundary is computed from color-matching functions (CMF), x(λ), ¯ y(λ), ¯ and z¯ (λ) of the CIE 57
58
Computational Color Technology
1931 2◦ or CIE 1964 10◦ observer by using Eq. (5.2) to give chromaticity coordinates of spectral stimuli.1 x(λ) = x(λ)/[ ¯ x(λ) ¯ + y(λ) ¯ + z¯ (λ)],
(5.2a)
y(λ) = y(λ)/[ ¯ x(λ) ¯ + y(λ) ¯ + z¯ (λ)],
(5.2b)
where λ is the wavelength. The chromaticity diagram is the plot of x versus y because the three chromaticity coordinates sum to 1; only two chromaticity coordinates x and y suffice for a specification of the chromaticity. Figure 5.1 shows the gamut boundaries of two CMFs, where the CIE 1931 CMF gives a slightly larger gamut size than the CIE 1964 CMF in the green, blue, and purple regions. The boundary of the color locus is occupied by the spectral colors. The chromaticity coordinates represent the relative amounts of the three stimuli X, Y , and Z required to obtain any color. However, they do not indicate the luminance of the resulting color. The luminance is incorporated into the Y value. Thus, a complete description of a color is given by the triplet (x, y, Y ). The chromaticity diagram provides useful information such as the dominant wavelength, complementary color, and color purity. The dominant wavelength is
Figure 5.1 Color gamuts of CIEXYZ space.
CIE Color Spaces
59
based on the Grassmann’s laws that the chromaticities of all additive stimulus mixtures from two primary colorants lie along a straight line in the chromaticity diagram. Therefore, the dominant wavelength of a color is obtained by extending the line connecting the color and the illuminant to the spectrum locus. The complement of a spectral color is on the opposite side of the line connecting the color and the illuminant used. A color and its complement, when added together in a proper proportion, yield white. If the extended line for obtaining the dominant wavelength intersects the “purple line,” the straight line that connects two extreme spectral colors (usually, 380 and 770 nm), then the color will have no dominant wavelength in the visible spectrum. In this case, the dominant wavelength is specified by the complementary spectral color with a suffix c. The value is obtained by extending a line backward through the illuminant to the spectrum locus. CIE defines purity of a given intermediate color as the ratio of two distances: the distance from the illuminant to the color and the distance from the illuminant through the color to the spectrum locus or the purple line. Pure spectral colors lie on the spectrum locus indicating a fully saturated purity of 100%. The illuminant represents a fully diluted color with a purity of 0%.
5.2 CIELUV Space CIEXYZ is a visually nonuniform color space, where colors, depending on the location in the color locus, show different degrees of error distributions. Many efforts have been dedicated to minimizing this visually nonuniform error distribution. One way to achieve more visually uniform color spaces is to perform nonlinear transforms of the CIEXYZ that describe color using opponent-type axes relative to a given absolute white-point reference. CIELUV and CIELAB are two well-known examples. CIELUV is a transform of the 1976 UCS chromaticity coordinate u , v , and Y .1,2 L∗ = 116(Y/Yn )1/3 − 16 if Y/Yn ≥ 0.008856,
(5.3a)
L∗ = 903.3(Y/Yn )
(5.3b)
if Y/Yn < 0.008856,
u∗ = 13L∗ (u − un ),
(5.3c)
v ∗ = 13L∗ (v − vn ),
(5.3d)
where L∗ is the lightness, Xn , Yn , Zn are tristimulus values of the illuminant, and u = 4X/(X + 15Y + 3Z),
v = 9Y/(X + 15Y + 3Z).
(5.4a) (5.4b)
The color difference in CIELUV space is calculated as the Euclidean distance. 1/2 . E uv = L∗2 + u∗2 + v ∗2
(5.5)
60
Computational Color Technology
It is sometimes desirable to identify the components of a color difference as correlates of perceived hue and colorfulness. Relative colorfulness or chroma is defined as 1/2 ∗ = u∗2 + v ∗2 , Cuv
(5.6)
and the relative colorfulness attribute called saturation is defined as
or
1/2 ∗ = 13 u∗2 + v ∗2 Suv
(5.7a)
∗ ∗ Suv = Cuv /L∗ .
(5.7b)
Hue angle is defined as h∗uv = tan−1 (v ∗ /u∗ ).
(5.8)
∗2 ∗2 1/2 − L∗2 − Cuv . h∗uv = Euv
(5.9)
and hue difference is
5.2.1 Color gamut boundary of CIELUV Like CIEXYZ, CIELUV has a well-defined gamut boundary that is based on the CIE 1976 uniform chromaticity scale (UCS) u and v . ¯ x(λ) ¯ + 15y(λ) ¯ + 3¯z(λ)], u (λ) = 4x(λ)/[
(5.10a)
v (λ) = 9y(λ)/[ ¯ x(λ) ¯ + 15y(λ) ¯ + 3¯z(λ)].
(5.10b)
Figure 5.2 gives the color gamut boundaries of the CIELUV space from the CIE 1931 and 1964 CMFs. Again, the CIE 1931 CMF is larger than the CIE 1964 CMF, where the gamut size difference between these two observers seems wider in CIELUV color space.
5.3 CIELAB Space CIELAB is a nonlinear transform of 1931 CIEXYZ.1 L∗ = 116f (Y/Yn ) − 16 or ∗ a = 500[f (X/Xn ) − f (Y /Yn )] b∗ = 200[f (Y/Yn ) − f (Z/Zn )] ∗ f (X/Xn ) 0 116 0 −16 L f (Y/Yn ) a ∗ = 500 −500 0 0 f (Z/Zn ) ∗ b 0 200 −200 0 1
(5.11a)
CIE Color Spaces
61
Figure 5.2 Color gamuts of CIELUV space.
and f (t) = t 1/3 = 7.787t + (16/116)
1 ≥ t > 0.008856,
(5.11b)
0 ≤ t ≤ 0.008856,
(5.11c)
where Xn , Yn , and Zn are the tristimulus values of the illuminant. Similar to CIELUV, the relative colorfulness or chroma is defined as 1/2 ∗ Cab = a ∗2 + b∗2 .
(5.12)
h∗ab = tan−1 (b∗ /a ∗ ).
(5.13)
Hue angle is defined as
Again, the color difference Eab is defined as the Euclidean distance in the 3D CIELAB space. 1/2 Eab = L∗2 + a ∗2 + b∗2 .
(5.14)
62
Computational Color Technology
The just noticeable color difference is approximately 0.5 to 1.0 Eab units. CIELAB is perhaps the most popular color space in use today. However, the problem of deriving suitably uniform metrics for a perceived small extent of color is not yet solved. CIE continues to carry out coordinated research on color difference evaluation. 5.3.1 CIELAB to CIEXYZ transform The inverse transform from CIELAB to CIEXYZ is given in Eq. (5.15). X = Xn [a ∗ /500 + (L∗ + 16)/116]3
if L∗ > 7.9996,
(5.15a)
= Xn (a ∗ /500 + L∗ /116)/7.787
if L∗ ≤ 7.9996,
(5.15b)
Y = Yn [(L∗ + 16)/116]3
if L∗ > 7.9996,
(5.15c)
= Yn L∗ /(116 × 7.787)
if L∗ ≤ 7.9996,
(5.15d)
Z = Zn [−b∗ /200 + (L∗ + 16)/116]3 if L∗ > 7.9996,
(5.15e)
= Zn (−b∗ /200 + L∗ /116)/7.787
if L∗ ≤ 7.9996.
(5.15f)
5.3.2 Color gamut boundary of CIELAB Unlike CIEXYZ and CIELUV spaces, CIELAB does not have a chromaticity diagram. As pointed out by Bartleson, this is because values of a ∗ and b∗ depend on L∗ .2 However, this does not mean that there is no gamut boundary for CIELAB. As early as 1975, Judd and Wyszecki already gave a graphic outer boundary of the CIELAB space viewed under illuminant D65 and CIE 1964 observer.3 Although the detail was not revealed on how this graph was generated, they did mention the use of optimal color stimuli. An optimal color stimulus is an imaginary stimulus, having two or more spectral components (usually, no more than three wavelengths) with a unit reflectance at the specified wavelength, and zero elsewhere. No real object surfaces can have this kind of abrupt reflectance curves. Although CIELAB space does not have a chromaticity diagram, it does have boundaries. The boundaries are obtained by using spectral and optimal stimuli if the standard observer and illuminant are selected.4 First, we compute tristimulus values of the spectral stimuli. Second, we compute tristimulus values of all possible two-component optimal stimuli. These tristimulus values are converted to L∗ , a ∗ , and b∗ via Eq. (5.3). For computing gamut boundary in CIELAB, tristimulus values of the object in Eq. (5.3) are replaced by a CMF at a given wavelength λ, then tristimulus values of the illuminant are normalized to Yn = 1. 1/3 L∗ = 116[y(λ)/Y ¯ − 16, n]
(5.16a)
CIE Color Spaces
63
1/3 1/3 a ∗ = 500 [x(λ)/X ¯ − [y(λ)/Y ¯ , n] n] 1/3 ¯ − [¯z(λ)/Zn ]1/3 , b∗ = 200 [y(λ)/Y n]
or
L∗ a∗ b∗
0 = 500 0
116 −500 200
0 0 −200
¯ x(λ)/X n −16 ¯ y(λ)/Y n 0 . z¯ (λ)/Zn 0 1
(5.16b) (5.16c)
(5.16d)
Two-dimensional projection of CIE spectral stimuli under either D50 or D65 in CIELAB shows that stimuli at both the high- and low-wavelength ends locate near the origin of the diagram where the illuminant resides as shown in Fig. 5.3. These results give a concave area in the positive a ∗ quadrants encompassed color regions from red through magenta to purple. This is because stimuli are weak at both ends of the CMF, having very small brightness and colorfulness. Thus, they are perceived as if they were achromatic hues. It is a known fact that a single spectral stimulus does not give saturated magenta colors. Magenta colors require at least two spectral stimuli in proper wavelengths
Figure 5.3 The spectral stimuli of CIE 1931 and 1964 CMFs in CIELAB space under D50 or D65 illuminant.
64
Computational Color Technology
with respect to each other such as one in the red region and the other in the blue region. Therefore, we start by computing all possible optimal stimuli of two spectral wavelengths in the range from 390 to 750 nm. This is achieved by fixing one stimulus at a wavelength λ1 and moving the other stimulus across the whole spectrum at a 5-nm interval, starting from λ2 = λ1 + 5 nm until it reaches the other end of the spectrum. The first stimulus is then moved to the next wavelength and the second stimulus again is scanned across the remaining spectrum at the 5 nm interval. This procedure is repeated until both stimuli reach the other end. Note that the 5-nm interval is an arbitrary choice. One can reduce the interval to get more precise wavelength location, or one can widen the interval to save computation cost with some sacrifice in accuracy. We employ Grassmann’s additivity law (see Section 1.1 for more detail) given in Eq. (5.17) with normalization (actually, this is the averaging because Y n is normalized to 1) to compute tristimulus values X, Y , and Z of two stimuli. ¯ 2 )]/2, X = [x(λ ¯ 1 ) + x(λ
(5.17a)
¯ 2 )]/2, Y = [y(λ ¯ 1 ) + y(λ
(5.17b)
Z = [¯z(λ1 ) + z¯ (λ2 )]/2.
(5.17c)
These tristimulus values are then plugged into Eq. (5.16) to obtain CIELAB values. With additional data from two-component optimal stimuli, we fill the concave area in the positive a ∗ quadrants somewhat to give a near convex boundary as shown in Fig. 5.4. Connecting the outermost colors produced by optimal and spectral stimuli, we obtain the boundary of the CIELAB space with respect to the illuminant used as shown in Fig. 5.5. For D65 , the resulting gamut looks pretty close to the outer boundary given by Judd and Wyszecki.3 We also obtain results for other combinations of illuminant and standard observer. For the CIE 1931 observer under illuminants D50 and D65 , D65 gives a substantially larger area in the green, cyan, blue, and purple regions, whereas D50 gives a slightly larger area in the magenta and red regions. The CIE 1964 observer under D50 and D65 gives a similar trend. Under the same illuminant, the CIE 1964 observer is slightly larger than the CIE 1931 observer in the cyan and blue regions, whereas the CIE 1931 observer is larger in the green, red, magenta, and purple regions. Generally speaking, the color gamut difference is small with respect to the difference in standard observer, but it is large with respect to the difference in illuminant used. By employing Eqs. (5.16) and (5.17), the computation indicates that there is indeed a gamut boundary in CIELAB space using spectral and optimal stimuli. However, unlike chromaticity diagrams of CIEXYZ and CIELUV that are fixed under any illumination (the gamut boundary is illuminant independent), the size of the CIELAB gamut depends on the illuminant used because the CIELAB is defined as the normalization with respect to the illuminant, which is a form of the chromatic adaptation [see Eq. (5.11)]. The illuminant has a significant influence on
CIE Color Spaces
65
Figure 5.4 The additional space of CIELAB.
the size of the gamut boundary in CIELAB space, whereas the standard observer has only a minor effect. From this computation, the common practice of connecting six primaries in CIELAB space to give a projected 2D color gamut is not a strictly correct way of defining a color gamut. However, it is a pretty close approximation for real colorants. To have a better definition of the color gamut in CIELAB plot, one should generate and measure more two-color mixtures.
5.4 Modifications The primary concerns of the CIE color space seem to be the visual uniformity and color difference measure. Since 1931, many attempts have been made to derive satisfactory formulas for establishing a uniform color space and a constant color difference across the whole space. One approach was based on the Munsell system,5 where Munsell samples were defined by three uniform scales of hue, value, and chroma. Thus, the difference between successive samples in the Munsell book of colors should be the same. If one plots Munsell samples of constant value (lightness), for example, in a uniform color space, one should get circles of increasing radius. However, none of the existing CIE color spaces and modifications meets
66
Computational Color Technology
Figure 5.5 Color gamut boundaries of CIELAB space under D50 or D65 illuminant.
this criterion as shown in Fig. 5.6.6 The benefit of plotting Munsell samples is that it provides the means to check and compare the uniformity of color spaces. The other approach was based on the MacAdam ellipses7 as shown in Fig. 5.7. If one plots small color differences in various directions from a particular color, the differences fall into an ellipsoid.6–8 For a uniform color space, the small color differences should form a circle instead of an ellipsoid. Thus, the MacAdam ellipses form the basis for a number of color difference formulas and a uniformity measure of the color space. These activities led to the establishment of CIELUV and CIELAB color spaces in 1976. Compared to CIEXYZ space, CIELUV and CIELAB are major improvements with respect to visual uniformity, but they are not totally uniform (see Fig. 5.6). As early as 1980, experimental works by McDonald already indicated that CIELAB was not completely satisfactory.9 If CIELAB were uniform, the plot of discrimination ellipses in the chromatic plane of a∗ versus b∗ should form equal-sized circles. But, the experimental results show that ellipses consistently increase in size as the distance from neutral (gray) increases. Therefore, many other uniform color spaces were proposed such as the Frei space,10 OSA,11,12 ATD,13 LABHNU,14 Hunter LAB,15 SVF space,16 Nayatani space,17 Hunt space,18 and IPT space.19 Recently, Li and Luo proposed a uniform J a b color space based on CIE color appearance model CAM97s2 (see Section 5.5).
CIE Color Spaces
67
Figure 5.6 Munsell colors of value 5 in (a) CIELAB, (b) CIELUV, (c) Hunt, and (d) Nayatani spaces. (Reprinted with permission of John Wiley & Sons, Inc.)6
A comparison study among CIELAB, CIECAM97s2, IPT, and J a b using six sets of data with large color differences shows that the J a b space gives a smaller mean color difference.20 Moreover, several color distance formulas (or color difference measures) have been constructed to determine color difference in terms of the just noticeable difference (JND); important ones are FMC,21 CMC,22–24 and BFD.25,26 Most color difference formulas proposed after 1976 are based on the non-Euclidean distance between two color stimuli, having a general expression of 1/2 E = [L∗ /(K L S L )]2 + [C ∗ /(K C S C )]2 + [H ∗ /(K H S H )]2 ,
(5.18)
where L∗ , C ∗ , and H ∗ are differences in lightness, chroma, and hue predictors, respectively. Parameters S L , S C , and S H are scaling factors that allow corrections of specific faults in the formula, and K L , K C , and K H are parametric factors that can be changed depending on viewing parameters such as textures and backgrounds. The ISO color difference standard of the CMC formula (CIE94) and BFD fall into this category. They differ in S and K parameters. For example, the simpler CIE94 formula has K L = K C = K H = 1, S L = 1, S C = 1 + 0.045C∗ab , and
68
Computational Color Technology
Figure 5.7 MacAdam ellipses in the constant lightness plane with luminance factor 0.2 plotted in (a) CIELAB, (b) CIELUV, (c) Hunt, and (d) Nayatani color spaces. (Reprinted with permission of John Wiley & Sons, Inc.)6
S H = 1 + 0.015C∗ab .22 The CMC formula has K L = K C = K H = 1 for the best fit to perceptibility data and K L = 2 for textile and other critical acceptability usage. But, it has very complex expressions for the S parameters that allow calculation of tolerance ellipsoids, which are different in size, as required for different parts of the color space. The ellipsoids are scaled so that differences in lightness, chroma, and hue, as defined by the formula, agree visually with the perceived size of these differences. In 2000, CIE released a general formula for color difference, CIEDE2000, as given in Eq. (5.19).27,28 E = [L∗ /(K L S L )]2 + [C ∗ /(K C S C )]2 + [H ∗ /(K H S H )]2 1/2 + R T Φ(C ∗ H ∗ ) . (5.19) A new term R T is introduced to deal with interactions between hue and chroma differences, which is required for blue colors to correct for the orientation of ellipses. Color difference formulas of non-Euclidean distance are rather complex; they are difficult to understand and cumbersome to use.
CIE Color Spaces
69
5.5 CIE Color Appearance Model A color appearance model is any color model that includes predictors of at least the relative color appearance attributes of lightness, chroma, and hue. To have reasonable predictors of these attributes, the model must include at least some form of a chromatic adaptation transform (see Chapter 4). All chromatic adaptation models have their roots in the von Kries hypothesis. The modern interpretation of the von Kries model is that each cone has an independent gain control as expressed in Eq. (5.20).
La Ma Sa
1/Lmax = 0 0
0 1/M max 0
0 0 1/S max
L M , S
(5.20)
where L, M, and S are the initial cone responses; La , M a , and S a are the cone signals after adaptation; and Lmax , M max , and S max are the cone responses for the scene white or maximum stimulus. This definition enables color spaces CIELAB and CIELUV to be considered as color appearance models.29 More complex models that include predictors of brightness, colorfulness, and various luminancedependent effects are the Nayatani,30 Hunt,31 RLAB,32 ATD,33 and LLAB34 models. Nayatani’s and Hunt’s models, evolved from many decades of studies, are capable of predicting an extensive array of color appearance phenomena. They are comprehensive and complex. ATD, developed by Guth, is a different type of model from the others. It is aimed at describing color vision. RLAB and LLAB are similar in structure; they are the extension of CIELAB and are relatively simple. In view of the importance of the color appearance in cross-media image renditions, the CIE has formed a committee for recommending a color appearance model. In 1997, the CIE recommended an interim color appearance model CIECAM97s.35 The formulation of CIECAM97s builds on the work of many researchers in the field of color appearance.29–34 It is a joint effort of top color scientists around the world. Subsequent studies have found three drawbacks of the model. In 2002, a revised model CIECAM02 was published.36 The formulation of CIECAM02 is the revision to CIECAM97s, but using the basic structure and form of CIECAM97s. Comparison studies indicate that CIECAM02 performs as well as or better than CIECAM97s in almost all cases and has a significant improvement in the prediction of saturation.37 Therefore, CIECAM02 is recommended for the CIE color appearance model. The formulation begins with a conversion from CIEXYZ to spectrally sharpened cone responses RGB (see Section 12.8 for the spectral sharpening) via a matrix multiplication for both sample and white point, where the matrix is the CAT02 (CIECAM97s uses the Bradford matrix, see M B of Chapter 4).
R X 0.7328 G = M CAT02 Y = −0.7036 B Z 0.0030
0.4296 1.6975 0.0136
−0.1624 0.0061 0.9834
X Y . Z
(5.21)
70
Computational Color Technology
The next step is the chromatic adaptation transform, which is a modified von Kries adaptation (CIECAM97s uses the exponential nonlinearity added to the shortwavelength blue channel). R c = [D(Y w /R w ) + 1 − D]R,
(5.22a)
Gc = [D(Y w /Gw ) + 1 − D]G,
(5.22b)
B c = [D(Y w /B w ) + 1 − D]B,
(5.22c)
D = F {1 − (1/3.6) exp[−(LA + 42)/92]},
(5.23)
where the D factor is used to specify the degree of adaptation, which is a function of the surround and LA (the luminance of the adapting field in candelas per square meter or cd/m2 ). The value of D is set equal to 1.0 for complete adaptation to the white point and 0.0 for no adaptation. In practice, D is greater than 0.65 for a dark surround and quickly approaches 0.8 with increasing LA ; for a dim surround, D is greater than 0.75 and quickly approaches 0.9 with increasing LA ; for an average surround, D is greater than 0.84 and quickly approaches 1.0 with increasing LA . Similar transformations are made for the source white point. The F value is set at 1.0, 0.9, or 0.8 for the average, dim, or dark surround, respectively. Next, parameters for the viewing conditions are computed. The value F L is calculated from Eqs. (5.24) and (5.25). k = 1/(5LA + 1),
2 F L = 0.2k 4 (5LA ) + 0.1 1 − k 4 (5LA )1/3 .
(5.24) (5.25)
The background induction factor g is a function of the background luminance factor with a range from 0 to 1. g = Y b /Y w .
(5.26)
The value g can then be used to calculate the chromatic brightness induction factors, N bb and N cb , and the base exponential nonlinearity z. N bb = N cb = 0.725(1/g)0.2 , z = 1.48 + g
1/2
(5.27) (5.28)
.
Postadaptation signals for both sample and source white are transformed from the sharpened cone responses to the Hunt-Pointer-Estevez cone responses using Eq. (5.29).
R G B
= M H M CAT02 −1
Rc Gc , Bc
(5.29)
CIE Color Spaces
where
and
71
0.38971 0.68898 −0.07868 M H = −0.22981 1.18340 0.04641 0.0 0.0 1.00000 1.096124 −0.278869 0.182745 M CAT02 −1 = 0.454369 0.473533 0.072098 . −0.009628 −0.005698 1.015326
Postadaptation nonlinear response compressions are performed by using Eq. (5.30).
(F L R /100)0.42 + 27.13 + 0.1, (5.30a)
Ga = 400(F L G /100)0.42 (F L G /100)0.42 + 27.13 + 0.1, (5.30b)
Ba = 400(F L B /100)0.42 (F L B /100)0.42 + 27.13 + 0.1. (5.30c) Ra =
400(F L R /100)0.42
The preliminary Cartesian coordinates a and b are calculated as follows: a = Ra − 12Ga /11 + Ba /11, b = (1/9) Ra + Ga − 2Ba .
(5.31) (5.32)
They are used to calculate a preliminary magnitude t and hue angle h. 1/2
t = e a 2 + b2 / Ra + Ga + (21/20)Ba ,
(5.33)
h = tan−1 (b/a).
(5.34)
Knowing h, we can compute an eccentricity factor e, which in turn is used to calculate the hue composition H . e = (12500/13)N c N cb [cos(hπ/180 + 2) + 3.8], H = Hi + [100(h − h1 )/e1 ]/[(h − h1 )/e1 + (h2 − h)/e2 ].
(5.35) (5.36)
The value N c in Eq. (5.35) is set at 1.0, 0.95, or 0.8 for average, dim, or dark surround, respectively, and the value N cb is calculated from Eq. (5.27). Table 5.1 gives h, e, and Hi values for red, yellow, green, and blue colors. The achromatic response Aˆ is calculated by using Eq. (5.37) for both sample and white. The lightness J is calculated from the achromatic signals of the sample and white using Eq. (5.38).
Aˆ = 2Ra + Ga + (1/20)Ba − 0.305 N bb , ˆ Aˆ w σ z , J = 100 A/
(5.37) (5.38)
72
Computational Color Technology
where σ is the constant for the impact of the surround; σ = 0.69 for an average surround, 0.59 for a dim surround, 0.525 for a dark surround, and 0.41 for cut-sheet transparencies. Knowing the achromatic response and lightness, the perceptual attribute correlate for brightness Q can then be calculated. Q = (4/σ )(J /100)1/2 Aˆ w + 4 F L 0.25 .
(5.39)
The chroma correlate C can be computed using the lightness J and temporary magnitude t. C = t 0.9 (J /100)1/2 (1.64 − 0.29g )0.73 .
(5.40)
Knowing the chroma C, we can calculate the colorfulness M and the saturation correlate s. M = CF L 0.25 ,
(5.41)
s = 100(M/Q)1/2 .
(5.42)
Finally, we can determine the Cartesian representations using the chroma correlate C and hue angle h. a C = C cos(h),
(5.43)
bC = C sin(h).
(5.44)
The notations a C and bC with subscript C specify the use of the chroma correlate. The corresponding Cartesian representations for colorfulness M, a M , and bM , and saturation correlate s, a s , and bs , can be computed in a similar way. As one can see, CIECAM02 is very computationally intensive. No real-time application of it is known. However, a major application of the color appearance models, CIECAM97s and CIECAM02 in particular, is the evaluation of color differences. The performances of the original CAMs and their extensions were tested using two types of color-difference data: large- and small-magnitude color differences. Results showed that the CIECAM02-based models in general gave a more accurate prediction than the CIECAM97s-based models. The modified version of CIECAM02 gave satisfactory performance in predicting different data sets (better than or equal to the best available uniform color spaces and color-difference Table 5.1 Perceptual attribute correlates of unique colors.
h e Hi
Red
Yellow
Green
Blue
Red
20.14 0.8 0
90 0.7 100
164.25 1.0 200
237.53 1.2 300
380.14 0.8 400
CIE Color Spaces
73
formulas). This strongly suggests that a universal color model based on a colorappearance model can be achieved for all colorimetric applications: color specification, color difference, and color appearance.38
5.6 S-CIELAB Zhang and Wandell extended CIELAB to account for the spatial as well as color errors in reproduction of the digital color image.39 They call this model SpatialCIELAB or S-CIELAB. The design goal is to apply a spatial filtering to the color image in a small-field or fine-patterned area, but reverting to the conventional CIELAB in a large uniform area. The procedure for computing S-CIELAB is outlined as follows: (1) Input image data are transformed into an opponent-colors space. This color transform converts the input image, specified in terms of the CIEXYZ tristimulus values, into three opponent-colors planes that represent luminance, red-green, and blue-yellow components. (2) Each opponent-colors plane is convoluted with a 2D kernel whose shape is determined by the visual spatial sensitivity to that color dimension; the area under each of these kernels integrates to one. A low-pass filtering is used to simulate the spatial blurring by the human visual system. The computation is based on the concept of the pattern-color separability. Parameters for the color transform and spatial filters were estimated from psychophysical measurements. (3) The filtered representation is converted back to CIEXYZ space, then to a CIELAB representation. The resulting representation includes both the spatial filtering and the CIELAB processing. (4) The difference between the S-CIELAB representations of the original and its reproduction is the measure of the reproduction error. The difference is expressed by a quantity Es , which is computed precisely as E∗ab in the conventional CIELAB. S-CIELAB reflects both spatial and color sensitivity. This model is a color-texture metric and a digital-imaging model. It has been applied to printed halftone images. Results indicate that S-CIELAB correlates with perceptual data better than standard CIELAB.40 This metric can also be used to improve the multilevel halftone images.41
References 1. CIE, Recommendations on uniform color spaces, color-difference equations and psychonetric color terms, Supplement No. 2 to Colorimetry, Publication No. 15, Bureau Central de la CIE, Paris (1978).
74
Computational Color Technology
2. C. J. Bartleson, Colorimetry, Optical Radiation Measurements, Color Measurement, F. Grum and C. J. Bartleson (Eds.), Academic Press, New York, Vol. 2, pp. 33–148 (1980). 3. D. B. Judd and G. Wyszecki, Color in Business, Science and Industry, 3rd Edition, Wiley, New York, pp. 331–332 (1975). 4. H. R. Kang, Color gamut boundaries in CIELAB space, NIP 19, pp. 808–811 (2003). 5. S. M. Newall, D. Nickerson, and D. B. Judd, Final report of the OSA subcommittee on the spacing of the Munsell colors, J. Opt. Soc. Am. 33, pp. 385–418 (1943). 6. M. Mahy, L. Van Eycken, and A. Oosterlinck, Evaluation of uniform color spaces developed after the adoption of CIELAB and CIELUV, Color Res. Appl. 19, pp. 105–121 (1994). 7. D. L. MacAdam, Visual sensitivities to color differences in daylight, J. Opt. Soc. Am. 32, pp. 247–274 (1942). 8. A. R. Robertson, The CIE 1976 color-difference formulae, Color Res. Appl. 2, pp. 7–11 (1977). 9. R. McDonald, Industrial pass/fail colour matching, Part III: Development of a pass/fail formula for use with instrumental measurements of colour difference, J. Soc. Dyers Colourists 96, pp. 486–495 (1980). 10. W. Frei and B. Baxter, Rate-distortion coding simulation for color images, IEEE Trans. Commun. 25, pp. 1385–1392 (1977). 11. D. L. MacAdam, Colorimetric data for samples of OSA uniform color scales, J. Opt. Soc. Am. 68, pp. 121–130 (1978). 12. D. L. MacAdam, Re-determination of colors for uniform scales, J. Opt. Soc. Am. A 7, pp. 113–115 (1990). 13. S. L. Guth, R. W. Massof, and T. Benzschawel, Vector model for normal and dichromatic color vision, J. Opt. Soc. Am. 70, pp. 197–212 (1980). 14. K. Richter, Cube-root spaces and chromatic adaptation, Color Res. Appl. 5, pp. 25–43 (1980). 15. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, p. 138 (1982). 16. T. Seim and A. Valberg, Towards a uniform color space: a better formula to describe the Munsell and OSA color scales, Color Res. Appl. 11, pp. 11–24 (1986). 17. Y. Nayatani, K. Hashimoto, K. Takahama, and H. Sobagaki, A nonlinear colorappearance model using Estevez-Hunt-Pointer primaries, Color Res. Appl. 12, pp. 231–242 (1987). 18. R. W. G. Hunt, Revised colour-appearance model for related and unrelated colours, Color Res. Appl. 16, pp. 146–165 (1991). 19. F. Ebner and M. Fairchild, Development and testing of a color space (IPT) with improved hue uniformity, 6th Color Imaging Conf.: Color Science, System, and Application, pp. 8–13 (1998).
CIE Color Spaces
75
20. C. Li and M. R. Luo, A uniform colour space based upon CIECAM97s, http://www.colour.org/tc8-05. C. Li, M. R. Luo, and G. Cui, Colour-difference evaluation using color appearance models, 11th Color Imaging Conf.: Color Science, System, and Application, pp. 127–131 (2003). 21. K. D. Chickering, FMC color-difference formulas: Clarification concerning usage, J. Opt. Soc. Am. 61, pp. 118–122 (1971). 22. F. J. Clarke, R. McDonald, and B. Rigg, Modification to JPC79 colour difference formula, J. Soc. Dyers Colourists 100, pp. 128–132 (1984). 23. F. J. Clarke, R. McDonald, and B. Rigg, Modification to JPC79 colour difference formula (Errata and test data), J. Soc. Dyers Colourists 100, pp. 281–282 (1984). 24. M. H. Brill, Suggested modification of CMC formula for acceptability, Color Res. Appl. 17, pp. 402–404 (1992). 25. M. R. Luo and B. Rigg, BFD(l:c) color-difference formula, Part 1: Development of the formula, J. Soc. Dyers Colourists 103, pp. 86–94 (1987). 26. M. R. Luo and B. Rigg, BFD(l:c) color-difference formula, Part 2: Performance of the formula, J. Soc. Dyers Colourists 103, pp. 126–132 (1987). 27. M. R. Luo, G. Cui, and B. Rigg, The development of the CIE 2000 colourdifference formula: CIEDE2000, Color Res. Appl. 26, pp. 340–350 (2001). 28. M. R. Luo, G. Cui, and B. Rigg, Further comments on CIEDE2000, Color Res. Appl. 27, pp. 127–128 (2002). 29. M. D. Fairchild, Color Appearance Models, Addison-Wesley, Reading, MA (1998). 30. Y. Nayatani, H. Sobagaki, K. Hashimoto, and T. Yano, Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation, Color Res. Appl. 20, pp. 156–167 (1995). 31. R. W. G. Hunt, Revised colour-appearance model for related and unrelated colours, Color Res. Appl. 16, pp. 146–165 (1991). 32. M. D. Fairchild, Refinement of the RLAB color space, Color Res. Appl. 21, pp. 338–346 (1996). 33. S. Guth, Further applications of the ATD model for color vision, Proc. SPIE 2414, pp. 12–26 (1995). 34. M. R. Luo, M.-C. Lo, and W.-G. Kuo, The LLAB (l:c) color model, Color Res. Appl. 21, pp. 412–429 (1996). 35. CIE, Publication 131-1998, The CIE 1997 interim color appearance model (simple version) CIECAM97s (1998). 36. N. Moroney, M. D. Fairchild, R. W. G. Hunt, C. Li, M. R. Luo, and T. Newman, The CIECAM02 color appearance model, 10th CIC: Color Science and Engineering Systems, Technologies, Applications, pp. 23–27 (2002). 37. C. Li, M. R. Luo, R. W. G. Hunt, N. Moroney, M. D. Fairchild, and T. Newman, The performance of CIECAM02, 10th CIC: Color Science and Engineering Systems, Technologies, Applications, pp. 28–32 (2002). 38. C. Li, M. R. Luo, and G. Cui, Colour-difference evaluation using colour appearance models, 11th CIC: Color Science and Engineering Systems, Technologies, Applications, pp. 127–131, Nov. 3 (2003).
76
Computational Color Technology
39. X. Zhang and B. A. Wandell, A spatial extension of CIELAB for digital color image reproduction, SID Int. Symp., Digest of Tech. Papers, pp. 731–734 (1996). 40. X. Zhang, D. A. Silverstein, J. E. Farrell, and B. A. Wandell, Color image quality metric S-CIELAB and its application on halftone texture visibility, IEEE Compcon., pp. 44–48 (1997). 41. X. Zhang, J. E. Farrell, and B. A. Wandell, Applications of a spatial extension to CIELAB, Proc. SPIE 3025, pp. 154–157 (1997).
Chapter 6
RGB Color Spaces RGB primaries play an important role in building colorimetry. CIE color-matching functions are derived by CIE standard RGB primaries. Many imaging devices are additive systems, such as television and digital cameras that are based on RGB primaries, where image signals are encoded in a colorimetrical RGB standard. Moreover, colorimetrical RGB encoding standards are a frequently encountered representation for color reproduction and color information exchanges. This chapter presents an extensive collection of the existing RGB primaries. Their gamut sizes are compared. Methods of transforming between CIEXYZ and colorimetric RGB are discussed. A conversion formula between RGB standards under the same white point is also provided. The general structure and representation of the RGB color-encoding standard is discussed. Several important RGB encoding standards are given in Appendix 4. Finally, conversion accuracies from RGB via CIEXYZ to CIELAB of these primaries are examined.
6.1 RGB Primaries Many RGB primary sets have been proposed for use in different industries such as motion picture, television, camera, film, printing, color measurement, and computer. We have collected 21 sets of RGB primaries; their chromaticity coordinates are given in Table 6.1.1–20 Usually, the gamut size of RGB primaries is plotted in a chromaticity diagram. The mixing of these colorimetric RGB primaries obeys Grassmann’s additivity law; therefore, the color gamut boundary is indicated by the triangle that connects three primaries in the chromaticity diagram.3 From the size of the gamut, RGB primaries can be classified into three groups. The first group has a relatively small gamut size in which RGB primaries are located inside of the spectral color locus as shown in Fig. 6.1. Adobe/RGB98, Bruse/RGB, EBU/RGB, Guild/RGB, Inkjet/RGB, ITU.BT709/RGB, NTSC/RGB, SMPTE-C/RGB, SMPTE-240M/RGB, and Sony-P22/RGB fall into this group. SMPTE-C/RGB, the early standard of the Society of Motion Picture and Television Engineers, gives the smallest color gamut. Both Sony and Apple Computer use P22/RGB; it has the same blue primary as SMPTE-C/RGB but different red and green primaries. ITU709/RGB is slightly larger than SMPTE-C/RGB; it has the primaries used in several important RGB encoding standards such as sRGB and PhotoYCC. Bruse/RGB is larger 77
78
Computational Color Technology Table 6.1 CIE 1931 chromaticity coordinates of RGB primaries.
Red
Adobe/RGB981 Bruse/RGB2 CIE1931/RGB3 CIE1964/RGB3 EBU/RGB4 Extended/RGB5 Guild/RGB6 Ink-jet/RGB7 ITU-R.BT.709-28 Judd-Wyszecki/RGB9 Kress/RGB10 Laser/RGB11 NTSC/RGB12 RIMM-ROMM/RGB13–15 ROM/RGB16 SMPTE-C17 SMPTE-240M4 Sony-P2218 Wide-Gamut/RGB1 Wright/RGB19 Usami/RGB20
Green
Blue
x
y
x
y
x
y
0.640 0.640 0.7347 0.7232 0.640 0.701 0.700 0.700 0.640 0.7347 0.6915 0.7117 0.670 0.7347 0.873 0.630 0.670 0.625 0.7347 0.7260 0.7347
0.330 0.330 0.2653 0.2768 0.330 0.299 0.300 0.300 0.330 0.2653 0.3083 0.2882 0.330 0.2653 0.144 0.340 0.330 0.340 0.2653 0.2740 0.2653
0.210 0.280 0.2737 0.1248 0.290 0.170 0.255 0.250 0.300 0.0743 0.1547 0.0328 0.210 0.1596 0.175 0.310 0.210 0.280 0.1152 0.1547 –0.0860
0.710 0.650 0.7174 0.8216 0.600 0.796 0.720 0.720 0.600 0.8338 0.8059 0.8029 0.710 0.8404 0.927 0.595 0.710 0.595 0.8264 0.8059 1.0860
0.150 0.150 0.1665 0.1616 0.150 0.131 0.150 0.130 0.150 0.1741 0.1440 0.1632 0.140 0.0366 0.085 0.155 0.150 0.155 0.1566 0.1440 0.0957
0.060 0.060 0.0089 0.0134 0.060 0.046 0.050 0.050 0.060 0.0050 0.0297 0.0119 0.080 0.0001 0.0001 0.070 0.060 0.070 0.0177 0.0297 –0.0314
than ITU709/RGB as a result of extending the green primary, but keeping the red and blue primaries the same as ITU709/RGB. Adobe/RGB98 is an enlarged Bruse/RGB; the red and blue primaries are the same as Bruse/RGB with the green primary at a higher chroma. The television standard NTSC/RGB has the same green primary as Adobe/RGB98 with extended red and blue primaries. SMPTE240M/RGB, also developed for NTSC coding, has the same red and green primaries as NTSC/RGB, whereas the blue primary is the same as Adobe/RGB98. Guild/RGB is chosen for developing tristimulus colorimeters (note that the chromaticity coordinates of Guild/RGB are estimated from Fig. 2.32 of Ref. 9, p. 192); it has a sufficiently large gamut with the intention to encompass as many colors as possible. Ink-jet/RGB is derived from experimental results of ink-jet prints; it has a slightly larger gamut size than Guild/RGB. The second group has RGB primaries located on the spectral color boundary as shown in Fig. 6.2; they are the spectral stimuli. This group includes CIE1931/RGB, CIE1964/RGB, Extended/RGB, Judd-Wyszecki/RGB, Kress/RGB, Laser/RGB, Wide-Gamut/RGB, and Wright/RGB. CIE1931/RGB is the spectral matching stimuli with blue primary at 435.8 nm, green at 546.1 nm, and red at 700.0 nm
RGB Color Spaces
79
Figure 6.1 Color gamut sizes of group 1 RGB primaries.
that the CIE 1931 2◦ observer is based upon, whereas CIE1964/RGB is the basis for the CIE 1964 10◦ observer with blue at 22500 cm−1 (∼444.4 nm), green at 19000 cm−1 (∼526.3 nm), and red at 15500 cm−1 (∼645.2 nm).3 Extended/RGB with blue at 467 nm, green at 532 nm, and red at 625 nm is proposed for accommodating applications in color imaging systems.5 Judd and Wyszecki chose spectral stimuli at two extremes of the visible spectrum for blue and red primaries and the middle at 520 nm for green. They pointed out the disadvantage of choosing at spectrum extremes that the primaries have very low brightness.9 Kress proposed a default RGB, having blue at 460 nm, green at 530 nm, and red at 620 nm.10 Starkweather has suggested a spectral RGB color space using primaries of three lasers with a helium-neon laser at 633 nm for red, an argon laser at 514 nm for green, and a helium-cadmium laser at 442 nm for blue.11 Wide-Gamut/RGB, proposed by Adobe, uses spectral stimuli at 450 nm, 525 nm, and 700 nm for blue, green, and red primaries, respectively.1 Wright chooses spectral primaries at 460 nm for blue, 530 nm for green, and 650 nm for red.19 Spectral stimuli, in general, give a lager gamut size than the primaries of the first group. However, they are not free of the gamut mismatch (or gamut mapping) problem because the mismatch is dependent not only on the gamut size but also on the locations of primaries.
80
Computational Color Technology
Figure 6.2 Color gamut sizes of groups 2 and 3 RGB primaries.
The last group consists of RIMM-ROMM/RGB, ROM/RGB, and Usami/RGB; they are also plotted in Fig. 6.2. The unique feature of this group is that they have primaries outside of the spectral locus. RIMM-ROMM/RGB and Usami/RGB have a spectral stimulus for red at 700 nm, but green and blue are outside of the spectral locus.13–15,20 Note that the green and blue primaries of Usami/RGB have negative values (see Table 6.1); the triangle defined by these primaries encloses the spectral color locus, containing all real colors as well as imaginary colors. For ROM/RGB, all primaries are outside of the spectral locus.16 Note that the red and green primaries do not meet the constraint of x + y ≤ 1(another way to put it is that z must be negative).
6.2 Transformation of RGB Primaries Colorimetric RGB has a simple linear relationship with CIEXYZ. Therefore, the conversion between RGB and CIEXYZ is a simple vector-matrix multiplication, provided the matrix coefficients are known. Matrix coefficients are derived from chromaticity coordinates of RGB primaries if a white point is adopted. Conversion matrices from XYZ to RGB and the inverse transform from RGB to XYZ under illuminants A, B, C, D50 , D55 , D65 , D75 , and D93 are derived and tabulated
RGB Color Spaces
81
in Appendix 1. Moreover, using CIEXYZ as an intermediate representation, we can establish the conversion from one RGB primary set to another if the white point is the same. Conversion matrices between RGB standards under the same white point are provided in Appendix 2 and Appendix 3 for sRGB under D65 and ROMM/RGB under D50 , respectively. Different white points require an extra step of the chromatic adaptation or white-point conversion. 6.2.1 Conversion formula As shown in Section 2.8, two sets of primaries are related by a 3 × 3 linear transformation, AT2 = (AT1 Φ 2 )−1 AT1 [see Eq. (2.31)], where A is a color-matching matrix and Φ 2 is the spectra of a set of primaries used to derive the color-matching matrix. Therefore, colorimetric RGB is represented by a set of linear equations as shown in Eq. (6.1) to give the forward encoding from XYZ to RGB.
R α11 G = α21 α31 B
α12 α22 α32
α13 α23 α33
X Y , Z
(6.1)
or Υ p = αΥ , where coefficients αij are the elements of the conversion matrix α. The inverse conversion from RGB to XYZ is given as
X β11 Y = β21 β31 Z
β12 β22 β32
β13 β23 β33
R G , B
(6.2)
or Υ = βΥ p , where coefficients βij are the elements of the matrix β. Matrix β is the inverse of the matrix α as given in Eq. (6.3). With three independent channels, the matrix α is not singular and can be inverted. β = α −1 .
(6.3)
Equation (6.2) provides a path from a colorimetric RGB via CIEXYZ to other CIE specifications such as CIELAB or CIELUV because the subsequent transformations are well established.3 Moreover, it also provides a path from a colorimetric RGB to another colorimetric RGB via CIEXYZ, if the white point is the same.
82
Computational Color Technology
The inverse matrix β is related to RGB primaries in the following manner:12 X = x rT rR + x gT gG + x bT bB Y = y rT rR + y gT gG + y bT bB
(6.4a)
Z = zr T r R + zg T g G + zb T b B,
Y X Z
xrT r = y rT r zr T r
x gT g y gT g zg T g
x bT b y bT b zb T b
R G , B
(6.4b)
where (x r , y r , zr ), (x g , y g , zg ), and (x b , y b , zb ) are the chromaticity coordinates of the red, green, and blue primaries, respectively. Parameters T r , T g , and T b are the proportional constants of the red, green, and blue primaries, respectively, under an adapted white point.4,12 By comparing with Eq. (6.2), we can establish the relationship between coefficients βij and chromaticity coordinates of primaries as β11 = x r T r ; β12 = x g T g ; β13 = x b T b ; β21 = y r T r ; β22 = y g T g ; β23 = y b T b ; β31 = zr T r ; β32 = zg T g ; β33 = zb T b ,
(6.5a)
or
β11 β21 β31
β12 β22 β32
β13 β23 β33
xr = yr zr
xg yg zg
xb yb zb
Tr 0 0
0 Tg 0
0 0 , Tb
(6.5b)
or β =ΓT.
(6.5c)
Equation (6.5) can be solved for T = [T r , T g , T b ]T by using a known condition of a gray-balanced and normalized RGB system; that is, when R = G = B = 1, a reference white point (xn , yn , zn ) of the device is produced. Using this condition, Eq. (6.4a) becomes xn /yn = x r T r + x g T g + x b T b 1 = y rT r + y gT g + y bT b
(6.6a)
zn /yn = zr T r + zg T g + zb T b ,
xn /yn 1 zn /yn
xr = yr zr
xg yg zg
xb yb zb
Tr 0 0
0 Tg 0
0 0 , Tb
(6.6b)
or Υw =ΓT,
(6.6c)
RGB Color Spaces
83
where normalized tristimulus values of the white point Υ w = [xn /yn , 1, zn /yn ] are given in the left-hand side of Eq. (6.6). This equation is used to compute T r , T g , and T b because chromaticity coordinates of primaries and white point are known. The matrix has three independent columns with a rank of three; therefore, it is nonsingular and can be inverted. By inverting matrix Γ , we obtain vector T . T = Γ −1 Υ w .
(6.7)
Resulting T values are substituted back into Eq. (6.5) with the known chromaticity coordinates of primaries to obtain coefficients βij of the transfer matrix. Strictly specking, Eq. (6.6) is only valid at one extreme point of the reference white, but the derived coefficients are used in any RGB → XYZ conversions. How well this assumption holds across the whole encoding range requires further investigations. 6.2.2 Conversion formula between RGB primaries After obtaining the β matrix, one can apply Eq. (6.3) to obtain matrix α for the forward transform from XYZ to RGB, if the matrix β is not singular. Appendix 1 lists the conversion matrices for 20 sets of primaries under 8 different white points (illuminants A, B, C, D50 , D55 , D65 , D75 , and D93 ). When the white point is the same for two sets of RGB primaries, we can combine the relationships given in Eqs. (6.1) and (6.2) for converting one set of RGB primaries via CIEXYZ to another. Equation (6.8) gives the conversion formula between RGB sets.21
Rd Gd Bd
α d11 = α d21 α d31
α d12 α d22 α d32
α d13 α d23 α d33
β s11 β s21 β s31
β s12 β s22 β s32
β s13 β s23 β s33
Rs Gs , Bs
(6.8a)
or Υ p,d = α d β s Υ p,s = α d α −1 s Υ p,s ,
(6.8b)
where subscript s indicates the source and subscript d indicates the destination RGB space. These two matrices can be combined to give a single conversion matrix. All conversions between RGB primaries can be computed using Eq. (6.8) if the white point is the same. Appendix 2 gives conversion matrices of various RGB primaries to ITU-R.BT.709/RGB under D65 . Appendix 3 gives conversion matrices of various RGB primaries to ROMM/RGB under D50 . For cases of different white points, an additional step of the white-point conversion or chromatic adaptation is required. Several practical approaches of white-point conversion and chromatic adaptation have been reported.5,11,21–23
84
Computational Color Technology
6.3 RGB Color-Encoding Standards Colorimetrical RGB standards play an important role in color imaging because they are a frequently encountered representation for color reproduction and color information exchanges. The purpose of the color-encoding standard is to provide format and ranges for representing and manipulating color quantities. Its foundation is a set of RGB primaries, either imaginary or real stimuli. By adding the viewing conditions, gamma correction, conversion formula, and digital representation, a set of RGB primaries becomes a color-encoding standard. Important RGB encoding standards are SMPTE-C, European TV standard EBU, NTSC, and American Television standard YIQ for the television industry; sRGB for Internet; and PhotoYCC and ROMM-RIMM for photographic and printing industries. These standards are given in Appendix 4. The general structure of the RGB encoding standard is given in this section. 6.3.1 Viewing conditions The viewing conditions include an adapted white point such as D50 or D65 , surround, luminance level, and viewing flare. Generally, the display industry prefers D65 and the printing industry uses D50 as the adapted white point. The surround is a field outside the background and can be considered to be the entire room in which an image is viewed. Printed images are usually viewed in an illuminated “average” surround, meaning that scene objects are surrounded by other similarly illuminated objects. The luminance level is set according to the application or not set at all; for instance, the outdoor scene is set under typical daylight luminance levels (>5,000 cd/m2 ). When an image is viewed, the observer ideally should see only the light from the image itself. This is the case for instrumental color measurements, but is not the case for real viewing conditions by human observers. In most actual viewing conditions, the observer will also see flare light—the stray light imposed on the image from the environment and reflected to viewer. The viewing flare is usually low (<1.0 cd/m2 ); sometimes it is set as a percentage of the whitepoint luminance (e.g., 1%) or included in 0/45 measurements as a part of the scene itself. 6.3.2 Digital representation Cameras and scanners receive light or photons that are converted to electrons or voltage by a photoelectric process (e.g., photomultiplier). In digital devices, the voltage is further converted to bits via an analog-to-digital converter. On the other hand, a display such as a CRT monitor takes digital values and converts them back to voltage via a digital-to-analog converter to drive the electron gun. Generally, all color channels are encoded within a fixed range such as [0, 1]; this range is digitized and scaled to the bit depth used in the device, usually 8 bits.
RGB Color Spaces
85
6.3.3 Optical-electronic transfer function Most RGB encoding standards are designed for additive devices such as CRT displays in which a nonlinear voltage-to-luminance relationship exists; this requires a power function to transfer the voltage into luminance. The general equation for the electronic-optical transfer function is given in Eq. (6.9).4,21,24 P L = [(PV + offset)/(1 + offset)]gamma
if PV ≥ b,
(6.9a)
P L = gain × PV
if PV < b,
(6.9b)
where P L is the luminance factor or one of the RGB device values, and PV is the voltage. The power of the function is the monitor gamma that varies within a narrow range around 2.5. For small PV values, the voltage-to-luminance relationship is nearly linear and goes to the point of origin as given by Eq. (6.9b) with a slope as the gain. Figure 6.3 shows the effect of gamma correction for the case of gamma = 2.2 and offset = 0.099; the gamma correction linearizes the device value with luminance.
Figure 6.3 The gamma correction.
86
Computational Color Technology
Images shown on television are acquired by a camera, whereas images in a computer monitor may come from the computer itself, the Internet, a scanner, or a digital still camera. Camera and scanner have a nonlinear luminance-to-signal relationship; one needs to correct the nonlinear video signal or device value by Eq. (6.10), an inversion of Eq. (6.9). P = (1 + offset)P 1/gamma − offset
if 1 ≥ P ≥ b ,
(6.10a)
P = (1/gain) × P
if 0 < P < b .
(6.10b)
Equation (6.10) is known as the gamma correction, where P is the input video signal (or coded value of the device), P is the gamma-corrected output signal (or device value), and b is a constant.
6.4 Conversion Mechanism Once the white point is selected, the conversion mechanism between RGB and XYZ can be established. The method is given in Section 6.2. Appendix 1 gives the conversion matrices for 20 sets of primaries under eight different white points. Further transforms from CIEXYZ to CIELAB or YIQ are documented in CIE literature and color textbooks. The mechanism is a simple matrix-vector multiplication. The conversion matrix between different RGB primaries can be computed using Eq. (6.8). Appendix 2 gives conversion matrices of nineteen RGB sets to ITU-R.BT.709/RGB under D65 . Appendix 3 gives conversion matrices of nineteen RGB sets to ROMM/RGB under D50 .
6.5 Comparisons of RGB Primaries and Encoding Standards It has been shown that an improper encoding scheme can severely damage the color conversion accuracy.7 Therefore, we compare RGB primaries and standards to determine the most suitable RGB encoding with respect to the gamut size, gamma correction, encoding format (floating-point or integer representation, bit depth, etc.), and conversion accuracy. A set of 150 color patches printed by an ink-jet printer, consisting 125 color patches from five-level combinations of an RGB cube and 25 three-color mixtures, is used to compare RGB primaries and encoding standards. The color patches are measured to obtain CIEXYZ and CIELAB values under D65 illuminant. These color patches are the outputs of the current printing technology, which are readily available and frequently encountered. Thus, these patches provide a realistic environment for assessing the color transform in the system environment. To check conversion accuracy, we convert measured CIEXYZ values to a RGB encoding standard using the specified transfer matrix, gamma correction (if provided), and encoding range. We then convert the RGB-encoded data back to CIELAB via the inverse transform for the purpose of comparing to the initial
RGB Color Spaces
87
measured CIELAB. Transfer matrices from RGB to XYZ of twenty sets of RGB primaries under D65 are computed by using Eq. (6.6). The encoding matrices from XYZ to RGB are obtained via matrix inversion (see Appendix 1 for obtaining these matrices). Table 6.2 summarizes the results of the computational accuracy via RGB encoding; the second column gives the percentage of the out-of-range colors from a total of 150 colors, the third column gives the average color difference of 150 colors, and the fourth column gives the maximum color difference. SMPTE-C/RGB is the smallest space; it gives 45 out-of-range colors (30%, see Fig. 6.4). The maximum error is 27.42 Eab and the average error is 2.92 Eab (see Fig. 6.5). Using sRGB encoding, we find that 38 color patches require clipping to put the encoded value within the range of [0, 1]. This is an alarming 25.3% of the population of out-of-range colors for such a common test target that could come from any color printer. Most clipped sRGB points give an error greater than 2 Eab with a maximum of 28.26 Eab , and an average of 2.22 Eab . Outof-range colors appear in most color regions except the blue-purple region (see Fig. 6.6). Because of the clipping, these 38 points cannot be reversed back to their original CIELAB values (see Fig. 6.7). This indicates that the sRGB space is too small for printing. The increase in bit depth does not help either; errors of out-ofrange colors remain the same regardless of the bit depth (see Table 6.3). Moreover, Table 6.2 Computational accuracy of RGB encoding standards.
RGB primaries
% out of range color
Average Eab
Maximum Eab
SMPTE-C/RGB ITU-R.BT.709/RGB Sony-P22/RGB EBU/RGB Bruse/RGB Adobe/RGB98 NTSC/RGB SMPTE-240M/RGB Guild/RGB Ink-jet/RGB CIE1931/RGB Laser/RGB Judd-Wyszecki/RGB CIE1964/RGB Wide-Gamut/RGB Wright/RGB Kress/RGB Extended/RGB RIMM-ROMM/RGB ROM/RGB
30.0% 25.3% 23.3% 22.0% 18.0% 10.0% 6.0% 5.3% 0.7% 0 7.3% 5.3% 1.3% 0.7% 0.7% 0 0 0 0 0
2.92 2.22 2.67 2.28 1.43 1.17 0.87 0.74 0.60 0.58 1.08 1.05 0.74 0.64 0.67 0.68 0.64 0.61 0.71 0.43
27.42 28.26 33.59 30.23 19.31 19.83 12.19 9.60 5.91 2.94 18.08 28.26 11.54 3.68 3.53 3.30 3.36 3.00 4.29 0.99
88
Computational Color Technology
Figure 6.4 Color gamut of SMPTE-C/RGB for reproduction of printer colors.
Figure 6.5 Color differences between measured and computed out-of-gamut colors encoded in SMPTE-C/RGB.
RGB Color Spaces
89
Figure 6.6 Color gamut of sRGB for reproduction of printer colors.
Figure 6.7 Color differences between measured and computed out-of-gamut colors encoded in sRGB.
90
Computational Color Technology
the average error improves very slowly with increasing bit depth because error is mostly contributed from those out-of-range colors. By removing the 38 outof-range colors, we obtain a much smaller error as shown in row 4 of Table 6.3. Also, the average and maximum errors decrease much faster with respect to bit depth. There are several extensions of sRGB such as sRGB64 and e-sRGB. sRGB64 is a rather interesting standard; it is the same as sRGB but uses 16 bits per channel, and is actually encoded in 13 bits with a scaling factor of 8192. As shown in Table 6.3, the bit-depth increase does not help much. e-sRGB removes the constraint on the encoding range, allowing sRGB to have negative and overflow values.25 Error distributions of the CIELAB → sRGB transform without clipping are given in Table 6.4. The computation uses integer arithmetic with 8-bit ITULAB inputs. Compared to Table 6.3, average errors are smaller than the corresponding errors encoded by sRGB with clipping. Note that the maximum error of 9.22 Eab Table 6.3 Computational errors of sRGB with respect to bit depth.
Average color difference, Eab
Maximum color difference, Eab
Method∗
8-bit 9-bit 10-bit 12-bit 14-bit 8-bit
1 2 3 4
2.39 2.22 3.73 1.93
2.20 2.12 3.06 1.12
2.12 2.08 2.84 0.85
2.05 2.04 2.74 0.74
2.04 2.04 2.72 0.74
9-bit
10-bit 12-bit 14-bit
28.36 28.34 28.35 28.26 28.33 28.37 28.74 27.95 28.74 7.18 4.17 2.41
28.34 28.35 28.74 1.34
28.35 28.35 28.74 1.63
∗ Method 1: Floating-point computation. Method 2: Floating-point computation and gamma correction. Method 3: Integer computation. Method 4: Integer computation using 112 data points by removing out-of-range colors.
Table 6.4 Error distribution of CIELAB → sRGB transform without clipping.
Range
8-bit
9-bit
10-bit
11-bit
12-bit
13-bit
14-bit
0–1 1–2 2–3 3–4 4–5 5–6 6–7 7–8 8–9 9–10 Average Maximum
27 61 38 8 8 3 1 1 2 1 2.13 9.22
65 72 7 4 2
99 48 3
118 32
116 34
116 34
119 31
1.20 4.17
0.87 2.41
0.74 1.42
0.72 1.34
0.71 1.42
0.71 1.63
RGB Color Spaces
91
at 8-bit depth is about a factor of three smaller than the value obtained by sRGB. Moreover, both average and maximum errors decrease rapidly as the bit depth increases, but the improvement levels off around 11 bits. Two of the specified bit depths, 10 bits and 12 bits, give average errors of 0.87 Eab and 0.72 Eab , respectively. No clipping of out-of-range values means that it allows mathematical extrapolation from the triangle connected by the ITU-R.BT.709/RGB primaries. This practically extends the color space to an unknown size—infinity if no limit is placed on the out-of-range value. Eliminated clipping takes care of output-referred images very well. The information is retained in storage for interchange. However, the clipping still exists when converted to sRGB for display. This makes one wonder: why not use a primary set with a larger color gamut to eliminate the outof-range colors? By so doing, all colors will be encoded by interpolation. Mathematically, the extrapolation is subjected to a higher uncertainty than interpolation; not to mention the difficulty of dealing with negative values in the system environment. Sony-P22/RGB has a slightly larger gamut than ITU-R.BT.709/RGB; it has 35 out-of-range colors (23.3%). The average color difference of 150 patches with respect to the measured values is 2.67 Eab with a maximum of 33.59 Eab . EBU/RGB is slightly larger than Sony-P22/RGB; it has 33 out-of-range colors (22.0%). The average color difference of 150 patches with respect to the measured values is 2.28 Eab with a maximum of 30.23 Eab . Bruse/RGB gives 27 outof-range colors (18%) with a maximum error of 19.31 Eab and an average error of 1.43 Eab . Similar to sRGB, SMPTE-C/RGB and Bruse/RGB spaces produce out-of-range colors that appear in most color regions (see Fig. 6.8). Adobe/RGB98, having an enlarged green region, reduces the number of out-ofrange colors to fifteen (10%) by eliminating the clipping error in the green region. Therefore, the distribution of out-of-range colors is in the yellow, red, and purple regions (see Fig. 6.9). The maximum error is 19.83 Eab and the average error is 1.17 Eab . Using NTSC/RGB encoding, we find that there are nine out-of-range colors (6%). These colors are clustered in the red region with one exception in yellow (see Fig. 6.10). The maximum color difference is 12.19 Eab and the average error is 0.87 Eab . NTSC/RGB primaries, having extended space in the green region, eliminate the clipping problem in the green region. However, the green primary is located too far left on the x-axis of the chromaticity diagram, such that it reduces the space in the red-magenta region. This causes many red colors to become out of range. SMPTE-240M/RGB has a relatively large gamut; therefore, it has only 8 outof-range colors or 5.3% (see Fig. 6.11). The average color difference of 150 patches is 0.74 Eab with a maximum of 9.60 Eab . Primaries of the Ink-jet/RGB are chosen to encompass all 150 experimental data. As expected, there is no out-ofrange color (see Fig. 6.12). In 8-bit depth, the average error is 0.58 Eab and the maximum error is 2.94 Eab . Further improvements in computational accuracy can be realized by increasing the bit depth for encoding the integer RGB. The
92
Computational Color Technology
Figure 6.8 Color gamut of Bruse/RGB for reproduction of printer colors.
average error becomes smaller and the error distribution becomes narrower as the bit depth increases. Practically, there is no visually detectable error at 12 bits or higher. Guild/RGB is almost as big as Ink-jet/RGB. However, Guild’s blue primary is a little toward the right-hand side of the Ink-jet’s blue; thus, the gamut is slightly smaller in the blue region. This causes it to have one out-of-range color (0.7%). The average error is 0.60 Eab and the maximum error is 5.91 Eab . The results of Guild/RGB and Ink-jet/RGB demonstrate that it does not necessarily need a large gamut to minimize the clipping errors; a properly selected RGB set is more helpful in reducing out-of-range colors. For Group 2 RGB sets, laser spectral primaries give a much larger color space, but we still get eight out-of-range colors (5.3%). The average error is 1.05 Eab and maximum error is 28.26 Eab for 8-bit representation. This is because the positions of primaries are not in a proper wavelength to cover the real colors encountered; in particular, the wavelength of the green primary at 514 nm is too low, such that the line connecting the green and red primaries exclude many yellow and green colors (see Fig. 6.13). This primary set demonstrates that a larger gamut size does not guarantee the results to be free of out-of-range color. Results from Guild/RGB, Ink-jet/RGB, and Laser/RGB suggest that the positions of primaries are more important. CIE 1931 spectral primaries give eleven out-of-range colors (7.3%) in the green-blue region. The maximum error is 18.08 Eab and the average error is 1.08
RGB Color Spaces
Figure 6.9 Color gamut of Adobe/RGB98 for reproduction of printer colors.
Figure 6.10 Color gamut of NTSC/RGB for reproduction of printer colors.
93
94
Computational Color Technology
Figure 6.11 Color gamut of SMPTE-240M/RGB for reproduction of printer colors.
Figure 6.12 Color gamut of Ink-jet/RGB for reproduction of printer colors.
RGB Color Spaces
95
Figure 6.13 Color gamut of Laser/RGB for reproduction of printer colors.
Eab . This is because the green primary at λ = 546.1 nm is too high in wavelength (see Fig. 6.14). Concerning the color gamut, the position of the CIE 1931 green primary is too far right, whereas the laser/green primary is too far left; a proper wavelength for the green primary is around 530 nm. Other spectral primaries fare much better because the green primary is in the proper position of around 530 nm. Judd-Wyszecki/RGB, with green at 520 nm, has two out-of-range colors (0.74%). The maximum error is 11.54 Eab and the average error is 0.74 Eab . Adobe Wide-Gamut/RGB, with green at 525 nm, gives only one out-of-range color—the most saturated yellow. The maximum error is 3.53 Eab and the average error is 0.67 Eab . CIE1964/RGB, with green at 526.3 nm, gives the same out-of-range yellow with a maximum error of 3.68 Eab and an average error of 0.64 Eab (see Fig. 6.15). An Extended/RGB space, having properly selected primaries (green at 532 nm) to encompass the commercial Scanner RGB, Monitor RGB, Duoproof RGB, Inkjet CMYK, Printing offset press CMYK, and Hexachrome offset press, gives no out-of-range color (see Fig. 6.16).26 Error distributions for 150 data encoded by Extended/RGB are given in Table 6.5, showing that the error distribution becomes narrower as the bit depth increases. Also, both average and maximum errors become smaller with increasing bit depth. There is no visually detectable error at 12 bits and above. Like Extended/RGB, Kress/RGB and Wright/RGB have no out-of-range color (both green primaries are at 530 nm). The average error is 0.64 Eab and the maximum error
96
Computational Color Technology
Figure 6.14 Color gamut of CIE1931/RGB for reproduction of printer colors.
Figure 6.15 Color gamut of CIE1964/RGB for reproduction of printer colors.
RGB Color Spaces
97
Figure 6.16 The color gamut of Extended/RGB for reproduction of printer colors.
Table 6.5 Error distribution of Extended/RGB.
Range
8-bit
9-bit
10-bit
12-bit
14-bit
0–1 1–2 2–3 3–4 Average Maximum
129 15 5 1 0.61 3.00
149 1
149 1
150
150
0.31 1.08
0.16 1.18
0.04 0.14
0.01 0.08
is 3.36 Eab for Kress/RGB. The maximum error is 3.30 Eab and the average error is 0.68 Eab for Wright/RGB. ROMM/RGB and ROM/RGB are believed to enclose most, if not all, realworld producible colors. To demonstrate the importance of the gamma correction, we perform conversions with and without it to see the difference. Without gamma correction, ROMM/RGB gives an average of 0.71 Eab and a maximum of 4.29 Eab . With gamma correction, it gives an average of 0.43 Eab and a maximum of 0.99 Eab . The gamma correction provides a significant improvement for ROMM/RGB; unlike sRGB, where there are only marginal improvements (see Table 6.3).
98
Computational Color Technology
This study reveals that out-of-range colors give the biggest errors. Out-of-range colors cannot be brought into range by extending the number of bits for encoding. There are two ways of dealing with this problem: the first one is to remove the clipping (this is the approach used in e-sRGB) and the second one is to use a wide-gamut primary set. Using the first method, any out-of-range color is represented by either a negative value or a value greater than the maximum range. Negative values increase the complexity of the digital implementation. For example, one may need extra control logic for dealing with out-of-range values or one may not be able to use simple lookup tables. In addition, most electronic devices cannot render negative values. Therefore, some kind of mapping or clipping must be used. If mapping is used, the color fidelity will be in jeopardy. If a clipping is used, the same computational inaccuracy experienced in sRGB will resurface.7 Kress pointed out that any truncation of negative values would cause loss of image detail in highly saturated colors and color shifts in hue, saturation, and lightness.10 Another solution is to use a wide-gamut space. As we have shown in various RGB standards, the color space is controlled by the locations of primaries. The number, error magnitudes, and locations of out-of-range colors are dependent on the size and shape of the color space. Therefore, we can eliminate out-of-range colors by properly selecting RGB primaries; examples are Ink-jet/RGB and Extended/RGB spaces. Kress has compared the gamut of monitors (ITU709, P22, NTSC, and SMPTE), photographic films (Agfa, Fuji Photo, Kodak, and Konica), and printer-paper outputs (SWOP, wax thermal transfer, dye diffusion, Kodak Q60, and graphic-arts proofing material). He concluded that there was no single encoding scheme that resulted in minimal computation time, absence of image artifacts, device independence, and optimal quantization.10 To accommodate wider applications at the system level, Kress proposed a spectral RGB space using primaries at 620, 530, and 460 nm (note that this primary set is very close to the Extended/RGB set). With this space, colors from photographic input materials and printer outputs could be encompassed. Süsstrunk, Buckley, and Swen derived a similar conclusion that no particular RGB space was ideal for archiving, communicating, compressing, and viewing of color images.27 The correct color space depended on the application. They recommended that if the desired rendering intent is known, the use of a wide-gamut space is the best choice for the situation where more than one type of output is desired (this is the system environment). From our study, we draw the same conclusion that a wide RGB color space gives the best results in the system environment. Problems caused by using a wide RGB space are relatively minor compared to the problems caused by clipping or negative values. For example, the low numerical resolution can be overcome by using a higher bit depth and a proper gamma correction, and the mismatch between RGB encoding standard and real phosphor or CCD chromaticity becomes a device-characterization problem, which is a separate issue.
RGB Color Spaces
99
6.6 Remarks Comparisons of RGB encoding standards revealed that out-of-range colors gave the biggest color errors. We showed that the out-of-range colors induced by improper color encoding could be eliminated. There are numerous problems for color reproduction at the system level; the most difficult one, perhaps, is color gamut mismatch. There are two kinds of color gamut mismatch: one stems from the physical limitation of imaging devices (for example, a monitor gamut does not match a printer gamut); another one is due to the color-encoding standard used, such as sRGB. The difference is that one is imposed by nature and the other one is a man-made constraint to describe and manipulate color data. We may not be able to do much about limitations imposed by nature (although we have tried and are still trying by means of the color gamut mapping). However, we should make every effort to eliminate color errors caused by the color-encoding standard. It is my opinion that at system level applications, we need a wide-gamut space, such as ROMM/RGB, Kress/RGB, or Extended/RGB, for preserving color information. We should not impose a small, device-specific color space for carrying color information. With a wide-gamut space, the problem is boiled down to have proper device characterizations when we move color information between devices. It is in the device color profile that the color mismatch and device characteristics are taken into account. In this way, any color error is confined within the device; it does not spread to other system components. Furthermore, we should make gamma correction an option because not every transform requires it. For example, Scanner/RGB designed to meet the Luther condition does not need it.28 In this case, the empty slot can be used for implementing gray-balance curves, such that an equal value for all three RGB components gives a gray. However, not all scanners are designed in this way. A check of two scanners (HP OfficeJet G95 and Microtek ScanMaker 5) showed that they are nonlinear with respect to luminance; thus, gamma correction is still needed. It can be combined to the gray balancing if the lookup-table approach is used.
References Adobe Photoshop® 5.0, Adobe Systems Inc., San Jose, CA. B. Fraser and D. Blatner, http://www.pixelboyz.com. CIE, Colorimetry, Publication No. 15, Bureau Central de la CIE, Paris (1971). A. Ford and A. Roberts, Colour space conversions, http://www.inforamp. net/~poynton/PDFs/colourreq.pdf. 5. H. R. Kang, Implementation issues of digital color imaging, Color Image Science Conf. 2000, Derby, England, April 10-12, pp. 107–115 (2000). 6. J. Guild, The colorimetric properties of the spectrum, Phil. Trans. Roy. Soc. London A230, p. 149 (1931). 1. 2. 3. 4.
100
Computational Color Technology
7. H. R. Kang, Computational accuracy of RGB encoding standards, NIP 16, pp. 661–664 (2000). 8. IEC/3WD 61966-2.1: Colour measurement and management in multimedia systems and equipment—Part 2.1: Default RGB colour space—sRGB, http://www.srgb.com (1998). 9. D. B. Judd and G. Wyszecki, Color in Business Science and Industry, 3rd Edition, Wiley Interscience, New York, pp. 190–192 (1975). 10. W. C. Kress, First considerations of default RGB database, Proc. TAGA, Sewickley, PA, pp. 67–84 (1993). 11. G. Starkweather, Colorspace interchange using sRGB, http://www.srgb.com (1998). 12. Color Encoding Standard, Xerox Corp. Xerox Systems Institute, Sunnyvale, CA, p. C-3 (1989). 13. Eastman Kodak Company, Reference output medium metric RGB color space (ROMM RGB) white paper, http://www.colour.org/tc8-05. 14. Eastman Kodak Company, Reference input medium metric RGB color space (RIMM RGB) white paper, http://www.pima.net/standards/iso/tc42/wq18. 15. K. E. Spaulding, G. J. Woolfe, and E. J. Giorgianni, Reference input/output medium metric RGB color encodings (RIMM/ROMM RGB), PICS 2000 Conf., Portland, OR, March 26-29 (2000). 16. K. E. Spaulding, B. Pridham, and E. J. Giorgianni, Definition of standard reference output medium RGB color space (ROM RGB) for best practice tone/color processing, Kodak Imaging Science Best Practice Document. 17. SMPTE RP 145-1999, SMPTE C color monitor colorimetry, Society of Motion Picture and Television Engineers, White Plains, NY (1999). 18. N. Katoh and T. Deguchi, Reconsideration of CRT monitor characteristics, 5th Color Imaging Conf., Scottsdale, AZ, pp. 33–40 (1997). 19. W. D. Wright, A trichromatic colorimeter with spectral primaries, Trans. Opt. Soc. London 29, p. 225 (1927). 20. A. Usami, Colorimetric-RGB color space, IS&T’s 45th Annual Conf., East Rutherford, NJ, May 10-15, pp. 157–160 (1992). 21. SMPTE RP 177-1993, Derivation of basic television color equations, Society of Motion Picture and Television Engineers, White Plains, NY (1993). 22. H. R. Kang, Color Technology for Electronic Imaging Devices, SPIE Press, Bellingham, WA, Chap. 1, pp. 22–28 (1997). 23. H. R. Kang, Color conversion between sRGB and Internet FAX standards, NIP 16, pp. 665–668 (2000). 24. C. Poynton, Frequently asked questions about gamma, http://www.poynton. com/~poynton/. 25. PIMA 7667: 2001, Photography—Electronic still picture imaging—Extended sRGB color encoding–e-sRGB, http://www.sRGB.com/sRGB64/. 26. The Secrets of Color Management, Digital Color Prepress, Agfa Educational Publ., Randolph, MA, Vol. 5, p. 9 (1997).
RGB Color Spaces
101
27. S. Süsstrunk, R. Buckley, and S. Swen, Standard RGB color spaces, Proc. of 7th Color Imaging Conf., IS&T/SID, Scottsdale, AZ, pp. 127–134 (1999). 28. H. R. Kang, Color scanner calibration, J. Imaging Sci. Techn. 36, 162–170 (1992).
Chapter 7
Device-Dependent Color Spaces Most device-dependent color spaces are creations for the convenience of practical usage, digital representation, and computation. They do not relate to the objective definition or the way humans see color. They are used to encode device-specific digital data at the device-control level. Device-dependent color spaces fall into two main classes—additive and subtractive spaces. Additive spaces include RGB spaces and any spaces derived from Device/RGB space, such as HSV and HLS spaces. Subtractive spaces include CMY, CMYK, and Hi-Fi spaces that have five or more primary colorants. In this chapter, the color gamut of device-dependent color spaces is discussed. The gamut computation of ideal block dyes is given in detail. The process of determining a color gamut boundary of a real imaging device, which includes the test target, device gamut model, interpolation method, and color gamut descriptor, is given. Finally, we discuss color gamut mapping for cross-media rendition because of the gamut mismatch among real imaging devices.
7.1 Red-Green-Blue (RGB) Color Space RGB color space defines colors within a unit cube by the additive color-mixing model. Additive color mixing means that a color stimulus for which the radiant power in any wavelength interval, small or large, in any part of the spectrum is equal to the sum of the powers in the same interval of the constituents of the mixture, constituents that are assumed to be optically incoherent.1 As shown in Fig. 7.1, red, green, and blue are additive primaries represented by the three axes of the cube that defines the color gamut boundary of the RGB space; all colors are located within the cube. Each color in the cube can be represented as a triplet (R, G, B) where values for R, G, and B are assigned in the range from 0 to 1 (or from 0 to the bit depth of the device). In an ideal case, the mixture of two additive primaries produces a subtractive primary; thus, the mixture of the red (1, 0, 0) and green (0, 1, 0) is yellow (1, 1, 0), the mixture of the red (1, 0, 0) and blue (0, 0, 1) is magenta (1, 0, 1), and the mixture of the green (0, 1, 0) and blue (0, 0, 1) is cyan (0, 1, 1). A white (1, 1, 1) is obtained when all three primaries are added together and the black (0, 0, 0) is located at the origin of the cube. Shades of gray are located along the diagonal line that connects the black and white points. The additive color mixing of ideal block dyes behaves like a logical “OR” operation; the output is 1 when any of the primaries is 1. An important characteristic of 103
104
Computational Color Technology
Figure 7.1 Additive RGB color space.
the additive system is that the object itself is a light emitter such as a television. In addition to televisions, electronic color devices that use RGB space are scanners, computer monitors, and digital cameras.
7.2 Hue-Saturation-Value (HSV) Space HSV space has a hexcone shape as shown in Fig. 7.2. Additive and subtractive primaries occupy the vertices of the hexagon that is the 2D projection of the RGB cube along the neutral diagonal line. This hexagon governs the hue change. Hue H is represented as an angle about the vertical axis. Vertices of the hexagon are separated by 60 deg intervals. Red is at 0 deg, yellow is at 60 deg, green is at 120 deg, cyan is at 180 deg, blue is at 240 deg, and magenta is at 300 deg. Complementary colors are 180 deg apart. Saturation S indicates the strength of the color; it increases by moving from the center toward the edge of the hexagon. It varies from 0 to 1, representing the ratio of the purity of a selected color to its maximum purity. At S = 0, we have the gray scale that is represented by the center axis of the hexcone. Value V indicates the darkness of the color. It varies from 0 at the apex of the hexcone to 1 at the top. The apex represents black. At the top, colors have their maximum intensity. When V = 1 and S = 1, we have the “pure” hues. White is located at V = 1 and S = 0. Since HSV space is a modification of the RGB space, a simple transform exists between them.2 V = Max(R, G, B),
(7.1)
Device-Dependent Color Spaces
105
Figure 7.2 HSV color space.
S=0
if V = 0,
(7.2a)
S = [V − Min(R, G, B)]/V
if V > 0,
(7.2b)
H =0
if S = 0,
(7.3a)
H = 60(G − B)/(SV )
if V = R,
(7.3b)
H = 60[2 + (B − R)/(SV )]
if V = G,
(7.3c)
H = 60[4 + (R − G)/(SV )]
if V = B,
(7.3d)
H = H + 360
if H < 0.
(7.3e)
7.3 Hue-Lightness-Saturation (HLS) Space HLS space (shown in Fig. 7.3) is a double cone shape with the highest saturation at 50%. Hue has the same meaning as in the HSV model. H = 0 deg corresponds to blue. Magenta is at 60 deg, red is at 120 deg, yellow is at 180 deg, green is at 270 deg, and cyan is at 300 deg. Again, complementary colors are 180 deg apart. The vertical axis is called lightness L, indicating the darkness of the color. Pure black and pure white are converged to a point. The pure hues lie on the L = 0.5 plane, having a saturation value S = 1.
106
Computational Color Technology
Figure 7.3 HLS color space.
7.4 Lightness-Saturation-Hue (LEF) Space LEF space is derived by applying a linear transformation to the RGB color cube, then a rotation that places the black-white axis in the vertical position. On the planes perpendicular to the black-white axis, saturation and hue are represented in polar coordinates as radius and angle.3,4 LEF lightness (black-white axis) is given by the L coordinate. The LEF saturation-hue plane is given by the E coordinate that is perpendicular to the L axis, containing a hexagonal arrangement of the hue circle, and the F -coordinate is perpendicular to the L and E axes (see Fig. 7.4). The forward transformation from RGB to LEF is given in Eq. (7.4), and the reverse transformation is given in Eq. (7.5). 2/3 L E = 1 F 0
2/3 2/3 R G, −1/2 −1/2 √ √ B 3/2 − 3/2
(7.4)
0√ L 1/ √3 E . F −1/ 3
(7.5)
1/2 2/3 R G = 1/2 −1/3 B 1/2 −1/3
Equation (7.4) indicates that the LEF space is mathematically linear with respect to the RGB space and can therefore be directly used for generating juxtaposed colors
Device-Dependent Color Spaces
107
Figure 7.4 Transformed RGB cube viewed in LEF color space.4
whose sum, weighted by their respective surface coverages, should correspond to a given target color.
7.5 Cyan-Magenta-Yellow (CMY) Color Space CMY color space defines colors within a unit cube by the subtractive color-mixing model. Subtractive mixing means color stimuli for which the radiant powers in the spectra are selectively absorbed by an object such that the remaining spectral radiant power is reflected or transmitted, then received by observers or measuring devices. The object itself is not a light emitter, but a light absorber. Cyan, magenta, and yellow are subtractive primaries. This system is the complement of the additive system as shown in Fig. 7.5. The mixing of two subtractive primaries creates an additive primary. When cyan and magenta colorants are mixed, cyan absorbs the red reflection of the magenta and magenta absorbs the green reflection of the cyan. This leaves blue the only nonabsorbing spectral region. Similarly, the mixture of cyan and yellow gives green, and the mixture of magenta and yellow gives red. The point (1, 1, 1) of the subtractive cube represents black because all components of the incident light are absorbed. The origin of the cube is white (0, 0, 0). In theory, equal amounts of primary colors produce grays, locating along the diagonal line of the cube. Thus, the subtractive mixing of block dyes behaves like a logical “AND” operation; for
108
Computational Color Technology
Figure 7.5 Subtractive cyan-magenta-yellow (CMY) color space.
a given region of the visible spectrum, the output is 1 if all participated primaries are 1 at that spectral region. A good example of subtractive color mixing is color printing on paper. Most printers today add a fourth primary, the black that gives many advantages such as the enlargement of the color gamut and the saving of color ink consumption by replacing the common component with the black ink.
7.6 Ideal Block-Dye Model Device RGB and CMY color spaces are closely related to the ideal block-dye model. The ideal block-dye model is the simplest color-mixing model. Primary colorants of block dyes are assumed to have a perfect reflection (normalized to the value 1) at a portion of the visible spectrum (usually one-third for additive primaries and two-thirds for subtractive primaries) and a total absorption (assigned with the value 0) for the rest of the portions, as shown in Figs. 7.6 and 7.7 for additive and subtractive block-dye models, respectively. Additive and subtractive color mixings are different. Additive color mixing is applied to imaging systems that are light emitters, whereas subtractive mixing is for imaging systems that combine unabsorbed light. 7.6.1 Ideal color conversion The simplest model for converting from RGB to cmy is the block-dye model that a subtractive primary is the total reflectance (white or 1) minus the reflectance of the
Device-Dependent Color Spaces
109
Figure 7.6 Additive color mixing of ideal block dyes.
corresponding additive primary. Mathematically, this is expressed as c = 1 − R,
m = 1 − G,
y = 1 − B,
(7.6a)
where the total reflectance is normalized to 1. If we set a vector Υ cmy = [c, m, y]T , a vector Υ rgb = [R, G, B]T , and a unit vector U 1 = [1, 1, 1]T , we can express Eq. (7.6a) in vector space. Υ cmy = U 1 − Υ rgb .
(7.6b)
The intuitive model of ideal color conversion implies an ideal case of block dyes (see Fig. 7.8).5 This model is simple and has minimal computation cost, but it is grossly inadequate. This is because none of the additive or subtractive primaries come close to the block-dye spectra. Typical spectra of subtractive primaries contain substantial unwanted absorptions in cyan and magenta colorants.6 To minimize this problem and improve the color fidelity, a linear transform is applied to the input RGB.
110
Computational Color Technology
Figure 7.7 Subtractive color mixing of ideal block dyes.
R β11 G = β21 B β31
β12 β22 β32
R β13 β23 G , β33 B
Υ rgb = βΥ rgb ,
(7.7a)
(7.7b)
then the corrected additive primary is removed from the total reflectance to obtain the corresponding subtractive color. c = 1 − R,
m = 1 − G ,
y = 1 − B ,
Υ cmy = U 1 − Υ rgb = U 1 − βΥ rgb .
(7.8a)
(7.8b)
The coefficients βij of the transfer matrix are determined in such a way that the resulting cmy have a closer match to the original or a desired output. Generally, the diagonal elements have values near 1 and off-diagonal elements have small values,
Device-Dependent Color Spaces
111
Figure 7.8 Ideal color conversion of block dyes.
serving as the adjustment to fit the measured results. However, this correction is still not good enough because it is a well-known fact that the RGB-to-cmy conversion is not linear. A better way is to use three nonlinear functions or lookup tables for transforming RGB to R G B .
7.7 Color Gamut Boundary of Block Dyes Block dyes are similar to optimal stimuli in that they are also imaginary colorants, having a uniform spectrum of a unit reflectance within specified wavelength ranges, and zero elsewhere; the difference is that block dyes have a wider wavelength range than corresponding optimal stimuli. Again, no real colorants process this kind of spectra. We generate ideal block dyes by selecting a bandwidth and moving it from one end of the visible spectrum to the other end. We also produce block dyes with a complementary spectrum Sc (λ); that is, unit reflectance subtracts a block-dye spectrum SB (λ) across the whole visible region, Sc (λ) = 1 − SB (λ).
(7.9)
We start at a bandwidth of 10 nm at one end and move it at a 10-nm interval for generating a whole series of block dyes. We then increase the bandwidth by
112
Computational Color Technology
10 nm to generate the next set of block dyes. This procedure is repeated until the bandwidth reaches 220 nm. We compute tristimulus values of these block dyes by using the CIE standard formulation given in Eq. (1.1) and repeat it here as Eq. (7.10). X=k
E(λ)SB (λ)x(λ)λ, ¯
(7.10a)
E(λ)SB (λ)y(λ)λ, ¯
(7.10b)
E(λ)SB (λ)¯z(λ)λ, E(λ)y(λ)λ ¯ , k = 1/
(7.10c)
Y =k Z=k
(7.10d)
where SB (λ) is the spectrum of a block dye and E(λ) is the spectrum of an illuminant. We then compute CIELAB values using Eq. (5.11) and repeat it here as Eq. (7.11) to derive the gamut boundary for block dyes. L∗ = 116f (Y/Yn ) − 16 a ∗ = 500[f (X/Xn ) − f (Y /Yn )] b∗
= 200[f (Y /Yn ) − f (Z/Zn )]
L∗
0 a ∗ = 500 b∗ 0
116 −500 200
0 0 −200
or f (X/Xn ) −16 f (Y /Yn ) 0 f (Z/Zn ) 0 1
(7.11a)
and f (t) = t 1/3 = 7.787t + (16/116)
1 ≥ t > 0.008856,
(7.11b)
0 ≤ t ≤ 0.008856.
(7.11c)
The shape of the 2D gamut boundary of block dyes is pretty similar to the corresponding boundary of spectral stimuli with a much smaller gamut size (see Fig. 7.9), whereas the 3D gamut shows some similarity to the boundary of objectcolor stimuli given by Judd and Wyszecki (see Fig. 7.10).7 7.7.1 Ideal primary colors of block dyes Block dyes can be used to find ideal primary colorants with respect to color strength. The most saturated red has a spectrum with wavelength onset around 600 nm and cutoff around 680 nm. The hue is not sensitive to broadening the spectrum at the long-wavelength side because CMF is very weak at the long-wavelength end. On the short-wavelength side, we can broaden the spectrum as low as 550 nm, but hue is gradually shifted toward orange.
Device-Dependent Color Spaces
113
Figure 7.9 CIE a ∗ -b∗ plots of block dyes and spectral stimuli.
The most saturated green has a spectrum with a wavelength range between 500 and 560 nm. There are various shades of greens; the hue shifts toward cyan if we broaden the short-wavelength end of the spectrum and the hue shifts toward yellow if we broaden the long-wavelength end. The most saturated blue has a spectrum of [400, 470] nm. By shifting a blue spectrum with a fixed bandwidth to higher wavelengths, the hue gradually changes to cyan. We still get blue color when the long wavelength ends around 510 nm. Similar to shifting, the hue gradually changes to cyan by broadening the spectrum at the long-wavelength side. However, broadening at the short-wavelength side is not sensitive to hue shift. This is because CMF is very weak at the blue end. We still get blue color with a bandwidth of [390, 520] nm. The most saturated cyan has a spectrum of [400, 560] nm. By broadening the cyan spectrum at the long-wavelength side, the hue shifts toward green. It is still considered as cyan with a bandwidth of [400, 610] nm. The change at the shortwavelength side is not sensitive to hue shift. However, the lower bound should be no higher than 430 nm; otherwise the hue will be too greenish. In order to produce a wider range of greens, the cyan range should be extended to [390, 580] nm. The most saturated magenta has a spectrum of [400, 460] and [600, 700] nm. By extending the short-wavelength side of the red component, the hue shifts from purple/blue through magenta toward red. By broadening the long-wavelength
114
Computational Color Technology
side of the blue component, the hue remains as magenta color with a diminished chroma. By reducing the blue component, the hue shifts toward red. The most saturated yellow has a spectrum of [540, 620] nm. By broadening the yellow spectrum at the long-wavelength side, the hue becomes warmer (toward red). It is still considered as yellow with [540, 700] nm bandwidth. By broadening the short-wavelength side, the hue becomes cooler (toward green). We still get yellow with a bandwidth of [490, 700] nm. To make a broad range of greens, especially the darker bluish-greens, the yellow spectrum should be extended to lower wavelengths. Thus, the cool yellows are preferred. The recommended spectral ranges for RGB and CMY block dyes are given in Table 7.1 and are used for the subsequent color-mixing computations. These the-
Figure 7.10 Three-dimensional gamut boundary of block dyes in CIELAB space.
Table 7.1 Block-dye sets used in the computation of the gamut size.
RGB set 1
RGB set 2
CMY set 1
CMY set 2
Blue/Cyan Green/Magenta
[400, 470] nm [500, 560] nm
[390, 500] nm [500, 600] nm
Red/Yellow
[600, 680] nm
[600, 720] nm
[400, 560] nm [400, 460] and [600, 700] nm [540, 620] nm
[390, 590] nm [390, 490] and [590, 750] nm [490, 750] nm
Device-Dependent Color Spaces
115
oretical spectral ranges of block dyes may serve as useful guidance for designing and producing real colorants. Interestingly, chromaticity coordinates of RGB block dyes are pretty close to certain standard RGB primaries such as NTSC/RGB or sRGB (see Table 7.2). This seems to imply that behind a simple chromaticity representation of a primary, there is an associated block-dye spectrum. This association is not surprising because many RGB primaries are spectral stimuli, such as CIE primaries. The chromaticity coordinates of a primary can be matched by a block dye if we finely tune the spectrum on a wavelength-by-wavelength basis. 7.7.2 Additive color mixing of block dyes We compute the color mixing of the most saturated RGB block dyes (RGB set 1) to obtain the color gamut. For comparison purposes, we perform the same additive mixing on RGB set 2 and CMY set 2 with broader spectra (see Table 7.1). Equation (7.12) gives the formula of the additive mixing; it is a linear combination of block dyes at a given wavelength. P (λ) = wr Pr (λ) + wg Pg (λ) + wb Pb (λ),
(7.12)
where wr , wg , and wb are the weights or concentrations of red, green, and blue components, respectively, in the mixture, and Pr , Pg , and Pb are the respective reflectances of red, green, and blue dyes. The computation indicates that RGB set 1 indeed has the largest color gamut. Two-color mixtures lie perfectly in the lines of a triangle, indicating that the additive mixing obeys Grassmann’s law regardless of the type of block dyes, whether RGB or CMY (see Fig. 7.11). Converting to CIELAB, the data no longer lie in a straight line (see Fig. 7.12), indicating that the common practice of connecting R, Y, G, C, B, and M primary colors in straight lines is not a correct way to define color gamut size in a projected CIELAB a ∗ -b∗ plot. 7.7.3 Subtractive color mixing of block dyes We also compute the color gamut formed by the most saturated CMY block dyes (CMY set 1) and CMY set 2 in subtractive mixing, where the reflectances of Table 7.2 The similarity between block dyes and standard RGB primaries.
Block RGB set 1 NTSC/RGB Block RGB set 2 sRGB
Red x
y
Green x
y
Blue x
y
0.6787 0.670 0.6791 0.640
0.3211 0.330 0.3207 0.330
0.2105 0.210 0.3323 0.300
0.7138 0.710 0.6224 0.600
0.1524 0.140 0.1393 0.150
0.0237 0.080 0.0521 0.060
116
Computational Color Technology
Figure 7.11 Two-dimensional gamut boundaries of block dyes in chromaticity diagram.
Figure 7.12 Two-dimensional gamut boundaries of block dyes in CIELAB space.
Device-Dependent Color Spaces
117
three components are converted to densities by taking the logarithm base 10 (see Chapter 15 for definition of density), weighted by their corresponding fractions, then sum the three components together. The resulting total density is converted back to reflectance by taking the antilogarithm. The logarithm conversion from reflectance to optical density poses a problem for block dyes because they have zero reflectance at many wavelengths. Mathematically, the logarithm of zero is undefined. Therefore, a density value must be artificially assigned to zero reflectance. We choose to give a maximum density of 4, which is high enough for most, if not all, practical applications. The individual densities of subtractive primaries are weighted and combined to give the density of the mixture at a given wavelength. Finally, the density is converted back to reflectance for computing the tristimulus and CIELAB values via Eq. (7.11). Using a maximum density of 4, we compute the color gamut of the CMY block dye sets 1 and 2 under D65 in CIEXYZ and CIELAB spaces. In CIEXYZ space, CMY set 2 forms a nearly perfect triangle with vertices located in the R, G, and B regions (see Fig. 7.13). All two-color mixtures lie on lines of the triangle. CMY set 1 does not give a triangle; instead, it gives a pentagon, where two-color mixtures fall on lines connecting the R, G, C, B, and M vertices. The resulting color gamut closely resembles the chromaticity diagram of primaries employed in Donaldson’s six-primary colorimeter.8,9 The difference between CMY set 1 and 2 may be attributed to the fact that the complementary spectra of CMY set 1 are overlapped, whereas complementary spectra of CMY set 2 form a continuous white spectrum
Figure 7.13 Two-dimensional gamut boundaries of subtractive block dyes in chromaticity diagram.
118
Computational Color Technology
with no overlapping. These computations indicate that Grassmann’s additivity is followed, if not strictly obeyed, for block dyes, even in subtractive mixing. By transforming to CIELAB, both dye sets give a rather curved boundary with six vertices (see Fig. 7.14). These results reaffirm that the straight-line connection of six primaries will give a misled color gamut in CIELAB space because it is the projection of a 3D color gamut as shown in Fig. 7.15 for CMY set 1. In addition, we also compare the computed block-dye color gamut with two measured real inks. The real inks give a pretty straight hexagon shape (with some slight deviations) in the chromaticity diagram (see Fig. 7.16), indicating that the practice of connecting six primaries in straight lines is a reasonable approximation. They give a slightly curved polygon in CIELAB (see Fig. 7.17), indicating that they do not obey Grassmann’s law, but they can be modeled by other colormixing theories that take the complex phenomena of absorption, reflection, and transmission into account.10 As a summary, spectral and optimal stimuli obey Grassmann’s law of color mixing. Likewise, block dyes, either a RGB or CMY set, obey Grassmann’s law of additive color mixing. Surprisingly, subtractive block dyes in subtractive color mixing follow Grassmann’s law closely, whereas the real inks do not. From this computation, the common practice of connecting six primaries in CIELAB space to give a projected 2D color gamut is not a strictly correct way of defining a color gamut. However, it is a pretty close approximation for real colorants. To have a better definition of the color gamut, more two-color mixtures should be measured and plotted in CIELAB space.
Figure 7.14 Two-dimensional gamut boundaries of subtractive block dyes in CIELAB space.
Device-Dependent Color Spaces
119
Figure 7.15 Three-dimensional gamut boundary of subtractive block dye set 1 in CIELAB space.
Figure 7.16 Two-dimensional gamut boundaries of inks in a chromaticity diagram.
120
Computational Color Technology
Figure 7.17 Two-dimensional gamut boundaries of inks in CIELAB space.
7.8 Color Gamut Boundary of Imaging Devices The device color gamut boundary is important in color reproduction for producing both accurate and pleasing outputs. For accurate color reproduction, we need to establish the relationship between device signals with device-independent color specifications (preferably CIE specifications) for in-gamut rendering. For pleasing color renditions from devices with different color gamut boundaries, the gamut boundary is the essential information required for color gamut mapping. The accurate description of the color gamut is a necessary component for the simulation of printing and proofing, and the optimization of color output for display. An inaccurate color gamut boundary can cause color mismatches that create image artifacts and color errors. Color gamut size of imaging devices is not as well defined as the ideal block dyes or CIE color boundaries. Each device has its own color boundary, depending on many factors such as the physical properties of the medium, the absorption characteristics of the colorants, the viewing conditions, the halftone technique, and the imaging process. Moreover, color gamuts are often represented in two dimensions, such as the chromaticity diagram or CIELAB a∗ -b∗ plot. This obscures the real three-dimensionality of the color gamut, and it is the 3D description of the gamut that is useful. The 2D plot omits the range of lightness, which is an important di-
Device-Dependent Color Spaces
121
mension of the color gamut. Sometimes, this omission causes the misjudgment of out-of-gamut colors as in-gamut when they appear to be inside the projected 2D gamut but actually are not. A chromaticity diagram shows the boundary of the color gamut in a 2D plot. It is a projected color gamut because the luminance (or lightness) axis is not presented. This horseshoe shape is the ideal gamut formed by the purest colors. In the real world, these colors do not exist. Real color devices have much smaller gamuts. Figure 7.18 depicts color gamuts of a typical monitor, printer, and film in a chromaticity diagram.11 A large portion of the monitor and printer gamuts overlap, but there are areas that the monitor can display that the printer cannot render and vise versa. This poses a problem in color reproduction; some kind of gamut mapping is needed. Color gamut mapping addresses one of the most difficult problems in color reproduction. Therefore, it is not surprising that numerous methods for determining the color gamut boundary have been proposed. Generally, the method consists of two parts: a properly designed test target and a device gamut model or interpolation method.
Figure 7.18 Color gamuts of a typical monitor, printer, and film in a chromaticity diagram.11
122
Computational Color Technology
7.8.1 Test target of color gamut The color gamut is defined by colors of the full-strength primary colors and their two-color mixtures. A typical test target (or gamut-boundary descriptor) contains a series of color patches (or coordinates) with known CIE specifications that define a set of points on the boundary surface. It can be as simple as eight colors, having white, red, green, blue, cyan, magenta, yellow, and black in the solid area coverage, or as complex as several thousand colors. Ideally, the points should be spaced with some perceptual uniformity. The larger the number of points, the more accurate the boundary descriptor can be. However, oversampling the boundary may place some points very close together such that the inherent uncertainty in the color rendition and color measurement may cause problems for interpolation and subsequent gamut mapping. There are several standard test targets, such as ISO 12640 (IT8.7/3) and ISO 12641 (IT8.7/1) designed for the device characterization.12,13 They have a limited number of patches at the colorant boundary and limited steps in lightness and hue. In view of these deficiencies, Green has designed a test target specifically for determining the color gamut boundary.14 The test target consists of eighteen columns, having constant proportions of the primary colorants for each column, and 24 rows with approximately constant lightness. In a given column, each patch contains the maximum available chroma at the lightness level of the row. A total of 24 lightness steps were chosen between the smallest printable dot and a tertiary overprint with 100% of the dominant color, 50% of the complementary, and 100% of black. The layout of the CMYK and RGB targets can be found in Green’s paper. 7.8.2 Device gamut model and interpolation method The second component is the device gamut model or interpolation method. For printing devices, the gamut model can be based on physical models of color mixing such as the Neugebauer equations,15 the Yule-Neilsen model, the Beer-LambertBorguer law, or the Kubelka-Munk theory.16,17 These physical models will be discussed in Chapters 15–18 of this book. In addition, several analytical gamut models, such as the dot-gain model18–21 or mathematical formula,22,23 are proposed for general usage of input, display, and output devices. Gustavson developed analytical models for physical and optical dot gains.18–21 The optical dot model includes nearly all paths of light interacting with a substrate as well as the wavelength dependence. And the physical dot model uses the realistic imperfect, noncircular dot. The model is comprehensive but extremely complex. Herzog and Hill developed a mathematical representation for any device color gamut.22 The method is based on the general characteristics of the source and destination gamuts. All color signals of a device are contained in a cube of unit strength for each primary and called the kernel gamut. The kernel gamut surface is mapped onto the destination gamut surface in a manner such that the eight corners, twelve edges, and six planes of the kernel gamut come to lie at the corresponding
Device-Dependent Color Spaces
123
corners, edges, and planes of the destination gamut. The mapping is achieved by using analytical functions to distort the kernel gamut in closed forms. Mahy proposed a printer model by assuming that there exists a continuous function between device space (e.g., CMY or CMYK) and device-independent color space (e.g., CIE spaces or colorimetric RGB space).23 He employed the Beer-Lambert-Bouger law as the printer model for the photographic process and used a quadratic function for cellar Neugebauer equations. He also took ink limitation into consideration. Physical and mathematical models allow the use of fewer color patches in the test target. The problem is that none of these models are perfect in describing the color mixing and color gamut size. Therefore, the use of a device model leads to errors in the prediction of the color-space coordinates, whose magnitude depends on the model used. Often, a model tends to give the largest errors at the gamut boundary and for dark colors. A more accurate prediction comes from experimental measurements of surface colors together with an interpolation technique, provided that the test target has an adequate number of surface colors. A variety of methods for calculating the color gamut boundary have been proposed. Several methods are briefly discussed; detailed information on these methods can be found in the original articles. Kress and Stevens measured a large set of samples spanning the printable range of the device and used a spline interpolation to locate the gamut surface.24 This method could be used to compute gamuts of images and media. Braun and Fairchild used a triangulation and interpolation process to convert nonuniform color data from a device RGB cube into a CIELAB L∗ C∗ab h∗ab representation of the color gamut.25 They took advantage of the fact that gamut mapping and visualization are better or more efficiently performed in cylindrical coordinates such as CIELAB L∗ C∗ab h∗ab . Triangulation of the data was performed by projecting the nonlinearly spaced L∗ C∗ab h∗ab data from the device RGB onto the L∗ h∗ab plane, grouping them into triangles using the inherent connectivity associated with the points from the RGB cube. The vertices of this mesh were measured or modeled from the surface of the RGB cube. A uniform L∗ h∗ab grid of C∗ab values was interpolated using triangular linear interpolation from the data provided by the triangle list. This method provided a computational process for gamut-surface fitting from measured data that is independent of the gamut concavity or convexity. This also provided a goodness-of-fit measure to test the fitting of the gamut surface. For some CRT gamuts tested, the goodness expressed as an average Eab value was about one. Computational methods were also developed to find the line gamut boundary (LGB), that is, the interactions between a gamut plane and a line along which mapping is to be carried out.25–28 Morovic and Luo28 summarized principal features of computing the LGB in a plane of constant hue and compared color gamuts of different media as follows:28–31 (1) Determine the 2D L∗ -C ∗ gamut boundary at the hue angle of interest h∗ using the equation at this angle.
124
Computational Color Technology
(2) Find the pair of nearest neighboring points that encompass the hue angle in the gamut-boundary descriptor (GBD). (3) For each pair, calculate the intersection of the L∗ -C ∗ plane and the line connecting the two GBD points. (4) Calculate the points on the L∗ axis where the surface defined by the GDB matrix intersects it. This procedure results in a set of boundary points that form a polygon for a given hue angle. The intersection of a given line and the polygon is determined as follows: (1) For each pair of neighboring points in the polygon, calculate the formula of the boundary line between them. (2) For each of these lines, calculate their intersection point with the given line. If it lies between the two points from the polygon, then it is an LGB point.
7.9 Color Gamut Mapping With the gamut differences among a wide range of images that are being acquired, displayed, and printed on various imaging devices, color gamut mapping is becoming ever more important. The need for understanding the scope of the color gamut mapping and for coming up with an acceptable universal gamut mapping has been recognized by CIE, which formed the CIE Technical Committee 8-03 on color gamut mapping led by Morovic and charged it with investigating this issue. In 1999, the committee published the comprehensive report “Survey of Gamut Mapping Algorithms,” reviewing 57 papers that appeared between 1977 and the first quarter of 1999.32 Morovic also wrote a chapter named “Gamut Mapping” in the book “Digital Color Imaging Handbook,” edited by Sharma.33 The chapter contains various aspects of color gamut mapping such as color gamut definition, gamut description and visualization, gamut boundary computation, and gamut-mapping algorithms. It gives an overview of the recent developments and future directions, and is an excellent reference for research and development. Based on CIE definitions, color gamut mapping is a method for assigning colors from the reproduction medium to colors from the original medium or image, where the reproduction medium is defined as a medium for displaying, capturing, or printing color information (e.g., CRT monitor, digital camera, scanner, printer with associated substrate). The aim of color gamut mapping is to ensure a good correspondence of overall color appearance between the original and the reproduction by compensating for the mismatch in size, shape, and location between the original and reproduction gamuts.33,34 The difficulties are (i) there is no estab-
Device-Dependent Color Spaces
125
lished model for quantifying the appearance of complex images and (ii) there is no established measure for quantifying the difference between original and reproduction. Nonetheless, some empirical criteria are established for assessing image quality and are given in Section 7.9.3. 7.9.1 Color-mapping algorithm In general, the color-mapping algorithms consist of two components—a directional strategy and a mapping algorithm. The directional strategy decides which color space to perform the color mapping, determines the reference white, computes the gamut surface, and decides what color channel to hold constant and what channel to compress first, or to do them simultaneously.35 A gamut-mapping algorithm provides the means for transforming input out-ofgamut colors to the surface or inside of the output color gamut. There are two ways of mapping—clipping and compression. Gamut-clipping algorithms only change the out-of-gamut colors and leave in-gamut colors untouched. Clipping is characterized by the mapping of all out-of-gamut colors to the surface of the output gamut, and no change is made to input colors that are inside the output gamut. This will map multiple colors into the same point (many-to-one mapping) that may lose fine details and may cause shading artifacts in some images. This phenomenon is known as “blocking.” However, clipping tends to maintain the maximum image saturation. Gamut-compression algorithms are applied to all colors from the input image to distribute color differences caused by gamut mismatch across the entire input gamut range. Several compression methods are in use: linear, piecewise linear, nonlinear, and high-order polynomial compression.32,35 Sometimes, a combination of different compression methods is used. Linear compression can be expressed as L∗o = t + sL∗i ,
(7.13a)
where t = MIN(L∗o ),
(7.13b)
s = MAX(L∗o ) − MIN(L∗o ) / MAX(L∗i ) − MIN(L∗i ) ,
(7.13c)
and MIN is the minimum operator and MAX is the maximum operator, and L∗i and L∗o are the lightness for the input and output, respectively. A similar expression can be obtained for chroma at a constant hue angle. Other linear compressions in the CIELUV and CIEXYZ spaces have been suggested.36,37 Piecewise linear compression is a variation of linear compression in which the whole range is divided into several regions. Each region is linearly compressed
126
Computational Color Technology
with its own compression ratio (or slope). Unlike simple linear compression that applies a global, uniform ratio to all colors, piecewise linear compression provides different ratios depending on the attributes of input colors to which they are applied. Nonlinear compression, in principle, can have any functions such as the cubic, spline, or a high-order polynomial. In practice, however, the middle tone is usually retained, while the shadow and highlight regions are nonlinearly mapped. Good results are obtained by using a knee function as proposed by Wallace and Stone.38 It is a soft clipping, accomplished by using a tangent to a linear function near the gray axis, where it then approaches a horizontal line near the maximum output saturation. This is designed to minimize the loss of detail that occurs with clipping, while retaining the advantage of reproducing most of the common gamut colors accurately. Nonlinear mappings maintain the shading, but can cause an objectionable decrease in saturation.
7.9.2 Directional strategy Color gamut mapping is most effectively performed in color spaces where the luminance and chrominance are independent of each other, such as CIELAB and CIELUV. Popular directional strategies for CIELAB or CIELUV are as follows: Lines of constant perceptual attribute predictors As an example, we present the sequential L∗ and C∗ mapping at constant h∗ .35 A point p of the input color (see Fig. 7.19) located outside of the output color gamut (solid lines) is to be compressed into the output gamut. L∗ is first mapped to the compressed L∗ (dotted lines). If clipping is used, the point will lie on the dashed line. If a linear compression is used, the mapped point pl will be inside the dotted line. Some researchers have stated that linear lightness mapping is the best technique.37,39,40 Jorgensen, however, had a different opinion. He suggested achieving this by selecting an area of interest within the image, reproducing the range of lightness within that area with an equal range of lightness on the print, and compressing elsewhere.41 Wallace and Stone also noted the necessity of different lightness mappings for each image.38 After the lightness mapping from point p to p1 , the mapped color p1 is then moved horizontally in the L∗ -C ∗ diagram to the final destination for the chroma compression. It is desirable to maintain hue constancy although it has been noted that CIELAB and CIELUV do not exhibit perfect hue constancy.38,42 If clipping is used, the mapped color pm will be located at the boundary of the output color gamut. If a linear or nonlinear compression is used, the compressed color pn will be located somewhere inside the output color gamut (see Fig. 7.19). The location depends on the slope and intercept for linear mapping and the equation or lookup table used in the nonlinear mapping. Viggiano and Wang performed an experiment in CIELAB where lightness and chroma could be varied independently, and
Device-Dependent Color Spaces
127
Figure 7.19 Sequential L∗ and C ∗ mapping at constant h∗ .
found that the linear compression in chroma with lightness compression was not preferred.37 Lines toward a single center of gravity A simultaneous L∗ and C ∗ mapping to a fixed anchor point L∗ = 50 at constant h∗ is given as an example. Figure 7.20 gives the mapping to the anchor point L∗ = 50 and C ∗ = 0.35 If clipping is used, the out-of-gamut color will be located at the interception of the output boundary and the line that connects the out-of-gamut color and the anchor point. If linear compression is used, one draws the line connecting the anchor point and the point of interest, then makes the line intersect both input and output boundaries. Thus, the distances from output and input boundaries to the anchor point are obtained. One can then calculate the ratio of the distances. The L∗ and C ∗ of the out-of-gamut color are weighted by this ratio. For nonlinear compression, the location is dependent on the function employed. Meyer and Barth found that this technique has a tendency to lighten shadows.43 Lines toward variable centers of gravity A good example of a variable center of gravity is the lightness compression from center toward the lightness of the cusp on the lightness axis, where the cusp varies with the hue angle; thus, the center of gravity has to change accordingly.
128
Computational Color Technology
Figure 7.20 Simultaneous L∗ and C ∗ mapping to an anchor point at constant h∗ .
Lines toward the nearest color in the reproduction gamut Simultaneous L∗ , C ∗ , and h∗ mapping to minimize the color difference between two gamuts.39,44 Liang has developed an optimum algorithm—modified vector shading—to minimize the matching error and to perform neighborhood gamut compression.45 Image-dependent gamut mapping The gamut of a given image is compressed to a device rather than mapping all images from one device onto another device. This approach is less general but has the flexibility to tune the color reproduction for this particular image; therefore, it produces better results. All of the directional strategies mentioned above can be used for image-dependent gamut mapping. However, they require maintaining some form of image-gamut data such as the maximum and minimum values of chrominance values during the processing.36 Stone, Cowan, and Beatty developed an interactive gamut-mapping technique by using computer and human judgment.46
Device-Dependent Color Spaces
129
7.9.3 Criteria of gamut mapping A set of criteria for assessing the image-quality aspect of color gamut mapping is proposed as follows, based on traditional color reproduction and psychophysical principles:46,47 (1) The neutral axis of the image should be preserved. (2) Maximum luminance contrast is desirable. (3) Few colors should lie outside the destination gamut to reduce the number of out-of-gamut colors by excluding some extremes. (4) Hue and saturation shifts should be minimized. (5) It is better to increase than to decrease the color saturation by preserving chroma differences presented in the original. (6) It is more important to coordinate the relationship between colors present than their precise value.
7.10 CIE Guidelines for Color Gamut Mapping The report from the CIE TC 8-03 committee, “Survey of Gamut Mapping Algorithms,” reviewed a wide variety of gamut-mapping strategies together with some evaluations of color gamut mapping techniques.32 Four salient trends in color gamut mapping were identified as follows: (1) Image-dependent compression techniques are preferred to image-independent methods. For large amounts of compression, the preferred technique is image dependent.35 (2) Clipping algorithms are preferred to compression methods, given the same constant color attributes—specifically, the clipping of chroma to the border of the realizable output gamut at constant lightness and hue.38 For small amounts of compression, Hoshino and Berns find the preferred technique is a soft clipping algorithm that maps the upper 95% without adjustment and compresses the rest linearly. This mapping algorithm is most similar to clipping. (3) A vast majority of algorithms start with uniform overall lightness compression and hue preservation, suggesting that lightness and hue are more important than saturation. (4) The use of different mapping methods for different parts of the color space. For example, Spaulding and colleagues describe a method for specifying different color-mapping strategies in various regions of the color space, while providing a mechanism for smooth transitions between the different regions.48 Because of the importance, difficulty, and complexity of gamut mapping, CIE Technical Committee 8-03 has published a technical report, “Guidelines for the
130
Computational Color Technology
Evaluation of Gamut-Mapping Algorithms,” to provide guidance for the evaluation of the performance of gamut-mapping algorithms that will lead to the development and recommendation of an optimal solution for cross-device and cross-media image reproduction.49 The CIE committee provides guidance and supporting material for the following: (1) (2) (3) (4) (5) (6) (7) (8)
The test images to be used The media on which they are to be reproduced The viewing conditions to be employed The measurement procedures to be followed The gamut-mapping algorithms to be applied The way gamut boundaries are to be calculated The color spaces in which the mapping is to be done, and The experimental method for carrying out the evaluation.
The guidelines also contain example work flows that show how they are to be applied under different circumstances and psychophysical evaluation processes.
References 1. G. Wyszecki and W. S. Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition, Wiley, New York, p. 118 (1982). 2. Color Encoding Standard, XNSS 288811, Xerox Corp., Xerox Systems Institute, Sunnyvale, CA (1989). 3. N. Rudaz, R. D. Hersch, and V. Ostromoukhov, Specifying color differences in a linear color space (LEF), Proc. IS&T/SID 97 Color Imaging Conf., Scottsdale, AZ, Nov. 17–20, pp. 197–202 (1997). 4. N. Rudaz and R. D. Hersch, Protecting identity documents by microstructure color difference, J. Electron. Imaging 13 (2), pp. 315–323 (2004). 5. H. R. Kang, Color Technology for Electronic Imaging Devices, SPIE Press, Bellingham, WA, p. 30 (1997). 6. H. R. Kang, Water-based ink-jet ink. I. Formulation, J. Imag. Sci. 35, pp. 179– 188 (1991). 7. D. B. Judd and G. Wyszecki, Color in Business, Science and Industry, 3rd Edition, Wiley, New York, p. 332 (1975). 8. R. Donaldson, Spectrophotometry of fluorescent pigments, Brit. J. Appl. Phys. 5, pp. 210–224 (1954). 9. D. B. Judd and G. Wyszecki, Color in Business, Science and Industry, 3rd Edition, Wiley, New York, pp. 195–197 (1975). 10. H. R. Kang, Kubelka-Munk modeling of ink jet ink mixing, J. Imaging Sci. Techn. 17, pp. 76–83 (1991).
Device-Dependent Color Spaces
131
11. AGFA, The Secrets of Color Management, AGFA Educational Publ., Randolph, MA, p. 9 (1997). 12. ISO 12640: 1997 graphic technology—Prepress digital data exchange— CMYK standard colour image data (SCID). 13. ISO 12641: 1997 graphic technology—Prepress digital data exchange—colour targets for input scanner calibration (SCID). 14. P. J. Green, A test target for defining media gamut boundaries, Proc. SPIE 4300, pp. 105–113 (2000). 15. M. Mahy, Calculation of color gamuts based on the Neugebauer model, Color Res. Appl. 22, pp. 365–374 (1997). 16. P. Engeldrum and L. Carreira, The determination of the color gamut of dye coated paper layers using Kubelka-Munk theory, Soc. Photo. Sci. and Eng. Annual Conf., pp. 3–5 (1984). 17. P. Engeldrum, Computing color gamuts of ink-jet printing systems, SID 85 Digest, pp. 385–388 (1985). 18. S. Gustavson, The color gamut of halftone reproduction, Proc. IS&T/SID Color Imaging Conf., Scottsdale, AZ, Vol. 4, pp. 80–85 (1996). 19. S. Gustavson, Dot gain in color halftones, Linköping Studies in Science and Technology, Dissertation No. 492, Image Processing Laboratory, Dept. of Electrical Engineering, Linköping University, Sweden (1997). 20. S. Gustavson, Color gamut of halftone reproduction, J. Imaging Sci. Techn. 41, pp. 283–290 (1997). 21. H. R. Kang, Color mixing models, Digital Color Halftoning, SPIE Press, Bellingham, WA, Chap. 6, pp. 83–111 (1999). 22. P. G. Herzog and B. Hill, A new approach to the representation of color gamuts, Proc. IS&T/SID Color Imaging Conf., Scottsdale, AZ, Vol. 3, pp. 78– 81 (1995). 23. M. Mahy, Gamut calculation of color reproduction devices, Proc. IS&T/SID Color Imaging Conf., Scottsdale, AZ, Vol. 4, pp. 145–150 (1996). 24. W. Kress and M. Stevens, Derivation of 3-dimensional gamut descriptors for graphic arts output devices, TAGA Proc., Sewickley, PA, pp. 199–214 (1994). 25. G. Braun and M. D. Fairchild, Techniques for gamut surface definition and visualization, Proc. IS&T/SID Color Imaging Conf., Scottsdale, AZ, Vol. 5, pp. 147–152 (1997). 26. P. G. Herzog, Analytical color gamut representations, J. Imaging Sci. Techn. 40, pp. 516–521 (1996). 27. P. G. Herzog, Further development of the analytical color gamut representations, Proc. SPIE 3300, pp. 118–128 (1998). 28. J. Morovic and M. R. Luo, Developing algorithms for universal colour gamut mapping, Colour Engineering: Vision and Technology, L. W. MacDonald (Ed.), Wiley, New York, pp. 253–283 (1999). 29. J. Morovic and M. R. Luo, Calculating medium and image gamut boundaries for gamut mapping, Color Res. Appl. 25, pp. 394–401 (2000).
132
Computational Color Technology
30. J. Morovic and P.-L. Sun, How different are colour gamuts in cross-media color reproduction? Proc. Conf. Colour Image Science, John Wiley & Sons, Ltd., Chichester, West Sussex, England, pp. 169–182 (2000). 31. J. Morovic and P.-L. Sun, The influence of image gamuts on cross-media color image reproduction, Proc. IS&T/SID Color Imaging Conf., Scottsdale, Vol. 8, pp. 324–329 (2000). 32. J. Morovic and M. R. Luo, The fundamentals of gamut mapping: A survey, J. Imaging Sci. Techn. 45, pp. 283–290 (2001). 33. J. Morovic, Gamut mapping, Digital Color Imaging Handbook, G. Sharma (Ed.), CRC Press, Boca Raton, pp. 639–685 (2003). 34. J. Morovic, To Develop a Universal Gamut Mapping Algorithm, Ph.D. thesis, University of Derby (1998). 35. T. Hoshino and R. S. Berns, Color gamut mapping techniques for color hard copy images, Proc. SPIE 1909, pp. 152–165 (1993). 36. J. Gordon, R. Holub, and R. Poe, On the rendition of unprintable colors, Proc. 39th Annual TAGA Conf. San Diego, TAGA, Sewickley, PA, pp. 186–195 (1987). 37. J. A. S. Viggiano and C. J. Wang, A comparison of algorithms for mapping color between media of different luminance ranges, TAGA Proc. 1992, TAGA, Sewickley, PA, Vol. 2, pp. 959–974 (1992). 38. W. E. Wallace and M. C. Stone, Gamut mapping computer generated imagery, Image Handling and Reproduction Systems Integration, Proc. SPIE 1460, pp. 20–28 (1991). 39. E. G. Pariser, An investigation of color gamut reduction techniques, IS&T’s 2nd Symp. on Electronic Prepress Technology and Color Proofing, pp. 105– 107 (1991). 40. A. Johnson, Techniques for reproducing images in different media: Advantages and disadvantages of current methods, TAGA Proc., Sewickley, PA, pp. 739–755 (1992). 41. G. W. Jorgensen, Improved black and white halftones, GATF Research Project Report No. 105 (1976). 42. P. Hung, Non-linearity of hue loci in CIE color spaces, Konica Tech. Report 5, pp. 78–83 (1992). 43. J. Meyer and B. Barth, Color gamut matching for hard copy, SID 89 Digest, pp. 86–89 (1989). 44. R. S. Gentile, E. Walowit, and J. P. Allebaach, A comparison of techniques for color gamut mismatch compensation, J. Imaging Tech. 16, pp. 176–181 (1990). 45. Z. Liang, Generic image matching system (GIMS), Color hard copy and graphic arts, Proc. SPIE 1670, pp. 255–265 (1992). 46. M. C. Stone, W. B. Cowan, and J. C. Beatty, Color gamut mapping and the printing of digital color images, ACM Trans. Graphics 7, pp. 249–292 (1988). 47. L. W. MacDonald, Gamut mapping in perceptual color space, Proc. 1st IS&T/SID Color Imaging Conf., Scottsdale, AZ, Vol. 1, pp. 193–196 (1993).
Device-Dependent Color Spaces
133
48. K. E. Spaulding, R. N. Ellson, and J. R. Sullivan, Ultracolor: A new gamut mapping strategy, Device-independent color imaging II, Proc. SPIE 2414, pp. 61–68 (1995). 49. CIE, Guidelines for the evaluation of gamut mapping algorithms, Technical Report 15x (2003).
Chapter 8
Regression Converting a color specification from one space to another requires finding the links of the mapping. A frequently used link is the polynomial method. Polynomial regression is based on the assumption that the correlation between color spaces can be approximated by a set of simultaneous equations. This chapter describes the mathematical formulation of the regression method using matrix notation. Examples of the forward and backward color transforms using the regression method are given, and the extension to spectral data is discussed. Finally, the method is tested and conversion accuracies are reported.
8.1 Regression Method The schematic diagram of the regression method is depicted in Fig. 8.1. Sample points in the source color space are selected and their color specifications in the destination space are measured. An equation is chosen for linking the source and destination color specifications; examples of polynomials with three independent variables (x, y, z) are given in Table 8.1. A regression is performed on selected points with known color specifications in both source and destination spaces for deriving the coefficients of the polynomial. The only requirement is that the number of points should be higher than the number of polynomial terms; otherwise, there are no unique solutions to the simultaneous equations because there are more unknown variables than equations. Once the coefficients are derived, one can plug the source specifications into the simultaneous equations to compute the destination specifications. The so-called polynomial regression is, in fact, an application of the multiple linear regression of m variables, where m is a number greater than the number of independent variables.1 The general approach of the linear regression with m variables is given as follows: pi (q) = c1 q1i + c2 q2i + · · · + cm qmi .
(8.1a)
Polynomials can be expressed in the vector form. pi = Qi T C = C T Qi . 135
(8.1b)
136
Computational Color Technology
Figure 8.1 Schematic diagram of the regression method.
Table 8.1 The polynomials for color space conversion.
p(x, y, z) = c1 x + c2 y + c3 z p(x, y, z) = c0 + c1 x + c2 y + c3 z p(x, y, z) = c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx p(x, y, z) = c0 + c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c10 xyz p(x, y, z) = c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c7 x 2 + c8 y 2 + c9 z2 p(x, y, z) = c0 + c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c7 x 2 + c8 y 2 + c9 z2 + c10 xyz 7. p(x, y, z) = c0 + c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c7 x 2 + c8 y 2 + c9 z2 + c10 xyz + c11 x 3 + c12 y 3 + c13 z3 8. p(x, y, z) = c0 + c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c7 x 2 + c8 y 2 + c9 z2 + c10 xyz + c11 x 3 + c12 y 3 + c13 z3 + c14 xy 2 + c15 x 2 y + c16 yz2 + c17 y 2 z + c18 zx 2 + c19 z2 x 1. 2. 3. 4. 5. 6.
Vector Qi has m elements indicating the number of terms in the polynomial; each element represents an independent variable or a multiplication of independent variables. Vector C is the corresponding coefficient vector. An example of applying the polynomial regression to three independent variables, R, G, and B, with nine polynomial terms can have the form of q1 = R, q2 = G, q3 = B, q4 = RG, q5 = GB, q6 = BR, q7 = R 2 , q8 = G2 , and q9 = B 2 . These q values are derived from inputs of the three independent variables, where output response pi is given by the corresponding color value in the destination space.
Regression
137
An explicit expression of Eq. (8.1) is given as follows: p1 = c1 q11 + c2 q21 + c3 q31 · · · + cj qj 1 · · · + cm qm1 p2 = c1 q12 + c2 q22 + c3 q32 · · · + cj qj 2 · · · + cm qm2 p3 = c1 q13 + c2 q23 + c3 q33 · · · + cj qj 3 · · · + cm qm3 ···
···
···
···
···
···
···
···
···
···
···
···
pk = c1 q1k + c2 q2k + c3 q3k · · · + cj qj k · · · + cm qmk .
(8.2a)
The scalar k is the number of responses (k > m). Equation (8.2a) can be put into vector-matrix notation. q11 q21 q31 · · · qm1 p1 q22 q32 · · · qm2 c1 q p2 12 q13 q23 q33 · · · qm3 c2 p3 (8.2b) = · · · · · · · · · · · · · · · c3 ··· ··· ··· ··· ··· ··· ··· ··· ··· ··· ··· ··· ··· c m pk q1k q2k q3k · · · qmk or P = QT C.
(8.2c)
Vector P has k elements, matrix Q has a size of m × k, and C is a vector of m elements. If the number of responses in vector P is less than the number of unknowns in vector C, k < m, Eq. (8.2) is underconstrained and there is no unique solution. The number of elements in P must be greater than or equal to the unknowns in order to have a unique solution. If the number of responses is greater than the number of unknowns, this type of estimation is overconstrained. Because any measurement always contains errors or noises, the unique solutions to the overconstrained estimation may not exist. If the measurement noise of the response is Gaussian and the error is the sum of the squared differences between the measured and estimated responses, there are closed-form solutions to the linear estimation problem.2 This is the least-squares fit, where we want to minimize the sum of the squares of the difference between the estimated and measured values as given in Eq. (8.2). (8.3) p = [pi − (c1 q1i + c2 q2i + · · · + cm qmi )]2 . The summation carries from i = 1, 2, . . . , k. Equation (8.3) can also be given in the matrix form p = P − QT C T P − QT C . (8.4)
138
Computational Color Technology
The least-squares fit means that the partial derivatives with respect to cj (j = 1, 2, . . . , m) are set to zero, resulting in a new set of equations.3 QQT C = QP.
(8.5)
If the number of samples k is greater than (or equal to) the number of coefficients m, the product of (QT Q) is nonsingular and can be inverted, such that the coefficients are obtained by −1 C = QQT (QP).
(8.6)
With k sets of inputs, Q is a matrix of size m × k, where m is the number of terms in the polynomial. QT is the transpose of the matrix Q that is obtained by interchanging the rows and columns of the matrix Q; therefore, it is a matrix of size k ×m. The product of QQT is an m×m symmetric matrix. A six-term equation given in Table 8.1 with eight data sets is used to illustrate this technique. p(x, y, z) = c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx,
x1 y1 z Q= 1 x1 y1 y z 1 1 z1 x1
x2 y2 z2 x2 y2 y2 z2 z2 x2
x3 y3 z3 x3 y3 y3 z3 z3 x3
x4 y4 z4 x4 y4 y4 z4 z4 x4
x5 y5 z5 x5 y5 y5 z5 z5 x5
x6 y6 z6 x6 y6 y6 z6 z6 x6
x7 y7 z7 x7 y7 y7 z7 z7 x7
(8.7)
x8 y8 z8 , x8 y8 y8 z8 z8 x8
(8.8)
where the triplet (xi , yi , zi ) represents the input values of the ith point. The product [QQT ] is a 6 × 6 symmetric matrix. QQT 2 x
i xy i i xi zi = x 2 yi i xyz
i 2i i xi zi
xy
i 2i y
i yi zi
x y2
i2 i y z
i i xi yi zi
xz
i i yz
i2i z
i xyz
i i2i yz
i i2 xi zi
2 x y
i 2i xy
i i xi yi zi
2 2 x y
i 2i xy z
i2 i i xi yi zi
xyz
i 2i i y z
i 2i yz
i 2i xy z
i 2i 2 i y z
i i2 xi yi zi
2 x z
i i xyz
i i2i xz
2i i . xi yi zi
x y z2
i 2 i 2i xi zi (8.9)
Regression
139
The summations in Eq. (8.9) carry from i = 1 to 8. The product of Q with vector P is p1 p2 x2 x3 x4 x5 x6 x7 x8 x1 y2 y3 y4 y5 y6 y7 y8 p3 y1 z2 z3 z4 z5 z6 z7 z8 p4 z QP = 1 x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 x7 y7 x8 y8 p5 y z y z y z y z y z y z y z y z p 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 6 z x z x z x z x z x z x z x z x p 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
7
p8
xi pi yi pi zp = i i . xi yi pi yzp
i i i xi zi pi
(8.10)
The most computationally intensive part is to invert the [QQT ] matrix; the cost increases as the matrix size increases. A matrix is invertible if and only if the determinant of the matrix is not zero. detQQT = 0.
(8.11)
There are several ways to invert a matrix; we choose the Gaussian elimination for its lower computational cost. Gaussian elimination is the combination of the triangularization and back substitution. The triangularization will make all matrix elements in the lower left of the diagonal line zero. Consequently, the last row in the matrix contains only one element, which is the solution for the last coefficient. This solution is substituted back into the front rows to calculate other coefficients (for details of the Gaussian elimination, see Appendix 5). After obtaining [QQT ]−1 and [QP], we can calculate the coefficient C via Eq. (8.6).
8.2 Forward Color Transformation Equation (8.6) is derived for a single component and gives the polynomial coefficients for one component of the color specifications, such as the X of the tristimulus values from an input RGB. One needs to repeat the procedure twice to get coefficients for Y and Z. Or one can generalize Eq. (8.6) by including all three components for trichromatic systems or n (n > 3) components for multispectral devices, such that P becomes a matrix of k × 3 (or k × n for a multispectral device) and C becomes a matrix of m × 3 (or m × n). Considering the example of an RGB-to-CIEXYZ transformation using a six-term polynomial with eight data sets,
140
Computational Color Technology
we have a P matrix with 8 × 3 elements, as given in Eq. (8.12), containing the data of the tristimulus values. X1 Y1 Z1 X2 Y2 Z2 X3 Y3 Z3 X Y4 Z4 P = 4 (8.12) . X5 Y5 Z5 X6 Y6 Z6 X Y Z 7 7 7 X8 Y8 Z8 For the forward color transformation from RGB to XYZ, the regression is applied to the RGB data (independent variables or inputs) and tristimulus values P (dependent variable or output response) to compute the coefficients of the polynomial. The matrix Q, containing the data of the input RGB, is given in Eq. (8.13). The first three rows are the input data and the next three rows are the multiplications of two variables. R2 R3 R4 R5 R6 R7 R8 R1 G2 G3 G4 G5 G6 G7 G8 G1 B2 B3 B4 B5 B6 B7 B8 B1 Q= . R1 G 1 R2 G 2 R3 G 3 R4 G 4 R5 G 5 R6 G 6 R7 G 7 R8 G 8 G B G B G B G B G B G B G B G B 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 B1 R1 B2 R2 B3 R3 B4 R4 B5 R5 B6 R6 B7 R7 B8 R8 (8.13) Matrix [QQT ] of Eq. (8.9) and the vector [QP] of Eq. (8.10) are given in Eqs. (8.14) and (8.15), respectively. QQT R2
i Ri Gi RB = 2i i Ri Gi RGB
i
i
Ri2 Bi
i
RG
i 2i G
i GB
i 2i Ri Gi
2 G B
i i Ri Gi Bi
RB
i i Gi Bi
2 Bi
Ri Gi Bi
G B2
i i2 Ri Bi
2 R G
i 2i RG
i i RGB
i 2 i 2i R G
i 2i Ri Gi Bi
2 Ri Gi Bi
RGB
i 2i i G B
i 2i GB
i 2i Ri Gi Bi
2 2 G B
i i2 Ri Gi Bi
2 R B
i i RGB
i i2i RB
2i i , R GB
i i 2i RGB
i 2 i 2i Ri Bi
(8.14)
Ri X i G i Xi BX QP = i i Ri Gi Xi GBX
i i i Ri Bi Xi
Ri Yi
Gi Yi
Bi Yi
Ri Gi Yi
Gi Bi Yi Ri Bi Yi
Ri Zi
Gi Z i
Bi Z i .
Ri Gi Z i
Gi Bi Zi Ri Bi Zi
(8.15)
Regression
141
The summations in Eqs. (8.14) and (8.15) carry from i = 1 to 8. Using Eq. (8.6) and multiplying matrices [QQT ] and [QP], we obtain the coefficient C matrix with a size of 6 × 3. The explicit formulas are given in Eq. (8.16). X = cx,1 R + cx,2 G + cx,3 B + cx,4 RG + cx,5 GB + cx,6 BR,
(8.16a)
Y = cy,1 R + cy,2 G + cy,3 B + cy,4 RG + cy,5 GB + cy,6 BR,
(8.16b)
Z = cz,1 R + cz,2 G + cz,3 B + cz,4 RG + cz,5 GB + cz,6 BR,
(8.16c)
or
X cx,1 Y = cy,1 cz,1 Z
cx,2 cy,2 cz,2
cx,3 cy,3 cz,3
cx,4 cy,4 cz,4
cx,5 cy,5 cz,5
R
G cx,6 B cy,6 . RG cz,6 GB BR
(8.16d)
8.3 Inverse Color Transformation The color conversion is able to go in either direction—forward or backward. For many conversion techniques, it is easier to implement in one direction than in the other. However, this is not the case for polynomial regression. The inverse color transform using regression is simple and straightforward. All one needs to do is exchange the positions of the input and output data for the regression program. For the inverse color transformation of XYZ to RGB, the regression is applied to the tristimulus data (independent variables) and RGB values (dependent variable) in order to compute a new set of coefficients with the same polynomial order. The matrix [QQT ] and the vector [QP] of the inverse transformation are given in Eqs. (8.17) and (8.18), respectively, for a six-term polynomial. QQT X2
i Xi Yi XZ = i2 i Xi Yi XYZ
i i
Xi2 Zi
i
XY
i2i Y
i Yi Zi
X Y2
2i i Y Z
i i Xi Yi Zi
XZ
i i YZ
i 2i Zi
XYZ
i i2i YZ
i i2 X i Zi
2 X Y
i 2i Xi Yi
XYZ
i 2 i 2i X Y
i 2i Xi Yi Zi
2 Xi Yi Zi
XYZ
i2i i Y Z
i 2i YZ
i 2i XY Z
i 2i 2 i Y Z
i i2 Xi Yi Zi
2 X Z
i i XYZ
i i 2i XZ
2i i , X YZ
i i 2i XYZ
i 2 i 2i X i Zi
(8.17)
142
Computational Color Technology
Xi R i Yi R i ZR QP = i i Xi Yi Ri YZR
i i i Z i X i Ri
X i Gi
Yi G i
Z i Gi
Xi Yi Gi
Yi Zi Gi Z i Xi Gi
Xi Bi
Yi Bi
Zi Bi .
Xi Yi Bi
Yi Zi Bi Zi Xi Bi
(8.18)
Again, using Eq. (8.6) and multiplying matrices [QQT ] and [QP], we obtain the coefficients c´ for the inverse transform. The explicit formulas are given in Eq. (8.19). R = c´r,1 X + c´r,2 Y + c´r,3 Z + c´r,4 XY + c´r,5 Y Z + c´r,6 ZX,
(8.19a)
G = c´g,1 X + c´g,2 Y + c´g,3 Z + c´g,4 XY + c´g,5 Y Z + c´g,6 ZX,
(8.19b)
B = c´b,1 X + c´b,2 Y + c´b,3 Z + c´b,4 XY + c´b,5 Y Z + c´b,6 ZX,
(8.19c)
or
R c´r,1 G = c´g,1 c´b,1 B
c´r,2 c´g,2 c´b,2
c´r,3 c´g,3 c´b,3
c´r,4 c´g,4 c´b,4
c´r,5 c´g,5 c´b,5
X
Y c´r,6 Z c´g,6 . XY c´b,6 YZ ZX
(8.19d)
This method is particularly suitable to irregularly spaced sample points. If a remapping is needed, the regression method works for any packing of sample points, either uniform or nonuniform. Points outside the gamut are extrapolated. Because the polynomial coefficients are obtained by a global least-squares error minimization, the polynomial may not map the sample points to their original values.
8.4 Extension to Spectral Data Herzog and colleagues have extended the polynomial regression to spectral data.8 Equation (8.6) becomes −1 T QS . C = QQT
(8.20)
Matrix S contains the spectral data and is explicitly given in Eq. (8.21) with a size of n × k, where n is the sample number of the spectrum and k is the number of spectra used in the regression. The transpose of S is a k × n matrix and Q is an m × k matrix; therefore, the product (QST ) has a size of m × n. The resulting C
Regression
143
matrix has the size of m × n because (QQT )−1 has a size of m × m.
s1 (λ1 ) s1 (λ2 ) S = s1 (λ3 ) ··· s1 (λn )
s2 (λ1 ) s2 (λ2 ) s2 (λ3 ) ··· s2 (λn )
s3 (λ1 ) · · · sk (λ1 ) s3 (λ2 ) · · · sk (λ2 ) s3 (λ3 ) · · · sk (λ3 ) . ··· ··· ··· s3 (λn ) · · · sk (λn )
(8.21)
They applied the spectral polynomial regression to several sets of spectral data acquired by a digital camera. As expected, the average color difference decreases with increasing number of polynomial terms. Using a three-term linear equation, they obtain average color differences ranging from 4.9 to 8.5Eab with threechannel sensors. By using a 13-term polynomial, the color difference decreases to the range of 3.9 to 6.8Eab . Therefore, it is a trade-off between the accuracy and computational cost. There is another type of trade-off between the computational accuracy and the number of sensors. With a six-channel sensor, the average color differences drop below 1Eab .4 However, the computational cost in terms of memory size and arithmetical operations is increased accordingly.
8.5 Results of Forward Regression To test the proposed empirical regression method, we perform the forward conversion from Xerox/RGB to CIELAB. Four polynomials of Table 8.1 with 4, 8, 14, and 20 terms, respectively, are used for the regression. Table 8.2 lists the average color differences using these polynomials. The training data are a set of nine-level, equally spaced lattice points (729 points) and a set of nine-level, unequally spaced lattice points in the RGB space. The testing data consist of 3072 points selected around the entire RGB color space, with the emphasis on the difficult, dark colors. The uniform training set gives higher average Eab values for testing data of all four polynomials than the nonuniform training set (see columns 3 and 6 of Table 8.2), but the nonuniform training set gives higher Eab values for the training data (see columns 2 and 5 of Table 8.2). However, the overall errors, including the training and testing data, are about the same for both the equally and nonequally Table 8.2 The average Eab of 3072 test points from a Xerox/RGB to CIELAB transform using a training data set that consists of nine levels in each RGB axis.
Equally spaced training data
Unequally spaced training data
Matrix
Training Eab
Testing Eab
Total Eab
Training Eab
Testing Eab
Total Eab
4×3 8×3 14 × 3 20 × 3
12.18 11.44 3.98 2.63
17.86 15.43 6.06 4.77
16.77 14.66 5.66 4.36
18.76 17.19 6.95 4.91
15.78 14.48 5.68 4.59
16.35 15.00 5.92 4.65
144
Computational Color Technology
spaced data partitions. This indicates that the generalization from training to testing by the regression method is well behaved with no significant deviation from the norm. As expected, the results show that the average color difference decreases as the number of terms in the polynomial increases. The Eab distributions for the equally spaced data are plotted in Fig. 8.2; as the number of terms in the polynomial increases, the error distribution becomes narrower and shifts toward smaller Eab values. The unequally spaced data show a similar trend as in Fig. 8.2, with a slightly narrower band for a given polynomial size (see Fig. 8.3). A substantial improvement can be gained if the gray balancing to L∗ or Y is performed prior to the polynomial regression by using a gray-balance curve such as the one given in Fig. 8.4 for Device/RGB values that do not undergo a gamma correction. Table 8.3 shows the results of the polynomial regression with gray balancing under the same conditions as those of no gray balancing. Compared to the results of no gray balancing (Table 8.2), the average color differences are improved by at least 25%; in some cases, the improvements are as high as a factor of two for high-order polynomials. Figure 8.5 shows the error distributions of a 14-term polynomial with and without gray balance. With gray balance, the error distribution shifts toward lower values and the error band becomes narrower than the corresponding distribution without gray balancing. Other polynomials behave similarly.
Figure 8.2 Color-error distributions of four different polynomials using an equally spaced 729 training data set.
Regression
145
Figure 8.3 Color-error distributions of a 14-term polynomial using two different training data sets; one is equally spaced and the other is unequally spaced, both with 729 data points.
Figure 8.4 Relationship between Device/RGB (R = G = B) and lightness L∗ .
146
Computational Color Technology
Table 8.3 The average color differences of 3072 test points from a Xerox/RGB-to-CIELAB transform with gray balancing.
Equally spaced training data
Unequally spaced training data
Matrix
Training Eab
Testing Eab
Total Eab
Training Eab
Testing Eab
Total Eab
4×3 8×3 14 × 3 20 × 3
11.59 10.45 2.80 0.96
13.18 8.70 4.64 2.33
12.88 9.04 4.29 2.07
12.55 9.17 4.82 2.08
10.60 8.00 4.04 1.73
10.97 8.22 4.19 1.80
Figure 8.5 Color-error distributions of a 14-term polynomial with and without gray balance.
8.6 Results of Inverse Regression The average errors d, which are the Euclidean distances between the calculated and measured RGB values for the color-space transformation from CIELAB to Xerox/RGB using 3072 test points, are given in Table 8.4. The 14-term and 20-term polynomials of Table 8.1, having cubic terms in the equation, fit the data very well; the 20-term is practically an exact fit. The d error distributions are given in Fig. 8.6 for 4 × 3, 8 × 3, and 14 × 3 transfer matrices (there are 1542 points with d > 31 for the 3 × 4 matrix and 770 points for the 8 × 3 matrix that are not shown in Fig. 8.6) and the maximum d values are well
Regression
147
Table 8.4 The average errors d of 3072 test points from a CIELAB-to-Xerox/RGB transform.
Equally spaced training data
Unequally spaced training data
Matrix
Training d
Testing d
Total d
Training d
Testing d
Total d
4×3 8×3 14 × 3 20 × 3
31.80 22.80 2.49 0.03
42.59 30.36 3.74 0.04
40.52 28.91 3.50 0.04
40.78 27.62 3.73 0.04
32.78 23.49 3.20 0.03
34.31 24.28 3.30 0.03
Figure 8.6 The d error distributions of 4 × 3, 8 × 3, and 14 × 3 transfer matrices.
beyond 60. There is a distinct difference in the error distribution of the 14 × 3 matrix; it peaks at d = 3 with a high amplitude and a rather narrow band as compared to the 4 × 3 and 8 × 3 matrices that peak around d = 21 with a small amplitude. For the 20×3 matrix, the distribution is even better; all 3072 points have errors less than one device unit of an 8-bit system. From the CIE definitions, we know that the XYZ-to-L∗ a∗ b∗ transform is a function of the cubic root; therefore, the inverse transform will be a cubic function. Thus, it is not surprising that the 14term and 20-term polynomials, containing variables of cubic power (see Table 8.1), fit the data so well.
148
Computational Color Technology
It is a different story in the case of generalization. Results are given in Tables 8.5 and 8.6. By using a 6 × 3 matrix, the total average color difference increases no more than 0.8 units with a training set as small as 34, and a testing set as large as 202. In most cases, the average color differences of testing sets are about the same as the training sets. For a 14 × 3 matrix, the largest increase in the total average color difference is 2.1, and the highest color difference ratio of the testing to training is 2.8. These results indicate that the generalization of the polynomial regression is well behaved. For a given polynomial, the training and testing results are not necessarily worse when the number of training colors decreases (see columns 4 and 5 of Table 8.5 or 8.6). This implies that the position of the color used for training, not the number of colors, is more important in the color interpolation within a given gamut.
8.7 Remarks The regression technique has been applied for the color camera, scanner, and printer characterizations and calibrations.3,5–8 The adequacy of the method depends on the relationship between the source and destination spaces, the number and location of the points chosen for the regression, the number of terms in the Table 8.5 Testing results of Q60 using a 3 × 6 matrix.
Q60 Test 1 Test 2 Test 3 Test 4 Test 5 Test 6
Training patches
Testing patches
Training Eab
Testing Eab
Total Eab
236 172 105 70 58 46 34
0 64 131 166 178 190 202
2.52 2.31 2.77 3.03 3.37 2.72 2.99
– 4.07 3.08 3.06 2.97 3.11 3.32
2.52 2.79 2.94 3.05 3.07 3.03 3.27
Table 8.6 Testing results of Q60 using a 3 × 14 matrix
Q60 Test 1 Test 2 Test 3 Test 4 Test 5 Test 6
Training patches
Testing patches
Training Eab
Testing Eab
Total Eab
236 172 105 70 58 46 34
0 64 131 166 178 190 202
1.85 1.78 2.11 2.39 2.18 2.16 2.41
– 5.03 4.16 4.94 4.91 5.55 4.48
1.85 2.66 3.25 4.18 4.24 4.89 4.18
Regression
149
polynomial, and the measurement errors. It is ideal for transforms with a linear relationship. For nonlinear color-space conversion, this regression method does not guarantee a uniform accuracy across the entire color gamut; some regions, for example dark colors, have higher errors than other areas.5 In general, the accuracy improves as the number of terms in the equation increases.6,7 The trade-offs are the higher computation cost and lower processing speed. The main advantages of the regression method are: (i) that the inverse conversion is simple, (ii) it takes the statistical fluctuation of the measurement into account, and (iii) the sample points need not be uniformly spaced.
References 1. A. A. Afifi and S. P. Azen, Statistical Analysis, Academic Press, New York, Chap. 3, p. 108 (1972). 2. B. A. Wandell, Foundations of Vision, Sinauer Assoc., Sunderland, MA, pp. 431–436 (1995). 3. P. H. McGinnis, Jr., Spectrophotometric color matching with the least squares technique, Color Eng. 5, pp. 22–27 (1967). 4. P. G. Herzog, D. Knipp, H. Stiebig, and F. Konig, Colorimetric characterization of novel multiple-channel sensors for imaging and metrology, J. Electron. Imaging 8, pp. 342–353 (1999). 5. H. R. Kang, Color scanner calibration, J. Imaging Sci. Techn. 36, pp. 162–170 (1992). 6. H. R. Kang, Color scanner calibration of reflected samples, Proc. SPIE 1670, pp. 468–477 (1992). 7. H. R. Kang and P. G. Anderson, Neural network applications to the color scanner and printer calibrations, J. Electron. Imag. 1, pp. 125–135 (1992). 8. J. de Clippeleer, Device independent color reproduction, Proc. TAGA, Sewickley, PA, pp. 98–106 (1993).
Chapter 9
Three-Dimensional Lookup Table with Interpolation Color space transformation using a 3D lookup table (LUT) with interpolation is used to correlate the source and destination color values in the lattice points of a 3D table, where nonlattice points are interpolated by using the nearest lattice points. This method has been used in many applications with quite satisfactory results, and incorporated into the ICC profile standard.1 In this chapter, the structure of the 3D-LUT approach is discussed and the mathematical formulations of interpolation methods are given. These methods are tested using several sets of data points. The similarities and differences of these interpolation methods are discussed.
9.1 Structure of 3D Lookup Table The 3D lookup method consists of three parts—packing (or partition), extraction (or find), and interpolation (or computation).2 Packing is a process that partitions the source space and selects sample points for the purpose of building a lookup table. The extraction step is aimed at finding the location of the input pixel and extracting color values of the nearest lattice points. The last step is interpolation where the input signals and the extracted lattice points are used to calculate the destination color specifications for the input point. 9.1.1 Packing Packing is a process that divides the domain of the source space and populates it with sample points to build the lookup table. Generally, the table is built by an equal step sampling along each axis of the source space, as shown in Fig. 9.1, of a five-level LUT. This will give (n − 1)3 cubes and n3 lattice points, where n is the number of levels. The advantage of this arrangement is that it implicitly supplies information about which cell is next to which. Thus, one needs only to store the starting point and the spacing for each axis. Generally, a matrix of n3 color patches at the lattice points of the source space is made and the destination color specifications of these patches are measured. The corresponding values from the source and destination spaces are tabulated into a lookup table. 151
152
Computational Color Technology
Figure 9.1 A uniformly spaced five-level 3D packing.
Nonuniformly spaced LUTs are also used extensively. They lose the simplicity of the implementation edges, but gain the versatility and conversion accuracy as discussed in Section 9.7. 9.1.2 Extraction Nonlattice points are interpolated by using the nearest lattice points. This is the step where the extraction performs a search to select the lattice points necessary for computing the destination specification of the input point. A well-packed space can make the search simpler. In an 8-bit integer environment, for example, if the axis is divided into 2j equal sections where j is an integer smaller than 8, then the nearest lattice points are given in the most significant j bits (MSBj ) of the input color signals. In other words, the input point is bounded between the lattice points p(MSBj ) and p(MSBj + 1). To find the point of interest requires the computer operations of the masking byte and shifting bits that are significantly faster than the comparison operations. For unequally spaced packing, a series of comparisons are needed to locate the nearest lattice points. Further search within the cube may be needed, depending on the interpolation technique employed to compute the color values of nonlattice points. There are two interpolation methods: the geometrical method and cellular regression. Cellular regression does not require a search within the cube. All geometric interpolations
Three-Dimensional Lookup Table with Interpolation
153
except the trilinear approach require a search mechanism to find the subdivided structure where the point resides. These search mechanisms are inequality comparisons. 9.1.3 Interpolation Interpolation uses the input signals and the extracted lattice points that contain the destination specifications to calculate the destination color specifications for the input point. Interpolation techniques are mathematical computations that employ geometrical relationships or cellular regression. Geometrical interpolations exploit the ways of subdividing a cube. There are four geometrical interpolations, trilinear, prism, pyramid, and tetrahedral. The first 3D interpolation that appeared in the literature is the trilinear interpolation, disclosed in a 1974 British patent by Pugsley.3 The prism scheme was published in 1992 by Kanamori, Fumoto, and Kotera.4 This prism architecture has been made into a single-chip color processor by Matsushita Research Institute Tokyo, Inc.5,6 The pyramid interpolation was patented by Flanklin in 1982.7 The idea of linear interpolation using tetrahedral segmentation of a cube was published as early as 1967 by Iri.8 A similar concept of a linear interpolation by searching for the nearest four neighbors that enclose the point of interest and form a tetrahedron was applied to compute dot areas of color scanners by Korman and Yule in 1971.9 The application of tetrahedral interpolation to color-space transformation was later patented by Sakamoto and Itooka in U.S. Patent No. 4,275,413 (1981) and related worldwide patents.10–12 The extensive activities in developing and patenting interpolation techniques during the 1980s show the importance of the technique, the desire of dominating market share by the manufacturers, and the subsequent financial stakes.
9.2 Geometric Interpolations Basically, 3D interpolation is the multiple application of the linear interpolation; therefore, we start with the linear interpolation, then extend to 2D (bilinear) and 3D (trilinear) interpolations. A linear interpolation is depicted in Fig. 9.2; a point p on the curve between the lattice points p0 and p1 is to be interpolated. The interpolated value pc (x) is linearly proportional to the ratio of (x − x0 )/(x1 − x0 ), where (x1 − x0 ) is the projected length of the line segment connecting points p0 and p1 , and (x − x0 ) is the projected distance of the line connecting points p and p0 . pc (x) = p(x0 ) + [(x − x0 )/(x1 − x0 )][p(x1 ) − p(x0 )].
(9.1)
As shown in Eq. (9.1), the major computational operation in the interpolation is to calculate the projected distances. In view of the implementation, using a uniform 8-bit LUT, the projected distance at each axis of an input is simply p(LSB8−j ),
154
Computational Color Technology
Figure 9.2 Linear interpolation.
where the LSBs are the least significant bits. This is a simple byte-masking operation that significantly lowers the computational cost and increases speed. The interpolation error is given as δ = p(x) − pc (x).
(9.2)
9.2.1 Bilinear interpolation In two dimensions, we have a function of two variables p(x, y) and four lattice points p00 (x0 , y0 ), p01 (x0 , y1 ), p10 (x1 , y0 ), and p11 (x1 , y1 ) as shown in Fig. 9.3. To obtain the value for point p, we first hold y0 constant and apply the linear interpolation on lattice points p00 and p10 to obtain p0 . p0 = p00 + (p10 − p00 )[(x − x0 )/(x1 − x0 )].
(9.3)
Similarly, we calculate p1 by keeping y1 constant. p1 = p01 + (p11 − p01 )[(x − x0 )/(x1 − x0 )].
(9.4)
After obtaining p0 and p1 , we again apply the linear interpolation to them by keeping x constant. p(x, y) = p0 + (p1 − p0 )[(y − y0 )/(y1 − y0 )].
(9.5)
Three-Dimensional Lookup Table with Interpolation
155
Figure 9.3 Bilinear interpolation.
Substituting Eqs. (9.3) and (9.4) into Eq. (9.5), we obtain p(x, y) = p00 + (p10 − p00 )[(x − x0 )/(x1 − x0 )] + (p01 − p00 )[(y − y0 )/(y1 − y0 )] + (p11 − p01 − p10 + p00 )[(x − x0 )/(x1 − x0 )] × [(y − y0 )/(y1 − y0 )].
(9.6)
9.2.2 Trilinear interpolation The trilinear equation is derived by applying the linear interpolation seven times (see Fig. 9.4); three times each to determine the points p1 and p0 as illustrated in the 2D bilinear interpolation, then one more time to compute the point p. The general expression for the trilinear interpolation is given in Eq. (9.7). p(x, y, z) = c0 + c1 x + c2 y + c3 z + c4 xy + c5 yz + c6 zx + c7 xyz,
(9.7a)
where x, y, and z are the relative distances of the point with respect to the starting point p000 in the x, y, and z directions, respectively, as shown in Eq. (9.7b). x = (x − x0 )/(x1 − x0 );
y = (y − y0 )/(y1 − y0 );
z = (z − z0 )/(z1 − z0 ). (9.7b)
156
Computational Color Technology
Figure 9.4 Trilinear interpolation.
Coefficients cj are determined from the values of the vertices. c0 = p000 ; c1 = (p100 − p000 ); c2 = (p010 − p000 ); c3 = (p001 − p000 ); c4 = (p110 − p010 − p100 + p000 ); c5 = (p011 − p001 − p010 + p000 ); c6 = (p101 − p001 − p100 + p000 ); c7 = (p111 − p011 − p101 − p110 + p100 + p001 + p010 − p000 ).
(9.7c)
Equation (9.7a) can be written in vector-matrix form as p = C T Q1
or
p = QT1 C,
(9.7d)
where C is the vector of coefficients, C = [c0
c1
c2
c3
c4
c5
c6
c7 ]T ,
(9.8)
and Q1 is the vector of distances related to x, y, and z. Q1 = [1 x
y
z
xy
yz
zx
xyz]T .
(9.9)
Three-Dimensional Lookup Table with Interpolation
157
Note that the sizes of vectors Q1 and C must be the same. The coefficients C can be put into vector-matrix form as shown in Eq. (9.10a) by expanding Eq. (9.7c). c0 1 0 0 c1 −1 0 0 1 c2 −1 0 c −1 1 0 3 = 0 −1 c4 1 c5 1 −1 −1 c 1 −1 0 6 c7 −1 1 1
0 0 0 1 0 0 0 0 0 −1 1 0 0 −1 −1 1
0 0 0 0 0 0 1 −1
0 0 0 0 1 0 0 −1
0 p000 0 p001 0 p010 0 p011 , 0 p100 0 p101 0 p110 p111 1
(9.10a)
or C = B 1P ,
(9.10b)
where vector P is a collection of vertices, P = [p000
p001
p010
p011
p100
p101
p110
p111 ]T ,
(9.11)
and the matrix B 1 , given in Eq. (9.10a), represents a matrix of binary constants, having a size of 8 × 8. Substituting Eq. (9.10b) into Eq. (9.7d), we obtain the vector-matrix expression for calculating the destination color value of point p. p = C T Q1 = P T B T1 Q1 ,
(9.12a)
p = QT1 C = QT1 B 1 P .
(9.12b)
Equation (9.12) is exactly the same as Eq. (9.7), only expressed differently. There is no need for a search mechanism to find the location of the point because the cube is used as a whole. But the computation cost, using all eight vertices and having eight terms in the equation, is higher than other 3D geometric interpolations. 9.2.3 Prism interpolation If one cuts a cube diagonally into two halves as shown in Fig. 9.5, one gets two prism shapes. A search mechanism is needed to locate the point of interest. Because there are two symmetric structures in the cube, a simple inequality comparison is sufficient to determine the location: if x > y, then the point is in Prism 1, otherwise the point is in Prism 2. For x = y, the point is laid on the diagonal plane, and either prism can be used for interpolation.
158
Computational Color Technology
Figure 9.5 Prism interpolation.
The equation has six terms and uses six vertices of the given prism for computation. Equation (9.13) gives prism interpolation in vector-matrix form.
p1 p2 =
p000 p000
(p100 − p000 ) (p110 − p100 ) (p110 − p010 ) (p010 − p000 )
(p101 − p001 − p100 + p000 ) (p111 − p011 − p110 + p010 ) 1 x y × . z xz yz
(p001 − p000 ) (p001 − p000 )
(p111 − p101 − p110 + p100 ) (p011 − p001 − p010 + p000 )
(9.13)
By setting Q2 = [1 x
y
z
xz
yz]T ,
(9.14)
Eq. (9.13) can be expressed in vector-matrix form as given in Eq. (9.15). p1 = P T B T21 Q2 = QT2 B 21 P ,
(9.15a)
p2 = P T B T22 Q2 = QT2 B 22 P ,
(9.15b)
Three-Dimensional Lookup Table with Interpolation
159
where vector P is given in Eq. (9.11), and B 21 and B 22 are binary matrices, having a size of 6 × 8, given as follows:
1 0 0 0 0 0 0 0 0 −1 0 0 1 0 0 0 0 −1 0 1 0 B 21 = 0 0 −1 1 0 0 0 1 −1 0 0 −1 1 0 0 0 0 0 1 −1 −1 1 0 0 0 0 0 0 0 −1 0 0 0 1 0 1 0 0 0 0 −1 0 B 22 = −1 1 0 0 0 0 0 0 0 1 −1 0 0 −1 1 −1 −1 1 0 0 0
0 0 0 , 0 0 1 0 0 0 . 0 1 0
The location of the data point is determined by the following IF-ELSE construct: If x > y, else
p = p1 , p = p2 .
9.2.4 Pyramid interpolation For pyramid interpolation, the cube is sliced into three pieces; each one takes a face as the pyramid base, having its corners connected to a vertex in the opposite side as the apex (see Fig. 9.6). A search is required to locate the point of interest. The equation has five terms and uses five vertices of the given pyramid to compute the value. Equation (9.16) gives the vector-matrix form of the pyramid interpolation.
Figure 9.6 Pyramid interpolation.
160
Computational Color Technology
p 1 p2 p3
p000 = p000 p000
(p111 − p011 ) (p100 − p000 ) (p100 − p000 )
(p010 − p000 ) (p111 − p101 ) (p010 − p000 )
(p001 − p000 ) (p001 − p000 ) (p111 − p110 )
0 (p011 − p001 − p010 + p000 ) 0 0 (p110 − p100 − p010 + p000 ) 0
0 (p101 − p001 − p100 + p000 ) 0
1 x y z × xy . yz zx
(9.16)
By setting Q3,1 = [1
x
y
z
yz]T ,
(9.17a)
Q3,2 = [1
x
y
z
zx]T ,
(9.17b)
Q3,3 = [1
x
y
z
xy]T .
(9.17c)
Equation (9.16) can be expressed in vector-matrix form as given in Eq. (9.18). p1 = P T B T31 Q3,1 = QT3,1 B 31 P ,
(9.18a)
p2 = P T B T32 Q3,2 = QT3,2 B 32 P ,
(9.18b)
p3 = P T B T33 Q3,3 = QT3,3 B 33 P ,
(9.18c)
where B 31 , B 32 , and B 33 are binary matrices, having a size of 5 × 8, given as follows:
1 0 B 31 = −1 −1 1 1 −1 B 32 = 0 −1 1
0 0 0 1 −1 0 0 0 1 −1
0 0 0 0 0 −1 0 0 1 0 0 0 0 0 0 0 −1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 −1 0 0 0 0 0 0 −1 1
0 0 0 0 0 0 0 0 0 0
0 1 0, 0 0 0 0 1, 0 0
Three-Dimensional Lookup Table with Interpolation
1 −1 B 33 = −1 0 1
161
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0. 0 0 0 0 0 −1 1 0 −1 0 −1 0 1 0
The location of the data point is determined by the following IF-THEN-ELSE construct: If (y > x and z > x), else if (x > y and z > y),
then p = p1 , then p = p2 , else p = p3 .
9.2.5 Tetrahedral interpolation The tetrahedral interpolation slices a cube into six tetrahedrons; each has a triangle base as shown in Fig. 9.7.
Figure 9.7 Tetrahedral interpolation.
162
Computational Color Technology
The vector-matrix expression of the tetrahedral interpolation is given in Eq. (9.19).
p1 p000 p2 p000 p3 p000 = p4 p000 p p 5 000 p6 p000
(p100 − p000 ) (p100 − p000 ) (p101 − p001 ) (p110 − p010 ) (p111 − p011 ) (p111 − p011 )
(p110 − p100 ) (p111 − p101 ) (p111 − p101 ) (p010 − p000 ) (p010 − p000 ) (p011 − p001 )
(p111 − p110 ) (p101 − p100 ) 1 (p001 − p000 ) x . (p111 − p110 ) y (p011 − p010 ) z (p001 − p000 ) (9.19)
By setting Q4 = [1
x
y
z]T ,
(9.20)
Equation (9.19) can be expressed in vector-matrix form as given in Eq. (9.21). p1 = P T B T41 Q4 = QT4 B 41 P ,
(9.21a)
p2 = P T B T42 Q4 = QT4 B 42 P ,
(9.21b)
p3 = P T B T43 Q4 = QT4 B 43 P ,
(9.21c)
p4 = P T B T44 Q4 = QT4 B 44 P ,
(9.21d)
p5 = P T B T45 Q4 = QT4 B 45 P ,
(9.21e)
p6 = P T B T46 Q4 = QT4 B 46 P ,
(9.21f)
where B 41 , B 42 , B 43 , B 44 , B 45 , and B 46 are binary matrices, having a size of 4 × 8, given as follows:
1 0 0 0 0 −1 0 0 0 1 B 41 = 0 0 0 0 −1 0 0 0 0 0 1 0 0 0 0 −1 0 0 0 1 B 42 = 0 0 0 0 0 0 0 0 0 −1 1 0 0 0 0 0 −1 0 0 0 B 43 = 0 0 0 0 0 −1 1 0 0 0 1 0 0 0 0 0 0 −1 0 0 B 44 = −1 0 1 0 0 0 0 0 0 0
0 0 0 0 0 1 0 −1 0 0 0 0 −1 0 1 0 0 0 1 0 −1 0 0 0 0 0 0 1 0 0 0 −1
0 0 , 0 1 0 0 , 1 0 0 0 , 1 0 0 0 , 0 1
Three-Dimensional Lookup Table with Interpolation
163
1 0 0 0 0 0 0 0 −1 0 B 45 = −1 0 1 0 0 0 0 −1 1 0 1 0 0 0 0 0 0 −1 0 0 B 46 = 0 −1 0 1 0 −1 1 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 1 , 0 0 0 1 . 0 0
The location of the data point is determined by the following IF-THEN-ELSE construct: If (x > y > z), else if (x > z > y), else if (z > x > y), else if (y > x > z), else if (y > z > x), else
then then then then then
p = p1 , p = p2 , p = p3 , p = p4 , p = p5 , p = p6 .
Having four linear terms and using four vertices, it has the lowest computational cost. 9.2.6 Derivatives and extensions The difference among various geometrical interpolations lies in how one slices the cube. There are only three ways of slicing a cube into multiple 3D structures with equal numbers of vertices. They are the prism (six vertices), pyramid (five vertices), and tetrahedron (four vertices). Any substructure with fewer than four vertices is no longer 3D. And it is not possible to slice a cube equally into multiple seven-vertex structures. However, many variations do exist to the geometric slicing of a cube such as cutting a cube from a different angle (or orientation),13 the subdivision into 24 isomorphic tetrahedrons with the body center and face centers as the vertices and selectively combining two, three, or four tetrahedrons to from a tetrahedron, pyramid, prism, cube, or other 3D shapes,11 and the combination of tetrahedrons across the cell boundary.13 In any case, it is recommended that the main diagonal axis of the substructure is aligned with the neutral axis of the color space. It is interesting to point out that the use of the average value of eight vertices in a cube for the body center and the use of the average value of four corners for face centers are the special cases of the trilinear and bilinear interpolations, respectively. A face center or body center is located midway between two lattice points; therefore, (x − x0 )/(x1 − x0 ) = (y − y0 )/(y1 − y0 ) = (z − z0 )/(z1 − z0 ) = 1/2.
(9.22)
164
Computational Color Technology
Substituting Eq. (9.22) into Eq. (9.6) of the bilinear interpolation, we obtain the value for a face-centered point that is the average of the four corner points. p(1/2, 1/2) = p00 + (p10 − p00 )/2 + (p01 − p00 )/2 + (p11 − p01 − p10 + p00 )/4 = (p00 + p01 + p10 + p11 )/4. Similarly, Eq. (9.7) of the trilinear interpolation becomes p(1/2, 1/2, 1/2) = (p000 + p001 + p010 + p011 + p100 + p101 + p110 + p111 )/8. This means that the face centers and body center are obtained by the primary interpolation and the point of interest interpolated from face-centered and bodycentered points is obtained by the secondary interpolation, which uses interpolated vertices for interpolation. The secondary interpolation will cause further error propagation. If one corrects this problem by taking measurements for the face centers and body center, then it becomes the same as the doubling of the sampling frequency. Moreover, the interpolation accuracy of the face center and body center is dependent on the location of the cube in the color space; the interpolation error increases rapidly as the device value decreases.13
9.3 Cellular Regression Three-dimensional interpolation using cellular regression is a combination of the 3D packing and polynomial regression.13–15 The idea is to apply regression to a small lattice cell instead of the entire color space for the purpose of increasing the interpolation accuracy. The eight vertices of a cube are used to derive the coefficients of a selected equation. There are several variations to the cellular regression such as selections with respect to the polynomials, the regression points, and the cell sizes and shapes. Compared to the geometric interpolation, this has the following advantages: (1) There is no need to find the position of the interpolation point within the cube. (2) There is no need for uniform packing; it can apply to any 3D structure such as distorted hexahedra. (3) It can accommodate any arithmetical expressions such as square root, logarithm, and exponential terms. (4) It can have any number of terms in the equation as long as the number does not exceed the number of vertices in the cube, which means that the number of terms cannot exceed eight. The last constraint can be overcome by sampling the color space in a finer division than the desired levels. In the case of a double sampling rate, one has 27 data
Three-Dimensional Lookup Table with Interpolation
165
points in the cube instead of 8; therefore, one can have a maximum of 26 terms. The drawback is that about eight times the samples and measurements are needed, which are time consuming and costly. If one cannot afford these extra costs, there is another way to get around this problem. One can include the neighboring cubes and weigh them differently from the cube of interest when performing the regression. For example, one can include six more cubes adjacent to each face of the cube of interest. The 8 vertices of the center cube are weighted—say, by 4—and the other 24 vertices are weighted by one. The regression is then performed on these 32 weighted vertices via a selected polynomial that can accommodate as many as 31 terms. With these extensions and variations, cellular regression provides the additional flexibility and accuracy not offered by geometrical interpolations. If the process speed is the prime concern, one can use a couple of linear terms for interpolation to ease the computation time and cost. If the color quality is the main concern, one can use all allowed terms and tailor the terms to the characteristic of the device by selecting suitable arithmetical functions.
9.4 Nonuniform Lookup Table The discussion so far has been centered on the standard way of implementing LUT; that is, the source color space is equally spaced with respect to the sampling rate. This results in an uneven and irregular destination space for those color conversions that are nonlinear. Many techniques have been proposed to work on nonuniform data.2,15–19 A very simple example of nonuniform packing is shown in Fig. 9.8. With this packing, each subcell is no longer a cube, but a rectangular shape. The lattice points of the source RGB space can be selected, for example, by using the gray-balance curve of RGB with respect to the lightness (see Fig. 8.4) such that the resulting L∗ spacing in the destination space is approximately equal. Because of this change, the inequality rules of the geometric interpolations are no longer valid. They have to be modified by substituting x, y, and z with the relative distances xr , yr , and zr , where xr = (x − xi )/(xi+1 − xi ); zr = (z − zi )/(zi+1 − zi ),
yr = (y − yi )/(yi+1 − yi ); (9.23)
where the subscript i indicates the LUT level. The normalization transforms a rectangular shape to a cube. This implementation is basically the same as putting three 1D LUTs to linearize the incoming RGB signals in front of an equally spaced 3D LUT. The nonuniform LUT reduces the implementation cost and simplifies the design without adding to the computational cost. The real benefit, which will be shown in Section 9.7, is the improvement in the interpolation accuracy and more uniform error distribution.
166
Computational Color Technology
Figure 9.8 A five-level unequal sampling of the input color space.
9.5 Inverse Color Transform As mentioned in Chapter 8, some transformation techniques are easier to implement in one direction than the other. Three-dimensional interpolation is one. A good example is the CIELAB-to-printer/cmy transform. It is difficult to preset the desired CIELAB lattice points for the forward transformation, but the desired cmy values are readily available in the inverse direction from printer/cmy → CIELAB. Therefore, the general approach is to print an electronic file with known printer/cmy values, then measure the output L∗ a ∗ b∗ values. If the destination cmy space is uniformly sampled, the source CIELAB space will not be uniformly sampled because of the nonlinear relationship between cmy and L∗ a ∗ b∗ . This introduces some complications to the color conversion in the areas of data storage and search. Therefore, a remapping to an equally spaced packing in the source space is often needed. The need of remapping arises in many instances; it is not limited to the inverse transform. For example, the scanner calibration from RGB to CIELAB is a forward transform. But, the remapping is required because the color specifications of test targets are not likely to fall exactly onto the equally spaced grid points of the source color space. The only transform that does not require remapping is perhaps the forward transform of monitor/RGB to other color spaces. Usually, a remapping of the source space to a uniform sampling is performed by using the existing sample points. The repacking can be achieved in many ways as follows:
Three-Dimensional Lookup Table with Interpolation
167
(1) The new lattice points are computed from known analytical formulas such as those provided by the CIE and Xerox Color Encoding Standard. For example, the lattice points for CIELAB → Xerox/RGB can be calculated using the known transform of CIELAB → CIE/XYZ [see Eq. (5.15)] followed by the known linear transform of CIEXYZ → Xerox/RGB20 such that the corresponding [L∗ , a ∗ , b∗ ] and [R, G, B] values are established. These formulas are ideal because they give no color-conversion error at the lattice points; therefore, they are useful for color-simulation studies. However, these ideal cases are rarely encountered in practical applications. (2) The new lattice points can be evaluated from a polynomial regression as described in Chapter 8. This works for any packing of sample points, either uniform or nonuniform. Points outside the gamut are extrapolated. Because the polynomial coefficients are obtained by a global least-squares error minimization, the polynomial may not map the sample points to their original values. (3) The reshaping can be obtained by a weighted vector averaging. Rolleston has successfully applied d −4 weighted averaging to color-space conversion where d is the distance between the point of interest and neighboring points.19 All sample points are weighted by d −4 , then added together. Because of the inverse fourth power, the contribution to the sum from sample points vanishes quickly with distance. Like the polynomial evaluation, the method is able to do the extrapolation and to process irregularly spaced data. (4) The remapping can be interpolated by a piecewise inversion of the space. The idea is to divide a color space into a set of tetrahedrons such that the nonlinear mapping of the entire space is approximated by a number of local linear transformations. The search for the enclosing tetrahedron is harder for nonuniform packing; often a special search technique is needed.16 The interpolated values are bounded by the given sample points; there is no extrapolation. Points that do not reside within the tetrahedron cannot be evaluated. The packing of an inversed 3D LUT is critical for the accuracy of the interpolation. The conventional approach is a uniform spacing in all three axes of the color space, such as the one shown in Fig. 9.1; the size of the new LUT is the bounding box enclosing the destination color gamut such as the CIELAB of the printer/cmy → CIELAB transform. These boundaries are the anticipated maximum and minimum values of L∗ , a ∗ , and b∗ normalized to the bit depth of the internal representation (usually, an 8-bit integer). It is apparent that this implementation has a lot of waste; valid data occupy a small fraction of the total space. A more efficient packing is the nonuniform space, such as the one depicted in Fig. 9.9. The color space is first dissected on the L∗ axis to layers of unequal thickness by using the relationship of L∗ -RGB. The bounding box (shown as dashed lines in Fig. 9.9) of each L∗ layer is set as close to the a ∗ and b∗ color gamut as possible.
168
Computational Color Technology
Figure 9.9 A nonuniformly spaced lookup table for scaled CIELAB space (to 8-bit integer).
9.6 Sequential Linear Interpolation The biggest drawback in the 3D-LUT approach is the inefficient use of the available color space, as discussed in the previous section. Due to the nonlinear relationship, the inverse interpolation creates a large empty space when a bounding box is placed in the destination space. Allebach, Chang, and Bouman proposed an efficient way, called sequential linear interpolation (SLI), to implement these nonlinear transformations.17,18 Sequential linear interpolation optimally allocates grid points according to the characteristics of the function. Since the characteristics of the function are not known in advance, they propose a design procedure that iteratively estimates the characteristics of functions and constructs the SLI structure with increasing accuracy. This procedure is depicted in Fig. 9.10. An initial set of printer measurements is made first. They then construct an initial SLI structure so that the distance between the measured output points and the grid locations is minimized. They use the sequential scalar quantization (SSQ) method to initialize this structure. Next, the necessary characteristics of the inverse printer transfer function are estimated. These estimates are then used to guide the selection of new printer measurement points so that the mean squared error is minimized. Since the new measurement points are approximately estimated by the initial SLI structure, the actual measured output points in the CIELAB space will not exactly have the desired SLI
Three-Dimensional Lookup Table with Interpolation
169
Figure 9.10 Iterative design procedure of the sequential linear interpolation.
structure. Therefore, one needs to perform SSQ on the output data again to obtain a new SLI structure based on the new measurement points. This process requires iterations with an increasing number of measurement points to obtain more accurate SLI structures. The regularly spaced interpolation grid is a special case of the sequential interpolation grid where the grid lines and the grid points are distributed uniformly and the domain is regular. As in the case with the regular interpolation grid, the sequential interpolation scheme will produce a continuous function, since all the 1D interpolations are continuous. The sequential interpolation grid automatically tracks the domain of the function (i.e., the printer gamut) by placing all the grid points inside the domain. If the domain of the function is not rectangular, then a regular grid will waste grid points outside the domain. More importantly, when the number of grid points is limited, the sequential interpolation grid allows the implementer to arbitrarily allocate grid lines and points to minimize the interpolation error. Chang, Bouman, and Allebach applied SLI to data of CIELAB values measured from printed 9 × 9 × 9 color patches uniformly distributed in the printer RGB space using an Apple color printer. Results show that the SLI grid always outperforms the uniform grid as indicated by the average color difference; and it does better in maximum color difference in all cases except for 5 × 5 × 5 grid points. In general, the color difference for the SLI grid is smaller and its distribution smoother than that of the uniform grid. The advantage of SLI is due to the fact that no grid points are wasted outside the printer gamut. The inefficiency of the uniform grids is shown in their data, the fraction of grid points falling within the printer gamut ranges being from 40% for a 5 × 5 × 5 LUT to 22% for a 65 × 65 × 65 LUT. These results indicate that the uniform grids are not efficient; many grid points are wasted. They
170
Computational Color Technology
have shown that SLI definitely has advantages over the uniform LUT with respect to the interpolation accuracy. The trade-offs are the complexity, computation cost, and speed.
9.7 Results of Forward 3D Interpolation This section provides experimental results of testing several 3D-LUT packings to show the accuracy of the 3D-LUT methods. Five test conditions are used: Test 1 is a 5-level, equally spaced LUT (125 lattice points); Test 2 is a 9-level, equally spaced LUT (729 lattice points); Test 3 is a 17-level, equally spaced LUT (4913 lattice points); Test 4 is a 5-level, unequally spaced LUT (125 lattice points); Test 5 is 9-level, unequally spaced LUT (729 lattice points). Table 9.1 lists the interpolation errors of the geometric techniques along the neutral axis. Relationships between the interpolation error and 255 neutral colors (in 8-bit Xerox/RGB value) that are converted from Xerox/RGB to CIELAB using four LUT packings are plotted in Fig. 9.11 for trilinear interpolation. Other interpolation schemes behave similarly. This figure reveals the following important characteristics of the geometric interpolation: (1) The interpolation error peaks at the center and diminishes at the nodes (lattice points). This implies that the assumption of using the average values of vertices for the body center and face centers is a poor one. (2) The error amplitude decreases as the number of the level increases. (3) The highest amplitude occurs at the lowest level (dark colors). For equally spaced LUTs, the amplitude damps quickly as the level increases. (4) Unequally spaced LUTs have a much lower fundamental peak but the errors are rippled to higher levels; this gives a more even error distribution and a better average value. Table 9.2 lists the average color differences of 12 interpolation techniques under five different conditions using 3072 test points. The first four techniques are the geometrical approach and the rest are the cellular regression approach. Results in Tables 9.1 and 9.2 confirm that the interpolation accuracy improves as the Table 9.1 Comparisons of interpolation accuracies in terms of the average Eab for 255 neutral colors.
LUT level
5-level
9-level
17-level
5-level
9-level
LUT packing
Equal spacing
Equal spacing
Equal spacing
Unequal spacing
Unequal spacing
Trilinear Prism Pyramid Tetrahedral
2.23 3.01 3.08 2.95
0.90 1.18 1.20 1.06
0.38 0.45 0.46 0.41
1.21 1.47 1.27 1.31
0.38 0.43 0.36 0.36
Three-Dimensional Lookup Table with Interpolation
171
Figure 9.11 Trilinear interpolation errors of 255 neutral colors using four different LUTs from Xerox/RGB to CIELAB under D50 illumination.
Table 9.2 Comparisons of interpolation accuracies in terms of the average Eab using 3072 data points.
LUT level
5-level
9-level
17-level
5-level
9-level
LUT packing
Equal spacing
Equal spacing
Equal spacing
Unequal spacing
Unequal spacing
Cubic (Trilinear) Prism Pyramid Tetrahedral 3 × 3 matrix (8 points) 3 × 4 matrix (8 points) 3 × 6 matrix (8 points) 3 × 7 matrix (8 points) 3 × 3 matrix (27 points) 3 × 4 matrix (27 points) 3 × 6 matrix (27 points) 3 × 7 matrix (27 points)
5.81 6.38 6.29 6.84 9.04 5.84 6.09 5.81 8.47 4.48
2.50 2.77 2.74 2.99 4.28 2.51 2.75 2.51 3.94 1.76 2.11 1.62
0.92 1.02 1.01 1.11 2.08 0.91 0.98 0.92
1.74 1.81 1.76 1.86 10.28 1.88 4.36 1.74
0.46 0.47 0.45 0.49 5.36 0.48 1.10 0.46
4.22
172
Computational Color Technology
sampling rate increases. At each LUT packing, the interpolation accuracies are about the same for various geometrical techniques. The differences in computational accuracy become even smaller as LUT size increases or nonuniform packing is used. The same conclusion could be drawn from Kotera’s study and Kasson’s results.21–23 Using 8-bit integer data for computation, Kotera and coworkers reported that the trilinear interpolation is the best and prism is the second for 5-level and 9-level LUTs. Similarly, they found that the difference in interpolation accuracy is reduced as the size of the LUT increases. The 9-level LUT gives one Erms difference from the best (trilinear) to the worse (tetrahedral). Using floating-point computation, we obtained errors about half of their sizes. For larger 17-level and 33-level LUTs, the accuracy is about the same for all four geometrical interpolations.21,22 Kasson, Plouffe, and Nin compared the trilinear interpolation with two tetrahedral interpolations and a disphenoid tetrahedral interpolation, which is a tetrahedron formed by spanning two cubes; the resulting average color differences are 1.00, 1.24, 1.01, and 0.99, respectively.23 These numbers are very close, if not the same, indicating that there is little difference in their interpolation capabilities. They also showed that the interpolation accuracy improves as the sampling rate increases. If the sampling rate is high enough, the linear interpolation becomes a very good approximation for computing a point that is not a lattice point. However, the accuracy improvement levels off at high sampling rates. A further increase in the sampling rate is not necessary because the gain in the accuracy will be small. However, the cost of the storage is increased by about eight times for each increment in LUT size. From this simulation, we believe that a 9-level or 17-level LUT will provide an adequate accuracy for most color conversions. In addition, we also determined the error distribution. For a given interpolation method, the Eab distributions improve as the LUT size increases, as shown in Fig. 9.12 for the trilinear interpolation and Fig. 9.13 for the tetrahedral interpolation, where the distribution bandwidth becomes narrower and the color difference shifts to smaller values in the left-hand side of the diagram. Prism and pyramid interpolations behave similarly. For a given LUT size, the distributions from various interpolation techniques are about the same as shown in Fig. 9.14 for a uniform 5-level LUT, Fig. 9.15 for a uniform 9-level LUT, Fig. 9.16 for a uniform 17-level LUT, and Fig. 9.17 for a nonuniform 5-level LUT. As shown in Table 9.2, the accuracy improvement is dramatic for nonuniform LUTs. Results of the color difference showed that a 5-level nonuniform LUT is about 35% better than a 9-level uniform LUT, and a 9-level nonuniform LUT, having over 96.16% of points within 1 Eab , is about a factor of two better than a 17-level uniform LUT. Better yet, the error distribution is almost uniform and most points, if not all, have errors less than two units. These results demonstrated that, with a proper selection of the sampling points along the principle axes, we can gain a big saving in memory cost and a great improvement in interpolation accuracy as well as the error distribution. Similar computations were performed on the conversion from sRGB to CIELAB under D65 illumination. The average color difference in Eab units of
Three-Dimensional Lookup Table with Interpolation
Figure 9.12 Error distributions of the trilinear interpolation.
Figure 9.13 Error distributions of the tetrahedral interpolation.
173
174
Computational Color Technology
Figure 9.14 Error distributions of a uniform 5-level LUT.
Figure 9.15 Error distributions of a uniform 9-level LUT.
Three-Dimensional Lookup Table with Interpolation
Figure 9.16 Error distributions of a uniform 17-level LUT.
Figure 9.17 Error distributions of a nonuniform 5-level LUT.
175
176
Computational Color Technology
5832 equally spaced colors in sRGB space for four interpolation methods under four different LUTs are given in Table 9.3, where Test 1 uses a 5-level equally spaced LUT, Test 2 uses a 9-level equally spaced LUT, Test 3 uses a 5-level unequally spaced LUT, and Test 4 uses a 9-level unequally spaced LUT. The error distributions of neutral colors under four different LUTs are plotted in Fig. 9.18. These results contradict the data obtained for a Xerox/RGB-to-CIELAB transform Table 9.3 Comparisons of interpolation accuracies in terms of the average Eab for sRGBto-CIELAB transform.
LUT level
5-level
9-level
5-level
9-level
LUT packing
Equal spacing
Equal spacing
Unequal spacing
Unequal spacing
Trilinear Prism Pyramid Tetrahedral
1.92 1.67 2.01 1.29
0.48 0.42 0.49 0.33
2.94 2.54 3.14 1.80
0.77 0.66 0.82 0.47
Figure 9.18 Trilinear interpolation errors of 255 neutral colors using four different LUTs from sRGB to CIELAB under D65 illumination.
Three-Dimensional Lookup Table with Interpolation
177
in two areas. First, the interpolation accuracies are not the same; the tetrahedral interpolation is better than other methods. However, the differences are not big. Second, the equally spaced LUTs give better accuracy than the corresponding nonuniform LUTs. This is the most significant contradiction that can be explained by the gamma correction of the sRGB formulation [see Eq. (A4.21) of Appendix 4]; the gamma correction linearizes the sRGB digital count with respect to luminance Y as shown in Fig. 9.19, whereas the nonlinear LUT in Xerox/RGB → CIELAB transform mimics this behavior. These results indicate that the RGB encoding with gamma correction is already optimal with respect to the luminance; therefore, the linear-spaced LUT gives the best results, where the nonlinear adjustment makes an already linear relationship nonlinear, giving much worse conversion accuracies. Thus, the nonlinear-spaced LUT should only be used for Device/RGB or RGB encoding without gamma correction.
9.8 Results of Inverse 3D Interpolation Results of the 3D LUT with interpolation for a CIELAB-to-Xerox/RGB transform are given in Table 9.4. The nonuniform 3D LUTs improve the interpolation accuracy by about 20%. Similar to the forward interpolation, the accuracy of the
Figure 9.19 Relationship of gamma-corrected sRGB and luminance Y.
178
Computational Color Technology
inverse interpolation increases with the sampling rate or the size of the LUT (see Fig. 9.20), and the accuracies for all four geometric interpolations are about the same (see Fig. 9.21). The error distributions of the uniform and nonuniform LUTs for the trilinear interpolation at 5-level are shown in Fig. 9.22; the nonuniform LUT has a narrower band and peaks earlier. Other geometric interpolations show a similar trend.
Figure 9.20 Error distributions of the trilinear interpolation using an inverse 3D LUT.
Table 9.4 The average errors, d, of 3072 test points from a CIELAB-to-Xerox/RGB transform using a 3D lookup table with geometric interpolations.
Uniform 5-level from known formula Uniform 5-level from 20-term regression Nonuniform 5-level from known formula Uniform 9-level from known formula Uniform 9-level from 20-term regression Nonuniform 9-level from known formula Uniform 17-level from known formula Uniform 17-level from 20-term regression
Cubic
Prism
Pyramid
Tetrahedral
10.2 10.0 8.6 2.8 2.6 2.3 1.1 1.0
12.6 12.3 10.5 3.4 3.2 2.8 1.2 1.1
10.5 10.2 9.1 2.9 2.7 2.5 1.1 1.0
11.3 11.0 9.5 3.1 2.8 2.7 1.2 1.0
Three-Dimensional Lookup Table with Interpolation
179
Figure 9.21 Error distributions of a 9-level inverse 3D-LUT.
Figure 9.22 Error distributions of the trilinear interpolation using a uniformly spaced and a nonuniformly spaced inverse 3D LUT.
180
Computational Color Technology
9.9 Remarks The differences among various geometrical interpolations lie in how the cube is subdivided. This then leads to differences in the extractions and the equations for computation. Simulation results of the Xerox/RGB ← → CIELAB conversions indicate that the precision of approximating a true value by geometrical interpolations is very good; even the lowest 5-level LUT has precision of less than 7 Eab units. The magnitude of the error decreases as the number of the level increases; at 17-level, the errors are about 1 Eab unit. Proper packing will increase the precision further; for example, the precision is less than 0.5 Eab for a nonuniform 9-level LUT. Moreover, the interpolation errors of various geometrical techniques are about the same; the differences from the best to the worst are small; they range from about 1 Eab for a 5-level uniform LUT to less than 0.05 for a 9-level nonuniform packing. The error peaks at the center of the cube and diminishes at the lattice points. The highest amplitude occurs at the lowest level (darker colors) in the forward transformation. For equally spaced LUTs, the amplitude damps quickly. For unequally spaced LUTs, the fundamental peak is lower but the errors ripple to higher levels, resulting in a more even error distribution. In the case of RGB encoding standards that have gamma correction, the highest accuracies are obtained from uniform 3D LUTs because the gamma correction linearizes the RGB values to the luminance Y. The 3D lookup table with interpolation has numerous applications in scanner, monitor, and printer calibrations. Compared to other transformation techniques, the 3D-LUT approach provides better accuracy because it has the advantage that the color space can always be further divided by increasing the sampling rate to improve accuracy. If the sampling rate is high enough, the linear interpolation becomes a very good approximation for computing a point that is not a lattice point. For the interpolation techniques, the tetrahedral interpolation has the lowest computation and implementation costs, highest processing speed, and a simpler analytical scheme to obtain the inverse lookup table. This method has been applied successfully to the device characterizations and calibrations, and color renditions of electronic images.24–32
References 1. InterColor Consortium, InterColor Profile Format, Version 3.0 (1994). 2. J. M. Kasson, W. Plouffe, and S. I. Nin, A tetrahedral interpolation technique for color space conversion, Proc. SPIE 1909, pp. 127–138 (1993). 3. P. C. Pugsley, Image reproduction methods and apparatus, British Patent No. 1,369,702 (1974). 4. K. Kanamori, T. Fumoto, and H. Kotera, A color transformation algorithm using prism interpolation, IS&T 8th Int. Congress on Advances in Non-Impact Printing Technologies, pp. 477–482 (1992).
Three-Dimensional Lookup Table with Interpolation
181
5. K. Kanamori, H. Kotera, O. Yamada, H. Motomura, R. Iikawa, and T. Fumoto, Fast color processor with programmable interpolation by Small Memory (PRISM), J. Electron. Imag. 2, pp. 213–224 (1993). 6. H. Kotera, K. Kanamori, T. Fumoto, O. Yamada, H. Motomura, and M. Inoue A single chip color processor for device independent color reproduction, 1st IS&T/SID’s Color Imaging Conf.: Transforms and Transportability of Color, pp. 133–137 (1993). 7. P. Flanklin, Interpolation methods and apparatus, U.S. Patent No. 4,334,240 (1982). 8. M. Iri, A method of multi-dimensional linear interpolation, J. Info. Processing Soc. Japan 8, pp. 33–36 (1968). 9. N. I. Korman and J. A. C. Yule, Digital computation of dot areas in a colour scanner, Proc. 11th Int. Conf. of Printing Research Institutes, Canandaigua, NY, Edited by W. H. Banks, pp. 93–106 (1971). Hensenstamm: P. Keppler (1973). 10. T. Sakamoto and A. Itooka, Interpolation method for memory devices, Japanese Patent Disclosure 53-123201 (1978). 11. T. Sakamoto and A. Itooka, Linear Interpolator for Color Correction, U.S. Patent No. 4,275,413 (1981). 12. T. Sakamoto, Interpolation method for memory devices, Japanese Patent Disclosure 57-208765 (1982). 13. H. R. Kang, Color Technology for Electronic Imaging Devices, SPIE Press, Bellingham, WA, Chaps. 4 and 6 (1997). 14. H. R. Kang, Comparisons of Three-Dimensional Interpolation Techniques by Simulations, Device-independent color imaging II, Proc. SPIE 2414, pp. 104– 114 (1995). 15. H. R. Kang, Printer-related color processing techniques, Color hard copy and graphic arts III, Proc. SPIE 2413, pp. 410–419 (1995). 16. I. E. Bell and W. Cowan, Characterizing printer gamuts using tetrahedral interpolation, 1st IS&T/SID’s Color Imaging Conf.: Transforms and Transportability of Color, pp. 108–113 (1993). 17. J. P. Allebach, J. Z. Chang, and C. A. Bouman, Efficient implementation of nonlinear color transformations, 1st IS&T/SID’s Color Imaging Conf.: Transforms and Transportability of Color, pp. 143–148 (1993). 18. J. Z. Chang, C. A. Bouman, and J. P. Allebach, Recent results in color calibration using sequential linear interpolation, IS&T’s 47th Annual Conf./ICPS, pp. 500–505 (1994). 19. R. Rolleston, Using Shepard’s interpolation to build color transformation tables, 2nd IS&T/SID’s Color Imaging Conf.: Color Science, Systems, and Applications, pp. 74–77 (1994). 20. XNSS 288811, Color Encoding Standard, Xerox Corporation. 21. K. Kanamori, H. Kotera, O. Yamada, H. Motomura, R. Iikawa, and T. Fumoto, Fast color processor with programmable interpolation by Small Memory (PRISM), J. Electron. Imag. 2, pp. 213–224 (1993).
182
Computational Color Technology
22. H. Kotera, K. Kanamori, T. Fumoto, O. Yamada, H. Motomura, and M. Inoue, A single chip color processor for device independent color reproduction, 1st IS&T and SID’s Color Imaging Conference: Transforms and Transportability of Color, pp. 133–137 (1993). 23. J. M. Kasson, W. Plouffe, and S. I. Nin, A Tetrahedral Interpolation Technique for Color Space Conversion, Proc. SPIE 1909, pp. 127–138 (1993). 24. D. A. Clark, D. C. Strong, and T. Q. White, Method of color conversion with improved interpolation, U.S. Patent No. 4,477,833 (1984). 25. H. Ikegami, New direct color mapping method for reducing the storage capacity of look-up table memory, Proc. SPIE 1075, pp. 1075–1105 (1989). 26. K. Kanamori, H. Kawakami, and H. Kotera, A novel color transformation algorithm and its applications, Image Processing Algorithm and Techniques, Proc. SPIE 1244, pp. 272–281 (1990). 27. K. Kanamori and H. Kotera, A method for selective color control in perceptual color space, J. Imaging Sci. Techn. 35(5), pp. 307–316 (1991). 28. Po-Chieh Hung, Colorimetric calibration for scanners and media, Proc. SPIE 1448, pp. 164–174 (1991). 29. K. Kanamori and H. Kotera, Color correction technique for hard copies by 4neighbors interpolation method, J. Imaging Sci. Techn. 36, pp. 73–80 (1992). 30. S. I. Nin, J. M. Kasson, and W. Plouffe, Printing CIELAB Images on a CMYK printer using tri-linear interpolation, Color hard copy and graphic arts, Proc. SPIE 1670, pp. 316–324 (1992). 31. P.-C. Hung, Colorimetric calibration in electronic imaging devices using a look-up-table model and interpolations, J. Electron. Imag. 2, pp. 53–61 (1993). 32. K. D. Gennetten, RGB to CMYK conversion using 3D barycentric interpolation, Device-independent color imaging and imaging systems integration, Proc. SPIE 1909, pp. 116–126 (1993).
Chapter 10
Metameric Decomposition and Reconstruction
This chapter presents the applications of the matrix R theory for spectrum decomposition and reconstruction. We apply the method to spectra of seven illuminants and fourteen spectra used in the color rendering index (CRI) under the CIE 1931 or CIE 1964 standard observer. The common characteristics are derived and discussed. Based on these characteristics, we develop two methods for deriving two basis vectors that can be used to reconstruct various illuminants to some degree of accuracy. The first method uses the intuitive approach of averaging to generate basis vectors. The second method uses input tristimulus values to obtain the fundamental metamer via orthogonal projection, and the metameric black is obtained from a set of coefficients to scale the average metameric black. The coefficients are derived from ratios of input tristimulus values to average tristimulus values. These methods are applied to reconstruct 7 illuminants and 14 CRI spectra. The application of the metameric spectral reconstruction to the estimation of the fundamental metamer from an RGB or XYZ color scanner for accessing skin-tone reproducibility is also discussed.
10.1 Metameric Spectrum Decomposition In Section 3.2, we showed that any spectrum ηi could be decomposed to a fundamental and a metameric black using the matrix R.1–3 T T T R = A(AT A)−1 AT = AM −1 a A = AM e A = M f A
(10.1)
´ M f AT ηi = M f Υ = A(AT A)−1 Υ = η,
(10.2)
where Υ = AT ηi is a 3 × 1 vector of tristimulus values. Matrix R has a size of n × n because M f is n × 3 and AT is 3 × n, where n is the number of elements in vector ηi . But R has a rank of three only because it is derived solely from matrix A, having three independent columns. It decomposes the spectrum of the stimulus into two components, the fundamental η´ and the metameric black κ, as given in 183
184
Computational Color Technology
Eqs. (10.3) and (10.4), respectively, where the fundamental is common within any group of mutual metamers, but metameric blacks are different. η´ = Rηi ,
(10.3)
κ = ηi − η´ = ηi − Rηi = (I − R)ηi .
(10.4)
and
Figures 10.1 and 10.2 show the metameric decompositions of spectral power distributions (SPDs) of illuminants D65 and A, respectively. Inversely, the stimulus spectrum can be reconstructed if the fundamental and metameric black are known.1,4 ηi = η´ + κ = Rηi + (I − R)ηi .
(10.5)
To show the performance of the spectrum reconstruction using Eq. (10.5), we use the SPDs of the illuminants and fourteen spectra of the color rendering index. This set is small, yet contains a very different spectral shape for testing the reconstruction method. The set is small; thus, it is easy to analyze in detail without losing
Figure 10.1 Metameric decomposition of illuminant D65 .
Metameric Decomposition and Reconstruction
185
Figure 10.2 Metameric decomposition of illuminant A.
oneself in a sea of data, such as the Munsell chip set. Also, this set is in the public domain and is readily available to users who are interested in duplicating the results and verifying the algorithm. It provides a good learning practice, which is not available by using private data. Applying the method of spectrum decomposition to a set of 7 illuminants and 14 CRI spectra, we derive the fundamental metamers and metameric blacks of illuminants A, B, C, D50 , D55 , D65 , and D75 as shown in Figs. 10.3 and 10.4, and CRI spectrum decompositions in Figs. 10.5 and 10.6. Results reaffirm Cohen’s observations as follows: (1) The broadband and smoothly varying spectrum gives a fundamental metamer of positive values (see Figs. 10.3 and 10.5). (2) The fundamental metamers cross the input spectrum three or four times (see Figs. 10.4 and 10.6). (3) The fundamental and metameric black are mirror images of each other, where the peak of one component is the valley of the other and vice versa (see Figs. 10.7 and 10.8).1
186
Computational Color Technology
Figure 10.3 Fundamental metamers of seven illuminants and average under CIE 1931 CMF.
Figure 10.4 Metameric blacks of seven illuminants and average under CIE 1931 CMF.
Metameric Decomposition and Reconstruction
187
Figure 10.5 Fundamental metamers of 14 CRI spectra and average under CIE 1931 CMF.
Although the magnitudes of spectra are not the same, the general shapes are similar in that the peaks and valleys occur approximately