-
Notifications
You must be signed in to change notification settings - Fork 1
/
ZCAMishDRT_v006.nk
7071 lines (7071 loc) · 370 KB
/
ZCAMishDRT_v006.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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
set cut_paste_input [stack 0]
version 13.0 v3
push $cut_paste_input
Group {
name ZCAMishDRT
tile_color 0x770567ff
gl_color 0x6d055eff
label "v0.6\nBounds: \[value gamutBounds]"
note_font "Verdana Italic"
selected true
xpos 1076
ypos 2031
addUserKnob {20 User}
addUserKnob {26 In}
addUserKnob {41 gamut l "in gamut" T InGamut_to_XYZ.gamut}
addUserKnob {26 ""}
addUserKnob {41 inverseData1 l "Inverse Data 1" +INVISIBLE T ZCAM11.inverseData1}
addUserKnob {4 gamutBounds l "Gamut Bounds" M {"Rec709/sRGB - 100nits" "P3 D65 - 100nits" "P3 D65 - 1000nits"}}
addUserKnob {7 edgeThreshold l "Edge Threshold"}
edgeThreshold 0.95
addUserKnob {7 headThreshold l "Head Threshold"}
headThreshold 0.7
addUserKnob {26 ""}
addUserKnob {26 Out}
addUserKnob {41 colorspace_out l out T Colorspace25.colorspace_out}
addUserKnob {41 illuminant_out l "" -STARTLINE T Colorspace25.illuminant_out}
addUserKnob {41 primary_out l "" -STARTLINE T Colorspace25.primary_out}
addUserKnob {26 ""}
addUserKnob {2 gamutBoundsLocation}
gamutBoundsLocation /Users/afry/GitHub/nukeZCAM/images/gamutBounds/
addUserKnob {26 "" +STARTLINE}
addUserKnob {26 version l "" +STARTLINE T "Alpha v0.6"}
}
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0x71c67100
label "HDR curve"
note_font_size 20
xpos 1677
ypos -224
bdheight 132
}
BackdropNode {
inputs 0
name BackdropNode2
tile_color 0x71c67100
label "SDR curve"
note_font_size 20
xpos 1492
ypos -225
bdheight 132
}
Read {
inputs 0
file_type exr
file "\[value parent.gamutBoundsLocation]JMh_P3_1000nits_gamutBound_tempImg.exr"
format "1024 1024 0 0 1024 1024 1 square_1K"
origset true
version 5147
name Read95
xpos 468
ypos 147
}
Colorspace {
primary_in DCI-P3
colorspace_out CIE-XYZ
name Colorspace5
xpos 468
ypos 227
}
Multiply {
value 1000
name Multiply8
label "Mult by 1000 to put in absolute nits"
xpos 468
ypos 251
}
Read {
inputs 0
file_type exr
file "\[value parent.gamutBoundsLocation]JMh_P3_100nits_Gamma1_gamutHeadBound_tempImg.exr"
origset true
version 13346
name Read141
xpos 372
ypos 146
}
Colorspace {
colorspace_out CIE-XYZ
name Colorspace1
xpos 372
ypos 226
}
Multiply {
value 100
name Multiply3
label "Mult by 100 to put in absolute nits"
xpos 372
ypos 250
}
Read {
inputs 0
file_type exr
file "\[value parent.gamutBoundsLocation]JMh_sRGB_100nits_Gamma1_gamutHeadBound_tempImg.exr"
origset true
version 11299
name Read1
xpos 283
ypos 144
}
Colorspace {
colorspace_out CIE-XYZ
name Colorspace4
xpos 283
ypos 224
}
Multiply {
value 100
name Multiply7
label "Mult by 100 to put in absolute nits"
xpos 283
ypos 248
}
Switch {
inputs 3
which {{parent.gamutBounds}}
name boundsSwitch3
xpos 435
ypos 312
}
Group {
name ZCAM2
label "\[value direction]\n\[if \{\[value direction] ==\"inverse\"\} \{return \[value inverseData0]\} \{return \"\"\}] - \[if \{\[value direction] ==\"inverse\"\} \{return \[value inverseData1]\} \{return \"\"\}]\n0.0.2"
xpos 435
ypos 352
addUserKnob {20 ZCAM}
addUserKnob {4 direction M {forward inverse}}
addUserKnob {26 ""}
addUserKnob {26 inverseModes l "Inverse Input Data Modes"}
addUserKnob {4 inverseData0 l "Inverse Data 0" M {J Q}}
addUserKnob {4 inverseData1 l "Inverse Data 1" M {aM,bM aC,bC aS,bS M,h C,h}}
inverseData1 M,h
addUserKnob {26 ""}
addUserKnob {26 _1 l _SURROUND_PARAMETERS}
addUserKnob {41 surrounds T Constants.surrounds}
addUserKnob {41 c T Constants.c}
addUserKnob {41 Nc T Constants.Nc}
addUserKnob {41 F T Constants.F}
addUserKnob {41 FLL T Constants.FLL}
addUserKnob {26 _2 l _DEFAULT_CONDITIONS}
addUserKnob {41 La T Constants.La}
addUserKnob {41 Yb T Constants.Yb}
addUserKnob {41 surround T Constants.surround}
addUserKnob {41 D T Constants.D}
addUserKnob {41 Dtype T Constants.Dtype}
addUserKnob {26 ""}
addUserKnob {41 xyzw_d65 T Constants.xyzw_d65}
addUserKnob {41 xyzw T Constants.xyzw}
addUserKnob {26 ""}
addUserKnob {41 Yw T Constants.Yw}
addUserKnob {41 FL T Constants.FL}
addUserKnob {41 n T Constants.n}
addUserKnob {41 Fb T Constants.Fb}
addUserKnob {41 Fs T Constants.Fs}
addUserKnob {26 ""}
addUserKnob {41 xyzwc T Constants.xyzwc}
addUserKnob {41 iabzw T Constants.iabzw}
addUserKnob {41 Qw T Constants.Qw}
}
BackdropNode {
inputs 0
name BackdropNode1
tile_color 0x71c67100
label xyz_to_jabz
note_font_size 42
xpos -1063
ypos -50
bdwidth 255
bdheight 678
}
BackdropNode {
inputs 0
name BackdropNode2
tile_color 0x388e8e00
label Forward
note_font_size 42
xpos -1278
ypos 673
bdwidth 1634
bdheight 582
}
BackdropNode {
inputs 0
name BackdropNode3
tile_color 0x388e8e00
label Inverse
note_font_size 42
xpos -2310
ypos 2374
bdwidth 1715
bdheight 953
}
BackdropNode {
inputs 0
name BackdropNode4
tile_color 0x388e8e00
label "jabz to xyz"
note_font_size 42
xpos -2260
ypos 3390
bdwidth 300
bdheight 667
}
BackdropNode {
inputs 0
name BackdropNode5
label "h,H,Q,J,M,C,Sz,Vz,Kz,Wz\n\n :outin:\n | 'J,aM,bM', optional\n | String with requested output (e.g. \"J,aM,bM,M,h\") \[Forward mode]\n | - attributes: 'J': lightness,'Q': brightness,\n | 'M': colorfulness,'C': chroma, 's': saturation,\n | 'h': hue angle, 'H': hue quadrature/composition,\n | 'Wz': whiteness, 'Kz':blackness, 'Sz': saturation, 'V': vividness\n | String with inputs in data \[inverse mode]. \n | Input must have data.shape\[-1]==3 and last dim of data must have \n | the following structure for inverse mode: \n | * data\[...,0] = J or Q,\n | * data\[...,1:] = (aM,bM) or (aC,bC) or (aS,bS) or (M,h) or (C, h), ..."
xpos -1922
ypos 791
bdwidth 411
bdheight 201
}
Input {
inputs 0
name Input1
xpos -984
ypos -137
}
Dot {
name Dot4
label xyzc
xpos -950
ypos -97
}
Dot {
name Dot5
xpos -950
ypos -21
}
set Na3684800 [stack 0]
ColorMatrix {
matrix {
{{b} 0 {1-b}}
{{1-g} {g} 0}
{0 0 1}
}
name M_to_xyzp
label " # Setup X,Y,Z to X',Y',Z' transform as matrix:\n b = 1.15 \n g = 0.66\n\n M_to_xyzp = np.array(\[\[b, 0, 1 - b],\[1 - g, g, 0],\[0, 0, 1]])"
xpos -984
ypos 30
addUserKnob {20 User}
addUserKnob {7 b}
b 1.15
addUserKnob {7 g}
g 0.66
}
ColorMatrix {
matrix {
{0.41478972 0.579999 0.014648}
{-0.20151 1.120649 0.0531008}
{-0.0166008 0.2648 0.6684799}
}
name _M_XYZP_TO_LMS
label "# Define X',Y',Z' to L,M,S conversion matrix:"
xpos -984
ypos 102
}
Dot {
name Dot1
label LMS
xpos -950
ypos 154
}
Expression {
expr0 "((c1 + c2*(r/10000)**n)/(1 + c3*(r/10000)**n))**p"
expr1 "((c1 + c2*(g/10000)**n)/(1 + c3*(g/10000)**n))**p"
expr2 "((c1 + c2*(b/10000)**n)/(1 + c3*(b/10000)**n))**p"
name Expression1
label "# response compression: lms to lms'"
xpos -984
ypos 199
addUserKnob {20 _PQ_PARAMETERS}
addUserKnob {7 c1}
c1 {{3424/2**12}}
addUserKnob {7 c2}
c2 {{2413/2**7}}
addUserKnob {7 c3}
c3 {{2392/2**7}}
addUserKnob {7 n}
n {{2610/2**14}}
addUserKnob {7 p}
p {{1.7*2523/2**5}}
}
Dot {
name Dot2
label lmsp
xpos -950
ypos 260
}
set Nebbcf000 [stack 0]
ColorMatrix {
matrix {
{0 1 0}
{3.524 -4.066708 0.542708}
{0.199076 1.096799 -1.295875}
}
name _M_LMSP_TO_IAB_ZCAM
xpos -912
ypos 329
}
Add {
value -3.703522621e-11
name Add1
label "Iabz\[...,0]-=epsilon # correct to ensure zero output"
xpos -912
ypos 353
}
Dot {
name Dot6
label Iabz
xpos -878
ypos 411
}
push $Nebbcf000
ColorMatrix {
matrix {
{0.5 0.5 0}
{3.524 -4.066708 0.542708}
{0.199076 1.096799 -1.295875}
}
name _M_LMSP_TO_IAB_JABZ
xpos -1053
ypos 328
}
Dot {
name Dot7
label Iabz
xpos -1019
ypos 410
}
Switch {
inputs 2
which 1
name use_zcam_parameters
xpos -978
ypos 441
}
set Na4adeb00 [stack 0]
Expression {
expr0 "((1-0.56)*r/(1-0.56*r)) - 1.6295499532821566e-11"
name Expression2
label " if ztype == 'jabz':\n Iabz\[...,0] = ((1-0.56)*Iabz\[...,0]/(1-0.56*Iabz\[...,0])) - 1.6295499532821566e-11\n print(\"Iabz post jabz: \", Iabz)"
xpos -886
ypos 492
}
push $Na4adeb00
Switch {
inputs 2
name use_zcam_parameters1
label "# convert Iabz' to Jabz coordinates:\n if ztype == 'jabz':"
xpos -978
ypos 564
}
Dot {
name Dot3
label iabz
xpos -944
ypos 753
}
set Nebbcd400 [stack 0]
Expression {
temp_name0 r2d
temp_expr0 180.0/pi
temp_name1 h360
temp_expr1 "360.0\n"
temp_name2 h
temp_expr2 atan2(b,g)*r2d
channel0 rgba
expr0 h
name h
xpos -1074
ypos 904
}
set Nebbcd000 [stack 0]
Expression {
temp_name0 h
temp_expr0 r
channel0 rgba
expr0 "1.015 + cos((h + 89.038)*pi/180)"
name ez
xpos -1074
ypos 928
}
push $Nebbcd400
Copy {
inputs 2
from0 rgba.red
to0 rgba.red
name Copy1
xpos -894
ypos 989
}
Expression {
channel0 rgba
expr0 "100*((g**2.0 + b**2.0)**0.37)*(r**0.068)*(Constants.FL**0.2) / ((Constants.iabzw.r**0.78) * (Constants.Fb**0.1))"
name M_colorfulness
label "# calculate colorfulness, M:"
xpos -894
ypos 1021
}
set Nebbcc400 [stack 0]
Expression {
channel0 rgba
expr0 100*r/Constants.Qw
name C
label "# calculate chroma, C:"
xpos -894
ypos 1118
}
set N99a17c00 [stack 0]
push $Nebbcd400
Expression {
channel0 rgba
expr0 "2700 * (r**(1.6*Constants.Fs/(Constants.Fb**0.12))) * (Constants.Fs**2.2) * (Constants.Fb**0.5) * (Constants.FL**0.2)"
name Q
label "# calculate brightness, Q:"
xpos -1030
ypos 1019
}
set N99a17800 [stack 0]
Expression {
channel0 rgba
expr0 "100.0 * (r/Constants.Qw)"
name J
label "# calculate lightness, J:"
xpos -1030
ypos 1117
}
set N99a17400 [stack 0]
Copy {
inputs 2
from0 rgba.green
to0 rgba.green
name Copy3
xpos -1030
ypos 1155
}
set N99a17000 [stack 0]
Expression {
channel0 rgba
expr0 "100 - ((100-r)**2 + g**2)**0.5"
name Wz
label "# calculate whiteness, W:"
xpos -1030
ypos 1195
}
set N99a16c00 [stack 0]
add_layer {zcam zcam.J zcam.Q zcam.M zcam.C}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam
fromInput2 {{0} B}
mappings "4 black -1 -1 zcam.J 0 0 black -1 -1 zcam.Q 0 1 black -1 -1 zcam.M 0 2 black -1 -1 zcam.C 0 3"
name Shuffle2
xpos -1202
ypos 1199
}
push $Nebbcd000
Dot {
name Dot9
label h
note_font_size 20
note_font_color 0x677754ff
xpos -1975
ypos 2339
}
push $Nebbcd400
Shuffle2 {
fromInput1 {{0} B}
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 rgba.red 0 0 rgba.red 0 0 rgba.green 0 1 rgba.red 0 0 rgba.blue 0 2 rgba.red 0 0 rgba.alpha 0 3"
name Iz
xpos -1127
ypos 835
}
push $Nebbcd400
Shuffle2 {
fromInput1 {{0} B}
fromInput2 {{0} B}
mappings "4 rgba.green 0 1 rgba.red 0 0 rgba.green 0 1 rgba.green 0 1 rgba.green 0 1 rgba.blue 0 2 rgba.green 0 1 rgba.alpha 0 3"
name az
xpos -978
ypos 837
}
push $Nebbcd400
Shuffle2 {
fromInput1 {{0} B}
fromInput2 {{0} B}
mappings "4 rgba.blue 0 2 rgba.blue 0 2 rgba.blue 0 2 rgba.red 0 0 rgba.blue 0 2 rgba.green 0 1 rgba.blue 0 2 rgba.alpha 0 3"
name bz
xpos -825
ypos 835
}
NoOp {
inputs 0
name Constants
xpos -527
ypos 180
addUserKnob {20 User}
addUserKnob {26 _1 l _SURROUND_PARAMETERS}
addUserKnob {4 surrounds M {average dim dark}}
addUserKnob {7 c}
c {{curve(surrounds) 0.69 0.59 0.525}}
addUserKnob {7 Nc}
Nc {{curve(surrounds) 1 0.9 0.8}}
addUserKnob {7 F}
F {{curve(surrounds) 1 0.9 0.8}}
addUserKnob {7 FLL}
FLL {{curve(surrounds) 1 1 1}}
addUserKnob {26 _2 l _DEFAULT_CONDITIONS}
addUserKnob {7 La}
La 100
addUserKnob {7 Yb}
Yb 20
addUserKnob {4 surround M {avg dim dark}}
addUserKnob {7 D}
D 1
addUserKnob {7 Dtype}
addUserKnob {26 ""}
addUserKnob {18 xyzw_d65}
xyzw_d65 {95.043 100 108.89}
addUserKnob {6 xyzw_d65_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {18 xyzw}
xyzw {{xyzw_d65.r} {xyzw_d65.g} {xyzw_d65.b}}
addUserKnob {6 xyzw_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {26 ""}
addUserKnob {7 Yw}
Yw 100
addUserKnob {7 FL}
FL {{"0.171 * La**(1/3) * (1 - exp(-48/9*La))"}}
addUserKnob {7 n}
n {{Yb/Yw}}
addUserKnob {7 Fb}
Fb {{n**0.5}}
addUserKnob {7 Fs}
Fs {{c}}
addUserKnob {26 ""}
addUserKnob {18 xyzwc}
xyzwc {95.043 100 108.89}
addUserKnob {6 xyzwc_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {18 iabzw}
iabzw {0.31331 -0.00014318 -8.9369e-05}
addUserKnob {6 iabzw_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
addUserKnob {7 Qw}
Qw 185.85
}
push $Na3684800
push $Nebbcd000
push $Nebbcc400
Copy {
inputs 2
from0 rgba.green
to0 rgba.green
name Copy5
xpos 67
ypos 1136
}
set N99a15000 [stack 0]
Expression {
channel0 rgba
expr0 r*sin(g*pi/180.0)
name bM
xpos 163
ypos 1202
}
add_layer {zcam_bM zcam_bM.red zcam_bM.green zcam_bM.blue zcam_bM.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_bM
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_bM.red 0 0 rgba.green 0 1 zcam_bM.green 0 1 rgba.blue 0 2 zcam_bM.blue 0 2 rgba.alpha 0 3 zcam_bM.alpha 0 3"
name Shuffle11
xpos -752
ypos 1400
}
push $N99a15000
Expression {
channel0 rgba
expr0 r*cos(g*pi/180.0)
name aM
xpos 67
ypos 1203
}
add_layer {zcam_aM zcam_aM.red zcam_aM.green zcam_aM.blue zcam_aM.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_aM
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_aM.red 0 0 rgba.green 0 1 zcam_aM.green 0 1 rgba.blue 0 2 zcam_aM.blue 0 2 rgba.alpha 0 3 zcam_aM.alpha 0 3"
name Shuffle10
xpos -848
ypos 1400
}
push $Nebbcd000
push $N99a17c00
Copy {
inputs 2
from0 rgba.green
to0 rgba.green
name Copy25
xpos -164
ypos 1149
}
set Nff08b800 [stack 0]
Expression {
channel0 rgba
expr0 r*sin(g*pi/180.0)
name bC
xpos -76
ypos 1207
}
add_layer {zcam_bC zcam_bC.red zcam_bC.green zcam_bC.blue zcam_bC.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_bC
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_bC.red 0 0 rgba.green 0 1 zcam_bC.green 0 1 rgba.blue 0 2 zcam_bC.blue 0 2 rgba.alpha 0 3 zcam_bC.alpha 0 3"
name Shuffle25
xpos -949
ypos 1399
}
push $Nff08b800
Expression {
channel0 rgba
expr0 r*cos(g*pi/180.0)
name aC
xpos -164
ypos 1207
}
add_layer {zcam_aC zcam_aC.red zcam_aC.green zcam_aC.blue zcam_aC.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_aC
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_aC.red 0 0 rgba.green 0 1 zcam_aC.green 0 1 rgba.blue 0 2 zcam_aC.blue 0 2 rgba.alpha 0 3 zcam_aC.alpha 0 3"
name Shuffle24
xpos -1048
ypos 1397
}
push $Nebbcd000
push $N99a17800
push $Nebbcc400
Copy {
inputs 2
from1 rgba.green
to1 rgba.green
name Copy2
xpos -734
ypos 1076
}
Expression {
channel0 rgba
expr0 "100.0* ((r/g)**0.5) * (Constants.FL)**0.6"
name s
label "# calculate saturation, s:"
xpos -734
ypos 1118
}
set Nff08a000 [stack 0]
Copy {
inputs 2
from0 rgba.green
to0 rgba.green
name Copy24
xpos -381
ypos 1143
}
set Nff089c00 [stack 0]
Expression {
channel0 rgba
expr0 r*sin(g*pi/180.0)
name bS
xpos -287
ypos 1207
}
add_layer {zcam_bS zcam_bS.red zcam_bS.green zcam_bS.blue zcam_bS.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_bS
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_bS.red 0 0 rgba.green 0 1 zcam_bS.green 0 1 rgba.blue 0 2 zcam_bS.blue 0 2 rgba.alpha 0 3 zcam_bS.alpha 0 3"
name Shuffle23
xpos -1150
ypos 1398
}
push $Nff089c00
Expression {
channel0 rgba
expr0 r*cos(g*pi/180.0)
name aS
xpos -381
ypos 1207
}
add_layer {zcam_aS zcam_aS.red zcam_aS.green zcam_aS.blue zcam_aS.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_aS
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_aS.red 0 0 rgba.green 0 1 zcam_aS.green 0 1 rgba.blue 0 2 zcam_aS.blue 0 2 rgba.alpha 0 3 zcam_aS.alpha 0 3"
name Shuffle22
xpos -1254
ypos 1395
}
push $N99a17000
Expression {
channel0 rgba
expr0 "((r - 58)**2 + 3.4*g**2)**0.5"
name Vz
label "# calculate vividness, V:"
xpos -583
ypos 1200
}
add_layer {zcam_Vz zcam_Vz.red zcam_Vz.green zcam_Vz.blue zcam_Vz.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_Vz
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_Vz.red 0 0 rgba.green 0 1 zcam_Vz.green 0 1 rgba.blue 0 2 zcam_Vz.blue 0 2 rgba.alpha 0 3 zcam_Vz.alpha 0 3"
name Shuffle9
xpos -1345
ypos 1396
}
push $Nff08a000
Expression {
channel0 rgba
name Sz
label "# calculate saturation, S:"
xpos -734
ypos 1196
}
add_layer {zcam_Sz zcam_Sz.red zcam_Sz.green zcam_Sz.blue zcam_Sz.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_Sz
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_Sz.red 0 0 rgba.green 0 1 zcam_Sz.green 0 1 rgba.blue 0 2 zcam_Sz.blue 0 2 rgba.alpha 0 3 zcam_Sz.alpha 0 3"
name Shuffle8
xpos -1436
ypos 1395
}
push $N99a17000
Expression {
channel0 rgba
expr0 "100 - 0.8*(r**2 + 8*g**2)**0.5"
name Kz
label "# calculate blackness, K:"
xpos -895
ypos 1195
}
add_layer {zcam_Kz zcam_Kz.red zcam_Kz.green zcam_Kz.blue zcam_Kz.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_Kz
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_Kz.red 0 0 rgba.green 0 1 zcam_Kz.green 0 1 rgba.blue 0 2 zcam_Kz.blue 0 2 rgba.alpha 0 3 zcam_Kz.alpha 0 3"
name Shuffle7
xpos -1524
ypos 1393
}
push $N99a16c00
add_layer {zcam_Wz zcam_Wz.red zcam_Wz.green zcam_Wz.blue zcam_Wz.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_Wz
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_Wz.red 0 0 rgba.green 0 1 zcam_Wz.green 0 1 rgba.blue 0 2 zcam_Wz.blue 0 2 rgba.alpha 0 3 zcam_Wz.alpha 0 3"
name Shuffle6
xpos -1613
ypos 1393
}
push $Nff08a000
add_layer {zcam_s zcam_s.red zcam_s.green zcam_s.blue zcam_s.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_s
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_s.red 0 0 rgba.green 0 1 zcam_s.green 0 1 rgba.blue 0 2 zcam_s.blue 0 2 rgba.alpha 0 3 zcam_s.alpha 0 3"
name Shuffle5
xpos -1708
ypos 1392
}
push $N99a17c00
add_layer {zcam_C zcam_C.red zcam_C.green zcam_C.blue zcam_C.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_C
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_C.red 0 0 rgba.green 0 1 zcam_C.green 0 1 rgba.blue 0 2 zcam_C.blue 0 2 rgba.alpha 0 3 zcam_C.alpha 0 3"
name Shuffle4
xpos -1798
ypos 1391
}
push $N99a17400
add_layer {zcam_J zcam_J.red zcam_J.green zcam_J.blue zcam_J.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_J
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_J.red 0 0 rgba.green 0 1 zcam_J.green 0 1 rgba.blue 0 2 zcam_J.blue 0 2 rgba.alpha 0 3 zcam_J.alpha 0 3"
name Shuffle1
xpos -1900
ypos 1390
}
push $Nebbcc400
add_layer {zcam_M zcam_M.red zcam_M.green zcam_M.blue zcam_M.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_M
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_M.red 0 0 rgba.green 0 1 zcam_M.green 0 1 rgba.blue 0 2 zcam_M.blue 0 2 rgba.alpha 0 3 zcam_M.alpha 0 3"
name Shuffle12
xpos -1999
ypos 1389
}
push $N99a17800
add_layer {zcam_Q zcam_Q.red zcam_Q.green zcam_Q.blue zcam_Q.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_Q
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_Q.red 0 0 rgba.green 0 1 zcam_Q.green 0 1 rgba.blue 0 2 zcam_Q.blue 0 2 rgba.alpha 0 3 zcam_Q.alpha 0 3"
name Shuffle3
xpos -2089
ypos 1391
}
push $Nebbcd000
add_layer {zcam_h zcam_h.red zcam_h.green zcam_h.blue zcam_h.alpha}
Shuffle2 {
fromInput1 {{0} B}
out1 zcam_h
fromInput2 {{0} B}
mappings "4 rgba.red 0 0 zcam_h.red 0 0 rgba.green 0 1 zcam_h.green 0 1 rgba.blue 0 2 zcam_h.blue 0 2 rgba.alpha 0 3 zcam_h.alpha 0 3"
name Shuffle13
xpos -2182
ypos 1392
}
push $Na3684800
Dot {
name Dot16
xpos -2265
ypos 1253
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_h
name Copy21
xpos -2299
ypos 1416
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_Q
name Copy22
xpos -2299
ypos 1458
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_M
name Copy20
xpos -2298
ypos 1505
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_J
name Copy11
xpos -2298
ypos 1547
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_C
name Copy12
xpos -2298
ypos 1589
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_s
name Copy13
xpos -2302
ypos 1631
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_Wz
name Copy14
xpos -2302
ypos 1673
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_Kz
name Copy15
xpos -2302
ypos 1715
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_Sz
name Copy16
xpos -2302
ypos 1757
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_Vz
name Copy17
xpos -2302
ypos 1799
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_aS
name Copy26
xpos -2302
ypos 1841
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_bS
name Copy27
xpos -2302
ypos 1883
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_aC
name Copy28
xpos -2302
ypos 1925
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_bC
name Copy29
xpos -2302
ypos 1963
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_aM
name Copy18
xpos -2302
ypos 2005
}
Copy {
inputs 2
from0 -rgba.alpha
to0 -rgba.alpha
channels zcam_bM
name Copy19
xpos -2302
ypos 2047
}
Switch {
inputs 2
which {{parent.direction}}