Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Desaturate an image except for a specified color or colors
ResourceFunction["DesaturateExcept"][image,color] desaturate the specified image except for the specified color. | |
ResourceFunction["DesaturateExcept"][image,color,d] desaturate the specified image except for colors with maximum distance d around color. | |
ResourceFunction["DesaturateExcept"][image,{color1,color2,…}] desaturate the specified image except for the specified colors. | |
ResourceFunction["DesaturateExcept"][image,{color1,color2,…},d] desaturate the specified image except for colors with maximum distance d around the specified colors. |
Desaturate the image except for colors near Red:
In[1]:= |
Out[1]= |
The distance from the specified color can be constrained to include smaller or larger regions:
In[2]:= |
Out[2]= |
Desaturate the image except for colors near a specified RGBColor:
In[3]:= |
Out[3]= |
Desaturate the image except for colors near Yellow and Red:
In[4]:= |
Out[4]= |
"DesaturationFraction" can be used to adjust how much desaturation to use:
In[5]:= |
Out[5]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License