Match Tint [SUBMITTED]
Moderator: SecondMan
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Match Tint
Hi everyone, hope you are doing great!!
I'm working on a keying tutorial, and needed to match the grade of the keyed foreground with the background.
I saw this interesting AE tutorial that uses AE's "Tint" effect to do exactly that.
So I made a DCTL fuse that maps the highlights of an input image to one color and the shadows to another color.
It's a pretty simple fuse, but it can be very useful.
I hope it can be useful to all of you.
Thanks again,
David
I'm working on a keying tutorial, and needed to match the grade of the keyed foreground with the background.
I saw this interesting AE tutorial that uses AE's "Tint" effect to do exactly that.
So I made a DCTL fuse that maps the highlights of an input image to one color and the shadows to another color.
It's a pretty simple fuse, but it can be very useful.
I hope it can be useful to all of you.
Thanks again,
David
You do not have the required permissions to view the files attached to this post.
- Millolab
- Fusionista
- Posts: 705
- Joined: Wed Oct 24, 2018 6:26 am
- Contact:
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
Nice Suggestion @Millolab !!
I don't know what's the algorithm for that, do you happen to know it?
Thanks again.
David
Added in 19 minutes 24 seconds:
Never mind, I found it.
I don't know what's the algorithm for that, do you happen to know it?
Thanks again.
David
Added in 19 minutes 24 seconds:
Never mind, I found it.

- Millolab
- Fusionista
- Posts: 705
- Joined: Wed Oct 24, 2018 6:26 am
- Contact:
Re: Match Tint
well, I don't know any algorithm but the math is pretty simple: first you divide your RGB channels by the alpha, then do your tinting, then multiply RGB by the alpha again. That's all. How to implement that in a Fuse, well... I sadly don't know...
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
Thanks @Millolab, I found the info in one of Vito's videos.
My only concern is: what if the alpha pixel is equal to 0?
Can't divide by zero.
I'll experiment for a little bit first.
Thanks again,
David
My only concern is: what if the alpha pixel is equal to 0?
Can't divide by zero.

I'll experiment for a little bit first.
Thanks again,
David
- Midgardsormr
- Fusionator
- Posts: 2015
- Joined: Wed Nov 26, 2014 8:04 pm
- Location: Los Angeles, CA, USA
- Been thanked: 3 times
- Contact:
Re: Match Tint
You'll need a test condition for alpha == 0, which will do nothing. It's pretty easy to verify your code against Fusion's own behavior. Check the Waveform subview on this:
That should give you an idea of the behavior to expect.
Code: Select all
{
Tools = ordered() {
Background2 = Background {
Inputs = {
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
Depth = Input { Value = 3, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
TopLeftBlue = Input { Value = 0.431, },
EffectMask = Input {
SourceOp = "Background1",
Source = "Output",
}
},
ViewInfo = OperatorInfo { Pos = { 529, 121 } },
},
Background1 = Background {
CtrlWZoom = false,
Inputs = {
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
Depth = Input { Value = 3, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
Type = Input { Value = FuID { "Gradient" }, },
Start = Input { Value = { 0.482905982905983, 0.507604562737643 }, },
Gradient = Input {
Value = Gradient {
Colors = {
[0] = { 0, 0, 0, 0 },
[1] = { 1, 1, 1, 1 }
}
},
},
},
ViewInfo = OperatorInfo { Pos = { 406, 122 } },
},
Transform1 = Transform {
Inputs = {
ProcessAlpha = Input { Value = 0, },
Center = Input { Value = { 0.282868525896414, 0.5 }, },
Edges = Input { Value = 2, },
Input = Input {
SourceOp = "Background2",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 651, 123 } },
},
AlphaDivide1 = AlphaDivide {
Inputs = {
Input = Input {
SourceOp = "Transform1",
Source = "Output",
},
},
ViewInfo = OperatorInfo { Pos = { 766, 121 } },
}
}
}
- SecondMan
- Site Admin
- Posts: 4781
- Joined: Thu Jul 31, 2014 5:31 pm
- Location: Vancouver, Canada
- Been thanked: 18 times
- Contact:
Re: Match Tint
And version 1 i submitted! 
Please check if everything is working as you'd expect
Thanks!

Please check if everything is working as you'd expect

Thanks!
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
Thanks Pieter!!
I try it out asap.
Sorry that version 2 is coming so soon.
I should have asked you to postpone submission.
Sorry
Thanks again,
David
I try it out asap.
Sorry that version 2 is coming so soon.
I should have asked you to postpone submission.
Sorry

Thanks again,
David
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
And here it is:
v1.1, now with a Pre-Divide/Post-Multiply control.
@SecondMan, if you have time could you please update it?
Thanks again,
David
v1.1, now with a Pre-Divide/Post-Multiply control.
@SecondMan, if you have time could you please update it?
Thanks again,
David
You do not have the required permissions to view the files attached to this post.
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
Hi @SecondMan, It's a little late, but I want to thank you for fixing the date in the Atom.
A friend of mine was trying to install this fuse from Reactor, but it didn't show up.
I think that the problem was in the atom and also in the fuse, so I think I fixed the problem.
If you have some time, could you please update the atom?
Thanks again,
David
A friend of mine was trying to install this fuse from Reactor, but it didn't show up.
I think that the problem was in the atom and also in the fuse, so I think I fixed the problem.
If you have some time, could you please update the atom?
Thanks again,
David
You do not have the required permissions to view the files attached to this post.
- SecondMan
- Site Admin
- Posts: 4781
- Joined: Thu Jul 31, 2014 5:31 pm
- Location: Vancouver, Canada
- Been thanked: 18 times
- Contact:
Re: Match Tint
No problem, you're welcome 
The problem seemed to be that previously you had put the Fuse in a Tools folder, rather than a Fuses folder.
The Fuse is in the correct folder now, but you've also changed the Atom Category to Fuses/Color, rather than Tools/Color which doesn't follow convention and is not conform your other tools.
Make the quick change on your end? Just so we're in sync here...

The problem seemed to be that previously you had put the Fuse in a Tools folder, rather than a Fuses folder.
The Fuse is in the correct folder now, but you've also changed the Atom Category to Fuses/Color, rather than Tools/Color which doesn't follow convention and is not conform your other tools.
Make the quick change on your end? Just so we're in sync here...
- Shem Namo
- Fusionista
- Posts: 649
- Joined: Sun Oct 06, 2019 9:15 pm
- Location: North Israel
- Real name: David Kohen
- Been thanked: 1 time
Re: Match Tint
Do you mean that I can have the category in the Tools/Color menu, while the fuse is in the Fuses/Color folder?
Thanks again,
David
Thanks again,
David