ColorsNear

ColorsNear[color]

represents a region around color.

ColorsNear[color,d]

represents a region with maximum distance d around color.

ColorsNear[color,d,dfun]

uses the specified color distance function dfun.

Details

  • 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.

Examples

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, https://reference.wolfram.com/language/ref/ColorsNear.html.

Text

Wolfram Research (2019), ColorsNear, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorsNear.html.

CMS

Wolfram Language. 2019. "ColorsNear." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorsNear.html.

APA

Wolfram Language. (2019). ColorsNear. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorsNear.html

BibTeX

@misc{reference.wolfram_2024_colorsnear, author="Wolfram Research", title="{ColorsNear}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ColorsNear.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_colorsnear, organization={Wolfram Research}, title={ColorsNear}, year={2019}, url={https://reference.wolfram.com/language/ref/ColorsNear.html}, note=[Accessed: 22-December-2024 ]}