Skip to content

Commit c5c8ebd

Browse files
committed
toru-ver4#209 under debugging
1 parent 224a8b6 commit c5c8ebd

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,3 @@ temporary/**/**
216216
*.spi3d
217217
*.cube
218218
2023/05_gamut_map_effect/lut
219-

2023/05_gamut_map_effect/colormap_sample.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ def debug_plot_oklab():
4545
print(rgb)
4646

4747

48+
def check_primary_secondary_hue_angle():
49+
pp = np.array(
50+
[[1, 0, 0], [0, 1, 0], [0, 0, 1],
51+
[1, 0, 1], [1, 1, 0], [0, 1, 1]])
52+
xyz = cs.rgb_to_large_xyz(pp, cs.BT709)
53+
oklab = cs.XYZ_to_Oklab(xyz)
54+
oklch = cs.oklab_to_oklch(oklab)
55+
print(oklch[..., 2])
56+
57+
4858
if __name__ == '__main__':
4959
os.chdir(os.path.dirname(os.path.abspath(__file__)))
50-
debug_plot_oklab()
60+
# debug_plot_oklab()
61+
check_primary_secondary_hue_angle()

2023/05_gamut_map_effect/create_oklab_gb_lut.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def debug_plot_cielab_ab_plane_with_interpolation(
9898
ll_num = l_num_intp
9999

100100
total_process_num = ll_num
101-
block_process_num = int(cpu_count() / 4 + 0.999)
101+
block_process_num = int(cpu_count() / 2 + 0.999)
102102
block_num = int(round(total_process_num / block_process_num + 0.5))
103103

104104
for b_idx in range(block_num):
@@ -172,7 +172,7 @@ def plot_ab_plane_with_interpolation_core(
172172
ax1.imshow(
173173
rgb_gm24, extent=(-ab_max, ab_max, -ab_max, ab_max), aspect='auto')
174174
ax1.plot(aa, bb, color='k')
175-
fname = "/work/overuse/2023/05_oog_color_map/oklab/"
175+
fname = "/work/overuse/2023/05_oog_color_map/oklab_ab_low/"
176176
fname += f"ab_w_lut_{color_space_name}_{l_idx:04d}.png"
177177
print(fname)
178178
pu.show_and_save(
@@ -246,7 +246,7 @@ def debug_plot_cielab_cl_plane_with_interpolation(
246246
lightness_num=lightness_sample, hue_num=hue_sample)
247247

248248
total_process_num = h_num_intp
249-
block_process_num = int(cpu_count() / 2 + 0.9)
249+
block_process_num = int(cpu_count() / 4 + 0.9)
250250
print(f"block_process_num {block_process_num}")
251251
block_num = int(round(total_process_num / block_process_num + 0.5))
252252

@@ -273,21 +273,21 @@ def debug_plot_cielab_cl_plane_with_interpolation(
273273
def plot_oklab(
274274
hue_sample, lightness_sample, color_space_name,
275275
l_num_intp, h_num_intp):
276-
debug_plot_cielab_ab_plane_with_interpolation(
277-
hue_sample=hue_sample, lightness_sample=lightness_sample,
278-
l_num_intp=l_num_intp, color_space_name=color_space_name)
279-
# debug_plot_cielab_cl_plane_with_interpolation(
276+
# debug_plot_cielab_ab_plane_with_interpolation(
280277
# hue_sample=hue_sample, lightness_sample=lightness_sample,
281-
# h_num_intp=h_num_intp, color_space_name=color_space_name)
278+
# l_num_intp=l_num_intp, color_space_name=color_space_name)
279+
debug_plot_cielab_cl_plane_with_interpolation(
280+
hue_sample=hue_sample, lightness_sample=lightness_sample,
281+
h_num_intp=h_num_intp, color_space_name=color_space_name)
282282

283283

284284
def create_oklab_luts_all():
285285
chroma_sample = 256
286286
hue_sample = 4096
287287
lightness_sample = 1024
288-
color_space_name_list = [cs.BT709, cs.P3_D65, cs.BT2020]
288+
# color_space_name_list = [cs.BT709, cs.P3_D65, cs.BT2020]
289289
# color_space_name_list = [cs.BT2020]
290-
# color_space_name_list = [cs.BT709, cs.P3_D65]
290+
color_space_name_list = [cs.BT709]
291291

292292
met = MeasureExecTime()
293293
met.start()
@@ -298,11 +298,11 @@ def create_oklab_luts_all():
298298
# color_space_name=color_space_name)
299299
plot_oklab(
300300
hue_sample=hue_sample, lightness_sample=lightness_sample,
301-
color_space_name=color_space_name, l_num_intp=1000, h_num_intp=360)
301+
color_space_name=color_space_name, l_num_intp=1000,
302+
h_num_intp=1000)
302303
met.end()
303304

304305

305306
if __name__ == '__main__':
306307
os.chdir(os.path.dirname(os.path.abspath(__file__)))
307-
# create_luts_all()
308308
create_oklab_luts_all()

0 commit comments

Comments
 (0)