How to add emission to a specific color on an existing material?

Hi,
I like to seek help how to “filter” a specific color of an existing material and add emission to it. In the diagram below, I like to add emssion to the “green-blue” color as shown on this electrical device.

I understand one way is to try to “black out” the other colors and change the “specific color (in this case blue-green lines)” to white as a “fac” in a mix shader.

My problem is I just couldn’t figure how to do this “black out” and “white out” a specific color on an exisitng image.

Use a colorramp and separate rgb to squeeze individual colorchannels.

Hope that helps.

4 Likes

hi,
Hmm I think the problem is the color to add emission is not exactly blue or green.
So the question is how to isolate out this color which appears bluish green ?

I tried both green and blue output from Separate color node as you suggested . still can’t get it. Below us see i only could add emission to the horizontal bar and not the “bluish green” lines in the original diagram.

My attempt failed …

How about this?

I just used a noise texture instead of an image texture to test it. Just replace that with your image texture.

I compare the color of the noise (image) with the color you want to replace (my RGB node) and by changing the “exact range” to 0 you can choose that only the exact color will be replaced by emission. If you raise that value, also “neighbouring” colors will be replaced. Hope it helps. Happy blending!

Hmm I assume the Principle BSDF.Base Color input should comes from the image right?
So with that said, there is no emission effect when tried to follow yours… replacing the noise with my image, and also adding image input to Principle BSDF.Base Color


results … no effect.
image
same as I connect direct from BSDF to materiral output

yes, your assumption is right…but i cannot really believe that it doesn’t work…can u provide a blend file where you put that together and it doesn’t work? of course you might want to use a bigger range value than 0 because you maybe didn’t really got the right color? because 0 means: it must be that exact color.

Hi again.
Firstly, I make a mistake … the line in bluish green. It is a different object.
Anyway I wanted now to change the “light greenish” panel replace with red emission. I understand the logic of your shader should be able to replace this color and put in an emission. It still does not work.
Here’s my file of this transmission equipment object … with your shader that I tried to follow but did not get it to work .

ReplaceColorwith_Emission.blend (3.3 MB)

The “light greenish panels” I tried to convert it to an emission of blue

I had to change colorspace to filmic sRGB and swap inputs on the mix shader,
and then mess with epsilon on green channel.

maybe you could redo your bitmap to have a better color to key off? (like pure blue?) some of that image is quite noisy.

Anyways

Hope that get you closer.

You could try a hue saturation value node, and see if you can shift your target color into a better range for masking out.

Yeah. I tried this with a couple random jpgs of my own and had a lot of trouble getting this setup to work, until I did some prep work in the GIMP to clean up the noise. An image that already had solid colour areas and not much noise (hello, Mr Mondrian) worked nearly out of the box, just a little play with the epsilon and it was there.

I know how to reduce noise in 2D programs, but don’t know enough about Blender to translate that.

Thank you very much for your blend file.

I did this: i opened the image editor with your image:

then i created a new material just to click on color

then on eyedropper

and clicked on the green of the image to get that exact color

then i hovered the cursor over the color in the material and pressed ctrl-c to copy it.

Then i pasted that color in the rgb node from my node tree.

image

if i changed now the range to

image

i got:

blend file:

ReplaceColorwith_Emission.blend (3.4 MB)

@Blender_Fun1
I tried to follow @AlphaChannel explained solution and got a little confused.

But your file and approach appears clearer for a novice like me. Will adopt your approach for future reference. Thanks a lot.

1 Like

Did someone realize that he set 0 to the value of Epsilon? Is that supposed to work this way?