Computing Data for Color Vision Modelling
The program PCSF uses published mathematical equations which
approximate color sensitivity functions for computing data for
simulations of color vision. It can compute tables of receptor
absorptions, ocular media density, fundamental response and color
matching functions, and chromaticity coordinates. It also may be
used to evaluate spectral radiance data with respect to these
sensitivity functions. The source code is available and may
easily be incorporated into other programs.
Computing Data for Color Vision Modelling
Color vision modelling usually starts from color matching
functions. A set of such functions has been standardized by the
CIE for the CIE 1931 Standard Colorimetric System and may be
found tabulated in several sources (e. g. Wyszecki & Stiles,
1982). The CIE color matching functions include V(lambda), the
luminous efficiency function for the CIE 1924 standard observer.
Later data have shown deficiencies of the original V(lambda) data and
lead to a revision by Judd (1951, cited in Wyszecki & Stiles,
1982) which now is generally referred to as the "Judd 1951
modified V(lambda)". Judd's modification of V(lambda) also leads to a
modification of the CIE 1931 standard observer color matching
function. This new system is called the "Judd 1951 modified" CIE
standard observer and has been the basis of most work in color
vision theory involving color matching functions.
An example is the derivation of cone fundamental sensitivity
functions by Smith and Pokorny (1975). This derivation is based
on color and brightness matching data of dichromats and the
hypothesis of reduction dichromacy. The Smith and Pokorny results
have found rather strong confirmation by recent results of
Baylor, Nunn and Schnapf (1987) who were able to directly measure
response functions of primate cones. They found a close
similarity between their physiological measurements of the cones'
spectral sensitivities with the psychophysically derived
fundamental sensitivities of Smith and Pokorny. This comparison
has to take into acount the optical density of the lens and
macular pigmentation since these modify absorption (Pokorny &
All the spectral functions mentioned may be found tabulated
somewhere. Computer simulations of color vision models, however,
are easier to program with functional descriptions of the
sensitivity data. Examples are Brainard and Wandell's Color
Analysis Package (cited in Wandell, 1987) using discrete tables of
the Smith and Pokorny sensitivity functions to analyze the colors
of complex surfaces, and Siminoff (1991) who does a simulation of
lateral interactions of color selective cells in the human
retina. He uses piece-wise polynomial approximations of
PCSF contains modules which may be used for similar purposes.
They are based on functional descriptions of the Smith and
Pokorny fundamentals which have been derived by Boynton and
Wisowaty (1980) and of the cone spectral sensitivity functions of
Baylor et al. (1987). The program may be used as a stand-alone
program for computing and printing the built-in functions or its
single modules may be incorporated into other programs. The
following functions are provided:
1. The Smith and Pokorny (1975) long- (LWS), middle- (MWS), and
short-wave (SWS) sensitive cone spectra according to the
equations derived by Boynton and Wisowaty (1980) (Fig. 1.A).
2. The Judd 1951 modified V(lambda) function which is the sum of the
LWS and the MWS functions.
3. A smooth combined optical media absorption function based on
an equation also derived by Boynton and Wisowaty (1980) (Fig.
4. Long-, middle- and short-wave sensitive cone sensitivities
according to an equation derived by Baylor et al. (1987)
5. The Baylor et al. (1987) cone sensitivities corrected for
absorption by the optical media absorption function.
6. The Judd 1951 modified CIE color matching functions (Fig.
7. Chromaticity coordinates for the Judd 1951 modified CIE
8. Spectral coordinates for the cone excitation diagram proposed
by MacLeod and Boynton (1979).
Printing Function Tables
The program's functions may either be requested directly from the
command line by specifying Unix style command line options or
they may be selected from a menu that is printed on the screen if
no function generating command line options have been given. The
pcsf -rgb -s 1
will print three consecutive tables containing the Smith and
Pokorny long-, middle-, and short-wave sensitive cone
fundamentals respectively. Wavelength step size is 1 nm. Simply
will print the menu which is shown in Fig. 2 and then expect the
user to type in option letters. Input is finished by the ENTER
key. An input line which is equivalent to the above command line
Note that no special character separators are necessary in menu
mode. Sequences of option letters on the command line have to be
preceded by a minus sign as shown in the example.
Computing Spectrum Coordinates
In addition to printing values of sensitivity functions at
arbitrary wavelength steps the program may also be used to
evaluate stimulus spectra by computing color coordinates. The
radiance spectrum has to be tabulated in equal wavelength steps
in an input file. This has to be an ASCII text file with a single
pair of wavelength and radiance data per line. The spectrum data
are read and the products of each radiance value with the
requested color matching function value for the corresponding
wavelength are summed according to Wyszecki and Stiles (1982,
sect. 3.3.8) and printed to the output. To get stimulus
coordinates instead of function tables it suffices to give one or
more names of stimulus spectrum files in the command line when
calling PCSF. The type of coordinates computed is determined by
the options given in Fig. 2. Thus the command line
pcsf -rgb STIMULUS.DAT
will compute the long-, middle-, and short-wave sensitive cone
coordinates for the stimulus spectrum that is tabulated in the
file STIMULUS.DAT. Suppose STIMULUS.DAT contains the following
then the command line
pcsf -C STIMULUS.DAT
will return the Judd modified CIE chromaticities of the stimulus:
(0.3440, 0.3317). There will also be a warning message in this
case, since the spectral data are not equally spaced and thus
color matching coordinates may be distorted.
Figure 2 shows that most of the options are used to request
special sensitivity functions. Some options are used to specify
output modes. The option "n" results in normalized output values.
This only affects sensitivity functions and color matching
coordinates, but not chromaticity coordinates. If sensitivity
function tables are requested, then normalization of the
functions is with respect to their maximum. If color matching
coordinates for a radiance spectrum are requested, then
normalization is such that Y, V, and (R + G) approximate ordinary
luminance in cd*m^2 if the input spectrum is given in
watt * sr^-1 * m^-2 * nm^-1 and is equally spaced. This is not possible if
the spectrum is given in terms of a spectral density function.
Chromaticity coordinates are independent of the scaling of the
radiance data. A lower case letter "l" leads to log10 output
values instead of the usual linear values. This option does not
affect spectrum coordinates computed from radiance data. The
option "u" scales the blue sensitive fundamental such that it is
identical to the _z'(lambda) function. In command line mode the option
"s" followed by a number will set the wavelength step size. In
menu mode the letter "s" need not be given, a number is
sufficient. If PCSF prints more than a single table it may be
useful to add a mark at the end of each table. In command line
mode a marker string may be given after the option letter "a". In
menu mode it is sufficient to enter a string which is enclosed
between double quotes. This string will be printed at the end of
the last line of each table. Note that double quotes on the
command line have to be preceded by a backward slash (\),
otherwise they will not be passed to PCSF by the operating
The output of PCSF is written to the standard output device
and it may easily be redirected into a file by command line
redirection: The command
pcsf > OUT.TAB
will call PCSF in menu mode and write the resulting data output
into the file OUT.TAB.
The program is available both in source and in executable form.
It is written in ANSI C and may be compiled with any ANSI C
compiler for any operating system. Executable versions have been
created with Microsoft C 6.0 and Turbo C 2.0 for MS-DOS and with
the non-ANSI UNIX C compiler cc. No special hardware is required.
The single functions are written in a modular manner and may
easily be incorporated into other programs. The files are
available from the author via electronic mail by sending a
request to: firstname.lastname@example.org.
Baylor, D. A., Nunn, B. J., & Schnapf, J. L. (1987). Spectral
sensitivity of cones of the monkey Macaca Fascicularis.
Journal of Physiology, 390, 145-160.
Boynton, R. M., & Wisowaty, J. J. (1980). Equations for chromatic
Journal of the Optical Society of America, 70, 1471-1476.
MacLeod, D. I. A., & Boynton, R. M. (1979). Chromaticity diagram
showing cone excitation by stimuli of equal luminance.
Journal of the Optical Society of America, 69, 1183-1186.
Pokorny, J., & Smith, V. C. (1986). Colorimetry and color
discrimination. In K. R. Boff, L. Kaufman, & J. P. Thomas
(Eds.), Handbook of perception and performance.
Volume I. Sensory processes and perception (chapter 8). New
Siminoff, R. (1991). Simulated bipolar cells in fovea of human
retina. Biological Cybernetics, 64, 497-504.
Smith, V. C., & Pokorny, J. (1975). Spectral sensitivity of the
foveal cone pigments between 400 and 500 nm. Vision Research,
Wandell, B. A. (1987). The synthesis and analysis of color
images. IEEE Transactions on Pattern Analysis
and Machine Intelligence. PAMI-9, 2-13.
Wyszecki, G., & Stiles, W. S. (1982). Color science:
Concepts and methods, quantitative data and formulae, 2nd ed.
New York: Wiley.
1 Both Boynton and Wisowaty (1980, p. 1472, Eq. 8) and Smith and
Pokorny (1986, p. 8-34, Eq. 62) have a typographical error in the
equation for converting from quantum catch to energy based
2 There is an ambiguity in Boynton and Wisowaty's description of
their equation for the optical media function (their Eq. 13).
They do not give density, but the power of density which
corresponds to absorption. Thus optical density is the base 10
logarithm of their Eq. (13).
Figure 1. Graphical displays of tables produced by PCSF. A:
Output resulting from the option line "-rgbl". These are the
Smith and Pokorny (1975) fundamental sensitivity functions on a
logarithmic scale. B: Output from "-m", the smooth optical media
density function. C: Output of "-DPTl", the Baylor et al. (1987)
cone sensitivity functions on a logarithmic scale. D: Output of
"-xyz", the Judd 1951 modified CIE color matching functions x,
y, and z.
Figure 2. This screen menu is shown if PCSF is called from the
command line without giving one of the function generating
options. All but the last five options generate functions. The
last five options control the output mode. After showing the menu
PCSF will wait until some option characters are typed in and the
input is finished by pressing the ENTER key.