Here's one in progress I've been working on - not a perfect match but I've been
looking at the very same thing.
If someone has a better version and want to share or can improve on this ;)
Howard
set cut_paste_input [stack 0]
version 7.0 v4
push $cut_paste_input
Group {
name screenSubtract
knobChanged "\nn=nuke.thisNode()\nk=nuke.thisKnob()\nif
k.name()=='screenOp':\n op=n\[k.name()].value()\n
nuke.toNode('screenSubtractOp')\['operation'].setValue(op)\nelif
k.name()=='lumaOP':\n op=n\[k.name()].value()\n
nuke.toNode('luminanceOp')\['operation'].setValue(op)\n \n"
selected true
xpos -179
ypos 284
addUserKnob {20 User l Screen}
addUserKnob {6 scSubtract l "screen subtraction" +STARTLINE}
scSubtract true
addUserKnob {6 bgChroma l "use bg chroma" -STARTLINE}
bgChroma true
addUserKnob {6 bgLuma l "use bg luminance" -STARTLINE}
bgLuma true
addUserKnob {26 ""}
addUserKnob {4 screenOp l "screen subtract op" M {difference from}}
addUserKnob {4 lumaOP l "luminance op" -STARTLINE M {geometric multiply
overlay ""}}
addUserKnob {26 ""}
addUserKnob {26 edgeAdjust l "<b>adjust edge"}
addUserKnob {7 edgeWP l "white point"}
edgeWP 1
addUserKnob {26 ""}
addUserKnob {26 rmBGNoise l "<b>BG Noise"}
addUserKnob {7 BGNoiseThreshold l threshold R 0 0.3}
}
Input {
inputs 0
name matte
xpos -318
ypos 328
}
Dot {
name Dot12
label M
xpos -287
ypos 368
}
Expression {
channel3 alpha
expr3 a?a:0
name addAlphaChannel
xpos -318
ypos 417
}
set N2cf09f10 [stack 0]
Dot {
name Dot15
xpos -287
ypos 1437
}
set N2cf1d620 [stack 0]
Dot {
name Dot2
xpos -287
ypos 1714
}
push $N2cf1d620
Grade {
channels alpha
whitepoint {{edgeWP}}
black_clamp false
name Grade1
xpos -479
ypos 1419
}
Input {
inputs 0
name Bg
xpos -827
ypos 392
number 1
}
Dot {
name Dot16
label BG
xpos -796
ypos 473
}
Dot {
name Dot17
xpos -796
ypos 672
}
Dot {
name Dot3
xpos -749
ypos 672
}
set N2cf394b0 [stack 0]
Dot {
name Dot18
xpos -528
ypos 672
}
Saturation {
saturation 0
mode Maximum
name Saturation1
xpos -559
ypos 843
}
Shuffle {
red blue
green blue
alpha blue
name Shuffle2
label "\[value in] > \[value out]\n\[value in2] > \[value out2]"
xpos -559
ypos 1079
}
push $N2cf09f10
Invert {
name Invert2
xpos -414
ypos 443
}
Input {
inputs 0
name CS
xpos -481
ypos 327
number 2
}
Dot {
name Dot13
label C
xpos -450
ypos 368
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy3
xpos -481
ypos 510
}
Premult {
name Premult3
xpos -481
ypos 595
}
push $N2cf09f10
Input {
inputs 0
name Fg
xpos -155
ypos 332
number 3
}
Dot {
name Dot14
label FG
xpos -124
ypos 390
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy2
xpos -155
ypos 450
}
set N2cf78db0 [stack 0]
Merge2 {
inputs 2
operation difference
also_merge all
name screenSubtractOp
xpos -155
ypos 595
}
push $N2cf78db0
Dot {
name Dot5
xpos 42
ypos 516
}
Premult {
name Premult1
xpos 65
ypos 641
}
Switch {
inputs 2
which {{scSubtract}}
name doScreenSubtraction
xpos -155
ypos 734
}
Dot {
name Dot19
xpos -124
ypos 788
}
set N2cf9b720 [stack 0]
Dot {
name Dot20
xpos -345
ypos 788
}
set N2cf9f060 [stack 0]
Colorspace {
primary_in "Wide Gamut"
colorspace_out CIE-Lab
primary_out "Wide Gamut"
name ColorspaceColor1
xpos -690
ypos 783
}
push $N2cf394b0
Colorspace {
primary_in "Wide Gamut"
colorspace_out CIE-Lab
primary_out "Wide Gamut"
name ColorspaceIn1
xpos -780
ypos 787
}
ShuffleCopy {
inputs 2
red red
alpha alpha2
name LABshuffle1
xpos -721
ypos 850
}
Colorspace {
colorspace_in CIE-Lab
primary_in "Wide Gamut"
primary_out "Wide Gamut"
name ColorspaceOut1
xpos -721
ypos 918
}
push $N2cf9f060
Switch {
inputs 2
which {{bgChroma}}
name Switch1
label "use bg chroma"
xpos -721
ypos 1091
}
set N2cfd5db0 [stack 0]
Merge2 {
inputs 2
operation geometric
also_merge all
name luminanceOp
xpos -559
ypos 1263
}
push $N2cfd5db0
Switch {
inputs 2
which {{bgLuma}}
name Switch2
label "use bg Luminance"
xpos -721
ypos 1277
}
push $N2cf9f060
Dot {
name Dot21
xpos -345
ypos 1369
}
Keymix {
inputs 3
invertMask true
name Keymix2
xpos -721
ypos 1433
}
push $N2cf9b720
Dot {
name Dot1
xpos -124
ypos 1551
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels rgb
name Copy4
xpos -721
ypos 1547
}
Copy {
inputs 2
from0 rgba.alpha
to0 rgba.alpha
name Copy1
xpos -721
ypos 1718
}
Unpremult {
name Unpremult1
xpos -721
ypos 1826
}
Grade {
channels alpha
blackpoint {{BGNoiseThreshold}}
name BGNoiseRemove
selected true
xpos -721
ypos 1882
}
Premult {
name Premult2
xpos -721
ypos 1937
}
Output {
name Output1
xpos -721
ypos 2147
}
end_group
>________________________________
> From: Simon Björk <[email protected]>
>To: Nuke user discussion <[email protected]>
>Sent: Tuesday, 2 April 2013, 22:14
>Subject: [Nuke-users] IBK and use bkg luminance
>
>
>I've been trying to understand how the IBKs "use bkg luminance" switch works,
>as I've needed it for other keyers, but I haven't been able to come up with a
>match. I can get somewhere close by converting the fg and bg to HSL
>color-space, and combining the luminance channels, but I can't get a perfect
>match compared to the IBK. Anyone know what's happening under the hood?
>_______________________________________________
>Nuke-users mailing list
>[email protected], http://forums.thefoundry.co.uk/
>http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
>_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users