-
Notifications
You must be signed in to change notification settings - Fork 0
06 Color difference calculation
In colorimetry, delta E (ΔE) is a measure of the difference between two colors.
Delta E is a commonly used unit of measurement in colorimetry, and is often used in a variety of applications, such as color matching, color correction, and color quality control. It is important to note that delta E is a relative measure, and that the exact value of delta E will depend on the specific method of measurement and the units used to express the tristimulus values. In addition to its use in color matching and color quality control, delta E is also used in a variety of other fields, such as printing, painting, and design. In printing, for example, delta E is often used to compare the colors of different print jobs, and to ensure that they match the original design. In painting, delta E is used to compare the colors of different paints, and to ensure that they match the desired color. In design, delta E is used to compare the colors of different design elements, and to ensure that they match the overall design scheme.
Delta E is also used in a variety of applications in the field of vision science. For example, it is used to measure the color accuracy of displays, such as computer monitors and televisions, and to ensure that they produce colors that are accurate and consistent. It is also used to measure the color vision of individuals, and to diagnose color vision deficiencies, such as color blindness.
To calculate color difference between two measure, you first need to specify the delta E (ΔE) algorithm you want to use.
This package contains algorithms for four popular methods:
- CIE76, using
deltaCIE76()
method, - CIE94, using
deltaCIE94()
method, - CIEDE2000, using
deltaCIE00()
method, - CMC l:c, using
deltaCMClc()
method.
Altnernatively, you can use indirect method delta()
, using qualified delta E name (as seen in Delta E), as presented below.
use tei187\ColorTools\ColorModels\XYZ;
use tei187\ColorTools\ColorModels\LCh;
$a = new XYZ([.2967, .3178, .2817]);
$b = new LCh([63.61469287626, 9.1862923416512, 103.13494521567]);
# Using specific delta method:
$a->deltaCIE00($b);
// 0.39877497284808
# Using non-specific/alternative delta method:
$a->delta($b, 'cie00');
// 0.39877497284808
CIE94 and CMC l:c algorithms have a selection of modes, that will change the outcome. They are used for different applications. As such, they require a second argument when calculating color difference. If it is not passed they default to specific one.
For CIE94 the modes are "graphic_arts" (default) and "textiles".
For CMC l:c the modes are "acceptability" (default) and "perceptability".
Before calculating delta E, you should make sure that the objects share the same illuminants. If they do not, one of the objects should be adapted to other one's illuminant's chromaticity.