Is there a way to change the mortar color of an image texture from black to white through node editor?
You can use a setup similar to this answer.
Since the target color is black, you can calculate the relative length of each channel, use a Math node set to &quot;Less than&quot; and tweak the threshold to mask the grout part.
Then use a Mix RGB set to Mix to set the grout color (here, white)

Result :

Since the grout is not pure black, you have to tweak the Compare node threshold to get the desired effect. Too little, and you have persisting black spots. Too high, and you begin masking undesired darker colors.