X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=hacks%2Fgamma_graphs.py;h=ad75ba908cf48f4a91db8784533546ceb7c7267a;hb=bd4c3ae31019b2c6217f269a7623f6c2279067c1;hp=166a0382858d2ccc58fd5a16df2aefd1c6e3a181;hpb=6ec7654b77b22d32cb1ca0dd35c8d66e16ca36d6;p=dcpomatic.git diff --git a/hacks/gamma_graphs.py b/hacks/gamma_graphs.py index 166a03828..ad75ba908 100644 --- a/hacks/gamma_graphs.py +++ b/hacks/gamma_graphs.py @@ -6,14 +6,24 @@ import numpy as np x = np.logspace(-3, 0, 100) plt.loglog(x, pow(x, 2.2)) -plt.loglog(x, pow(x, 2.4)) +# plt.loglog(x, pow(x, 2.4)) -linearised = [] +srgb_linearised = [] for xx in x: if xx > 0.04045: - linearised.append(pow((xx + 0.055) / 1.055, 2.4)) + srgb_linearised.append(pow((xx + 0.055) / 1.055, 2.4)) else: - linearised.append(xx / 12.92) + srgb_linearised.append(xx / 12.92) + +# plt.loglog(x, srgb_linearised) + +rec_linearised = [] +for xx in x: + if xx > 0.081: + rec_linearised.append(pow((xx + 0.099) / 1.099, 1 / 0.45)) + else: + rec_linearised.append(xx / 4.5) + +plt.loglog(x, rec_linearised) -plt.loglog(x, linearised) plt.show()