Calibrite PROFILER の UI は全体的に分かりやすかった一方で、唯一 Technology Type の選択だけ分かりづらかったので、ここだけ少し詳しく述べようと思う。
Technology Type は図5 の画面で選択する。左側のリストから適切な項目を選択する必要があるのだが、筆者は最初どの項目を選べば良いか分からなかった。
画面右側の説明を読むと「製造元のウェブサイトを見るか calibrite.com/display-typeを見て下さい」との記述があった。
製造元のウェブサイトを見ても特に記述がなかったため、筆者は calibrite.com/display-type にて確認を行った。
すると図6 に示すデータが出てきたため、今回は Technology Type に White LED を使って Calibration を行った。
When calibrating an LCD display, i1Profiler provides the option to optimize your measurement for different types of backlit technologies. (中略) In this case you will need to consult your display’s documentation for more information about your technology type.
LCDディスプレイを調整する際、i1Profilerは異なるタイプのバックライト技術に対する計測を最適化するオプションを提供します。(中略)この場合、technology type についての詳細情報を得るために、ディスプレイのドキュメントを参照する必要があります。(ChatGPT による日本語訳)
根拠としてはやや弱いが、EDRファイルは Display Pro HL の測定値を補正するために使用していると思われる。
なぜ補正が必要となるのかについては、本記事の後半で ArgyllCMS のドキュメントを引用して説明する。
4.2.2. Resolve を使いテストパターンに対して Apple Log の Encoding Function を適用し EXR形式で保存
生成した画像は前述のコードを見ればわかるように Linear データである。これを Resolve を使って Apple Log に変換した。
Resolve の Color Management 設定を図3 の通りに設定し、Apple Log に変換して EXR 形式で出力した (図4)。
図3. Color Management の設定
図4. 出力設定
4.2.3. EXRファイルから Apple Log の Encoding Function を実現する 1DLUT を作成
Resolve から出力された画像は Log2 スケール上の Linear データを Apple Log で Encode したデータ列 である。
そのため、このデータ列は Shaper を適用済みの 1DLUT とみなすことができる。
ということで、今回は このデータ列を Apple Log の Encoding function を得るための 1DLUT として利用した。
具体的には以下のようなコードを準備して Apple Log の Encoding function を実現した。
import numpy as np
from colour.utilities import tstack
from colour.io import read_image
defsave_apple_log_as_1dlut():
resolve_out_exr= "./secret/apple_log_encode_out.exr"
img = read_image(resolve_out_exr)
width = img.shape[1]
ref_val = 0.18
exp_range = 12
x = create_log2_x_scale(
sample_num=width, ref_val=ref_val,
min_exposure=-exp_range, max_exposure=exp_range)
y = img[0, ..., 1] # extract horizontal green line data
lut = tstack([x, y])
np.save("./secret/apple_log_encode_lut.npy", lut)
deflog_encoding_apple_log(x):
""" Scence linear to Apple Log. Parameters ---------- x : ndarray Scene linear light (1.0 is SDR diffuse white) Examples -------- >>> log_encoding_apple_log(0.18) 0.488271418052 Note ---- Valid range of `x` is from 2^-12 to 2^12 """
lut_1d = np.load("./secret/apple_log_encode_lut.npy")
y = np.interp(x, xp=lut_1d[..., 0], fp=lut_1d[..., 1])
return y
Apple Log の色域に関しても Resolve を使うことで簡単に調べることができた。
色々とやり方はあるのだが、ここでは Video Scope にある CIE Chromaticity を使った確認方法を紹介する。
やり方は非常に簡単で、Color Management 設定で Output color space に Apple Log を指定した状態で
Video Scope を CIE Chromaticity に変更するだけである。すると現在の Output color space の色域が右上に表示される (図5 の② を参照)
ここで EL Zone System について補足説明しておく。EL Zone System は Webページ を見ると分かるように
Linear値の 18% Gray を基準したフォルスカラー表示を行う技術である。
そのため Log Encoding の特性に依らず、HLG でも S-Log3 でも LogC4 でも一貫したフォルスカラー表示が可能となる素晴らしい技術である。
当然、Apple Log に関しても Decoding Function の特性が分かっていれば利用可能である。
しかし EL Zone System は詳細仕様が公開されていないため、今回は筆者の独自解釈による実装を行うことにした (そのため作成した View LUT は非公開とする)。
4.5.3. View LUT の作成および動作確認
ということで、以下で EL Zone System を用いた View LUT の生成方法および動作確認の方法について述べていく。
結果は冒頭で述べた通り HDR表示はできなかった。一方で HDR to SDR 変換は働いており、画像データに埋め込んだ色情報は正しく認識されているようである(HLGの結果がかなり怪しいが…)。
なお、作成した JPEG XL データが本当に HDR表示に対応したものかは、別途 Adobe Camera Raw を使って確認済みである(詳細は省略)。
JPEG XL encoder v0.9.0 ff8a9c1c [AVX2,SSE4,SSE2]
Usage: cjxl INPUT OUTPUT [OPTIONS...]
INPUT
the input can be PNG, APNG, GIF, JPEG, EXR, PPM, PFM, PAM, PGX, or JXL
OUTPUT
the compressed JXL output file
Basic options:
-d DISTANCE, --distance=DISTANCE
Target visual distance in JND units, lower = higher quality.
0.0 = mathematically lossless. Default for already-lossy input (JPEG/GIF).
1.0 = visually lossless. Default for other input.
Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0. Mutually exclusive with --quality.
-q QUALITY, --quality=QUALITY
Quality setting, higher value = higher quality. This is internally mapped to --distance.
100 = mathematically lossless. 90 = visually lossless.
Quality values roughly match libjpeg quality.
Recommended range: 68 .. 96. Allowed range: 0 .. 100. Mutually exclusive with --distance.
-e EFFORT, --effort=EFFORT
Encoder effort setting. Range: 1 .. 9.
Default: 7. Higher numbers allow more computation at the expense of time.
For lossless, generally it will produce smaller files.
For lossy, higher effort should more accurately reach the target quality.
-V, --version
Print encoder library version number and exit.
--quiet
Be more silent
-v, --verbose
Verbose output; can be repeated and also applies to help (!).
Advanced options:
-a A_DISTANCE, --alpha_distance=A_DISTANCE
Target visual distance for the alpha channel, lower = higher quality.
0.0 = mathematically lossless. 1.0 = visually lossless.
Default is to use the same value as for the color image.
Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0.
-p, --progressive
Enable (more) progressive/responsive decoding.
--group_order=0|1
Order in which 256x256 groups are stored in the codestream for progressive rendering.
0 = scanline order, 1 = center-first order. Default: 0.
--container=0|1
0 = Avoid the container format unless it is needed (default)
1 = Force using the container format even if it is not needed.
--compress_boxes=0|1
Disable/enable Brotli compression for metadata boxes. Default is 1 (enabled).
--brotli_effort=B_EFFORT
Brotli effort setting. Range: 0 .. 11.
Default: 9. Higher number is more effort (slower).
-m 0|1, --modular=0|1
Use modular mode (default = encoder chooses, 0 = enforce VarDCT, 1 = enforce modular mode).
-j 0|1, --lossless_jpeg=0|1
If the input is JPEG, losslessly transcode JPEG, rather than using reencode pixels.
--num_threads=N
Number of worker threads (-1 == use machine default, 0 == do not use multithreading).
--photon_noise_iso=ISO_FILM_SPEED
Adds noise to the image emulating photographic film or sensor noise.
Higher number = grainier image, e.g. 100 gives a low amount of noise,
3200 gives a lot of noise. Default is 0.
--intensity_target=N
Upper bound on the intensity level present in the image, in nits.
Default is 0, which means 'choose a sensible default value based on the color encoding.
-x key=value, --dec-hints=key=value
This is useful for 'raw' formats like PPM that cannot store colorspace information
and metadata, or to strip or modify metadata in formats that do.
The key 'color_space' indicates an enumerated ColorEncoding, for example:
-x color_space=RGB_D65_SRG_Per_SRG is sRGB with perceptual rendering intent
-x color_space=RGB_D65_202_Rel_PeQ is Rec.2100 PQ with relative rendering intent
The key 'icc_pathname' refers to a binary file containing an ICC profile.
The keys 'exif', 'xmp', and 'jumbf' refer to a binary file containing metadata;
existing metadata of the same type will be overwritten.
Specific metadata can be stripped using e.g. -x strip=exif
-h, --help
Prints this help message. Add -v (up to a total of 4 times) to see more options.