-
Notifications
You must be signed in to change notification settings - Fork 26
/
n6HueShift.nk
422 lines (422 loc) · 7.84 KB
/
n6HueShift.nk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name N6HueShift
tile_color 0x53617700
addUserKnob {20 HueShift_tab l HueShift}
addUserKnob {26 about_label l " " T "<style> a:link \{ color: #ccc \}</style>\n<font color=#ccc>\n<b>Notorious Six HueShift</b> created by Jed Smith\n<br>v0.0.4 | <a href=https://github.com/jedypod/open-display-transform/tree/main/look-transforms>documentation</a><br>"}
addUserKnob {26 ""}
addUserKnob {7 sy l yellow R -1 1}
addUserKnob {7 sr l red R -1 1}
addUserKnob {7 sm l magenta R -1 1}
addUserKnob {7 sb l blue R -1 1}
addUserKnob {7 sc l cyan R -1 1}
addUserKnob {7 sg l green R -1 1}
addUserKnob {7 scu l custom R -1 1}
addUserKnob {7 cuh l "custom hue" t "hue angle center for custom hue extraction. 0 is green." R 0 360}
cuh 100
addUserKnob {7 cuw l "custom width" t "width for custom hue angle extraction"}
cuw 0.3
addUserKnob {26 ""}
addUserKnob {7 str l strength R 0.1 1}
str 0.33
addUserKnob {7 chl l "chroma limit"}
chl 0.33
addUserKnob {6 ze l "zone extract" t "effect a limited range of luminance." +STARTLINE}
addUserKnob {4 zr l "" -STARTLINE M {low high ""}}
zr 1
addUserKnob {7 zp l "zone range" t "set range affected: higher values affect a larger range" R -4 4}
addUserKnob {26 ""}
addUserKnob {41 maskChannelMask l mask -STARTLINE T NodeWrapper1.maskChannelMask}
addUserKnob {41 invert_mask l invert -STARTLINE T NodeWrapper1.invert_mask}
addUserKnob {41 mix T NodeWrapper1.mix}
}
Input {
inputs 0
name Inputmask
xpos -150
ypos 278
number 1
}
Input {
inputs 0
name Input
xpos -260
ypos -442
}
Dot {
name Dot104
xpos -226
ypos -366
}
set N6ff09600 [stack 0]
Dot {
name Dot1
xpos -336
ypos -366
}
set N6ff08f00 [stack 0]
Dot {
name Dot105
xpos -446
ypos -366
}
Expression {
channel0 rgba
expr0 max(r,g,b)
channel3 none
name Norm
xpos -480
ypos -346
}
Dot {
name Dot2
xpos -446
ypos -318
}
set Nbcffb900 [stack 0]
Dot {
name Dot106
xpos -446
ypos 162
}
set Nbcffb200 [stack 0]
push $N6ff08f00
Dot {
name Dot4
xpos -336
ypos 114
}
set Nbcffab00 [stack 0]
MergeExpression {
inputs 2
temp_name0 n
temp_expr0 max(1e-12,Ar)
temp_name1 to
temp_expr1 (n*n/(n+fl))
temp_name2 flow
temp_expr2 pow((to/(to+1))/n,p)
temp_name3 fhi
temp_expr3 1-pow((n/(n+1))/n,p)
channel0 {rgba.red -rgba.green -rgba.blue none}
expr0 r
expr1 g
expr2 b
expr3 zr?fhi:flow
name Extract2
xpos -370
ypos 206
addUserKnob {20 Params}
addUserKnob {7 fl R 0 0.02}
fl 0.004
addUserKnob {7 p R 0 64}
p {{pow(2,-zp)}}
}
push $Nbcffb200
push $Nbcffb900
push $N6ff09600
MergeExpression {
inputs 2
temp_name0 n
temp_expr0 Ar
expr0 n==0?0:r/n
expr1 n==0?0:g/n
expr2 n==0?0:b/n
name RGBRatios
xpos -260
ypos -322
}
Expression {
temp_name0 th
temp_expr0 -1
expr0 max(th,r)
expr1 max(th,g)
expr2 max(th,b)
name ClampMin
xpos -260
ypos -274
}
Dot {
name Dot7
xpos -226
ypos -222
}
set Nbcff8f00 [stack 0]
Dot {
name Dot9
xpos -116
ypos -222
}
set Nbcff8800 [stack 0]
Expression {
temp_name0 ch
temp_expr0 min(r,g,b)*(1-f)+f
temp_name1 c
temp_expr1 ch==0?0:min(1,1-min(r/ch,g/ch,b/ch))
temp_name2 cl
temp_expr2 chl<0.5?c*f0+c*(1-c)*(1-f0):c*pow(1-c,f0)
channel0 rgba
expr0 cl
name hch
xpos -150
ypos -178
addUserKnob {20 Params}
addUserKnob {7 f}
f {{str}}
addUserKnob {7 f0 R 0 10}
f0 {{chl<0.5?max(0,0.5-chl)*2:1/max(1e-3,((1-chl)*2))}}
}
set Nbcff8100 [stack 0]
push $Nbcff8800
Dot {
name Dot3
xpos 214
ypos -222
}
Expression {
temp_name0 M
temp_expr0 max(r,g,b)
temp_name1 C
temp_expr1 M-min(r,g,b)
channel0 rgba
expr0 (C==0?0:r==M?((g-b)/C+6)%6:g==M?(b-r)/C+2:b==M?(r-g)/C+4:0)
name hue
xpos 180
ypos -178
}
Dot {
name Dot8
xpos 214
ypos -102
}
set Nbc7deb00 [stack 0]
Dot {
name Dot5
xpos 214
ypos -30
}
set N7b7a8800 [stack 0]
Dot {
name Dot6
xpos 214
ypos 42
}
Expression {
temp_name0 h
temp_expr0 (r+o)%6
channel0 rgba
expr0 h<e1?clamp((h-e0)/(e1-e0)):clamp((h-e3)/(e2-e3))
name LinearWindow2
label Custom
xpos 70
ypos 32
addUserKnob {20 Param}
addUserKnob {7 o l offset R 0 6}
o {{cuh/60}}
addUserKnob {7 e0 R 0 4}
e0 {{2-cuw}}
addUserKnob {7 e1 R 0 4}
e1 2
addUserKnob {7 e2 R 0 4}
e2 2
addUserKnob {7 e3 R 0 4}
e3 {{2+cuw}}
}
MergeExpression {
inputs 2
temp_name0 f
temp_expr0 Ar
expr0 r*f
expr1 g*f
expr2 b*f
name Multiply2
xpos -150
ypos 38
}
push $Nbcff8100
push $N7b7a8800
Expression {
temp_name0 h0
temp_expr0 (r+o0)%6
temp_name1 h1
temp_expr1 (r+o1)%6
temp_name2 h2
temp_expr2 (r+o2)%6
expr0 clamp(h0>c0?(h0-c0-f0)/(c0-(c0+f0)):(h0-(c0-f0))/(c0-(c0-f0)))
expr1 clamp(h1>c1?(h1-c1-f1)/(c1-(c1+f1)):(h1-(c1-f1))/(c1-(c1-f1)))
expr2 clamp(h2>c2?(h2-c2-f2)/(c2-(c2+f2)):(h2-(c2-f2))/(c2-(c2-f2)))
channel3 none
name LinearWindow1
label CMY
xpos 70
ypos -40
addUserKnob {20 Param}
addUserKnob {7 o0 R 0 6}
o0 5
addUserKnob {7 o1 R 0 6}
o1 3
addUserKnob {7 o2 R 0 6}
o2 1
addUserKnob {26 ""}
addUserKnob {7 c0 R 1 3}
c0 2
addUserKnob {7 f0 R 0.2 1.2}
f0 1
addUserKnob {7 c1 R 1 3}
c1 2
addUserKnob {7 f1 R 0.2 1.2}
f1 1
addUserKnob {7 c2 R 1 3}
c2 2
addUserKnob {7 f2 R 0.2 1.2}
f2 1
}
MergeExpression {
inputs 2
temp_name0 f
temp_expr0 Ar
expr0 r*f
expr1 g*f
expr2 b*f
name Multiply1
xpos -150
ypos -34
}
push $Nbcff8100
push $Nbc7deb00
Expression {
temp_name0 h0
temp_expr0 (r+o0)%6
temp_name1 h1
temp_expr1 (r+o1)%6
temp_name2 h2
temp_expr2 (r+o2)%6
expr0 clamp(h0>c0?(h0-c0-f0)/(c0-(c0+f0)):(h0-(c0-f0))/(c0-(c0-f0)))
expr1 clamp(h1>c1?(h1-c1-f1)/(c1-(c1+f1)):(h1-(c1-f1))/(c1-(c1-f1)))
expr2 clamp(h2>c2?(h2-c2-f2)/(c2-(c2+f2)):(h2-(c2-f2))/(c2-(c2-f2)))
channel3 none
name LinearWindow
label RGB
xpos 70
ypos -112
addUserKnob {20 Param}
addUserKnob {7 o0 R 0 6}
o0 2
addUserKnob {7 o1 R 0 6}
o1 6
addUserKnob {7 o2 R 0 6}
o2 4
addUserKnob {26 ""}
addUserKnob {7 c0 R 1 3}
c0 2
addUserKnob {7 f0 R 0.2 1.2}
f0 1
addUserKnob {7 c1 R 1 3}
c1 2
addUserKnob {7 f1 R 0.2 1.2}
f1 1
addUserKnob {7 c2 R 1 3}
c2 2
addUserKnob {7 f2 R 0.2 1.2}
f2 1
}
MergeExpression {
inputs 2
temp_name0 f
temp_expr0 Ar
expr0 r*f
expr1 g*f
expr2 b*f
name Multiply
xpos -150
ypos -106
}
push $Nbcff8f00
MergeExpression {
inputs 2
expr0 r+Ab*s2-Ag*s1
expr1 g+Ar*s0-Ab*s2
expr2 b+Ag*s1-Ar*s0
name Shift_RGB
xpos -260
ypos -106
addUserKnob {20 Params}
addUserKnob {7 s0 R -1 1}
s0 {{sr}}
addUserKnob {7 s1 R -1 1}
s1 {{sg}}
addUserKnob {7 s2 R -1 1}
s2 {{sb}}
}
MergeExpression {
inputs 2
expr0 r+Ab*s2-Ag*s1
expr1 g+Ar*s0-Ab*s2
expr2 b+Ag*s1-Ar*s0
name Shift_CMY
xpos -260
ypos -34
addUserKnob {20 Params}
addUserKnob {7 s0 R -1 1}
s0 {{sc}}
addUserKnob {7 s1 R -1 1}
s1 {{sm}}
addUserKnob {7 s2 R -1 1}
s2 {{sy}}
}
MergeExpression {
inputs 2
expr0 r+Ar*(sc2-sc1)
expr1 g+Ar*(sc0-sc2)
expr2 b+Ar*(sc1-sc0)
name Shift_Custom
xpos -260
ypos 38
addUserKnob {20 Params}
addUserKnob {7 h R 0 6}
h {{(cuh%360)/60}}
addUserKnob {7 s R -1 1}
s {{scu*cuw}}
addUserKnob {7 sc0 R -1 1}
sc0 {{h<3?s-s*min(1,fabs(h-2)):s*min(1,fabs(h-5))-s}}
addUserKnob {7 sc1 R -1 1}
sc1 {{h<1?s-s*min(1,fabs(h)):h<5?s*min(1,fabs(h-3))-s:s-s*min(1,fabs(h-6))}}
addUserKnob {7 sc2 R -1 1}
sc2 {{h<2?s*min(1,fabs(h-1))-s:s-s*min(1,fabs(h-4))}}
}
MergeExpression {
inputs 2
temp_name0 n
temp_expr0 Ar
expr0 n*r
expr1 n*g
expr2 n*b
name Recombine
xpos -260
ypos 158
}
MergeExpression {
inputs 2
temp_name0 f
temp_expr0 ze?Aa:1
expr0 Ar*(1-f)+Br*f
expr1 Ag*(1-f)+Bg*f
expr2 Ab*(1-f)+Bb*f
name Mix
xpos -260
ypos 206
}
push $Nbcffab00
NodeWrapper {
inputs 2+1
channels rgb
name NodeWrapper1
xpos -260
ypos 278
}
Output {
name Output
xpos -260
ypos 350
}
end_group