<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>thomjiji</title><link>https://thomjiji.github.io/</link><description>Recent content on thomjiji</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 24 Aug 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://thomjiji.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>3x3 Matrix for Camera Matching</title><link>https://thomjiji.github.io/posts/3x3-matrix-for-camera-matching/</link><pubDate>Sun, 24 Aug 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/3x3-matrix-for-camera-matching/</guid><description>&lt;h2 id="前言"&gt;前言&lt;/h2&gt;
&lt;p&gt;使用 3x3 矩阵来做摄影机的匹配不是一个新技术了。很久之前看过这个叫作 &lt;a href="https://bsky.app/profile/ctcwired.paradoxwolf.info"&gt;Paradox&lt;/a&gt; 的人（他 day job 似乎是干广电的一个工程师、技术人员吧）做的一个&lt;a href="https://www.youtube.com/watch?v=inLKBxAnlzU&amp;amp;t"&gt;视频&lt;/a&gt;，其中讲解了他是如何对 Fuji 的一台什么相机拍摄的 Log 素材和 iPhone 拍摄的 Log 素材进行匹配的，分享了详细的过程。&lt;/p&gt;
&lt;p&gt;首先需要两台相机，源相机（source）和目标相机（target），在同一个照明环境下，拍摄同一张色卡。然后得到两条素材中色卡的值，计算两张色卡的差值，得到一个校正矩阵。将该校正矩阵应用到源相机（source）拍摄的素材上，就能实现与目标相机（target）的匹配。&lt;/p&gt;
&lt;p&gt;他的过程需要用到达芬奇、colour-science.org 的 &lt;a href="https://github.com/colour-science/colour"&gt;colour&lt;/a&gt; Python 库。我知道 Nuke 有一个 gizmo 叫作 &lt;a href="https://www.nukepedia.com/tools/gizmos/colour/mmcolortarget/"&gt;mmColorTarget&lt;/a&gt;，可以不需要用到 &lt;a href="https://github.com/colour-science/colour"&gt;colour&lt;/a&gt;，然后全部在 Nuke 里完成。在此将步骤简要记录：&lt;/p&gt;
&lt;h2 id="测试图像"&gt;测试图像&lt;/h2&gt;
&lt;p&gt;手边没有不同摄影机拍摄色卡的测试图，所幸 CML 有分享一组：&lt;a href="https://www.cinematography.net/edited-pages/ACES.html"&gt;Early ACES&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;第一张是 ARRI Alexa，第二、三张是 Sony F55 和 Sony F65，都是 RAW。这作为我们的这个匹配测试的测试图正正好。&lt;/p&gt;
&lt;h2 id="步骤"&gt;步骤&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;将两张图裁切到色卡填充满整个画面，色彩空间转换到一个统一的广色域（最好大到能够承载摄影机原始色域，例如 DWG 或 ACES AP0）。我们这里选择 ACES，传递函数选择 Linear 线性。输出 EXR，ACES Linear。&lt;/li&gt;
&lt;li&gt;开启一个 Python 虚拟环境 &lt;code&gt;.venv&lt;/code&gt;，安装这两个 python 包：colour 和 colour_checker_detection:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python -m venv .venv
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip install colour colour_checker
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;运行脚本：
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;colour&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;matrix_colour_correction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;read_image&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;colour_checker_detection&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;detect_colour_checkers_segmentation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;source_filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/path/to/source/f65-sony-rv.mxf.chart.exr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;target_filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/path/to/target/alexa-raw.ari.chart.exr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;detect_colour_checkers_segmentation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;read_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source_filename&lt;/span&gt;&lt;span class="p"&gt;))[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;detect_colour_checkers_segmentation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;read_image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target_filename&lt;/span&gt;&lt;span class="p"&gt;))[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;matrix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;matrix_colour_correction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;得到一个 matrix 像这样：
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[[&lt;/span&gt; 1.87196901 0.06371339 -0.08137244&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;[&lt;/span&gt;-0.02488484 1.9985176 -0.00450315&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;[&lt;/span&gt; 0.03458153 -0.06038139 1.77408664&lt;span class="o"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;将这个 matrix 的 9 个值复制到 Nuke 的 ColorMatrix 节点，把节点加载给源 source 素材。简单点可以首先复制一个 ColorMatrix 节点到文本编辑器：
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; cut_paste_input &lt;span class="o"&gt;[&lt;/span&gt;stack 0&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;version 16.0 v4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;push &lt;span class="nv"&gt;$cut_paste_input&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ColorMatrix &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; matrix &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; 0&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; 0&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; 1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name ColorMatrix1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; note_font Helvetica
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; selected &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xpos -483
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ypos &lt;span class="m"&gt;1283&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;把刚输出的那串 matrix 复制到上面的 matrix 那里，把 &lt;code&gt;[]&lt;/code&gt; 用 &lt;code&gt;{}&lt;/code&gt; 替换：
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;set&lt;/span&gt; cut_paste_input &lt;span class="o"&gt;[&lt;/span&gt;stack 0&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;version 16.0 v4
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;push &lt;span class="nv"&gt;$cut_paste_input&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ColorMatrix &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; matrix &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt; 1.87196901 0.06371339 -0.08137244&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt;-0.02488484 1.9985176 -0.00450315&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;{&lt;/span&gt; 0.03458153 -0.06038139 1.77408664&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name ColorMatrix1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; note_font Helvetica
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; selected &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xpos -483
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ypos &lt;span class="m"&gt;1283&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>Color Science Things</title><link>https://thomjiji.github.io/posts/color-science-things/</link><pubDate>Wed, 20 Aug 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/color-science-things/</guid><description>&lt;p&gt;关于广泛的“色彩科学”这一话题，以下是我零星的来源和笔记。这里权当做一个记录，同时帮助我厘清思路：&lt;/p&gt;
&lt;h2 id="troy-james-sobotka"&gt;Troy James Sobotka&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/sobotka/scise/wiki/Picture-Formation"&gt;Picture Formation Definition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mastodon.art/@troy_s/114569030157238196"&gt;Troy&amp;rsquo;s Mastodon about picture formation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hg2dc.com/2019/05/28/question-6/"&gt;Question #6: What the F*ck is a Transfer Function?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://surfacefragments.blogspot.com/2017/04/apelles-and-birth-of-illusionism.html?m=1"&gt;Apelles and the Birth of Illusionism: Ancient lessons in painting spatial depth&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="jed-smith"&gt;Jed Smith&lt;/h2&gt;
&lt;h3 id="output-transform-tone-scale-all-about-tonescale-functions-mm-naka-rushton-sigmoid-daniele-etc-dot"&gt;&lt;a href="https://community.acescentral.com/t/output-transform-tone-scale/3498"&gt;Output Transform Tone Scale&lt;/a&gt;: All about tonescale functions: MM, Naka-Rushton, Sigmoid, Daniele, etc.&lt;/h3&gt;
&lt;h3 id="per-channel-display-transform-with-wider-rendering-gamut-arri-k1s1-implemented-in-nuke-node"&gt;&lt;a href="https://community.acescentral.com/t/per-channel-display-transform-with-wider-rendering-gamut/3768"&gt;Per-Channel Display Transform with Wider Rendering Gamut&lt;/a&gt;: ARRI K1S1 implemented in Nuke node&lt;/h3&gt;
&lt;h3 id="经典的-tone-mapping-函数--reinhard-function--open-display-transform-wiki-tonescale-hyperbola"&gt;经典的 Tone Mapping 函数 (Reinhard function)：&lt;a href="https://github.com/jedypod/open-display-transform/wiki/tech_tonescale#hyperbola"&gt;open display transform wiki &amp;gt; tonescale &amp;gt; hyperbola&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;这个函数在 Thatcher Freeman 的&lt;a href="https://youtu.be/Z1qC1LuwMLw?si=uf-jidGg4cOO8qSU&amp;amp;t=175"&gt;这个&lt;/a&gt; DCTL 教学视频得到验证，他在视频中用的也是这个函数，可见这个函数确实很普遍，很 basic。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="self-crafted-log-curve-xlog"&gt;Self-crafted Log curve - XLog&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;XLog 曲线的图像可视化（Desmos）：&lt;a href="https://www.desmos.com/calculator/9pgjgo1gq4"&gt;https://www.desmos.com/calculator/9pgjgo1gq4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Google Colab 里对 XLog 曲线的数学推导和由来的记录，有很多讲解性的描述：&lt;a href="https://colab.research.google.com/drive/1NwjaD0NzNMzQeNQqZECj33PdcYGkeBM4"&gt;https://colab.research.google.com/drive/1NwjaD0NzNMzQeNQqZECj33PdcYGkeBM4&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://colab.research.google.com/drive/1NwjaD0NzNMzQeNQqZECj33PdcYGkeBM4#scrollTo=IiGLLRAoz2Cc&amp;amp;line=1&amp;amp;uniqifier=1"&gt;A multiply in linear is equal to an addition in log!?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="sigmoid-function"&gt;Sigmoid function&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://discuss.pixls.us/t/blender-agx-in-darktable-proof-of-concept/48697/526"&gt;https://discuss.pixls.us/t/blender-agx-in-darktable-proof-of-concept/48697/526&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://colab.research.google.com/drive/1CjDunkNCuhWIoWox_reDist6fTEJIim2"&gt;https://colab.research.google.com/drive/1CjDunkNCuhWIoWox_reDist6fTEJIim2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="关于-nuke-grade-node-里的-gamma-实际上不是纯-gamma-函数-而是在像素值超过-1-之后使用的是一个线性函数"&gt;关于 Nuke Grade node 里的 Gamma 实际上不是纯 Gamma 函数，而是在像素值超过 1 之后使用的是一个线性函数&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtu.be/umpA40uheIs?si=jUnCxGtiudqSwDIR&amp;amp;t=400"&gt;The Math of Color Grading in Nuke&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="i-can-understand-scene-linear-but-what-is-display-linear"&gt;I can understand scene-linear, but what is display-linear?&lt;/h3&gt;
&lt;h4 id="magic-numbers"&gt;magic numbers&lt;/h4&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OpenDRT:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	scene-linear 0.18 &lt;span class="o"&gt;(&lt;/span&gt;mid grey&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; display-linear 0.11
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	scene-linear 0.09 &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; display-linear 0.04
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DaVinci:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	scene-linear 0.18 &lt;span class="o"&gt;(&lt;/span&gt;mid grey&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; display-linear 0.17
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;	scene-linear 0.09 &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; display-linear 0.09
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id="https-discuss-dot-pixls-dot-us-t-opendrt-for-art-49257-19"&gt;&lt;a href="https://discuss.pixls.us/t/opendrt-for-art/49257/19"&gt;https://discuss.pixls.us/t/opendrt-for-art/49257/19&lt;/a&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Yes. OpenDRT is designed with digital cinema workflows in mind, and follows the convention in that domain to &lt;strong&gt;map “scene-linear” middle grey 0.18 to “display-linear” ~0.11, placing middle grey at around 11% of the overall range or at about 11 nits on a 100 nits Rec.1886 SDR display&lt;/strong&gt;. This is the convention used by pretty much all camera manufacturer image formation LUTs (except RED), and Resolve and Baselight, and follows the placement of middle grey of the original Rec.709 OETF.&lt;/p&gt;</description></item><item><title>Demystify Saturation</title><link>https://thomjiji.github.io/posts/demystify-saturation/</link><pubDate>Tue, 19 Aug 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/demystify-saturation/</guid><description>&lt;h2 id="understanding-hsvl-within-the-nuke-context"&gt;Understanding HSVL Within the Nuke Context&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Saturation is independent of Hue or Luminance and is an indicator of the intensity of a colour. Highly saturated colours appear &amp;ldquo;stronger&amp;rdquo; and by increasing Saturation we are &amp;ldquo;revealing&amp;rdquo; more of the Hue present in the color, for example, being &amp;ldquo;more red&amp;rdquo;, &amp;ldquo;more blue&amp;rdquo;, etc. This is because, while zero Saturation (i.e. grey) indicates that all the three channels have the same value (R=G=B) and low Saturation implies that the three channels are closely aligned, high Saturation signifies a strong disparity in the values of the three channels. Increasing Saturation pulls the values in the channels further apart, thus increasing the dominant Hue, while reducing Saturation pulls the values from the channels closer together.&lt;/p&gt;</description></item><item><title>Nuke Learning Resources</title><link>https://thomjiji.github.io/posts/nuke-learning-resources/</link><pubDate>Sat, 12 Jul 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/nuke-learning-resources/</guid><description>&lt;h2 id="download-nuke-software"&gt;Download Nuke Software&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.foundry.com/products/nuke/download"&gt;https://www.foundry.com/products/nuke/download&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="tcl-expression-and-python-in-nuke"&gt;Tcl Expression and Python in Nuke&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.gatimedia.co.uk/tcl-functions"&gt;Tcl Functions in Text Node - GATIMEDIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gatimedia.co.uk/expressions"&gt;Expressions &amp;amp; Tcl Tips - GATIMEDIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sachadjordjevic.com/index.php/nuke-python-tcl-scripts-tricks/"&gt;Python &amp;amp; TCL Scripts &amp;amp; Tricks - Sacha Djordjevic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nukepedia.com/written-tutorials/expressions-101"&gt;Expressions 101 - Written Tutorials - Nukepedia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="unlock-hdr-preview-in-nuke--apple-edr"&gt;Unlock HDR Preview in Nuke (Apple EDR)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.foundry.com/nuke/content/getting_started/using_interface/hdr_output.html"&gt;Working with HDR Images - Nuke User Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="other-resources"&gt;Other Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://benmcewan.com/blog/"&gt;https://benmcewan.com/blog/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="useful-articles"&gt;Useful Articles&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://guillermoalgora.com/grade-node-analysis.html"&gt;Analysing the grade node from a mathematical perspective&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://guillermoalgora.com/understanding-hsvl.html"&gt;Understanding HSVL Within The Nuke Context&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hiramgifford.com/buddy-system"&gt;A free suite of Nuke tools &amp;amp; scripts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://support.foundry.com/hc/en-us/articles/115000229764-Q100319-How-to-use-colorspaces-in-Nuke"&gt;Q100319: How to use colorspaces in Nuke?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://support.foundry.com/hc/en-us/articles/115000229804-Q100330-Generating-chromaticity-diagrams"&gt;Q100330: Generating chromaticity diagrams&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Convert between binary decimal hex and octal</title><link>https://thomjiji.github.io/posts/convert-between-binary-decimal-hex-and-octal/</link><pubDate>Fri, 11 Jul 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/convert-between-binary-decimal-hex-and-octal/</guid><description>&lt;h2 id="使用-emacs-calc"&gt;使用 Emacs Calc&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;首先开启 Emacs Calc：&lt;code&gt;C-x * c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;输入你想要进行转换的源头数字的原始形式。比如你想要把一个 decimal number 192 转换成二进制，那么输入 192&lt;/li&gt;
&lt;li&gt;然后按 d 改变 Emacs Calc 的显示模式，再按 2 选择以二进制显示。这样你刚输入的数字 192 就变成了 &lt;code&gt;2#11000000&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;这样我们的转换实际上是改变 Calc 对数字的显示模式，其实也达到了我们的目的。&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="notes"&gt;Notes&lt;/h3&gt;
&lt;p&gt;我们可以看到，Emacs Calc 显示非 decimal 十进制数字的时候使用的 notation 是这样：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2#11000000 &amp;lt;-- binary
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;16#C0 &amp;lt;-- hex
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;8#300 &amp;lt;-- octal
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;在 &lt;code&gt;#&lt;/code&gt; 前加上一个数字表示二进制、16 进制和八进制。正常的十进制就没有前缀了。&lt;/p&gt;
&lt;h3 id="using-emacs-calc-base-to-decimal"&gt;Using Emacs Calc (Base to Decimal)&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Start Emacs Calc: &lt;code&gt;C-x * c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Input the number using the base notation &lt;code&gt;base#number&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;For Hex &lt;code&gt;C0&lt;/code&gt;: Type &lt;code&gt;16#C0&lt;/code&gt; then press &lt;code&gt;RET&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For Binary &lt;code&gt;11000000&lt;/code&gt;: Type &lt;code&gt;2#11000000&lt;/code&gt; then press &lt;code&gt;RET&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;d 0&lt;/code&gt; (decimal mode).&lt;/li&gt;
&lt;li&gt;Calc will instantly convert the value on the stack to its standard decimal form (e.g., &lt;code&gt;192&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="notes-1"&gt;Notes&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;When you are in a non-decimal display mode (like Binary), you can just type the digits directly (e.g., &lt;code&gt;1100&lt;/code&gt;) and Calc will assume they are in the current display base.&lt;/li&gt;
&lt;li&gt;However, typing the &lt;code&gt;base#&lt;/code&gt; prefix is the most reliable way to enter numbers because it works regardless of your current display mode.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d 0&lt;/code&gt; is the shortcut for &amp;ldquo;Decimal&amp;rdquo; display, while &lt;code&gt;d r&lt;/code&gt; allows you to set any arbitrary &amp;ldquo;Radix&amp;rdquo; (base) from 2 to 36.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="使用-m--eval-expression"&gt;使用 M-: (eval-expression)&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;按 &lt;code&gt;M-:&lt;/code&gt; (eval-expression)&lt;/li&gt;
&lt;li&gt;输入你想要转换的十进制数，比如 192，按 &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;得到该十进制数对应的八进制和十六进制结果：&lt;code&gt;192 (#o300, #xc0)&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;可以看到这个方法只给到了 octal 和 hex，并没给到 binary 的结果。当然你可以输入一个 binary，比如 &lt;code&gt;#b11000000&lt;/code&gt; 然后按 RET 即可得到一样的输出：192 (#o300, #xc0)。所以我们是可以通过这个方法做 binary 到 decimal、octal、hex 的转换，但是！不可以做到 binary 的转换，it&amp;rsquo;s not possible.&lt;/p&gt;</description></item><item><title>DIT work useful commands</title><link>https://thomjiji.github.io/posts/dit-work-useful-commands/</link><pubDate>Thu, 03 Jul 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/dit-work-useful-commands/</guid><description>&lt;h2 id="注意事项"&gt;注意事项&lt;/h2&gt;
&lt;h3 id="安全"&gt;安全&lt;/h3&gt;
&lt;p&gt;运行终端命令的时候，你必须清楚的知道&lt;strong&gt;你在做什么&lt;/strong&gt;。不要盲目地把一串命令复制粘贴过来，一敲回车就直接运行了。&lt;/p&gt;
&lt;p&gt;如何知道一串终端命令究竟在做什么？大多数终端的命令和程序都有一个叫作 man page 的东西，它是这个命令、程序的 manual 手册。一般来说你可以在里面查阅到关于运行这个命令的所有信息，以及各种自定义选项。只需要在你要运行的命令前加上 &lt;code&gt;man&lt;/code&gt;，比如 &lt;code&gt;man find&lt;/code&gt;，&lt;code&gt;man gdu&lt;/code&gt;。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;always use &lt;code&gt;rm -i&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;或者将 &lt;code&gt;rm&lt;/code&gt; 命令用 trash-cli 替换掉：在需要使用 &lt;code&gt;rm&lt;/code&gt; 命令的时候，通通换成 &lt;code&gt;trash&lt;/code&gt; 命令。macOS 自带 &lt;code&gt;trash&lt;/code&gt; 命令（&lt;code&gt;man trash&lt;/code&gt;），其他平台需要&lt;a href="https://github.com/andreafrancia/trash-cli"&gt;安装 trash-cli&lt;/a&gt;。&lt;/li&gt;
&lt;li&gt;使用 &lt;code&gt;find ... -delete&lt;/code&gt; 执行删除操作前，always 先 pipe 给 less 命令来查看将要删除哪些东西&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="du"&gt;du&lt;/h2&gt;
&lt;p&gt;macOS 自带的 du 命令行为比较奇怪，我们使用 GNU 版本的 gdu&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install coreutils
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这将会下载安装 &lt;code&gt;gdu&lt;/code&gt; 命令到本机。&lt;/p&gt;
&lt;h3 id="如何知道一个文件有多大"&gt;如何知道一个文件有多大&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gdu -sbc --si /path/to/dir
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-s&lt;/code&gt;, &lt;code&gt;--summarize&lt;/code&gt;: display only a total for each argument.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-b&lt;/code&gt;, &lt;code&gt;--bytes&lt;/code&gt;: equivalent to &amp;lsquo;&amp;ndash;apparent-size &amp;ndash;block-size=1&amp;rsquo;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c&lt;/code&gt;, &lt;code&gt;--total&lt;/code&gt;: produce a grand total.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--si&lt;/code&gt;: like &lt;code&gt;-h&lt;/code&gt;, but use powers of 1000 not 1024.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;以上命令会以 MB、GB 的形式输出文件大小，如果想得到更加明细的字节数，则去掉 &lt;code&gt;--si&lt;/code&gt;：&lt;/p&gt;</description></item><item><title>I fixed Rime and Neovide</title><link>https://thomjiji.github.io/posts/i-fixed-rime-and-neovide/</link><pubDate>Sun, 04 May 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/i-fixed-rime-and-neovide/</guid><description>&lt;h1 id="tldr"&gt;TL;DR&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;问题&lt;/strong&gt;：Rime 的自动切换到英文输入法的设置对 macOS 上的 Neovide 不生效！&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;原因&lt;/strong&gt;：我一般是从 Terminal 启动 Neovide，这样其实调用的是 Homebrew 叫作 formula 的那个程序：&lt;code&gt;/opt/homebrew/bin/neovide&lt;/code&gt;。而我们在 Rime 的配置文件 &lt;code&gt;squirrel.yaml&lt;/code&gt; 设置的开启默认英文 &lt;code&gt;ascii_mode: true&lt;/code&gt; 是给 Neovide 的 GUI app 的！那它自然就不生效了。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;解决方案&lt;/strong&gt;：给 Neovide 设置一个 alias，让它指向 Neovide GUI app 的可执行文件 &lt;code&gt;/Applications/Neovide.app/Contents/MacOS/neovide&lt;/code&gt;。像我在 Fish shell 的 &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt; 就是这样设置:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;alias&lt;/span&gt; neovide &lt;span class="s2"&gt;&amp;#34;/Applications/Neovide.app/Contents/MacOS/neovide&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这样你在 Terminal 输入 &lt;code&gt;neovide&lt;/code&gt; 就不会调用那个 formula &lt;code&gt;/opt/homebrew/bin/neovide&lt;/code&gt;，而是 Neovide GUI app 的可执行文件。Rime 的默认英文的设置也就正常生效了。&lt;/p&gt;
&lt;h1 id="前情提要问题浮现"&gt;前情提要、问题浮现&lt;/h1&gt;
&lt;p&gt;Neovide 是一个我前阵子发现的宝藏 app，它让 Neovim 拥有 vscode 一般的顺滑操控和鼠标动画。我第一次知道这个 app 的那天晚上，下班一回到家，等不及迅速安装配置好了，然后就被惊到。这个动画的顺畅程度跟 vscode 真的有过之而无不及。那天晚上真是惊叹不已，要知道 Neovim 在 Terminal 里的体验你是绝对不会奢求它有多好的 animation 的。即便 LazyVim 的 snacks 插件有通过一个 Animate 的模块做了一点点让 Neovim 稍微顺滑一点的努力，但远不及 Neovide 这个顺滑。Neovide 属于你用了就回不去了的那种。&lt;/p&gt;</description></item><item><title>Tips and tricks</title><link>https://thomjiji.github.io/posts/tips-and-tricks/</link><pubDate>Wed, 08 Jan 2025 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/tips-and-tricks/</guid><description>&lt;p&gt;Firefox 的 &lt;a href="https://kb.mozillazine.org/Profile_folder_-_Firefox"&gt;Profile&lt;/a&gt; 文件夹可以在这里获取：Firefox 左上角菜单栏 &amp;gt; Help &amp;gt; More Troubleshooting Information &amp;gt; Application Basics &amp;gt; Profile Folder.&lt;/p&gt;
&lt;p&gt;在这个 Profile folder 里创建一个叫做 &lt;code&gt;user.js&lt;/code&gt; 的文件，就可以实现导出 Firefox 的全局用户设置（修改过的 Firefox 的默认设置）。&lt;/p&gt;
&lt;p&gt;所有在 &lt;code&gt;about:config&lt;/code&gt; 里修改的设置都在一个叫做 &lt;code&gt;prefs.js&lt;/code&gt; 的文件里。=&amp;gt; &lt;a href="https://kb.mozillazine.org/Prefs.js_file"&gt;Prefs.js file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;我的 Firefox 用户设置（&lt;code&gt;about:config&lt;/code&gt;）：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mousewheel.with_control.action: 3&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Reference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://support.mozilla.org/en-US/questions/1197798"&gt;https://support.mozilla.org/en-US/questions/1197798&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Change author name in commit message:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git config --global user.name &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git config --global user.email &amp;lt;email&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;安装 LazyVim 之后，LSP 的下载会遇到一些网络问题，比如每次都是 pyright 由于一些网络原因安装失败：&lt;code&gt;set -Ux https_proxy 127.0.0.1:7890&lt;/code&gt; 和 &lt;code&gt;set -Ux http_proxy 127.0.0.1:7890&lt;/code&gt; 都不好使，使用 sing-box 也不行。这时只需要取消系统代理就可以成功联网安装。&lt;/p&gt;</description></item><item><title>Create dummy directories using Rsync</title><link>https://thomjiji.github.io/posts/create-dummy-directories-using-rsync/</link><pubDate>Tue, 25 Jun 2024 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/create-dummy-directories-using-rsync/</guid><description>&lt;p&gt;Use &lt;code&gt;rsync&lt;/code&gt; to create dummy dirs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fish" data-lang="fish"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;rsync&lt;/span&gt; &lt;span class="na"&gt;-avPih&lt;/span&gt; &lt;span class="na"&gt;--include&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;*/&amp;#39;&lt;/span&gt; &lt;span class="na"&gt;--exclude&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;*&amp;#39;&lt;/span&gt; videos/ ~/Desktop/videos-dummy/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here’s a breakdown of the command:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-avPih&lt;/code&gt;: These flags stand for:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-a&lt;/code&gt;: Archive mode, which preserves permissions, timestamps, symbolic links, etc.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-v&lt;/code&gt;: Verbose, which provides detailed output.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-P&lt;/code&gt;: Combines &amp;ndash;progress and &amp;ndash;partial, showing progress during transfer and allowing for partial transfers to be resumed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-i&lt;/code&gt;: Output a change-summary for all updates.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-h&lt;/code&gt;: Output numbers in a human-readable format.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--include '*/'&lt;/code&gt;: Includes all directories (and subdirectories) in the transfer.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--exclude '*'&lt;/code&gt;: Excludes all files.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Best practice for grading stack in Baselight</title><link>https://thomjiji.github.io/posts/best-practice-for-grading-stack-in-baselight/</link><pubDate>Sun, 31 Mar 2024 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/best-practice-for-grading-stack-in-baselight/</guid><description>&lt;p&gt;&lt;strong&gt;Colour Online: Developing Digital Images &amp;gt; Best Practice Stack&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Start at &lt;a href="https://vimeo.com/473186556#t=3544s"&gt;59:04&lt;/a&gt;:&lt;/p&gt;

 &lt;div
 style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe
 src="https://player.vimeo.com/video/473186556?dnt=0"
 style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allow="fullscreen"&gt;
 &lt;/iframe&gt;
 &lt;/div&gt;

&lt;p&gt;&lt;img src="img/baselight_grading_stack.png" alt="image"&gt;&lt;/p&gt;</description></item><item><title>Use Default Setting</title><link>https://thomjiji.github.io/posts/use-default-setting/</link><pubDate>Sun, 14 Jan 2024 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/use-default-setting/</guid><description>&lt;h2 id="尽可能使用默认设定"&gt;尽可能使用默认设定&lt;/h2&gt;
&lt;p&gt;尽可能使用默认设定，不去做过多的自定义，不去 Tweaking 各种各样的细枝末节。这是我近期的一个感悟和追求。&lt;/p&gt;
&lt;p&gt;之前有一段时间习惯用 JetBrains 家的 IDE，渐渐习惯它们的 keybinding。有时需要用一下 VS Code 的时候都会想，我能不能在 VS Code 里用 JetBrains 的 keybinding。或者反过来，我能不能在 JetBrains 中用 VS Code 的 keybinding。其实是可以的，我特意去搜了一下：JetBrains IDE using VS Code key map，头两个结果就是。&lt;/p&gt;
&lt;p&gt;双方都有对应的插件，安装一下就可以使用对方的快捷键了。但可以想见的是，在 JetBrains IDE 中使用 VS Code 的 keybinding，或者在 VS Code 中使用 JetBrains keybinding 这种奇怪的组合，势必没有原生的 keybinding 好用。或者一些功能，在对方软件中根本不存在，那么就没有对应的 keybinding 可以给你用。这时你需要找到目前所在软件的对应功能，比如 VS Code 当中叫作 Expand Selection 的功能，在 JetBrains IDE 当中叫作 Extend Selection。你需要把它手动指定一个 keybinding，就开始麻烦起来了。&lt;/p&gt;
&lt;p&gt;所以我通常的做法是在哪个软件就用哪个软件的 keybinding。而且通常来说，JetBrains、VS Code 也好，或者 Obsidian，都有一个功能可以让你搜索要执行的命令，然后它对应的快捷键就在后面。&lt;/p&gt;
&lt;p&gt;当然有人 Vim 走天下。在哪个软件都是装个 Vim 插件，然后一套 Vim 的 keybinding 就完事了。&lt;/p&gt;</description></item><item><title>Setup Rime on Fedora</title><link>https://thomjiji.github.io/posts/setup-rime-on-fedora/</link><pubDate>Sat, 30 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/setup-rime-on-fedora/</guid><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install fcitx5 and fcitx5-rime via &lt;code&gt;sudo dnf install fcitx5-rime fcitx5&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to System Setting &amp;gt; Input Devices &amp;gt; Virtual Keyboard, select “Fcitx 5”.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit environment file via: &lt;code&gt;sudo vi /etc/environment&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the following content, &lt;a href="https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma"&gt;reference&lt;/a&gt;:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fish" data-lang="fish"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;INPUT_METHOD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fcitx
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;XMODIFIERS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;@&lt;span class="nv"&gt;im&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fcitx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open Input Method Selector &amp;gt; Use fcitx5 &amp;gt; Log out.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Clone &lt;a href="https://github.com/iDvel/rime-ice"&gt;雾凇拼音&lt;/a&gt; repo into &lt;code&gt;~/.local/share/fcitx5/&lt;/code&gt;, rename it to &lt;code&gt;rime&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fish" data-lang="fish"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;mv rime-ice rime
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart fcitx5 in the lower right corner of your Desktop.&lt;/p&gt;</description></item><item><title>Use mouse wheel to scroll less in iTerm2</title><link>https://thomjiji.github.io/posts/use-mouse-wheel-to-scroll-less-in-iterm2/</link><pubDate>Sun, 17 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/use-mouse-wheel-to-scroll-less-in-iterm2/</guid><description>&lt;p&gt;在 iTerm2 中使用 less command 有一个奇怪的点：你不能用鼠标来滚动页面。只能使用 Vim 的 keybinding &lt;code&gt;Ctrl+d&lt;/code&gt; 和 &lt;code&gt;Ctrl+u&lt;/code&gt; 来上下翻页。而且当你比如在查看一个 command 的 man page 时，因为 man page 默认是使用 less 来打开的，你查看完某个 man page 按 &lt;code&gt;q&lt;/code&gt; 退出，然后使用鼠标滚轮往上面滚一下，滚到上面一屏，你会发现你的 Terminal 变得很乱，有很多刚刚你查看的那个 man page 的残留。&lt;/p&gt;
&lt;p&gt;我的需求总结来说就是：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;能够在 less 里使用鼠标滚轮来翻页，滚动。&lt;/li&gt;
&lt;li&gt;退出 less 之后不要有残留。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;其实，这里有一个概念叫作 &lt;a href="https://superuser.com/a/321233"&gt;alternate screen&lt;/a&gt;。你用 less 打开查看一个什么文件的时候进入的就是一个 alternate sceen，按 &lt;code&gt;q&lt;/code&gt; 退出就是退出那个 alternate screen，回到 normal screen。Alternate screen 就是一个单独的 buffer，独立于当前 terminal 的。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When activated, the current screen is saved and replaced with the alternate screen.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>Use native file picker on KDE Plasma</title><link>https://thomjiji.github.io/posts/use-native-file-picker-on-kde/</link><pubDate>Sat, 09 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/use-native-file-picker-on-kde/</guid><description>&lt;h3 id="for-firefox"&gt;For Firefox&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Starting with version 64, Firefox can optionally use XDG Desktop Portals to handle various desktop features, such as &lt;strong&gt;opening a file picker&lt;/strong&gt;, or handling MIME types. — Arch Wiki | Firefox | &lt;a href="https://wiki.archlinux.org/title/Firefox#XDG_Desktop_Portal_integration"&gt;XDG Desktop Portal integration&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Type &lt;code&gt;about:config&lt;/code&gt; in Firefox address bar.&lt;/li&gt;
&lt;li&gt;Search &lt;code&gt;widget.use-xdg-desktop-portal.file-picker&lt;/code&gt;, set it to 1.
&lt;ul&gt;
&lt;li&gt;0 – Never&lt;/li&gt;
&lt;li&gt;1 – Always&lt;/li&gt;
&lt;li&gt;2 – Auto (typically depends on whether Firefox is run from within Flatpak or whether the &lt;code&gt;GDK_DEBUG=portals&lt;/code&gt; environment is set)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Done.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="for-vs-code"&gt;For VS Code&lt;/h3&gt;
&lt;p&gt;These two environment variables: &lt;code&gt;GTK_USE_PORTAL=1&lt;/code&gt;, &lt;code&gt;GDK_DEBUG=portals&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Pin apps to KDE Panel, not KDE Task Manager</title><link>https://thomjiji.github.io/posts/pin-apps-to-kde-panel/</link><pubDate>Mon, 04 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/pin-apps-to-kde-panel/</guid><description>&lt;p&gt;比如你想把 Konsole 和 Firefox 这些最最常用的 app pin 到底部的 bar/dock 上（实际上 KDE 叫它 Panel），最直观的，你下意识的右键 Task Manager 上已经打开的 app，这里有一个“Pin to Task Manager”的选项，勾选上它。但这好像不是你想要的，因为你发现即使 pin 上去了，只要你打开那个 app 的一个 instance，那个刚刚被你 pin 上去的 app 就又不见了。这似乎不是你期待中的“pin”。这时你想要打开那个 app 的第二个 instance，就没法去到老地方，你最初 pin 它的那个地方打开。得找到现在的正在运行的那个 instance 所在的 Task Manager 的地方，右键 &amp;gt; &amp;ldquo;Open a New Window&amp;rdquo;。&lt;/p&gt;
&lt;p&gt;其实，你刚刚 pin 上去的那个地方，是 Task Manager 的区域。Task Manager 外层还有一个区域，叫作 Panel。你应该，或者说你其实想把它 pin 到 &lt;strong&gt;Panel&lt;/strong&gt; 上。这样不管你开几个 instance，那个 app 的图标还是在那，当你想开第 n+1 的 instance 的时候，还是去那个 pin 的地方点一下就行了。&lt;/p&gt;
&lt;p&gt;总的来说，KDE 底部栏的层级是这样的：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Panel:
&lt;ul&gt;
&lt;li&gt;Application Launcher&lt;/li&gt;
&lt;li&gt;Pager&lt;/li&gt;
&lt;li&gt;Task Manager&lt;/li&gt;
&lt;li&gt;System tray&lt;/li&gt;
&lt;li&gt;Digital clock&lt;/li&gt;
&lt;li&gt;Peak at Desktop&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;你其实想把 Konsole 和 Firefox pin 到这里:&lt;/p&gt;</description></item><item><title>sshfs</title><link>https://thomjiji.github.io/posts/sshfs/</link><pubDate>Sun, 03 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/sshfs/</guid><description>&lt;h3 id="how-to-mount-remote-machines-directory-on-current-host"&gt;How to mount remote machine&amp;rsquo;s directory on current host?&lt;/h3&gt;
&lt;p&gt;This question originally came up when I wanted to use Kate to edit a configuration file on macOS. I normally ssh into macOS, cd to that directory, and then type &lt;code&gt;kate &amp;lt;file&amp;gt;&lt;/code&gt; to try opening the file for editing. But huh? There&amp;rsquo;s no kate command. Oh right, because I&amp;rsquo;m in the macOS environment, of course there&amp;rsquo;s no kate! But this is a problem - am I restricted to only using vi to edit remote files? I see &lt;a href="https://www.youtube.com/@AsahiLina"&gt;Asahi Lina&lt;/a&gt; smoothly using Kate to open projects and files across multiple Mac machines around her to edit back and forth during development. There must be some way to make this work.&lt;/p&gt;</description></item><item><title>gpg-agent doesn't work anyway!</title><link>https://thomjiji.github.io/posts/gpg-agent-does-not-work-anyway/</link><pubDate>Sat, 02 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/gpg-agent-does-not-work-anyway/</guid><description>Solved by this command: gpg-connect-agent updatestartuptty /bye &amp;gt;/dev/null</description></item><item><title>btrfs and btrbk</title><link>https://thomjiji.github.io/posts/btrfs-and-btrbk/</link><pubDate>Fri, 01 Dec 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/btrfs-and-btrbk/</guid><description>&lt;p&gt;&lt;code&gt;/etc/btrbk/btrbk.conf&lt;/code&gt; config file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;volume /
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; snapshot_dir btrbk_snapshots
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; subvolume home
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; incremental strict
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Key points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;volume /&lt;/code&gt;: &amp;ldquo;Base path within a btrfs filesystem containing the subvolumes to be backuped (usually the mount-point of a btrfs filesystem mounted with &lt;code&gt;subvolid=5&lt;/code&gt; option).&amp;rdquo; In this case, we use the existing root directory — which is already a btrfs filesystem (by default on Fedora). btrbk refer this &lt;code&gt;/&lt;/code&gt; (next to &lt;code&gt;volume&lt;/code&gt;) as &amp;ldquo;&amp;lt;volume-directory&amp;gt;&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;snapshot_dir btrbk_snapshots&lt;/code&gt;: &lt;code&gt;btrbk_snapshots&lt;/code&gt; is relative to the &lt;code&gt;volume&lt;/code&gt; set above, which in this case the &lt;code&gt;/&lt;/code&gt; (root directory). So the full path of &lt;code&gt;btrbk_snapshots&lt;/code&gt; will be &lt;code&gt;/btrbk_snapshots&lt;/code&gt;, which located just under the root directory. It&amp;rsquo;s like the &amp;ldquo;destination&amp;rdquo; of snapshots.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;subvolume home&lt;/code&gt;: &lt;code&gt;home&lt;/code&gt; is also relative to &lt;code&gt;/&lt;/code&gt; which set above. It&amp;rsquo;s the &amp;ldquo;source&amp;rdquo; of snapshots. There are also a &lt;code&gt;target&lt;/code&gt; field can be set: &lt;code&gt;target /mnt/btrbk_backup&lt;/code&gt;, but it&amp;rsquo;s optional. The &lt;code&gt;target&lt;/code&gt; is where the &amp;ldquo;backup&amp;rdquo; subvolumes to be created (refer to the man page of &lt;code&gt;btrbk.conf&lt;/code&gt; via &lt;code&gt;man btrbk.conf&lt;/code&gt;), while the &lt;code&gt;snapshot_dir&lt;/code&gt; is where &amp;ldquo;snapshot&amp;rdquo; to be stored.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;incremental strict&lt;/code&gt;: which means &amp;ldquo;non-incremental (initial) backups are never created&amp;rdquo; (&lt;code&gt;man btrbk.conf&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;What is snapshot?&lt;/p&gt;</description></item><item><title>GPG key for SSH authentication</title><link>https://thomjiji.github.io/posts/gpg-for-ssh-authentication/</link><pubDate>Tue, 28 Nov 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/gpg-for-ssh-authentication/</guid><description>Using GPG key for ssh authentication reduces the effort involved in managing SSH keys, which is the main reason I want to learn this technique. GPG key for all (not just one GPG key possibly).</description></item><item><title>SSH notes</title><link>https://thomjiji.github.io/posts/ssh-notes/</link><pubDate>Tue, 28 Nov 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/ssh-notes/</guid><description>&lt;p&gt;SSH 是一个我之前就想尝试使用的工具，当时只有对它的一个很简单的印象，就是可以通过它安全的访问另外一台电脑——的 Terminal。当然对它的具体原理和运行逻辑肯定是不了解的，包括它是怎么个安全法。只知道哦我可以通过它访问到比如说，当我自己打开 Terminal 时候首先展示在我面前的那一堆东西，其实就是在 &lt;code&gt;$HOME&lt;/code&gt; directory 你输入比如 &lt;code&gt;ls -al&lt;/code&gt; 命令出现的各个 directory。只是我可以看到另一台设备的这一堆东西。那当时这个需求也是没有那么强烈，所以就还是暂时搁置没有了解。&lt;/p&gt;</description></item><item><title>File size</title><link>https://thomjiji.github.io/posts/file-size/</link><pubDate>Wed, 01 Nov 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/file-size/</guid><description>&lt;h2 id="notes"&gt;Notes&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;du *&lt;/code&gt; 输出的其实不是我们通常理解上的文件大小，而是所谓 block size（block count 可能更准确）。而且，它显示的是 disk usage，也就是这个文件占了多大的硬盘容量，或者说文件系统实际分配了多少空间给到这个文件。而不是，这个文件，它本身有多大。这个区别比较关键，后面会有更多的说明。&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ du *
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5568	1-2-1_2frames_ap4h.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;8040	1-2-1_2frames_ap4x.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3928	1-2-1_2frames_apch.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2152	1-2-1_2frames_apcn.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;688	1-2-1_2frames_apco.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1592	1-2-1_2frames_apcs.mov
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;我们使用 &lt;a href="https://github.com/eza-community/eza"&gt;eza&lt;/a&gt; 这个 ls 的替代，用 &lt;code&gt;eza -lh -b -S&lt;/code&gt; 这个命令得到这样的输出：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ eza -lh -b -S
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Permissions Size Blocks User Date Modified Name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 2.7Mi &lt;span class="m"&gt;5568&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_ap4h.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 3.9Mi &lt;span class="m"&gt;8040&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_ap4x.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 1.9Mi &lt;span class="m"&gt;3928&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_apch.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 1.0Mi &lt;span class="m"&gt;2152&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_apcn.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 342Ki &lt;span class="m"&gt;688&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_apco.mov
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.rw-r--r--@ 793Ki &lt;span class="m"&gt;1592&lt;/span&gt; thom &lt;span class="m"&gt;27&lt;/span&gt; Oct 17:32 1-2-1_2frames_apcs.mov
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-l&lt;/code&gt;: Display extended file metadata as a table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-h&lt;/code&gt;: Add a header row to each column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-b&lt;/code&gt;: List file sizes with binary prefixes. &lt;code&gt;--binary&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-S&lt;/code&gt;: List each file’s number of file system blocks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;可以看到 Blocks 那一栏跟 &lt;code&gt;du *&lt;/code&gt; 的输出是一样的。&lt;code&gt;-S&lt;/code&gt; 的 flag 的作用也正是列出 file system blocks。&lt;/p&gt;</description></item><item><title>C++ Preprocessor</title><link>https://thomjiji.github.io/posts/cpp-preprocessor/</link><pubDate>Thu, 21 Sep 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/cpp-preprocessor/</guid><description>&lt;p&gt;&lt;strong&gt;Excerpted from &lt;a href="https://www.learncpp.com/cpp-tutorial/introduction-to-the-preprocessor/"&gt;learncpp.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="preprocessor"&gt;preprocessor&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;.cpp file =&amp;gt; preprocessor:
&lt;ul&gt;
&lt;li&gt;Make change to the text of the code file, but not actually to the original code file, rather temporarily in-memory
or using temporary files.&lt;/li&gt;
&lt;li&gt;Uninteresting things: strip out comments, ensures each code file ends in a newline.&lt;/li&gt;
&lt;li&gt;One important role: &lt;strong&gt;process &lt;code&gt;#include&lt;/code&gt; directives&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;=&amp;gt; What comes out of the preprocessor is called &lt;strong&gt;translation unit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The translation unit is then compiled by the compiler.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;The entire process of preprocessing, compiling and linking is called &lt;strong&gt;translation&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Parse QuickTime File Format</title><link>https://thomjiji.github.io/posts/parse-quicktime/</link><pubDate>Mon, 18 Sep 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/parse-quicktime/</guid><description>&lt;h3 id="apple-developer-documentation"&gt;Apple Developer Documentation&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/quicktime-file-format"&gt;Storing and sharing media with QuickTime files&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/documentation/quicktime-file-format/color_parameter_atom"&gt;Color parameter atom (&amp;lsquo;colr&amp;rsquo;)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/library/archive/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9"&gt;Uncompressed Y´CbCr Video in QuickTime Files&lt;/a&gt; — Documentation Archive&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="other-resources"&gt;Other resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.multimedia.cx/index.php/Apple_ProRes"&gt;Apple ProRes - MultiMedia Wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://exiftool.org/TagNames/QuickTime.html"&gt;QuickTime Tags - ExifTool&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://atomicparsley.sourceforge.net/mpeg-4files.html"&gt;MPEG-4 files - Atomic Parsley&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mp4ra.org/"&gt;MP4RA - Official Registration Authority for the ISOBMFF family of standards&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="implementationstools"&gt;Implementations/tools&lt;/h3&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Implementations&lt;/th&gt;
 &lt;th&gt;Language&lt;/th&gt;
 &lt;th&gt;Notes&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://github.com/piersdeseilligny/metacolor.editor"&gt;metacolor.editor&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;C#&lt;/td&gt;
 &lt;td&gt;Simple Implementation, can only change NCLC tags. Provide GUI.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://github.com/bbc/qtff-parameter-editor/tree/master"&gt;qtff-parameter-editor&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;C++&lt;/td&gt;
 &lt;td&gt;Good implementation, can only change NCLC tags. CLI.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://mogurenko.com/"&gt;AMCDXVideoPatcherCLI&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;C++&lt;/td&gt;
 &lt;td&gt;Close source. Can modify colr atom, add gama atom (but value of gamma can&amp;rsquo;t not be changed — seems a bug)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://github.com/da8eat/qtfile_pp"&gt;qtfile_pp&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;C++&lt;/td&gt;
 &lt;td&gt;AMCDXVideoPatcherCLI 作者的开源 parser，想必 AMCDXVideoPatcherCLI 的具体实现能够从这里看出一些端倪&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://github.com/Stuff7/dryv"&gt;dryv&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;Rust&lt;/td&gt;
 &lt;td&gt;No docs&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;a href="https://github.com/axiomatic-systems/Bento4"&gt;bento4&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;C++&lt;/td&gt;
 &lt;td&gt;最完善&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="inspection-tools"&gt;Inspection tools&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;hexdump -vC&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/wader/fq"&gt;fq&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gpac.github.io/mp4box.js/test/filereader.html"&gt;MP4Box.js&lt;/a&gt; - a file inspection tool&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/essential61/mp4analyser"&gt;mp4analyser&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="notes"&gt;Notes&lt;/h3&gt;
&lt;p&gt;这么些处理 atom (包括 NCLC tag) 的实现，都是用 C++ 写的。其实 Rust 也能做这些 low-level 的事情，对吗？只是这门语言比较新，暂时还没有人用它来做这个事而已。那么我能不能来做呢？用 Rust 写一个 parse MOV file format 的实现。其实已经有了：&lt;a href="https://github.com/Stuff7/dryv"&gt;dryv&lt;/a&gt;——这两天就在更新。&lt;/p&gt;</description></item><item><title>Machine Learning Glossary</title><link>https://thomjiji.github.io/posts/machine-learning-glossary/</link><pubDate>Thu, 07 Sep 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/machine-learning-glossary/</guid><description>&lt;h2 id="reference"&gt;Reference&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://developers.google.com/machine-learning/glossary"&gt;Machine Learning Glossary - Google for
Developers&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="activation-function"&gt;activation function&lt;/h2&gt;
&lt;p&gt;A function that enables neural networks to learn non-linear (complex) relationships
between features and the label. Popupar activation functions include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ReLU&lt;/li&gt;
&lt;li&gt;Sigmoid&lt;/li&gt;
&lt;li&gt;Tanh&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="backpropagation"&gt;backpropagation&lt;/h2&gt;
&lt;p&gt;The algorithm that implements gradient descent in neural networks.&lt;/p&gt;
&lt;p&gt;Training a neural network involves many iterations of the following two-pass cycle:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;During the &lt;strong&gt;forward pass&lt;/strong&gt;, the system processes a batch of examples to yild
prediction(s). The system compares each prediction to each label value. The
difference between the prediction and the lable value is the loss for that example.
The system aggregates the losses for all the examples to compute the total loss for
the current batch.&lt;/li&gt;
&lt;li&gt;During the &lt;strong&gt;backward pass&lt;/strong&gt; (backpropagation), the system reduces loss by adjusting
the weights of all the neurons in all the hidden layer(s).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Neural networks often contain many neurons across many hidden layers. Each of those
neurons contribute to the overall loss in difference ways. Backpropagation determines
whether to increase or decrease the weights applied to particular neurons.&lt;/p&gt;</description></item><item><title>Calculus Recap</title><link>https://thomjiji.github.io/posts/calculus-recap/</link><pubDate>Wed, 30 Aug 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/calculus-recap/</guid><description>&lt;h2 id="intermediate-value-theorem-ivt"&gt;Intermediate Value Theorem (IVT)&lt;/h2&gt;
&lt;p&gt;If a function $f(x)$ is continuous on a closed interval $[a, b]$ and $k$ is any number between $f(a)$ and $f(b)$, then there is at least one number $c$ in the interval $[a, b]$ such that $f( c) = k$.&lt;/p&gt;
&lt;p&gt;The intermediate value theorem has two conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Function $f$ is continuous over the interval $[a, b]$.&lt;/li&gt;
&lt;li&gt;The value $d$ lies between $f(a)$ and $f(b)$&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We &lt;em&gt;must&lt;/em&gt; establish these two conditions to conclude that there is a value $c$ in the interval $[a, b]$ for which $g(x) = d$ (another way to phrase this conclusion is that the equation $g(x) = d$ has a solution where $a &lt;= x &lt;= b$).&lt;/p&gt;</description></item><item><title>Give Up Vim</title><link>https://thomjiji.github.io/posts/give-up-vim/</link><pubDate>Sun, 09 Jul 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/give-up-vim/</guid><description>&lt;h3 id="为什么从-vim-切换回普通-cursor"&gt;为什么从 Vim 切换回普通 Cursor&lt;/h3&gt;
&lt;p&gt;Obsidian 用的就不是 Vim 模式。因为我需要在 Obsidian 输入中文，中文输入之下，Vim 完全是不可用的状态。我也不想去折腾怎么让 Vim 的模态切换在中文输入下也可用（应该是有这样的解决方案的）。&lt;/p&gt;
&lt;p&gt;其他地方，各种输入框：浏览器、Raycast、ChatGPT，包括网页的全局搜索框（Cmd+F），都不是工作在 Vim 的模式下（确实曾经也尝试过把浏览器也用 Vim keybind 来操作&amp;hellip;）。而在这些场景下使用普通的 Cursor 移动方式对我来说也已经非常熟练和习惯了。也觉得 &lt;code&gt;Cmd ←&lt;/code&gt; 和 &lt;code&gt;Cmd →&lt;/code&gt; 回到行首行尾和 &lt;code&gt;Opt ←&lt;/code&gt;, &lt;code&gt;Opt →&lt;/code&gt; （上一个词/下一个词）蛮好用的。&lt;/p&gt;
&lt;p&gt;我对在 Insert mode 和 Normal mode 之间切换感到疲倦。使用 Normal cursor 的话，就一个模式我想什么时候移动就什么时候移动。用 Vim 我还需要从 Insert mode 切换出来。而且我使用的退出 Insert mode 的 keybind 是 &lt;code&gt;jk&lt;/code&gt;，而不是 &lt;code&gt;Esc&lt;/code&gt;。之前觉得 &lt;code&gt;Esc&lt;/code&gt; 在键盘的位置，还是会让手的 movement 太大。&lt;code&gt;jk&lt;/code&gt; 直接就在 &lt;code&gt;hjkl&lt;/code&gt; 下，手臂不需要移动，非常方便。但现在觉得 &lt;code&gt;jk&lt;/code&gt; 都麻烦，尤其在模态之间切换频繁的话，一会儿就得 &lt;code&gt;jk&lt;/code&gt; 来一下，非常繁琐——繁琐是因为模态的切换，而不是换个 keybind 就能解决的。所以我选择不要这些模态。&lt;/p&gt;
&lt;p&gt;在 PyCharm 的 Completion 之间选择 Candidates，有时需要上下移动选择那个我想要的。之前想把它们 bind 到 &lt;code&gt;hjkl&lt;/code&gt; 上，但怎么都找不到办法，只有使用上下键。在 Vim 原教旨主义者看来很不 ok 是吧，但我当时忍了下来。现在想既然如此，为啥不直接全换到 Normal keybind。我知道是可以直接用 Emacs 的 keybind &lt;code&gt;Ctrl n&lt;/code&gt; 和 &lt;code&gt;Ctrl p&lt;/code&gt; 来上下选择，但……&lt;/p&gt;</description></item><item><title>DEVONthink 上手</title><link>https://thomjiji.github.io/posts/devonthink-unboxing/</link><pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/devonthink-unboxing/</guid><description>&lt;p&gt;我主要用 DEVONthink 来管理我的 PDF 文档。那事情最初呢，是因为我想找一个 PDF 阅读器。首先考虑的自然是 PDF Expert，然后是 Adobe Acrobat Reader。PDF Expert 我以前在 Mac 上试用过，功能很简单，就是一个纯粹的 PDF 阅读器，可以标注划线啥的，能满足我基本需要。但它是订阅制，每年 79.9 刀，也不便宜。况且我也不太喜欢订阅制。想着数码荔枝有没有代理 PDF Expert 在国内的销售？这样兴许能便宜好多。但没有。Adobe Acrobat Reader 呢，下载玩了一下，印象不怎么好。再加上我对 Adobe 的软件都不怎么喜欢，印象都不怎么好（Creative Cloud 那一大坨东西啊……看着就头疼），这个 Acrobat 也赶紧卸载了。&lt;/p&gt;
&lt;p&gt;那么回过来一想，PDF 阅读器，macOS 自带的不能用吗？我也试了下，作为正经的主力的 PDF 阅读器，我还是别为难自己了。人那个系统自带的 Preview 啊，苹果一贯的所谓简洁设计，我要用的功能找半天也找不到（还是没有？不知道）。我还是放自己一马吧。&lt;/p&gt;
&lt;p&gt;DEVONthink，这个软件呢，以前就有所耳闻。估计还是 2016、2017 年那会儿，刚入坑这数码生活的时候就有听说，终极的知识管理工具。后来在&lt;a href="https://space.bilibili.com/845032"&gt;环环&lt;/a&gt;的开箱 ARRI Mini LF 的&lt;a href="https://www.bilibili.com/video/BV19Z4y1x7Ez/"&gt;直播录像&lt;/a&gt;中，有看到他也在用 DEVONthink，在开 Mini LF 的一些文档什么的。那时觉得哎他有一个地方可以放所有的 PDF 文档，想查哪个文档直接来这找就行。我当时还没有，文档都是不知道放在哪里，Google Drive 也好，MEGA Sync 也好，或者 iCloud 也有。而且，重点是 DEVONthink 它自带有 PDF 阅读器啊。这个就正合我意了，于是这才冒出念头我要实际下载来试一下。&lt;/p&gt;
&lt;p&gt;Ok，下载安装了。这一大堆都是什么……噢看到有 Manual，还是一本…书？有提供 PDF 版本，EPUB 版本。这软件这么复杂的吗？当然我对这个复杂度也有预期，毕竟「终极知识管理工具」。那么先用起来吧。&lt;/p&gt;
&lt;p&gt;噢它是 Database 的概念。建一个 Database，所有的东西都存到这个 Database 里，存完后 Database 之外的副本就可以删掉了。然后 DEVONthink 软件在这个 Database 里做所有的扫描和索引，从而让你可以在里面全局搜索，不止搜文档名，搜索文档的内容都行。&lt;/p&gt;</description></item><item><title>ICC Profile</title><link>https://thomjiji.github.io/posts/icc-profile/</link><pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/icc-profile/</guid><description>&lt;p&gt;ICC Profile 这个文件本身其实是一个 binary 二进制文件。我们打开 macOS 里的 ColorSync Utility 软件，随便打开一个 Profile，比如 sRGB IEC61966-2.1。这时弹出来一个窗口：&lt;/p&gt;
&lt;p&gt;&lt;img src="./img/01_icc_profile_parsing.jpg" alt="01_icc_profile_parsing"&gt;&lt;/p&gt;
&lt;p&gt;这个窗口其实就是对 sRGB IEC61966-2.1 这个 ICC Profile 的 parser，它 parse 出来文件头、各种标签等等。&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;对普通显示器校色的时候，很难不碰到 &lt;a href="https://en.wikipedia.org/wiki/ICC_profile"&gt;ICC profile&lt;/a&gt; 这个东西。我们都知道这个名词，显示器的 ICC 文件，或许模糊的对它有一些概念。但它究竟是什么？原理如何。&lt;/p&gt;
&lt;p&gt;ICC Profile 跟我们已经有很明确概念的 ACES，或者更广泛一些地讲：“现代的色彩管理流程”，是很相似的 idea。都有一个处于整个链路中间的非常大的色彩空间，大到足以容纳所有不同的输入、显示和输出设备的各种色域（sRGB、AdobeRGB、Rec.709 等等）&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;。这个色彩空间在 ICC 这个概念下叫作 PCS（Profile Connection Space）。ICC profile 通过定义设备源或目标色彩空间与 PCS 之间的&lt;strong&gt;映射&lt;/strong&gt;来描述特定设备的色彩属性&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;。&lt;/p&gt;
&lt;p&gt;ICC 本身并不进行任何校准，它们只包含显示器关于色彩成像能力的数据。这些数据用于帮助可以识别 ICC profile 的软件（我们叫它 ICC aware 的软件）通过 CMM（色彩管理模块）对图像进行调整，以尝试纠正显示器的色偏来进行校准。ICC profile 完成的实际上是对&lt;strong&gt;图像的调整&lt;/strong&gt;，而不是对显示器的校正。不同的软件使用不同的 CMM 的话，即使都采用同一个 ICC，最终出来的结果也可能不一样。&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://www.ibm.com/docs/en/i/7.4?topic=management-icc-profiles"&gt;ICC Profile&lt;/a&gt; - IBM&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/ICC_profile"&gt;ICC profile&lt;/a&gt; - Wikipedia&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>VCGT Tag</title><link>https://thomjiji.github.io/posts/vcgt-tag/</link><pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/vcgt-tag/</guid><description>&lt;p&gt;之前我们知道，DisplayCAL 这种校色软件的工作原理：它会生成一个配置文件，在系统里加载，实际作用到显卡的输出信号上。更细节一点则是：&lt;/p&gt;
&lt;p&gt;DisplayCAL 生成的 ICC 配置文件中会包含一个叫作 VCGT（Video Card Gamma Table）的 tag，它实际是一个 1D LUT，包含对显示器的灰阶或白点的校正。然后操作系统需要把这个 VCGT Tag 加载到显卡输出信号上的有一个 Look Up Table 上，从而实现对显卡输出信号的校正。同时显卡的这个 Look Up Table 也是有精度限制的。&lt;/p&gt;
&lt;p&gt;&lt;img src="./img/img1_vcgt_in_icc.png" alt="vcgt_in_icc"&gt;&lt;/p&gt;
&lt;p&gt;具体在使用 DisplayCAL 的时候，右键桌面右下角 DisplayCAL 的图标，就会看到有一个 Reset video card gamma table 的东西。在系统加载了 DisplayCAL 生成的 profile 的情况下，这时点一下 Reset video card gamma table 会发现整个桌面的反差，或者说 Gamma、灰阶变了，它把对于显卡的校正给重置掉了，回到了最初的状态。&lt;/p&gt;
&lt;p&gt;再者就是我们还可以在 DisplayCAL 的 Tone curve 的设置中看到：如果不把 Tone curve 设为 “As measured” 的话，比如手动设为 Gamma 2.2。那 DisplayCAL 会做这么一件事情：在校准过程中，会通过一个 1D LUT 来校准（中和、补偿）显示器本身与这条纯粹的、Gamma 为 2.2 的指数曲线不相符的地方。如果设为 “As measured” 的话，则显示器的 grey scale 是怎么样就是怎么样，不做任何的校准和调整。&lt;/p&gt;</description></item><item><title>为什么使用上屏卡</title><link>https://thomjiji.github.io/posts/why-do-we-need-video-card/</link><pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/why-do-we-need-video-card/</guid><description>&lt;p&gt;做高端校色软件 ColourSpace 的 LightIllusion 有篇文章 &lt;a href="https://www.lightillusion.com/what_is_wrong_with_iccs.html"&gt;What&amp;rsquo;s wrong with ICCs?&lt;/a&gt; 指出了 ICC profile 的一些问题。&lt;/p&gt;
&lt;p&gt;总的来说，ICC profile 能 work 的前提是软件本身支持它，软件是否是 ICC aware。通常来说 ICC aware 的软件有一个 CMM 色彩管理模块（Color Management Module）能够正确识别我们生成的 ICC profile，然后能够对图像做调整以达到「准确」的结果，实现校色的目的。先不说 ICC 这种方式本质上是对图像的调整，而不是对显示器本身的校正（后者是更好的方式，所谓硬件校准就是如此）。即使软件具有 CMM，准确度和性能还得看各个软件自身的优化。这就变成一件非常麻烦和复杂的事情。那些不是 ICC aware 的软件，看到的就做一个完全未经校准的画面。&lt;/p&gt;
&lt;p&gt;那对于 Adobe 全家桶来说，像 Ps、Lr 这种平面设计软件，它们是有 CMM 模块，叫作 ACE（Adobe Color Engine）。就是能够识别图像自带的 ICC profile，将其转换到 Ps 的工作色彩空间。那对于 Pr 来说，它也有被他们称为 DCM（Display Color Management）的东西，作为 Pr 内在的色彩管理方式，也是利用系统的 ICC profile 来进行工作的。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;DCM uses the ICC profile for your monitor to apply a colorimetric conversion from the sequence working color space (or media color space in the case of the source monitor) to the monitor color space. The profile is specified by the operating system. We generally recommended using the default profile that the system choses for your display. If your monitor has been professionally calibrated, use that profile. The default profile may have the name of your monitor or something generic like “Color LCD”. Using the specified display profile will ensure predictable colors across the system and in other apps like web browsers and email. DCM requires GPU Acceleration. GPU acceleration can be configured in Project Settings &amp;gt; General &amp;gt; Video Rendering and Playback. &lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>显示器校色笔记</title><link>https://thomjiji.github.io/posts/monitor-calibration-notes/</link><pubDate>Wed, 15 Feb 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/monitor-calibration-notes/</guid><description>&lt;h2 id="displaycal-官网-user-guide"&gt;DisplayCAL 官网 User Guide&lt;/h2&gt;
&lt;p&gt;在对显示器校色之前，必须预热至少 30 分钟。这一点在我最近的校准过程中可以明确体会到，比如：在调整显示器自身的 RGB 输出时，当你把红绿蓝三个通道终于调到一条线上之后，这时亮度不达标了。调节显示器的亮度以达到目标值，比如 100 nits 之后，RGB 那三个值又不在一条线上了。一方面跟显示器的素质有关，不能保证在亮度增减的同时保持 RGB 三个值的输出一致。另一方面也跟显示器预热有关，没到 30 分钟状态还不稳定。&lt;/p&gt;
&lt;p&gt;显示器校准的基本概念：Calibration 和 Profiling/Characterization。在使用 DisplayCAL 进行校准的时候，第一步就是通过显示器自身的调节按钮，比如显示器的 RGB 三通道值的输出，来与事先定义好的目标值匹配。调节显示器的亮度按钮使其达到比如 100 尼特；在色温选项里使用用户自定义的方式来调节 RGB 输出，使其达到比如 6500K 的色温（CCT）。这一步我们粗略的称之为校准 Calibration，需要人手动去调的。而第二步是软件自动实现的过程，叫做 Profiling，就是它会在屏幕上生成一系列色块，测量这些色块的值，与标准值进行匹配，然后生成一个 Profile (e.g. ICC profile) 给我们最终加载到系统上。&lt;strong&gt;Profiling 实际上并不改变颜色&lt;/strong&gt;，它描述的是该显示器对各种颜色的响应，通常存储在一个 ICC 配置文件中。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Characterization (or profiling) is recording the way a device reproduces or responds to color. Typically the result is stored in a device ICC profile. Such a profile does not in itself modify color in any way. What it does is allow a system such as a CMM (Color Management Module) or color aware application to modify color when combined with another device profile. Only by knowing the characteristics of two devices or colorspaces, can a way of transferring color from one device representation to another be achieved.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description></item><item><title>mp4muxer &amp; mp4demuxer Basic Usage</title><link>https://thomjiji.github.io/posts/mp4muxer-mp4demuxer-basic-usage/</link><pubDate>Sun, 29 Jan 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/mp4muxer-mp4demuxer-basic-usage/</guid><description>&lt;h2 id="installation"&gt;Installation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/DolbyLaboratories/dlb_mp4base"&gt;mp4muxer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/DolbyLaboratories/dlb_mp4demux"&gt;mp4demuxer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="commands"&gt;Commands&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;将 MP4 的音视频分离（脱壳 Demux）：&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mp4demuxer --input-file input.mp4 --output-folder ~/Output
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="2"&gt;
&lt;li&gt;合并杜比视界 Profile 8.4 和杜比全景声双音轨：&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mp4muxer &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i input.h265 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; --input-video-frame-rate &lt;span class="m"&gt;25&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; --hvc1flag &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; --dv-bl-compatible-id &lt;span class="m"&gt;4&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i Stereo.aac &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i Atmos.ec3 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -o DolbyVision_DolbyAtmos.mp4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="3"&gt;
&lt;li&gt;合并 SDR 视频和杜比全景声双音轨:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mp4muxer &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i input.h264 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; --input-video-frame-rate &lt;span class="m"&gt;25&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i Stereo.aac &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -i Atmos.ec3 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="se"&gt;&lt;/span&gt; -o SDR_DolbyAtmos.mp4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Baselight LOOK 添加更多的 DRT 和 Looks</title><link>https://thomjiji.github.io/posts/baselight-look-%E6%B7%BB%E5%8A%A0%E6%9B%B4%E5%A4%9A%E7%9A%84-drt-%E5%92%8C-looks/</link><pubDate>Sat, 28 Jan 2023 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/baselight-look-%E6%B7%BB%E5%8A%A0%E6%9B%B4%E5%A4%9A%E7%9A%84-drt-%E5%92%8C-looks/</guid><description>&lt;h2 id="操作步骤"&gt;操作步骤&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://www.filmlight.ltd.uk/support/customer-login/colourspaces/colourspaces.php"&gt;Truelight Colour Spaces&lt;/a&gt;, download:
&lt;ol&gt;
&lt;li&gt;ARRI Look Library (LogC3)&lt;/li&gt;
&lt;li&gt;ARRI Look Library (LogC4)&lt;/li&gt;
&lt;li&gt;ARRI ALF-2 v5 DRT Family&lt;/li&gt;
&lt;li&gt;ARRI REVEAL DRT family&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;将以上四个 zip 分别解压：
&lt;ol&gt;
&lt;li&gt;把 ARRI Look Library (LogC3) 文件夹里的所有文件拷贝到 =&amp;gt; &lt;code&gt;/Library/Application Support/FilmLight/looks&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把 ARRI Look Library (LogC4) 文件夹里的所有文件拷贝到 =&amp;gt; &lt;code&gt;/Library/Application Support/FilmLight/looks&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把 ARRI ALF-2 v5 DRT Family 文件夹里的所有文件拷贝到 =&amp;gt; &lt;code&gt;/Library/Application Support/FilmLight/etc/colourspaces&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;把 ARRI REVEAL DRT family 文件夹里的所有文件拷贝到 =&amp;gt; &lt;code&gt;/Library/Application Support/FilmLight/etc/colourspaces&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;打开 Baselight LOOK，完成。&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;要实现预期的视觉效果，你必须在输出端应用 ARRI DRT 系列：LogC3 库使用 ALF-2，LogC4 库使用 REVEAL。或者，你也可以使用 T-CAM 的 Scene Look（例如 C-302 ARRI-2018），通过 T-CAM DRT 模拟 ARRI DRT 的视觉效果。&lt;/p&gt;</description></item><item><title>High Quality H.264 Render in Baselight</title><link>https://thomjiji.github.io/posts/high-quality-h.264-render-in-baselight/</link><pubDate>Wed, 28 Dec 2022 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/posts/high-quality-h.264-render-in-baselight/</guid><description>&lt;!-- &lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/Vj5zy2q7O9U?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;
 --&gt;

 &lt;div
 style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe
 src="https://player.vimeo.com/video/426967364?dnt=0"
 style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allow="fullscreen"&gt;
 &lt;/iframe&gt;
 &lt;/div&gt;

&lt;h2 id="params"&gt;Params&lt;/h2&gt;
&lt;p&gt;Start at &lt;a href="https://vimeo.com/426967364#t=2396s"&gt;39:56&lt;/a&gt;, Daniele introduced the method for rendering high quality H.264 in Baselight. Here is the key parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rate Control: CRF based VBR&lt;/li&gt;
&lt;li&gt;Quantizer:
&lt;ul&gt;
&lt;li&gt;Nominal Quantizer parameter: 18&lt;/li&gt;
&lt;li&gt;Quantizer parameter: 18&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>About</title><link>https://thomjiji.github.io/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://thomjiji.github.io/about/</guid><description>&lt;p&gt;Under construction&amp;hellip;&lt;/p&gt;</description></item></channel></rss>