What are the exact functions of Blend Modes?

I’ve collected and written down the functions of Blend Modes (which are used many softwares, including in PTS, AE, (…)) at the end of this post, the problem is, Blender inserts the input Factor into the functions somewhere that I’m aware of. Blender is the only software which does this to the functions of Blend Modes, by the way.

I need your help, please correctly insert the input Factor into each function. I’ve only finished so far, which I’ve tested and found them to be correct:
Color Dodge: A/(1−tB)
Add: A+tB
Difference: |A+tB|

I have the Blender source codes here, but I can’t read codes.

Thank you!


Color Dodge: f(A,B) = A/(1-B)
Darken: f(A,B) = A (for A<B) , B (else)
Multiply: f(A,B) = AB
Lighten: f(A,B) = A (for A>B) , B (else)
Screen: f(A,B) = 1-[(1-A) * (1-B)]
Color Burn: f(A,B) = 1-(1-A)/B
Overlay: f(A,B) = 2AB (for A<0.5) , 1-2[(1-A)*(1-B)] (else)
Soft light: f(A,B) = {2AB+A^2(1-2B) (for B<0.5) , Sqrt(A)(2B-1)+(2A(1-B)] (else)
Linear Light: f(A,B) = A+2B-1 (for B<0.5) , A+2(B-0.5) (else)
Add: f(A,B) = A+B
Subtract: f(A,B) = A-B
Difference: f(A,B) = |A-B|
Divide: f(A,B) = A/B
Exclusion: f(A,B) = A+B-2AB

AFAIK and also see this in the sources ( didn’t checked every single line…) blender just adds a factor ( your t) to the second argument ( your B ) so that you can control the influence of it… meaning using 1 it’s just the “usual” blending; using 0 it’s only the first input ( your A )… (so no blending at all)…

So they named the first argument result_color r_col and it is almost always something derived from something like:

r_col = compute_something_with (r_col, fac * col)

or in your naming:

A = compute_something_with (A, t * B)

where the second argument / color is just named col and weighted by a factor fac

but because of the nature of the differetn blending modes sometimes it’s using the “rest part to one” facm = 1 - fac…so it’s more like

A = compute_someother_with (A, (1-t) * B)

…and maybe even differently so that’s the reason why they did it for everthing for it’s own…

1 Like

Thank you so much!
Sorry for my late reply.

I have a few specific questions if you don’t mind:
In this newer source code:

  1. “col 1” is not supposed to specifically mean A and
    “col 2” is not supposed to specifically mean B
    , are they?
  2. It’s up to us to choose:
    A or B for col1 and
    A or B for col2, isn’t it?
  3. We can freely define mix(col1,col2,t) as:
    At+f(A,B)(1-t) or
    Bt+f(A,B)(1-t),
    do we?
  4. Specific example, we can freely define col1*t+(col1-col2)(1-t) as:
    At+(A-B)(1-t) or
    Bt+(B-A)(1-t)
    because both are correct, do we?
  5. If you agreed with all of the above mini questions, then would you agree that people’s definitions of Blend Modes are not “broad” enough? For example, here, they say:
    “Difference Blend Mode is the absolute value of the difference between base and blend layers
    Do you think that the definition should be:
    “Difference Blend Mode is the absolute value of the difference between one layer and another layer?

I do not understand what you want to “discuss” with your enumerations here ?? Because it’s just all: no

The source code regardless of using any names defines exactly what it is… and even if the docs.blender manual glossary term-Color-Blend-Modes refers to the Krita pages… the is also…

…so sometimes the names differ and sometimes blend modes with the same name may even mean something different… and that’s it…

…and also: the old discussion is over 10 years old…

:person_shrugging:

No, because the transfer is cumulative - not simply applying to a single pair of layers.

If we use blend mode result = (A + B) * C, then C is affecting both A and B, and would still affect the result even if A or B was removed from the equation.

1 Like