-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathNayatani_HK.nk
283 lines (283 loc) · 7.21 KB
/
Nayatani_HK.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
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name Nayatani_HK
addUserKnob {20 Nayatani_HK_tab l "Nayatani HK"}
addUserKnob {41 gamut l "input gamut" T InGamut_to_XYZ.gamut}
addUserKnob {41 illum T Nayatani1997_.illum}
addUserKnob {41 meth l method T Nayatani1997_.meth}
addUserKnob {41 La T Nayatani1997_.La}
addUserKnob {6 invert +STARTLINE}
}
StickyNote {
inputs 0
name StickyNote1
tile_color 0x272727ff
label "<left><pre>\n<b>References</b>\nSimple estimation methods for the Helmholtz—Kohlrausch effect\nYoshinobu Nayatani\nhttps://doi.org/10.1002/(SICI)1520-6378(199712)22:6<385::AID-COL6>3.0.CO;2-R\n\nClarification of differences between variable achromatic color and variable chromatic color methods in the Helmholtz–Kohlrausch effect\nYoshinobu Nayatani, Hideki Sakai\nhttps://doi.org/10.1002/col.20194\n\nPrediction of the Helmholtz-Kohlrausch effect using the CIELUV formula\nYoshinobu Nayatani, Motohiro Nakajima\nhttps://doi.org/10.1002/(SICI)1520-6378(199608)21:4<252::AID-COL1>3.0.CO;2-P"
note_font_size 14
note_font_color 0xa8a8a8ff
xpos 115
ypos -119
}
Input {
inputs 0
name Input
xpos -40
ypos -154
}
Dot {
name Dot1
xpos -6
ypos -78
}
set N9a8c2b00 [stack 0]
Group {
name InGamut_to_XYZ
tile_color 0x429940ff
xpos -150
ypos -82
addUserKnob {20 InputGamut_to_XYZ_tab l InputGamut_to_XYZ}
addUserKnob {4 gamut l "input gamut" M {ACES ACEScg P3D65 Rec.2020 Rec.709 "Alexa WideGamut" "Red WideGamutRGB" "Sony SGamut3" "Filmlight E-Gamut" "DaVinci Wide Gamut" "" ""}}
gamut ACEScg
addUserKnob {41 matrix T ColorMatrix.matrix}
addUserKnob {41 invert -STARTLINE T ColorMatrix.invert}
}
Input {
inputs 0
name Input
xpos 290
ypos -610
}
Dot {
name Dot1
xpos 324
ypos -546
}
set N9a8c1600 [stack 0]
ColorMatrix {
matrix {
{{"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"}}
{{"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"}}
{{"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"} {"SwitchGamut.input\[value SwitchGamut.which].matrix"}}
}
name ColorMatrix
xpos 290
ypos -370
}
Output {
name Output
xpos 290
ypos -250
}
push $N9a8c1600
Dot {
name Dot391
label " *RGB to XYZ D65 CAT: XYZ Scaling"
xpos 434
ypos -546
}
set N9a8c0100 [stack 0]
ColorMatrix {
matrix {
{0.7006223202 0.1487748027 0.101058729}
{0.2741184831 0.8736317754 -0.1477504224}
{-0.09896290302 -0.1378953159 1.325916052}
}
name ColorMatrix30
label "DaVinci WG to XYZ D65"
xpos 1390
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.705396831 0.1640413404 0.08101775497}
{0.2801307142 0.8202067018 -0.1003373787}
{-0.1037815139 -0.07290726155 1.265746593}
}
name ColorMatrix29
label "Filmlight E-Gamut to XYZ D65"
xpos 1280
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.5990839005 0.2489254922 0.1024464965}
{0.2150758207 0.8850684166 -0.1001443192}
{-0.03206584975 -0.02765838802 1.148782015}
}
name ColorMatrix31
label "SonySGamut3 to XYZ D65"
xpos 1170
ypos -465
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.735275209 0.06860940903 0.1465712786}
{0.2866940796 0.8429790735 -0.1296732426}
{-0.07968084514 -0.3473432064 1.516081929}
}
name ColorMatrix22
label "REDWideGamutRGB to XYZ D65"
xpos 1060
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.6380076408 0.2147038132 0.09774445742}
{0.2919537723 0.8238408566 -0.1157948226}
{0.002798279049 -0.06703422219 1.153293848}
}
name ColorMatrix21
label "Arri AlexaWideGamut to XYZ D65"
xpos 950
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.4123909175 0.3575843573 0.1804807931}
{0.2126390785 0.7151687145 0.07219231129}
{0.01933082566 0.1191947833 0.9505321383}
}
name ColorMatrix18
label "Rec709 to XYZ D65"
xpos 840
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.6369581223 0.1446169168 0.1688809693}
{0.2627002299 0.6779981256 0.05930171534}
{4.99410725e-17 0.02807269618 1.060985088}
}
name ColorMatrix17
label "Rec2020 to XYZ D65"
xpos 730
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.4865711331 0.2656677067 0.1982173175}
{0.2289746404 0.6917386055 0.07928691804}
{-3.972076965e-17 0.04511338845 1.043944478}
}
name ColorMatrix16
label "P3D65 to XYZ D65"
xpos 620
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.6609312296 0.1336961389 0.1558285803}
{0.2722287476 0.6740817428 0.05368950963}
{-0.006018006243 0.004383686464 1.090692043}
}
name ColorMatrix1
label "ACEScg to XYZ D65"
xpos 510
ypos -466
}
push $N9a8c0100
ColorMatrix {
matrix {
{0.9503623843 0 9.346324805e-05}
{0.3439664543 0.728166163 -0.07213254273}
{0 0 1.089057803}
}
name ColorMatrix2
label "ACES to XYZ D65"
xpos 400
ypos -466
}
Switch {
inputs 10
which {{gamut}}
name SwitchGamut
xpos 400
ypos -370
}
end_group
Expression {
temp_name0 f
temp_expr0 0
expr0 max(0,r+f)
expr1 max(0,g+f)
expr2 max(0,b+f)
name Clamp
xpos -150
ypos -57
}
Expression {
temp_name0 d
temp_expr0 (r+15*g+3*b)
temp_name1 L
temp_expr1 g>_e?116*pow(g,1/3)-16:g*_k
expr0 L/(n?100:1)
expr1 d==0?0:4*r/d
expr2 d==0?0:9*g/d
name XYZ_to_Luv
label "XYZ to L*u'v'"
xpos -150
ypos -15
addUserKnob {20 Params}
addUserKnob {7 _e}
_e {{216/24389}}
addUserKnob {7 _k}
_k {{24389/27}}
addUserKnob {6 n l normalize +STARTLINE}
n true
}
Expression {
temp_name0 h
temp_expr0 atan2(b-w_uv.1,g-w_uv.0)
temp_name1 th
temp_expr1 h<0?h+radians(360):h
temp_name2 q
temp_expr2 -0.01585-0.03017*cos(th)-0.04556*cos(2*th)-0.02667*cos(3*th)-0.00295*cos(4*th)+0.14592*sin(th)+0.05084*sin(2*th)-0.01900*sin(3*th)-0.00764*sin(4*th)
temp_name3 S_uv
temp_expr3 13*hypot(g-w_uv.0,b-w_uv.1)
channel0 {rgba.red rgba.green rgba.blue none}
expr0 1/(1+(m*q+0.0872*K_Br)*S_uv)
name Nayatani1997_
label "object colors"
xpos -150
ypos 33
addUserKnob {20 Params_tab l Params}
addUserKnob {4 illum M {D50 D55 D60 D65}}
illum D65
addUserKnob {78 w_xy n 2}
w_xy {{curve(illum) 0.3457 0.33243 0.321626 0.3127} {curve(illum) 0.3585 0.34744 0.337737 0.329}}
addUserKnob {78 w_uv n 2}
w_uv {{4*w_xy.0/(-2*w_xy.0+12*w_xy.1+3)} {9*w_xy.1/(-2*w_xy.0+12*w_xy.1+3)}}
addUserKnob {7 La t "adapting luminance" R 0 200}
La 63.61
addUserKnob {4 meth l method M {VAC VCC}}
meth VCC
addUserKnob {7 m R -4 4}
m {{meth?-0.134:-0.866}}
addUserKnob {7 K_Br R 0 10}
K_Br {{0.2717*(6.469+6.362*pow(La,0.4495))/(6.469+pow(La,0.4495))}}
}
push $N9a8c2b00
MergeExpression {
inputs 2
expr0 invert?Br/Ar:Ar*Br
expr1 invert?Bg/Ag:Ag*Bg
expr2 invert?Bb/Ab:Ab*Bb
name MergeExpression1
xpos -40
ypos 39
}
Output {
name Output
xpos -40
ypos 110
}
end_group