represents a region around color.


represents a region with maximum distance d around color.


uses the specified color distance function dfun.


  • ColorsNear can be used to represent a region around a specific color.
  • The distance function dfun can be any valid ColorDistance metric. Possible settings include:
  • "CIE76"Euclidean distance in LABColor
    "CIE94"color difference defined in LCHColor
    "CIE2000"CIE94 with some corrections (default)
    {"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 allclose all

Basic Examples  (3)

Represent a region around red:

Show the region around red, green and blue:

Detect image regions with colors near green:

Scope  (3)

A region around red:

Colors near red with distances smaller than 0.2:

Colors near red using a specific distance metric:

Applications  (3)

Detect regions of an image with colors near red:

Detect regions using chroma differences:

Recolor regions with colors near red in an image:

Use color neighborhoods for chroma keying:

Remove the green screen by setting the alpha channel:

Properties & Relations  (2)

Using "CIE76" distance in Lab color space; every color neighborhood is a sphere:

The shape of the neighborhood varies for each color with other color distances:

Wolfram Research (2019), ColorsNear, Wolfram Language function,


Wolfram Research (2019), ColorsNear, Wolfram Language function,


Wolfram Language. 2019. "ColorsNear." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2019). ColorsNear. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_colorsnear, author="Wolfram Research", title="{ColorsNear}", year="2019", howpublished="\url{}", note=[Accessed: 19-June-2024 ]}


@online{reference.wolfram_2024_colorsnear, organization={Wolfram Research}, title={ColorsNear}, year={2019}, url={}, note=[Accessed: 19-June-2024 ]}