ColorDetect[image,cspec]
returns a mask image representing regions in image with colors within the specified color region.
ColorDetect
ColorDetect[image,cspec]
returns a mask image representing regions in image with colors within the specified color region.
Details
- ColorDetect is typically used to specify an image mask, including pixels within the color region.
- Possible settings for the color specification cspec include:
-
color colors near color ColorsNear[color,d,…] explicit specification of colors near color
Examples
open all close allBasic Examples (1)
Use ColorDetect to compute an image region:
ColorDetect[[image], RGBColor[0.40541765226970417, 0.5989489462507049, 0.9031254989108909]]Use the region as an alpha channel:
SetAlphaChannel[[image], ColorNegate[%]]Scope (3)
Compute the pixels in the color region:
ColorDetect[[image], RGBColor[0.6989759246143588, 0.818080938661109, 0.9248021130489484]]Specify a maximum color distance:
ColorDetect[[image], ColorsNear[RGBColor[0.6989759246143588, 0.818080938661109, 0.9248021130489484], .2]]Specify a custom function to compute the distance:
ColorDetect[[image], ColorsNear[RGBColor[0.6989759246143588, 0.818080938661109, 0.9248021130489484], .05, "DeltaL"]]Related Guides
History
Text
Wolfram Research (2019), ColorDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/ColorDetect.html.
CMS
Wolfram Language. 2019. "ColorDetect." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColorDetect.html.
APA
Wolfram Language. (2019). ColorDetect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColorDetect.html
BibTeX
@misc{reference.wolfram_2026_colordetect, author="Wolfram Research", title="{ColorDetect}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ColorDetect.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_colordetect, organization={Wolfram Research}, title={ColorDetect}, year={2019}, url={https://reference.wolfram.com/language/ref/ColorDetect.html}, note=[Accessed: 12-June-2026]}