ICC-Profile
view release on metacpan or search on metacpan
pod/ICC/Support/Color.pod view on Meta::CPAN
Note that each of the object elements has accessor methods (see L<"General accessors">), except for the cached
'color-weight functions'. Normally, there is no need to access these internal object elements, except for the 'white-point'.
The Color object is created from the parameter hash, and does its work through the 'transform' and 'jacobian' methods.
=head2 Spectral measurements
Spectral measurements are made with a spectrophotometer for prints, or with a spectroradiometer for illumination. For each
sample, light is split into wavelength bands by a diffraction grating. The instrument returns a list of measurements at each
wavelength. For colorimetry, the range of wavelengths is usually confined to visible light, typically between 380 and 780 nm.
An instrument commonly used in the graphic arts, the X-Rite i1Pro 2, measures from 380 to 730 nm with an increment of 10 nm.
Each sample consists of 36 measurements, for 380 nm, 390 nm, 400 nm, etc. In the reflective mode, the values returned range
from 0 to 1.0, with 1.0 representing a perfect diffuse white. In the emissive mode, the values represent spectral irradiance,
and taken together, form the spectral power distribution (SPD).
The optics of a graphic arts spectrophotometer normally illuminate the sample with a 45 degree cone, and capture the light
reflected perpendicular from the surface. This is called 45/0 geometry. Industrial spectrophotometers commonly use an
integrating sphere to minimize the effect of gloss variation. Measurements from these instruments are incompatible with 45/0
measurements, but are handled identically when computing colorimetry.
When measuring reflective samples, the UV content of the instrument's light source may affect the readings, especially if the
samples are printed on paper or media with OBAs (optical brightening agents). The ISO 13655 standard specifies "measurement
conditions" for the light source. These measurement conditions are known as 'M0', 'M1', 'M2' and 'M3'. The Chart module has
functions to handle the OBA effect using 'M1' and 'M2' measurements. However, the measurement condition is not a factor in
colorimetry calculations.
=head2 Colorimetry
Spectral measurements are objective. They describe the physical properties of materials and light sources. The perception
of color is subjective, and depends on the function of the eyes and brain. Colorimetry is the science and technology that
relates the spectral properties of light to its perceived color. CIE 15 is the international standard defining colorimetry.
Colorimetry is based on color matching experiments using human observers. The observers match color samples using a mixture
of three monochromatic light sources. Color-matching functions are derived from these experiments. The first standard set
of color-matching functions was published by the CIE in 1931. These functions were based on a 2 degree field of view.
The experiments were repeated with a 10 degree field of view, with corresponding color-matching functions published in 1964.
More recently, so-called "physiologically-relevant" color-matching functions were developed and published.
These color-matching functions are used to convert spectral measurements into XYZ values that represent the perceived color.
The spectral measurements are multiplied by the color matching functions, then integrated to get the XYZ values. The color
matching functions are supplied with a range of 360 to 830 nm and an increment of 1 nm. The CIE recommends that calculations
are done with a 1 nm increment for greatest accuracy.
=head2 Interpolation
Most graphic arts spectrophotometers measure color with a 10 nm increment. In order to calculate XYZ values with 1 nm
colorimetry, it is necessary to interpolate. Interpolation estimates the intermediate values by fitting a mathematical
function to the measured data. There are many ways to do this, as explained in the CIE 15 document.
The Color object provides three different interpolation methods, linear, cubic spline, and Lagrange. Linear interpolation
uses a straight line function between points. Cubic spline interpolation uses a cubic function between points. Lagrange
interpolation uses a polynomial function that passes through some number of points surrounding the interval. The ASTM E 308
and E 2022 standards employ Lagrange interpolation.
In most cases, cubic spline interpolation will provide the best results. A so-called "natural" cubic spline is used, which
has continuous first and second derivatives. Linear interpolation is preferred for fluorescent and gas discharge
illuminants. For illuminants, the appropriate interpolation method is selected based on the "smoothness" of the SPD.
Lagrange interpolation is included for ASTM compatibility.
Wavelengths outside the range of the measuring device are copied from the endpoints. This is the preferred way to extend the
data. Fortunately, the values of the color-matching functions become extremely small as they approach the UV and IR regions.
This minimizes any errors from an abbreviated measurement range.
=head2 Color weight functions
To compute the colorimetry of a single sample using a 1 nm increment requires interpolating 470 values, multiplying them by
the color-matching functions and illuminant, then adding these products together to get X, Y, and Z values. This consumes a
lot of computing power.
This work can be greatly simplified with color-weight functions. Color-weight functions combine the interpolation and
integration steps. The colorimetry calculation is reduced to the dot product of each color-weight function and the raw
spectral data. The ASTM E 308 standard provides pre-computed color-weight functions for commonly used illuminants. (The ISO
13655 standard contains tables 5.9 and 5.10 from ASTM E 308). Another standard, ASTM E 2022, shows how to create
color-weight functions using other illuminants and observers.
When the illuminant is set to a scalar value (e.g. 'D50'), the ASTM E 308 standard tables are used. When the illuminant is set
to an array reference (e.g. ['CIE', 'D50']), color-weight functions are computed using the supplied hash parameters. This
provides great flexibility, including the use of measured illuminants.
When density is selected by the 'status' key, the appropriate color-weight functions from ISO 5-3 are loaded.
=head2 Standard illuminants
The CIE 15 standard provides a large selection of standard illuminants which include daylight and various artificial light
sources. These illuminants are used to compute standard colorimetry, e.g. "D65, 2 degree observer". Of course, it is
possible to measure an actual illuminant, but in most instances the illuminant is chosen simply to represent the likely or
agreed upon viewing conditions. That is the function of standard illuminants.
The standard illuminants representing daylight are provided at specific color temperatures. For instance, D50 is 5000K, D65
is 6500K, and so on. The standard also provides a method for calculating the SPD at an arbitrary color temperature. The
'daylight' function implements this method,
$color = ICC::Support::Color->new{'illuminant' => [daylight(5700)]}; # daylight at 5700k
The Color module contains SPD data for of all CIE 15 standard illuminants, selected by the names used in the standard. It
also contains a set of typical commercial lamp SPDs provided by the Philips Corporation.
=head2 Bandpass correction
Bandpass correction is the adjustment of spectral values to represent the actual zero-bandwidth value at each wavelength.
Raw spectral measurements include a band of wavelengths, and represent the convolution of the spectral distribution with the
bandpass function of the instrument. Bandpass correction extracts the true distribution from this convoluted raw data. Some
instruments do this internally, while others do not, which is why bandpass correction is turned off by default. Bandpass
correction is enabled by the 'bandpass' key.
The ASTM E 2729 standard defines a generic bandpass correction method, for instruments having a triangular bandpass function.
ASTM calls their method "bandpass rectification", apparently to avoid suggesting that raw spectral data is somehow incorrect.
This correction method is selected by setting the 'bandpass' value to 'astm'.
The ASTM E 308 standard contains a complete set of color-weight functions (table 6) with bandpass correction applied. This
table is deprecated by ASTM E 2729. One reason for this change is to ensure that bandpass correction is applied to the raw
spectral data, which may have a different wavelength range than the color-weight tables.
A more sophisticated bandpass correction method is available that takes into account the bandpass function of the instrument
and the interpolation method. This correction method is selected by setting the 'bandpass' value to the shape of the
instrument bandpass function. Possible values are 'triangle', 'trapezoid', or a vector representing the actual bandpass
function. The 'trapezoid' shape simulates the bandpass function of X-Rite i1 instruments.
=head2 Data structure and transforms
( run in 0.626 second using v1.01-cache-2.11-cpan-524268b4103 )