Selective Coloring with a Perceptual Color Distance 

Selective desaturation is an effect commonly used to highlight specific details or objects in an image.

Create a distance map between pixels of an image and a given color using ColorDistance with a perceptually accurate distance function such as the CIE2000 color difference.

In[1]:=
Click for copyable input
X
Out[1]=

Use the map as a mask to highlight the regions close to the target color.

In[2]:=
Click for copyable input
X
Out[2]=

Compose the original image and its grayscale version using the distance map.

In[3]:=
Click for copyable input
X
Out[3]=
de es ja pt-br zh