Skip to content

Instantly share code, notes, and snippets.

@dbr
Created July 12, 2013 05:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbr/5982209 to your computer and use it in GitHub Desktop.
Save dbr/5982209 to your computer and use it in GitHub Desktop.
Inverting linear images
#! Nuke7.0 -nx
version 7.0 v8
Root {
inputs 0
name /tmp/inverting_linearlight.nk
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
}
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0xaaaaaa00
label "Expose wedge"
note_font_size 25
xpos -28
ypos -624
bdwidth 178
bdheight 190
}
Constant {
inputs 0
channels rgb
color 0.18
format "512 512 0 0 512 512 1 square_512"
name greycard
xpos -1
ypos -563
postage_stamp false
}
Reformat {
type "to box"
box_width 96
filter Impulse
name Reformat2
xpos -1
ypos -535
}
Expression {
temp_name0 stop
temp_expr0 "pow(2, 0.125)"
temp_name1 step
temp_expr1 "((x/(width-1)*48) * 2) - 48"
expr0 "r * (stop ** (step))"
expr1 "g * (stop ** (step))"
expr2 "b * (stop ** (step))"
name ExposureWedge
xpos -1
ypos -509
postage_stamp true
}
Crop {
box {0 0 67.59999847 96}
reformat true
crop false
name Crop1
label "Crop out >1.0 values because of sRGB used in example"
xpos -1
ypos -398
}
Reformat {
type "to box"
box_width 512
box_height 512
box_fixed true
name Reformat3
xpos -1
ypos -360
}
Dot {
name Dot1
label "Perceptively linear ramp"
xpos 33
ypos -286
}
Dot {
name Dot2
xpos 33
ypos -253
}
set N5218700 [stack 0]
Expression {
temp_name0 scanline
temp_expr0 0
expr0 "abs(r(x, scanline) - (y/height)) < 1/height"
expr1 "abs(g(x, scanline) - (y/height)) < 1/height"
expr2 "abs(b(x, scanline) - (y/height)) < 1/height"
name Expression4
label "Plot of \"perceptively linear\" ramp"
xpos 207
ypos -263
}
push $N5218700
Invert {
name Invert4
xpos -1
ypos -196
}
set N5374e50 [stack 0]
Expression {
temp_name0 scanline
temp_expr0 0
expr0 "abs(r(x, scanline) - (y/height)) < 1/height"
expr1 "abs(g(x, scanline) - (y/height)) < 1/height"
expr2 "abs(b(x, scanline) - (y/height)) < 1/height"
name Expression3
label "Plot: mathematically inverted ramp\nLooks \"brighter\" and not a smooth expose ramp"
xpos 213
ypos -196
}
push $N5218700
Colorspace {
colorspace_out sRGB
name Colorspace3
xpos -110
ypos -221
}
Invert {
name Invert2
xpos -110
ypos -195
}
Colorspace {
colorspace_in sRGB
name Colorspace4
xpos -110
ypos -157
}
Dot {
name Dot3
xpos -76
ypos -115
}
set N7165870 [stack 0]
Expression {
temp_name0 scanline
temp_expr0 0
expr0 "abs(r(x, scanline) - (y/height)) < 1/height"
expr1 "abs(g(x, scanline) - (y/height)) < 1/height"
expr2 "abs(b(x, scanline) - (y/height)) < 1/height"
name Expression1
label "Plot: Inverted in a perceptively linear space\nLooks as expected"
xpos 205
ypos -125
}
push $N7165870
push $N5374e50
push $N5218700
Viewer {
inputs 3
frame 1
input_number 2
input_process false
name Viewer1
xpos -143
ypos 19
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment