yeah, i had the same problem, and i was missing the
threshold slider in shake...

so made a gizmo which can acts very similar to a median
filter for the cases i need but is a lot faster..  i also
added a threshold slider.

sorry for the incomplete documentation, i wanted to clean it
up sometime and put it on nukepedia along with a few other
things, but you know how it is ;)

the default settings use a fast blur and a difference merge
to find which pixels to replace with the blur. for more
complex things there's two more inputs to feed another
difference image, and/or a different replacement image.
there's also a map option i find very useful which shows
which pixels will be affected...

if somebody got a better way i'd be interested to hear about
it.
++ chris

http://pastebin.com/Ceftw2T5


set cut_paste_input [stack 0]
push $cut_paste_input
Group {
 name cmDifference
help "This is a gizmo which compares one input to another and replaces only pixels above a certain difference threshold. By default there is a blur and a median filter built in to use. You can also use a third input to replace the pixels with a modified version"
 tile_color 0xff0000ff
 label "\[value multiply] / \[value gamma]"
 selected true
 xpos -155
 ypos -390
 addUserKnob {20 User}
 addUserKnob {41 channels T Median1.channels}
addUserKnob {6 useDiffInput l "use difference input for alpha/replace" +STARTLINE} addUserKnob {6 useCorrInput l "use corrected input for replace" +STARTLINE} addUserKnob {41 PixelMap l "Pixel map" t "Shows the r/g/b pixels that get affected by the mixing operation." T View_Matte.PixelMap}
 addUserKnob {26 ""}
addUserKnob {41 gamma l shadowWeight t "gamma operation. \naffects the weighting of shadow to highlights of the inputs to compare" T GradeBlackWeighting1.gamma} addUserKnob {41 multiply l threshold t "multiply operation.\nThis multiplies the difference between original and filtered image. Higher values means more pixels get affected." T Grade_Difference.multiply}
 addUserKnob {41 which_1 l "threshold mix" T Threshold_Mix.which}
 addUserKnob {41 disable_1 l disable -STARTLINE T Threshold_Mix.disable}
 addUserKnob {26 ""}
 addUserKnob {6 use_blur l "use blur for alpha/replace" +STARTLINE}
 use_blur true
 addUserKnob {41 size_1 l size T Blur1.size}
 addUserKnob {41 filter T Blur1.filter}
 addUserKnob {26 ""}
 addUserKnob {6 use_median l "use median for alpha/replace" +STARTLINE}
addUserKnob {41 size t "radius of the default median operation" T Median1.size}
 addUserKnob {26 ""}
 addUserKnob {41 which l Mix t "Mixback with original." T Dissolve1.which}
}
 Input {
  inputs 0
  name Input_diff
  xpos 231
  ypos 327
  number 1
 }
 Dot {
  name Dot13
  xpos 265
  ypos 535
 }
 Input {
  inputs 0
  name Input_Src
  xpos 179
  ypos 271
 }
 Dot {
  name Dot11
  xpos 213
  ypos 393
 }
set N227d1960 [stack 0]
 Dot {
  name Dot4
  xpos 391
  ypos 393
 }
set N227d43e0 [stack 0]
 Median {
  size 1
  maskChannelMask -rgba.alpha
  maskChannelInput -rgba.alpha
  name Median1
  xpos 357
  ypos 436
  disable {{!parent.use_median i}}
 }
 Blur {
  channels rgb
  size 2.5
  filter box
  name Blur1
  xpos 357
  ypos 486
  disable {{!parent.use_blur i}}
 }
 Switch {
  inputs 2
  which {{parent.useDiffInput i}}
  name Switch_mod_src1
  xpos 357
  ypos 532
 }
set N227e7250 [stack 0]
 Grade {
gamma {{parent.GradeBlackWeighting1.gamma.main i} {parent.GradeBlackWeighting1.gamma.main i} {parent.GradeBlackWeighting1.gamma.main i} {parent.GradeBlackWeighting1.gamma.main i}}
  name GradeBlackWeighting2
  xpos 492
  ypos 532
 }
push $N227d43e0
 Dot {
  name Dot3
  xpos 630
  ypos 393
 }
 Grade {
  gamma 1.5
  name GradeBlackWeighting1
  xpos 596
  ypos 526
 }
 Merge2 {
  inputs 2
  operation difference
  Achannels rgb
  Bchannels rgb
  output rgb
  name Merge1
  xpos 547
  ypos 591
 }
 Grade {
  channels {rgba.red rgba.green rgba.blue -rgba.alpha}
  multiply 15
  name Grade_Difference
  xpos 547
  ypos 655
 }
set N22709cf0 [stack 0]
 Expression {
  expr0 "r > 0.5 ? 1 : 0"
  expr1 "g > 0.5 ? 1 : 0"
  expr2 "b > 0.5 ? 1 : 0"
  name Threshold_RGB
  xpos 547
  ypos 695
 }
push $N22709cf0
 Clamp {
  channels rgb
  name Clamp1
  xpos 448
  ypos 694
 }
 Dissolve {
  inputs 2
  channels rgb
  which 1
  name Threshold_Mix
  xpos 547
  ypos 741
 }
 Dot {
  name Dot6
  xpos 581
  ypos 786
 }
set N22725a60 [stack 0]
 Dot {
  name Dot8
  xpos 581
  ypos 868
 }
set N22728450 [stack 0]
 Dot {
  name Dot7
  xpos 581
  ypos 938
 }
set N2272af40 [stack 0]
 Dot {
  name Dot1
  xpos 581
  ypos 1000
 }
push $N2272af40
 Input {
  inputs 0
  name Input_corr
  xpos 285
  ypos 268
  number 2
 }
 Dot {
  name Dot12
  xpos 319
  ypos 639
 }
push $N227e7250
 Switch {
  inputs 2
  which {{parent.useCorrInput i x904 0}}
  name Switch_mod_src
  xpos 357
  ypos 636
 }
 Dot {
  name Dot10
  xpos 391
  ypos 720
 }
set N22739650 [stack 0]
 Dot {
  name Dot5
  xpos 391
  ypos 815
 }
set N2273c1a0 [stack 0]
 Dot {
  name Dot9
  xpos 391
  ypos 897
 }
push $N22728450
push $N2273c1a0
push $N22725a60
push $N22739650
push $N227d1960
 Keymix {
  inputs 3
  channels {rgba.red -rgba.green -rgba.blue}
  maskChannel rgba.red
  name KeymixRed1
  xpos 179
  ypos 778
 }
 Keymix {
  inputs 3
  channels {-rgba.red rgba.green -rgba.blue}
  maskChannel rgba.green
  name KeymixGreen1
  xpos 179
  ypos 860
 }
 Keymix {
  inputs 3
  channels {-rgba.red -rgba.green rgba.blue}
  maskChannel rgba.blue
  name KeymixBlue1
  xpos 179
  ypos 930
 }
 Switch {
  inputs 2
  which {{PixelMap i}}
  name View_Matte
  xpos 179
  ypos 997
  addUserKnob {20 User}
  addUserKnob {6 PixelMap +STARTLINE}
 }
push $N227d1960
 Dot {
  name Dot2
  xpos 134
  ypos 393
 }
 Dissolve {
  inputs 2
  which 1
  name Dissolve1
  xpos 100
  ypos 1073
 }
 Output {
  name Output1
  xpos 100
  ypos 1143
 }
end_group






On 5/25/11 at 12:40 AM, [email protected] (Johan Boije) wrote:

Thank you for the tip. Still can't understand the speed difference though.

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to