ColorDifference Class

Color difference metrics (ΔE): how different two colors look, as a distance in CIELAB or Oklab. A difference of about 1 in CIELAB (about 0.02 in Oklab) is just noticeable.

public static class ColorDifference

Remarks

The metrics take the colors as they are: give them relative to the same white (CieLab.FromRgb gives D50). ColorDifference.DeltaE94 is not symmetric: its weights come from the reference color.

Methods

NameDescription
DeltaE2000(CieLab, CieLab, double, double, double)Computes the CIEDE2000 color difference (ΔE00, CIE 142-2001), as Sharma, Wu and Dalal state its equations ("The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations", 2005).
DeltaE76(CieLab, CieLab)Computes the CIE 1976 color difference (ΔE*ab, ΔE76): the Euclidean distance in CIELAB.
DeltaE94(CieLab, CieLab, Cie94Application)Computes the CIE 1994 color difference (ΔE*94, CIE 116-1995): the differences of lightness, chroma and hue, weighted by the chroma of the reference color.
DeltaEOK(Oklab, Oklab)Computes the Oklab color difference (ΔEOK, CSS Color 4 section 13.1.2): the Euclidean distance in Oklab.

DeltaE2000(CieLab, CieLab, double, double, double)

ColorDifference.cs

Computes the CIEDE2000 color difference (ΔE00, CIE 142-2001), as Sharma, Wu and Dalal state its equations ("The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations", 2005).

public static double DeltaE2000(CieLab reference, CieLab sample, double lightnessWeight = 1d, double chromaWeight = 1d, double hueWeight = 1d)

Parameters

reference CieLab
The first color.
sample CieLab
The second color.
lightnessWeight double
The parametric factor kL of the viewing conditions. Defaults to 1.
chromaWeight double
The parametric factor kC of the viewing conditions. Defaults to 1.
hueWeight double
The parametric factor kH of the viewing conditions. Defaults to 1.

Returns

double The difference. It is symmetric.

DeltaE76(CieLab, CieLab)

ColorDifference.cs

Computes the CIE 1976 color difference (ΔE*ab, ΔE76): the Euclidean distance in CIELAB.

public static double DeltaE76(CieLab reference, CieLab sample)

Parameters

reference CieLab
The first color.
sample CieLab
The second color.

Returns

double The difference.

DeltaE94(CieLab, CieLab, Cie94Application)

ColorDifference.cs

Computes the CIE 1994 color difference (ΔE*94, CIE 116-1995): the differences of lightness, chroma and hue, weighted by the chroma of the reference color.

public static double DeltaE94(CieLab reference, CieLab sample, Cie94Application application = Cie94Application.GraphicArts)

Parameters

reference CieLab
The reference color, whose chroma weights the differences.
sample CieLab
The color compared with the reference.
application Cie94Application
The weights of the kind of samples compared.

Returns

double The difference.

Exceptions

ArgumentOutOfRangeException
application is not a defined value.

DeltaEOK(Oklab, Oklab)

ColorDifference.cs

Computes the Oklab color difference (ΔEOK, CSS Color 4 section 13.1.2): the Euclidean distance in Oklab.

public static double DeltaEOK(Oklab reference, Oklab sample)

Parameters

reference Oklab
The first color.
sample Oklab
The second color.

Returns

double The difference; 0.02 is about a just noticeable difference.