Pairwise blending of RGB to get white

Hi,

Was playing around with the blending nodes and adjusting the foreground weights to add red, green and blue to create white. Performing pairwise addition like this reduces the final color values so I added an Adjust Image Colors node to compensate.

Is doing it this way efficient or is there a better way?

Thanks

Blend_RGB_to_get_white.vuo (3.96 KB)

Here’s a working method to blend RGB sources and get white without the final adjustment, comp attached. It uses screen blend mode.
Is there actually a use case for this?

Blend_RGB_to_get_white JC.vuo (3.39 KB)

Oh yeah, see attched using addition blend mode. It’s what I thought first but hadn’t noticed you had the opacity set the way you did.

Blend_RGB_to_get_whiteJC2.vuo (3.12 KB)

2 Likes

Thanks @Scratchpole - I see now that using the dodge mode simplifies the composition and does a better job by brightening the blended colors. The purpose is two fold; (i) so that I can better understand Vuo and (ii) I want to demonstrate image blending using colors and Vuo seems like a good and intuitive choice for that. Thank you

I appreciate your pursuits, @Marcorexo1. I posted a little demo of additive color in the composition gallery. It switches between add and subtract blending modes.

(Question came up while assembling it – layers are not premultiplied, otherwise Make Oval Layer would have a white square background, right? Why does “darker components” show the circle layer bounding box? Bug?)  

1 Like

I know this post is about blending colors, but it’s a short jump to blending images, considering that blend modes operate on color per pixel… I like this old site, found it on the Wikipedia page for blend modes: Pegtop delphi

Anyone want to help make a blend mode shader with blend mode equations? I haven’t tried yet. Below is some shader code from the Vuo manual, how should this be changed to be flexible for adding 3 or more? Obviously limited to the two blend modes with its method. In my limited knowledge, seems like a good idea to set up the blending equations before/outside the main function then call them when selected from the pulldown menu?

/*{ ”LABEL”:”Blend Image Components”, 
	”INPUTS”:[
 	{
		”NAME”:”image1”, 
		”TYPE”:”image” 
	},

	{
		”NAME”:”image2”,
		”TYPE”:”image” 
	},
	{
		”NAME”:”blendType”,
		”TYPE”:”long”,
		”VALUES”:[0, 1],
		”LABELS”:[”Darker Component”, ”Lighter Component”]
	} 
	]
}*/

void main() {
vec4 color1 = IMG_THIS_NORM_PIXEL(image1);
vec4 color2 = IMG_THIS_NORM_PIXEL(image2); 
gl_FragColor = (1 - blendType) * min(color1, color2) 
	+ blendType * max(color1, color2);
}
```  

@marcorexo1,

layers are not premultiplied, otherwise Make Oval Layer would have a white square background, right? Why does “darker components” show the circle layer bounding box?

Yes, unfortunately there’s no way to express “Darker Component” in the version of OpenGL supported by macOS. Maybe the Metal implementation will be different.

1 Like