gives the approximate perceptual distance between color directives c1 and c2.


gives color distances between elements of list and c.


gives color distances between corresponding elements of list1 and list2.


gives an image whose pixel values are color distance between pixels in image and the color c.


yields an image giving the pixelwise color distance between image1 and image2.

Details and Options

  • The distance between two colors is computed as the Euclidean distance between the two color vectors in the LABColor space.
  • In the computation of the color distance, the alpha channel is ignored.
  • ColorDistance works with arbitrary 2D and 3D images.
  • With ColorDistance[image,], color distances are returned as an image of a real type with the same dimensions as image.
  • With ColorDistance[image1,image2], image1 and image2 are center aligned, and an image of color distances for the overlapping pixels is returned.
  • ColorDistance supports a DistanceFunction option. The following settings are available:
  • "CIE76"Euclidean distance in LABColor (default)
    "CIE94"color difference defined in LCHColor
    "CIE2000"CIE94 with some corrections
    {"CMC",{l,c}}Color Measurement Committee metric with lightness l and chroma c
    "DeltaL"luminance difference in LCHColor
    "DeltaC"chroma difference in LCHColor
    "DeltaH"hue-based difference in LCHColor
    ffunction f that is given two lists of Lab values
  • With the "CMC" metric, commonly used parameters are for perceptibility and for acceptability. If not specified, is used.


open all close all

Basic Examples  (2)

Distance between two colors:

Click for copyable input

Distance between a color and each pixel of an image:

Click for copyable input

Scope  (5)

Options  (8)

Applications  (6)

Properties & Relations  (8)

Neat Examples  (1)

Introduced in 2014
Updated in 2015