# BitesBytes Lab — Full Technical Corpus (llms-full.txt) > Complete plain-Markdown compilation of BitesBytes Lab indie dev projects, open-source GitHub repositories, and bilingual (zh-CN / EN) technical sharing essays for LLM context windows, AI search indexing, and local RAG ingestion. - Canonical Index: https://twn39.github.io/llms.txt - GitHub Profile: https://github.com/twn39 ================================================================================ PART 1: OPEN SOURCE REPOSITORY SPECIFICATIONS ================================================================================ ## Repository: twn39/pylibheif (v1.23.1) - GitHub URL: https://github.com/twn39/pylibheif - Primary Language: Python | License: LGPL-3.0 | Stars: 1 - EN Summary: High-performance Python bindings for libheif (HEIC / AVIF / JPEG2000) via nanobind — Zero-copy Python/C++ bridge for modern HEIF containers featuring bidirectional NumPy Buffer Protocol access, >300k OPS streaming I/O, Pillow plugin integration, and a CLI toolkit. - ZH Summary: 基于 nanobind 构建的高性能 libheif (HEIC / AVIF / JPEG2000) Python 零拷贝绑定 — 面向现代高动态图像容器打造的 C++/Python 桥接库。支持通过 Python Buffer Protocol 与 NumPy 双向零拷贝共享像素平面,并提供超 300k OPS 的流式读写、Pillow 插件与命令行工具集。 - Key Engineering Highlights: * Zero-copy encoded binary export via lifetime-decoupled read-only memoryview * GIL-free multi-threaded HEIC, AVIF & JPEG2000 codecs with >300k OPS stream I/O * Seamless zero-copy NumPy plane sharing, Pillow plugin, and standalone wheels ## Repository: twn39/pyopenxlsx (v1.6.0) - GitHub URL: https://github.com/twn39/pyopenxlsx - Primary Language: Python | License: BSD-3-Clause | Stars: 4 - EN Summary: High-throughput Python Excel (.xlsx) binding powered by the OpenXLSX-NX C++ kernel — Delivers order-of-magnitude faster .xlsx read/write throughput and lower memory overhead than pure-Python openpyxl while preserving an idiomatic Pythonic API. - ZH Summary: 基于 OpenXLSX-NX C++ 内核的高吞吐 Python Excel (.xlsx) 读写引擎 — 在保持符合直觉的 Pythonic API 的同时,由底层 C++17 OpenXLSX-NX 驱动单元格解析与序列化,相比纯 Python 实现的 openpyxl 大幅提升海量工作簿的读写速度并降低内存峰值。 - Key Engineering Highlights: * C++17 native XML & ZIP streaming under the hood with ergonomic Pythonic wrappers * Supports Agile encryption, streaming I/O, vector shapes, and threaded comments * Ships full .pyi type stubs and prebuilt wheels across macOS, Linux, and Windows ## Repository: twn39/codegraph-gen (v1.7.0) - GitHub URL: https://github.com/twn39/codegraph-gen - Primary Language: Python | License: MIT | Stars: 0 - EN Summary: Multi-language static codebase knowledge graph compiler built for AI Coding Agents — Parses 11 languages via tree-sitter, clusters cohesive components with Louvain community detection, and exports database-free Markdown vaults (Obsidian-style) tailored for Claude Code and Codex. - ZH Summary: 面向 Claude Code / Codex 等编码 Agent 的多语言静态代码知识图谱编译器 — 基于 tree-sitter 静态解析 11 种编程语言符号与调用边,通过 Louvain 模块度社区发现算法自动聚类逻辑组件,导出零数据库依赖的扁平关联 Markdown 图谱库(Obsidian Vault)。 - Key Engineering Highlights: * Extracts cross-file calls, inheritance, and import edges across 11 languages via tree-sitter * Detects architectural God Nodes, circular file imports, and mutual recursion cycles * Stat-First incremental caching and generated AGENTS.md protocols with zero LLM API cost ## Repository: twn39/yt-dlp-qt-gui (v0.7.0) - GitHub URL: https://github.com/twn39/yt-dlp-qt-gui - Primary Language: Python | License: GPL-3.0 | Stars: 7 - EN Summary: Lightweight, modern cross-platform desktop client built on PySide6 and yt-dlp — Wraps yt-dlp format probing, stream muxing, subtitle embedding, and proxy routing inside a responsive multi-threaded PySide6 desktop interface across macOS, Windows, and Linux. - ZH Summary: 基于 PySide6 与 yt-dlp 内核构建的轻量级现代化跨平台流媒体下载工具 — 采用响应式多线程后台工作队列架构,将复杂的音视频流探测、清晰度编码筛选、字幕合并与代理配置封装为简洁流畅的原生桌面体验,支持 Windows、macOS 与 Linux。 - Key Engineering Highlights: * Non-blocking QThread worker architecture keeps 60fps UI responsiveness under concurrent downloads * Supports 1,000+ streaming sites (YouTube, Bilibili, Vimeo) with automatic FFmpeg stream merging * Bilingual UI, resumeable task queues, codec/resolution presets, and clipboard monitoring ## Repository: twn39/OpenXLSX-NX (v1.12.1) - GitHub URL: https://github.com/twn39/OpenXLSX-NX - Primary Language: C++ | License: BSD-3-Clause | Stars: 4 - EN Summary: Next-generation security-hardened C++17 library for high-speed .xlsx processing — An actively engineered C++17 continuation of OpenXLSX featuring enterprise fuzz-hardening, AST formula calculation, style deduplication, agile encryption, and low-memory streaming. - ZH Summary: 面向现代 C++17 安全加固与流式性能优化的下一代 .xlsx 文档引擎 — 在经典 OpenXLSX 基础上深度演进的零重型依赖 C++17 核心库。集成 LLVM libFuzzer 模糊测试加固、AST 公式求值引擎、样式哈希去重与高吞吐流式写入管线。 - Key Engineering Highlights: * Hardened against malformed OOXML inputs with LLVM libFuzzer plus ASan/UBSan verification * Built-in AST formula engine, automatic style deduplication, and high-throughput streaming * Minimal external dependencies with clean CMake integration across all major compilers ## Repository: twn39/tex2math (v2.4.1) - GitHub URL: https://github.com/twn39/tex2math - Primary Language: Rust | License: LGPL-3.0 | Stars: 0 - EN Summary: Blazing-fast, zero-copy Rust compiler & CLI converting LaTeX math to native MathML — Combines full AST parsing via winnow combinators with KaTeX-grade symbol dictionaries to emit standards-compliant MathML XML—rendering complex math in modern browsers with zero client JS. - ZH Summary: 极速、零拷贝、高容错的 Rust LaTeX 数学公式转原生 MathML 编译器与 CLI — 基于 winnow 解析器组合子构建完整数学 AST,并结合 KaTeX 级符号字典直接输出符合浏览器标准的原生 MathML XML —— 无需客户端加载庞大 JS 公式运行时即可渲染复杂嵌套公式。 - Key Engineering Highlights: * Slice-oriented winnow parser combinator AST handles deeply nested fractions, radicals & matrices * Emits native browser MathML (Chrome 109+, Safari, Firefox) eliminating heavy JS math runtimes * Pure Rust with resilient error recovery—ideal for SSR pipelines, CLIs, and WebAssembly targets ================================================================================ PART 1B: CLOSED-SOURCE & PROPRIETARY SYSTEM SPECIFICATIONS ================================================================================ ## App Store Application: Espresso — True Color Film Cam / Espresso — 真实色彩胶片相机 (v1.7.18 · iOS) - App Store (US): https://apps.apple.com/us/app/espresso-true-color-film-cam/id6802915035 - App Store (CN): https://apps.apple.com/cn/app/espresso-%E7%9C%9F%E5%AE%9E%E8%89%B2%E5%BD%A9%E8%83%B6%E7%89%87%E7%9B%B8%E6%9C%BA/id6802915035 - Core Stack: Swift 6 · Metal 3D LUT · Bayer RAW · CoreML ANE - EN Summary: Real-time Metal 3D LUT film-simulation camera with scene-referred Bayer RAW development — Brings color-accurate film science (Bradford/CAT16 chromatic adaptation, halation, bloom, organic grain, and spline tone curves) to both a 60fps Metal live viewfinder and full-resolution Metal compute photo processing. - ZH Summary: 基于 Metal 3D LUT 实时渲染与场景线性 Bayer RAW 显影的专业胶片模拟相机 — 将严谨色彩科学(Bradford / CAT16 色适应、OETF 曲线、卤化高光溢出 Halation 与物理颗粒模型)注入 iOS 实时取景器与 Metal 计算着色器成片管线,还原富士、柯达、徕卡与理光经典胶片质感。 - Key Architecture Highlights: * Dual GPU architecture: MTKView live render pass + actor-isolated Metal compute darkroom pipeline * Headless EspressoCore color-science engine with scene-referred Bayer CFA & Apple ProRAW strategies * CoreML ANE PiperSR-2x neural super-resolution, iOS Camera Control widget & EXIF border typography ## App Store Application: Fangcun — Stamp Camera / 方寸 — 邮票相机 (v1.1.0 · iOS) - App Store (US): https://apps.apple.com/us/app/fangcun-stamp-camera/id6795181081 - App Store (CN): https://apps.apple.com/cn/app/%E6%96%B9%E5%AF%B8-%E9%82%AE%E7%A5%A8%E7%9B%B8%E6%9C%BA/id6795181081 - Core Stack: Swift 6 · GRDB WAL · CJK FTS5 · CKSyncEngine - EN Summary: Vintage stamp camera combining procedural perforation geometry, CJK FTS5 & CloudKit sync — Turns everyday captures into collectible postage stamps using non-destructive normalized crop coordinates, procedural UIBezierPath perforations, viewport-clustered GPS maps, and tactile stamp albums. - ZH Summary: 拍摄即创作:融合程序化齿孔几何、本地优先 GRDB 存储与 iCloud 同步的复古邮票相机 — 将日常瞬间定格为可收藏的专属邮票。采用原图与归一化裁切坐标分离的无损存档设计,支持任意分辨率完美重建三档邮票锯齿边缘,并内置地图足迹聚合、日历集邮册与桌面小组件。 - Key Architecture Highlights: * Three-phase Saga capture pipeline over GRDB 7 SQLite WAL guarantees crash-safe photo persistence * Embedded custom cjkfts5 SQLite tokenizer + keyset pagination for instant CJK full-text search * CloudKit CKSyncEngine tombstone LWW multi-device sync paired with lock-free App Group WidgetKit snapshots ## App Store Application: Cappuccino — Smart Screen & AI / Cappuccino — 截屏神器 & AI (v1.3.0 · macOS) - App Store (US): https://apps.apple.com/us/app/cappuccino-smart-screen-ai/id6792465311?mt=12 - App Store (CN): https://apps.apple.com/cn/app/cappuccino-%E6%88%AA%E5%B1%8F%E7%A5%9E%E5%A5%87-ai/id6792465311?mt=12 - Core Stack: AppKit · ScreenCaptureKit · Vision OCR & AI - EN Summary: Menu-bar macOS capture, scroll-stitching, OCR & AI suite built in pure programmatic AppKit — Engineered from scratch in 100% programmatic AppKit (zero Storyboards/XIBs) under complete Swift 6 strict concurrency checking—unifying Retina capture, scrolling screenshot merge, vector markup, Vision OCR, and AI translation. - ZH Summary: 基于纯代码 AppKit、ScreenCaptureKit 与端侧视觉 AI 构建的 macOS 菜单栏截屏利器 — 摒弃一切 Storyboard/XIB 历史包袱,以 100% 纯代码 AppKit 与 Swift 6 完整数据竞争检查(Strict Concurrency Complete)打造。集区域捕捉、滚动长截图拼接、贴图钉选、矢量标注、端侧 OCR 与多语种 AI 翻译于一体。 - Key Architecture Highlights: * Complete actor-isolated pipeline with deterministic autoreleasepool scoping for minimal menu-bar RSS * High-DPI ScreenCaptureKit window/region capture paired with seamless scrolling image stitching * On-device Apple Vision OCR, AI visual translation, floating pin windows & universal macOS binary ## App Store Application: SymMath — Symbolic Calculator / SymMath — 代数科学计算器 (v1.2.3 · iOS & macOS) - App Store (US): https://apps.apple.com/us/app/symmath-symbolic-calculator/id6765642699 - App Store (CN): https://apps.apple.com/cn/app/symmath-%E4%BB%A3%E6%95%B0%E7%A7%91%E5%AD%A6%E8%AE%A1%E7%AE%97%E5%99%A8/id6765642699 - Core Stack: Swift/C++ Interop · SymEngine · SwiftTexMath - EN Summary: Native Apple Computer Algebra System powered by Swift-C++ interop, SymEngine & LaTeX typesetting — Brings exact symbolic computation to iOS and macOS via SymEngineKit—solving exact polynomial roots, partial derivatives (∂/∂x), algebraic expansions, and interactive function plots rendered in true Latin Modern LaTeX. - ZH Summary: 通过 Swift 原生 C++ 互操作驱动 SymEngine 的 Apple 跨平台符号代数计算器与函数绘图仪 — 将高性能计算机代数系统(CAS)带入 iOS 与 macOS。支持精确根式与三角恒等化简(如 √8 = 2√2)、多元偏导微积分、多项式精确代数求根、矩阵运算,并以经典 Latin Modern 字体实时渲染原生 LaTeX 公式。 - Key Architecture Highlights: * Uses native Swift C++ interoperability (.interoperabilityMode(.Cxx)) over the C++ symengine CAS core * Publication-grade live LaTeX rendering via SwiftTexMath paired with a custom mathematical ribbon keyboard * Interactive auto-scaling function curve plotter powered by Swift Charts plus snapshot-tested UI stability ================================================================================ PART 2: FULL TECHNICAL BLOG ESSAYS (ENGLISH & CHINESE) ================================================================================ --- # [EN] Cross-Camera Metamerism: Quantitative Colorimetric & Visual Analysis - Description: Quantifying hardware CFA metamerism between iPhone Pro sensors and Fujifilm, Sony, and ARRI cameras using CIE 1931 2°, CIEDE2000, ISO 17321 SMI, Vora–Trussell subspace measures, and narrowband LED stress tests. - Canonical URL: https://twn39.github.io/en/blog/cross-camera-metamerism-analysis/ - Related Project: espresso - Published: 2026-11-23 - Tags: Color Science, Metamerism, CIEDE2000, ACES, ProRAW, LUT > **Context**: Espresso Color Pipeline (iPhone Pro RAW / ProRAW → Native Cinema / Film LUTs) > **Colorimetric Benchmarks**: CIE 1931 2° Standard Observer, CIEDE2000 ($\Delta E_{00}$), ISO 17321 SMI, Vora–Trussell Subspace Measure > **Core Question**: When a mobile sensor (iPhone Pro) feeds native film/cinema LUTs calibrated for Fujifilm, Sony, or ARRI cameras, how large is the cross-camera metamerism caused by hardware color filter array (CFA) differences? ## TL;DR: Key Takeaways Under standard broadband lighting such as D65 daylight, hardware CFA metamerism between iPhone Pro and Fujifilm GFX 100 / X-T4 averages only **$\Delta E_{00} = 0.29\text{–}0.43$ (ISO SMI = 98, Vora $\nu = 0.981$)**—well below human perceptibility, with near-zero skin-tone drift ($\Delta E_{00} \le 0.56$). Noticeable physical divergence is confined to **$475\text{–}498\,\text{nm}$ cyan-blue neon** and **$605\text{–}630\,\text{nm}$ orange-red narrowband LEDs** ($+14.5^\circ\text{–}26.3^\circ$ hue twist). Accordingly, Espresso prioritizes a **clean ACES 2.0 scene-referred linear pipeline + native 3D LUTs** over static higher-order polynomial fitting. --- ## 1. Why Analyze Cross-Camera Metamerism? In Espresso's color pipeline, we directly integrate native 3D LUTs calibrated for professional camera systems (such as Fujifilm F-Log2C and ARRI / DaVinci cinema workflows). Before iPhone sensor captures enter these LUTs, the pipeline cleanly separates into two fundamentally distinct stages: 1. **Gamut & Transfer-Function Conversion (Deterministic Math, Exactly Alignable)** Whether the source resides in linear Display P3 and the target LUT expects ACEScct (AP1) or F-Log2C (F-Gamut C), conversions between standard color spaces consist strictly of **well-defined $3 \times 3$ primary transform matrices**, **chromatic adaptation transforms (Bradford / CAT16)**, and **analytical OETF/EOTF log encodings**. As long as scene-referred linear light remains pure and wide-gamut values are not prematurely clipped, gamut and transfer-function alignment is **mathematically lossless and exact** to floating-point precision. 2. **Sensor Spectral Sensitivity (Physical Hardware, Irreducible by Matrix Math)** A digital camera's raw response $\mathbf{c} = [R, G, B]^T$ does not directly measure human CIE XYZ tristimulus values. Instead, it integrates the illuminant spectral power distribution $E(\lambda)$, surface spectral reflectance $R(\lambda)$, and the sensor's Spectral Sensitivity Functions (**SSF**) $\mathbf{S}(\lambda) = [S_R(\lambda), S_G(\lambda), S_B(\lambda)]^T$: $$\mathbf{c} = \int_{400}^{700} E(\lambda)\, R(\lambda)\, \mathbf{S}(\lambda)\, d\lambda$$ By the **Luther–Ives condition**, an error-free $3 \times 3$ matrix mapping camera RGB to standard CIE XYZ exists only if the three SSF curves are exact linear combinations of the human CIE Color Matching Functions (CMF) $\bar{\mathbf{x}}(\lambda)$. In practice, due to signal-to-noise (quantum efficiency) trade-offs and organic dye filter manufacturing constraints, **no commercial camera satisfies the Luther–Ives condition**, and CFA spectral curves vary across manufacturers. This gives rise to **Cross-Camera Metamerism**: two physically distinct spectra that appear identical to human vision can excite different RGB ratios on an iPhone sensor versus a Fujifilm/Sony/ARRI sensor. Conversely, even after an optimal $3 \times 3$ color correction matrix (such as DNG `ColorMatrix`) is applied, irreducible chromatic residuals remain under specific illuminants or narrowband spectra. Before deciding whether Espresso needs higher-order cross-camera spectral fitting (such as Finlayson's Root-Polynomial Color Correction, RPCC), we must answer two concrete questions with objective, reproducible photometry: - **Under everyday broadband illuminants, how large is the hardware metamerism residual between iPhone Pro and Fujifilm/Sony/ARRI? Is it visually perceptible?** - **Under which extreme spectral conditions (e.g., narrowband LEDs, neon signs) does metamerism actually break down?** --- ## 2. Quantitative & Visual Methodology Subjective side-by-side photography cannot isolate **sensor metamerism** from **auto white balance, local tone mapping (LTM), sharpening, and in-camera color profiles**. To strictly isolate hardware SSF physics, this study employs **Spectral Forward Simulation**, placing every camera inside an identical ideal physical environment: ### 2.1 Unified Experimental Protocol - **Spectral Grid**: Uniformly sampled across $400\text{–}700\,\text{nm}$ at $\Delta\lambda = 5\,\text{nm}$ (61 wavelengths), evaluated with the **CIE 1931 2° Standard Observer**. - **Physical White Balance & Linear Matrix Alignment**: Under each test illuminant $E(\lambda)$, every camera is first white-balanced exactly (mapping an ideal Lambertian white diffuser to $[1, 1, 1]$), then fitted with a least-squares optimal $3 \times 3$ linear color correction matrix $\mathbf{M}_{\text{LCC}}$ over the 24-patch ColorChecker (mirroring dual-illuminant DNG `ColorMatrix` interpolation in real RAW pipelines) into CIE XYZ and CIELAB. - Under this protocol, **100% of the remaining color difference originates purely from SSF deviations from the Luther–Ives condition**, completely free of white-balance or exposure error. ### 2.2 Four Orthogonal Analysis Dimensions No single scalar captures metamerism completely. We evaluate four complementary dimensions: | Dimension | Core Metric | Scientific Question Answered | | :--- | :--- | :--- | | **1. Subspace Geometry** | **Vora–Trussell Measure $\nu \in [0, 1]$** | Independent of illuminants and patches, how closely do the 3D subspaces spanned by two cameras' SSFs overlap ($\nu = 1$ means exact $3 \times 3$ equivalence)? | | **2. Multi-Illuminant Error** | **Mean $\Delta E_{00}$** & **ISO 17321 SMI** | Across 6 illuminants—daylight (D65/D50), tungsten (A), fluorescent (FL11), phosphor white LED (LED-B1), and tri-band RGB LED (LED-RGB1)—does residual error exceed human JND ($\approx 1.0\text{–}2.0$)? | | **3. Narrowband Stress Test** | **LED Hue Twist $\Delta h_{ab}(\lambda)$** | Sweeping a monochromatic Gaussian LED ($\text{FWHM} = 15\,\text{nm}$) across $430\text{–}670\,\text{nm}$ in $5\,\text{nm}$ steps to pinpoint high-risk hue-twist bands. | | **4. Perceptual Vector Field** | **CIELAB $a^*b^*$ Displacement (3× scaled)** | Beyond scalar magnitude, showing the exact **chromatic direction** of each patch shift from Fujifilm to iPhone under daylight vs. RGB-LED. | The Vora–Trussell measure is defined as the mean squared cosine of principal angles between orthonormal bases $\mathbf{U}_1, \mathbf{U}_2 \in \mathbb{R}^{N \times 3}$ of the two 3D spectral subspaces: $$\nu(\mathbf{S}_1, \mathbf{S}_2) = \frac{1}{3}\operatorname{tr}\!\left(\mathbf{U}_1^T \mathbf{U}_2 \mathbf{U}_2^T \mathbf{U}_1\right) = \frac{1}{3}\sum_{i=1}^{3} \cos^2 \theta_i$$ The Sensitivity Metamerism Index (SMI) follows the standard ISO 17321 approximation $\text{SMI} = \max(0,\, 100 - 5.5 \cdot \overline{\Delta E}_{00})$, where $\text{SMI} \ge 90$ indicates excellent colorimetric fidelity. --- ## 3. Data Sources & Provenance Transparency Rigorous color science requires full disclosure of measurement provenance, precision, and scope limitations. The 5 camera SSF datasets used here come from two public repositories with distinct confidence tiers: | Camera Model | Source Repository | Acquisition Method | Spectral Step | Provenance Tier | | :--- | :--- | :--- | :--- | :--- | | **Fujifilm GFX 100** | AMPAS / ACES `rawtoaces-data` | **Wētā FX** `lightsaber` lab monochromator measurement | 5 nm (380–780 nm) | **Tier 1 (Industry Gold Standard)** | | **Fujifilm X-T4** | AMPAS / ACES `rawtoaces-data` | **Wētā FX** `lightsaber` lab monochromator measurement | 5 nm (380–780 nm) | **Tier 1 (Industry Gold Standard)** | | **Sony A7S III** (`ILCE-7SM3`) | AMPAS / ACES `rawtoaces-data` | **Wētā FX** `lightsaber` lab monochromator measurement | 5 nm (380–780 nm) | **Tier 1 (Industry Gold Standard)** | | **ARRI D21** | AMPAS / ACES `rawtoaces-data` | **AMPAS SciTech** lab monochromator measurement | 5 nm (380–780 nm) | **Tier 1 (Industry Gold Standard)** | | **iPhone 14 Pro Max** (`iPhone15,3`) | IEEE ICCP 2023 (Solomatov & Akkaynak, COLOR-Lab-Eilat) | **Manifold spectral inversion from DNG `ColorMatrix1/2`** | 10 nm (400–700 nm) | **Tier 2 (Peer-Reviewed Inversion)** | ### Three Objective Limitations of the iPhone SSF Dataset 1. **Indirect Spectral Inversion**: Apple does not publish official iPhone SSF curves. The ICCP 2023 paper *Spectral Sensitivity Estimation Without a Camera* infers SSFs from iPhone ProRAW DNG dual-illuminant calibration matrices using a low-dimensional spectral manifold learned from over a thousand real cameras. It faithfully captures filter centroids and bandwidths, though fine local fabrication ripples are smoothed out. 2. **Coarser Sampling**: The 10 nm step (31 samples) yields smoother curves when interpolated to 5 nm compared to Wētā's direct 5 nm monochromator sweeps, introducing a few degrees of uncertainty in narrowband 15 nm LED peak angles. 3. **Generational Offset**: The public ICCP 2023 benchmark represents **iPhone 14 Pro Max** (Sony IMX803), several generations prior to current flagships (iPhone 17 Pro / 18 Pro Max). While all belong to Apple's custom Sony stacked-CMOS CFA lineage with highly consistent macro spectral behavior, exact values should not be treated as direct monochromator ground truth for the latest silicon. --- ## 4. Visual Analysis of the Four Experiments ### 4.1 Spectral Sensitivity & Subspace Geometry ![Figure 1: Normalized Spectral Sensitivity (SSF) & Vora–Trussell Subspace Measure](https://twn39.github.io/images/blog/metamerism_fig1_ssf_vora.png) **Overview**: Normalized R/G/B SSFs for four representative cameras (iPhone 14 Pro Max solid, Fujifilm GFX 100 dashed, Sony A7S III dotted, ARRI D21 dash-dotted), overlaid with three physically critical bands—cyan-blue ($480\text{–}510\,\text{nm}$), hemoglobin skin-absorption doublet ($542/577\,\text{nm}$), and chlorophyll red edge ($675\text{–}700\,\text{nm}$)—with Vora–Trussell measures $\nu$ vs. CIE CMF and vs. iPhone annotated in the top-left. **Key Findings**: 1. **Strong Convergence Across Modern Sony-Lineage CMOS Sensors**: iPhone 14 Pro Max (solid) and Fujifilm GFX 100 (dashed) exhibit nearly overlapping green ($\sim 535\,\text{nm}$ peak) and red ($\sim 595\,\text{nm}$ peak) envelopes. Quantitatively, iPhone achieves **$\nu = 0.981$** against both **Fujifilm GFX 100 and X-T4** (maximum principal angle $\sim 12^\circ$) and **$\nu = 0.972$** against **Sony A7S III**. Because Fujifilm medium-format/APS-C and Apple custom sensors are both fabricated by Sony Semiconductor, they share closely aligned modern organic-dye CFA architectures. 2. **Divergence from Legacy Cinema CFAs**: The older **ARRI D21** (dash-dotted) features a notably narrower green channel and a pronounced secondary red shoulder near $540\,\text{nm}$. While closer to human CMFs ($\nu_{\text{CMF}} = 0.933$, highest of the five), it sits further from modern consumer CMOS sensors ($\nu = 0.966$ vs. iPhone). 3. **Localized Divergence Zones**: After per-channel peak normalization (removing white-balance gain differences), curve separation between iPhone and Fujifilm/Sony concentrates in two narrow bands: the **$460\text{–}500\,\text{nm}$ cyan-blue transition** (where iPhone's red channel shows a $\sim 0.16$ secondary lobe at $485\,\text{nm}$) and the **$570\text{–}620\,\text{nm}$ orange-red slope** (subtle differences in red-channel onset steepness and FWHM). Both zones directly predict the narrowband stress-test peaks below. --- ### 4.2 Multi-Illuminant Error & ISO SMI Evaluation ![Figure 2: Multi-Illuminant Cross-Camera Mean ΔE₀₀ & ISO SMI Heatmap](https://twn39.github.io/images/blog/metamerism_fig2_illuminant_heatmap.png) **Overview**: Six standard illuminants (from continuous daylight to spiky fluorescent and RGB-LED) along the vertical axis versus True CIE XYZ and four professional cameras along the horizontal axis. Each cell reports the 24-patch ColorChecker mean CIEDE2000 error and corresponding ISO 17321 SMI score. **Key Findings**: 1. **Sub-JND Error Between iPhone and Fujifilm Across All Illuminants**: Across all 6 illuminants, iPhone vs. **Fujifilm GFX 100 / X-T4** yields a mean $\Delta E_{00}$ of only **$0.29\text{–}0.43$** with an ISO SMI of **98**. Since the human Just-Noticeable Difference (JND) in side-by-side evaluation is $\Delta E_{00} \approx 1.0\text{–}2.0$, **hardware CFA metamerism between iPhone and Fujifilm sits well below human perceptual limits** under broadband lighting. 2. **Closer to Fujifilm Than to Human Ground Truth**: Column 1 (iPhone vs. True CIE XYZ) shows a mean error of **$0.81\text{–}1.53$** (SMI 92–96)—substantially higher than the $0.33$ gap between iPhone and Fujifilm. Modern CMOS CFAs depart from human CMFs in remarkably similar directions, making **cross-camera matching intrinsically easier than matching human ground truth**. 3. **Cross-Architecture Gap**: iPhone vs. Sony A7S III remains imperceptible at **$0.37\text{–}0.92$** (SMI 95–98), whereas the distinct CFA of **ARRI D21** reaches **$1.50$** (SMI 92) under Tungsten (Illuminant A, 3200K), approaching the edge of perceptibility. --- ### 4.3 Narrowband LED Hue-Twist Stress Test ![Figure 3: Narrowband LED Stress Test (FWHM = 15 nm) Hue Angle Twist](https://twn39.github.io/images/blog/metamerism_fig3_narrowband_led_hue.png) **Overview**: Simulating monochromatic narrowband LED emitters ($\text{FWHM} = 15\,\text{nm}$, representative of night neon signage, stage lighting, automotive taillights, and LED billboards) under a unified D65 matrix, plotting the CIELAB hue-angle twist $\Delta h_{ab}(\lambda) = h_{\text{iPhone}} - h_{\text{Target}}$ relative to Fujifilm GFX 100 (teal), Sony A7S III (blue), and ARRI D21 (orange). The shaded green band marks the $\pm 2^\circ$ perceptual neutrality zone. **Key Findings**: 1. **Broadband Safety Does Not Guarantee Narrowband Immunity**: Although broadband reflectance error in Figure 2 stays below $0.5$, a few nanometers of SSF slope mismatch are dramatically amplified into severe hue twists under monochromatic emitters. 2. **Two Consistent High-Risk Bands**: - **Cyan-Blue Neon ($475\text{–}498\,\text{nm}$)**: Hue twist reaches **$+26.3^\circ$ (@ $490\,\text{nm}$)** vs. Sony A7S III and **$+14.5^\circ$ (@ $485\,\text{nm}$)** vs. Fujifilm GFX 100—manifesting in real photography as cyan/aqua neon signs shifting toward blue or teal across cameras. - **Orange-Red LED ($605\text{–}630\,\text{nm}$)**: All three reference cameras show pronounced **$+17.8^\circ \sim +19.9^\circ$** excursions (iPhone vs. GFX 100 hits **$+19.9^\circ$** at $620\,\text{nm}$; vs. ARRI D21 hits **$+17.8^\circ$** at $610\,\text{nm}$)—corresponding to traffic signals, brake lights, and warm neon drifting between orange-red and magenta. 3. **Far-Red Cutoff Divergence ($> 650\,\text{nm}$)**: Near $670\,\text{nm}$, differing IR-cut filter roll-offs cause hue deviations to diverge again to **$-15^\circ \sim -20^\circ$**. 4. **Physical Boundary**: Narrowband hue twist is an **information-theoretic hardware limit**. Because monochromatic energy occupies only a sliver of spectrum in 3D RGB projection, neither a global $3 \times 3$ matrix nor a fixed 6-term root-polynomial trained on broadband patches can eliminate it. --- ### 4.4 CIELAB Chromaticity Displacement Vectors ![Figure 4: CIELAB a\*b\* Metamerism Displacement Vector Field (iPhone vs. Fujifilm GFX 100)](https://twn39.github.io/images/blog/metamerism_fig4_cielab_vectors.png) **Overview**: Projecting the 24 ColorChecker patches onto the CIELAB chromaticity plane ($a^*$ green↔red, $b^*$ blue↔yellow), drawing arrows from Fujifilm GFX 100 to iPhone 14 Pro Max. All vectors are **uniformly magnified 3×** for visual clarity. Dark teal arrows denote D65 daylight; magenta arrows denote the discrete-peak RGB-LED illuminant. **Key Findings**: 1. **Near-Zero Drift on Skin Tones**: Even at 3× magnification, the displacement vectors on `DarkSkin` and `LightSkin` barely extend beyond the marker dots (actual $\Delta E_{00} = 0.56$ and $< 0.3$). In the most portrait-critical chromatic region, iPhone and Fujifilm sensors exhibit virtually zero hardware color cast. 2. **Rock-Solid Neutral Axis**: All 6 neutral gray patches around $(0, 0)$ show zero displacement, confirming strict white-balance and linear-matrix neutrality. 3. **Peak Residual Locations & Directions**: - Under **D65 Daylight**, the largest individual residuals occur only on saturated `Orange` ($\Delta E_{00} = 0.78$) and `Green` ($\Delta E_{00} = 0.73$), with green shifting marginally toward $-a^*$. - Under **RGB-LED**, the illuminant's poor CRI pushes absolute patch chromaticity outward (outlined magenta markers), yet the cross-camera residual between iPhone and Fujifilm remains tightly bounded—peaking at `Orange` ($\Delta E_{00} = 1.18$) and `Red` ($0.70$), with the vast majority of patches still below $0.6$. --- ## 5. Conclusions & Engineering Implications for Espresso Synthesizing all four orthogonal colorimetric experiments yields clear, evidence-backed engineering conclusions: 1. **Under Natural & Broadband White Light, Sensor Metamerism Is Not the Bottleneck** Across D65, D50, tungsten, fluorescent, and white LED lighting, modern Sony-lineage mobile sensors (iPhone Pro) and professional mirrorless/medium-format bodies (Fujifilm GFX 100, X-T4, Sony A7S III) share extremely high spectral subspace overlap (Vora $\nu = 0.972\text{–}0.981$). Provided frontend RAW development preserves scene linearity and accurate DNG `ColorMatrix` mapping, mean cross-camera metamerism sits at $\Delta E_{00} \approx 0.3\text{–}0.8$ (ISO SMI 96–98)—**below human visual perceptibility**. 2. **Avoid Blindly Adding Higher-Order Non-Linear Fitting (e.g., 6-Term RPCC)** When baseline linear error is already $\Delta E_{00} \approx 0.3\text{–}0.4$, fitting higher-order polynomials on limited patch sets yields negligible gain while introducing risks of illuminant overfitting, subtle skin-tone non-linearity, and highlight extrapolation artifacts. **Maintaining a clean ACES 2.0 scene-referred linear transform paired with exact gamut conversion is both more scientific and more robust.** 3. **What Truly Governs "Native Film Character" Lives Downstream, Not in the CFA** Over 95% of the perceived gap between "smartphone look" and "Fujifilm / cinema look" stems not from CFA metamerism, but from four fully controllable software and optical stages: - **RAW Development Local Tone Mapping & Contrast Presets** (e.g., aggressive default Apple ProRAW `boost` / LTM causing Double Compression when stacked with film LUTs); - **Wide-Gamut Highlight Roll-off & Unclipped Scene-Referred Pass-Through** (preserving EDR highlights into ACEScct to eliminate hard-clipping hue shifts); - **Authentic Film Color Science (3D LUTs) & Emulsion Optics** (organic grain, halation, bloom); - **Awareness of Narrowband Physical Limits** (under intense $480\text{–}495\,\text{nm}$ cyan neon or $610\text{–}625\,\text{nm}$ orange-red LEDs, $15^\circ\text{–}26^\circ$ hue twists are physical hardware boundaries best addressed via selective hue grading rather than static pre-LUT matrices). 4. **Future Evolution** To eliminate generational offset from the ICCP 2023 iPhone 14 Pro Max inversion dataset, future work can directly extract `ColorMatrix1/2` metadata from live ProRAW DNG captures on current flagships (**iPhone 17 Pro / 18 Pro Max**) and validate against ColorChecker SG reference shoots, turning this four-dimensional suite into an ongoing per-device regression baseline. --- ## 6. Frequently Asked Questions (FAQ) ### How large is sensor metamerism when applying Fujifilm or cinema LUTs to iPhone ProRAW? Across six standard broadband illuminants (including D65, D50, tungsten, fluorescent, and white LED), iPhone 14 Pro Max achieves a Vora–Trussell subspace overlap of $\nu = 0.981$ with Fujifilm GFX 100 / X-T4 and a 24-patch mean CIEDE2000 residual of only **$0.29\text{–}0.43$** (ISO 17321 SMI = 98)—well below human JND ($\approx 1.0\text{–}2.0$). ### Which extreme lighting conditions trigger noticeable cross-camera hue shifts? Under monochromatic $15\,\text{nm}$ FWHM narrowband LEDs, small CFA slope differences amplify into large hue twists: **$+26.3^\circ$** vs. Sony A7S III (**$+14.5^\circ$** vs. Fujifilm GFX 100) in the $475\text{–}498\,\text{nm}$ cyan-blue neon band, and **$+17.8^\circ \sim +19.9^\circ$** across all three reference cameras in the $605\text{–}630\,\text{nm}$ orange-red LED band. ### Why does Espresso use an ACES 2.0 scene-referred linear pipeline instead of 6-term RPCC fitting? When baseline linear error is already $\Delta E_{00} \approx 0.3\text{–}0.4$, fitting higher-order polynomials on limited color patches offers negligible benefit while risking illuminant overfitting, skin-tone non-linearity, and highlight extrapolation artifacts. Clean ACES 2.0 linear transforms are far more robust. --- # [ZH] 跨相机同色异谱(Cross-Camera Metamerism)科学量化与可视化分析 - Description: 基于 CIE 1931 2° 标准观察者、CIEDE2000、ISO 17321 SMI 与 Vora–Trussell 子空间测度,系统量化 iPhone Pro 传感器与 Fujifilm、Sony、ARRI 专业相机之间的同色异谱残差与窄带 LED 色相边界。 - Canonical URL: https://twn39.github.io/blog/cross-camera-metamerism-analysis/ - Related Project: espresso - Published: 2026-11-23 - Tags: Color Science, Metamerism, CIEDE2000, ACES, ProRAW, LUT > **适用背景**:Espresso 色彩管线(iPhone Pro RAW / ProRAW → 原厂电影/胶片 LUT) > **测色学基准**:CIE 1931 2° 标准观察者、CIEDE2000($\Delta E_{00}$)、ISO 17321 SMI、Vora–Trussell 子空间测度 > **核心问题**:当移动端传感器(iPhone Pro)接入富士、索尼、ARRI 等专业相机的原厂色彩科学 LUT 时,硬件滤色片(CFA)差异所引起的同色异谱究竟有多大? ## 核心结论(TL;DR) 在 D65 日光等常规宽带照明下,iPhone Pro 与 Fujifilm GFX 100 / X-T4 之间的硬件传感器同色异谱平均色差仅 **$\Delta E_{00} = 0.29\text{–}0.43$(ISO SMI = 98,Vora $\nu = 0.981$)**,远低于人眼可分辨阈值,肤色区域几乎零漂移($\Delta E_{00} \le 0.56$)。真正的物理边界仅出现在 **$475\text{–}498\,\text{nm}$ 青蓝霓虹**与 **$605\text{–}630\,\text{nm}$ 橙红窄带 LED**,会产生 $14.5^\circ\text{–}26.3^\circ$ 的窄带色相扭曲。因此,Espresso 色彩管线坚持 **ACES 2.0 场景线性直通 + 原厂 3D LUT**,无需盲目堆叠高阶静态多项式拟合。 --- ## 1. 为什么要进行同色异谱分析? 在 Espresso 的色彩管线设计中,我们直接接入了面向专业相机系统(如 Fujifilm F-Log2C、ARRI / DaVinci 电影管线)标定的原厂 3D LUT。在将 iPhone 传感器采集到的图像送入这些原厂 LUT 之前,整条链路可以被清晰地拆分为两个截然不同的阶段: 1. **色域与传递函数转换(确定性数学问题,可精确对齐)** 无论源图像处于线性 Display P3 还是目标 LUT 要求 ACEScct(AP1)或 F-Log2C(F-Gamut C),不同标准色彩空间之间的转换都由**严格定义的 $3 \times 3$ 基色变换矩阵**、**色适应变换(如 Bradford / CAT16)**以及**解析 OETF/EOTF 对数编码公式**构成。只要保持场景线性域纯净(Scene-Referred Linear Light)且避免提前裁切宽色域数据,色域与传递函数的对齐在浮点精度下是**完全无损、精确可逆**的。 2. **传感器光谱响应(物理硬件问题,无法通过矩阵完全消除)** 数字相机的原始响应 $\mathbf{c} = [R, G, B]^T$ 并非直接记录人眼的 CIE XYZ 三刺激值,而是由光源光谱功率分布 $E(\lambda)$、物体表面光谱反射率 $R(\lambda)$ 与相机传感器光谱敏感度函数(Spectral Sensitivity Function, **SSF**)$\mathbf{S}(\lambda) = [S_R(\lambda), S_G(\lambda), S_B(\lambda)]^T$ 积分决定: $$\mathbf{c} = \int_{400}^{700} E(\lambda)\, R(\lambda)\, \mathbf{S}(\lambda)\, d\lambda$$ 根据 **Luther–Ives 条件**,只有当相机的三条 SSF 曲线恰好是人眼颜色匹配函数(CIE CMF)$\bar{\mathbf{x}}(\lambda)$ 的精确线性组合时,才存在一个 $3 \times 3$ 矩阵将相机 RGB 无误差地映射为标准 CIE XYZ。现实中,出于信噪比(量子效率)与滤色片染料工艺限制,**没有任何商用相机满足 Luther–Ives 条件**;不同品牌传感器的滤色片光谱形状也各不相同。 这就导致了**跨相机同色异谱(Cross-Camera Metamerism)**:两个物理光谱不同、但人眼看起来完全一样的物体,在 iPhone 传感器与富士/索尼/ARRI 传感器上可能激发出不同的 RGB 比例;反过来,即便经过最优的 $3 \times 3$ 色彩矩阵(如 DNG `ColorMatrix`)校准,在特定光源或特定光谱物体上,不同相机之间依然会残余无法消除的色差。 因此,在决定是否为 Espresso 引入额外的高阶跨相机光谱拟合算法(如 Finlayson Root-Polynomial Color Correction, RPCC)之前,我们必须用客观、可复现的光度学实验回答两个核心问题: - **在日常宽带光源下,iPhone Pro 与富士/索尼/ARRI 之间的传感器同色异谱残差究竟有多大?人眼能否察觉?** - **在哪些极端光谱条件下(如窄带 LED、霓虹灯),同色异谱才会真正击穿防线?** --- ## 2. 同色异谱的量化与可视化分析方法 仅靠“主观实拍肉眼对比”无法将**传感器同色异谱**与**白平衡算法、色调映射(LTM)、锐化及机身色彩风格**解耦。为了纯粹隔离出硬件 SSF 带来的物理差异,本分析采用**光谱前向仿真(Spectral Forward Simulation)**方法,将所有待测相机置于完全一致的理想物理环境中: ### 2.1 统一实验协议 - **光谱离散网格**:统一对齐至 $400\text{–}700\,\text{nm}$、步长 $\Delta\lambda = 5\,\text{nm}$(共 61 个采样点);观察者采用 **CIE 1931 2° 标准观察者**。 - **物理白平衡与线性矩阵对齐**:在每一种测试光源 $E(\lambda)$ 下,先对各相机执行精确白平衡(使理想漫反射白体输出 $[1, 1, 1]$),再基于标准 ColorChecker 24 色卡求解最小二乘最优 $3 \times 3$ 色彩校正矩阵 $\mathbf{M}_{\text{LCC}}$(对应真实 RAW 显影管线中的双光源插值 `ColorMatrix`),将所有相机统一映射至 CIE XYZ 与 CIELAB 空间。 - 如此处理后,**剩下的全部色差 100% 源自相机 SSF 违背 Luther–Ives 条件所产生的纯粹同色异谱残差**,不含任何白平衡误差或曝光差异。 ### 2.2 四维正交量化与可视化体系 单一指标无法全面刻画同色异谱,本实验构建了由浅入深的 4 个正交分析维度: | 维度 | 核心指标 | 回答的科学问题 | | :--- | :--- | :--- | | **1. 硬件子空间几何** | **Vora–Trussell 测度 $\nu \in [0, 1]$** | 脱离具体光源与色卡,从纯线性代数角度衡量两台相机 SSF 张成的三维子空间有多重合($\nu = 1$ 表示完全等价,可由 $3 \times 3$ 矩阵零误差互转)。 | | **2. 多光源统计误差** | **平均 $\Delta E_{00}$** 与 **ISO 17321 SMI** | 在日光(D65/D50)、钨丝灯(A)、荧光灯(FL11)、白光 LED(LED-B1)与 RGB 三色混合 LED(LED-RGB1)6 种光源下,综合色差是否超过人眼可辨阈值(JND $\approx 1.0\text{–}2.0$)。 | | **3. 极端窄带压力测试** | **窄带 LED 色相偏转 $\Delta h_{ab}(\lambda)$** | 构造半高宽 $\text{FWHM} = 15\,\text{nm}$ 的单色高斯 LED,以 $5\,\text{nm}$ 步长扫过 $430\text{–}670\,\text{nm}$,精确锁定最易发生色相扭曲(Hue Twist)的“危险波段”。 | | **4. 感知空间向量场** | **CIELAB $a^*b^*$ 平面位移向量(3× 放大)** | 不止看标量色差大小,直接呈现每个标准色块从富士到 iPhone 的**偏移方向**(偏青/偏红还是饱和度增减),以及自然光与 RGB-LED 下的漂移差异。 | 其中,Vora–Trussell 测度的定义为两个三维光谱子空间正交基 $\mathbf{U}_1, \mathbf{U}_2 \in \mathbb{R}^{N \times 3}$ 之间主夹角余弦平方的均值: $$\nu(\mathbf{S}_1, \mathbf{S}_2) = \frac{1}{3}\operatorname{tr}\!\left(\mathbf{U}_1^T \mathbf{U}_2 \mathbf{U}_2^T \mathbf{U}_1\right) = \frac{1}{3}\sum_{i=1}^{3} \cos^2 \theta_i$$ 而灵敏度同色异谱指数(Sensitivity Metamerism Index, SMI)按 ISO 17321 常用近似 $\text{SMI} = \max(0,\, 100 - 5.5 \cdot \overline{\Delta E}_{00})$ 换算($\text{SMI} \ge 90$ 即属极高色彩匹配度)。 --- ## 3. 数据来源与权威性说明 严谨的色彩科学研究必须如实披露数据来源、测量精度与适用边界。本次实验使用的 5 款相机 SSF 曲线来自两个不同的公开权威库,其可信度等级存在客观差异: | 相机型号 | 数据来源仓库 | 测量/获取方式 | 波长步长 | 权威等级 | | :--- | :--- | :--- | :--- | :--- | | **Fujifilm GFX 100** | AMPAS / ACES `rawtoaces-data` | **Wētā FX(维塔数码)** `lightsaber` 单色仪实验室实测 | 5 nm(380–780 nm) | **Tier 1(工业界黄金基准)** | | **Fujifilm X-T4** | AMPAS / ACES `rawtoaces-data` | **Wētā FX(维塔数码)** `lightsaber` 单色仪实验室实测 | 5 nm(380–780 nm) | **Tier 1(工业界黄金基准)** | | **Sony A7S III** (`ILCE-7SM3`) | AMPAS / ACES `rawtoaces-data` | **Wētā FX(维塔数码)** `lightsaber` 单色仪实验室实测 | 5 nm(380–780 nm) | **Tier 1(工业界黄金基准)** | | **ARRI D21** | AMPAS / ACES `rawtoaces-data` | **AMPAS 科技委员会(`scitech`)** 实验室单色仪实测 | 5 nm(380–780 nm) | **Tier 1(工业界黄金基准)** | | **iPhone 14 Pro Max** (`iPhone15,3`) | IEEE ICCP 2023(Solomatov & Akkaynak, COLOR-Lab-Eilat) | **基于 DNG `ColorMatrix1/2` 的光谱流形反演估计** | 10 nm(400–700 nm) | **Tier 2(顶会论文反演值)** | ### 关于 iPhone SSF 数据的 3 点客观局限 1. **非单色仪直接实测**:Apple 从未向公众披露过 iPhone 传感器的官方 SSF。ICCP 2023 论文 *Spectral Sensitivity Estimation Without a Camera* 通过读取 iPhone ProRAW DNG 内置的双光源校准矩阵,结合千余款真实相机 SSF 的低维先验模型进行数学反演。它能够可靠反映滤色片的整体重心与带宽,但无法捕捉局部微小的工艺波纹。 2. **波长采样较粗**:10 nm 步长(31 个点)在插值至 5 nm 时比 Wētā 的实测曲线更为平滑,因此在窄带 15 nm LED 测试中,具体峰值角度存在数度的估计不确定性。 3. **机型代际差异**:公开 SSF 库(ICCP 2023)中收录的代表性样本为 **iPhone 14 Pro Max**(Sony IMX803 传感器),与当前最新代际旗舰(iPhone 17 Pro / 18 Pro Max)已隔数代;尽管同属 Apple 定制 Sony 堆叠式大底滤色片体系,宏观特性高度一致,但具体数值不应等同于最新代际机型的绝对物理真值。 --- ## 4. 可视化图表逐一解读 下面将四项正交实验拆分为独立图表,逐一进行客观数据解读。 ### 4.1 光谱敏感度曲线与子空间测度 ![图 1:归一化光谱敏感度曲线(SSF)与 Vora–Trussell 子空间测度](https://twn39.github.io/images/blog/metamerism_fig1_ssf_vora.png) **图表内容**:展示 4 款代表性相机(iPhone 14 Pro Max 实线、Fujifilm GFX 100 虚线、Sony A7S III 点线、ARRI D21 点划线)的归一化 R/G/B 光谱敏感度曲线,叠加三个物理关键波段(青蓝光 $480\text{–}510\,\text{nm}$、血红蛋白肤色吸收双峰 $542/577\,\text{nm}$、植物叶绿素红边 $675\text{–}700\,\text{nm}$),左上角列出各相机对 CIE CMF 及对 iPhone 的 Vora 测度 $\nu$。 **核心发现**: 1. **现代 Sony 系 CMOS 的高度趋同性**:观察曲线形态可以清晰发现,iPhone 14 Pro Max(实线)与 Fujifilm GFX 100(虚线)在绿通道(峰值 $\sim 535\,\text{nm}$)与红通道(峰值 $\sim 595\,\text{nm}$)的包络几乎重合。数据上,iPhone 与 **Fujifilm GFX 100 / X-T4** 的 Vora 测度高达 **$\nu = 0.981$**(最大主夹角仅 $\sim 12^\circ$),与 **Sony A7S III** 为 **$\nu = 0.972$**。这是因为富士中画幅/APS-C 与 Apple 定制传感器均由 Sony 半导体代工,共享高度相近的现代有机染料滤色片光谱架构。 2. **传统电影机滤色片的差异**:相比之下,较早期的 **ARRI D21**(点划线)拥有明显更窄的绿通道以及在 $540\,\text{nm}$ 附近凸起的红通道次峰,其更接近人眼 CMF($\nu_{\text{CMF}} = 0.933$,为五者最高),但也因此与现代消费级 CMOS 拉开了距离(与 iPhone 的 $\nu = 0.966$)。 3. **局部差异集中区**:在逐通道归一化(各通道峰值统一为 $1.0$,消除白平衡增益干扰)后,iPhone 与富士/索尼的主要曲线形状分离点出现在两个区域——**$460\text{–}500\,\text{nm}$ 蓝绿交界区**(iPhone 红通道在 $485\,\text{nm}$ 处存在约 $0.16$ 的次级透射峰,且蓝通道短波肩部斜率略有不同),以及 **$570\text{–}620\,\text{nm}$ 橙红过渡区**(各品牌红通道上升沿陡度与半峰宽略有不同)。这直接预示了后续窄带测试的高风险区域。 --- ### 4.2 多光源跨相机色差与 ISO SMI 评估 ![图 2:多光源跨相机平均 ΔE₀₀ 与 ISO SMI 热力图](https://twn39.github.io/images/blog/metamerism_fig2_illuminant_heatmap.png) **图表内容**:纵轴为 6 种标准照明光源(从连续宽带日光到离散峰值荧光灯/RGB-LED),横轴为对比目标(真实 CIE XYZ 及 4 款专业相机),单元格内标注 ColorChecker 24 色卡上的平均 CIEDE2000 色差与对应的 ISO 17321 SMI 分数。 **核心发现**: 1. **iPhone vs. 富士在全光源下的极低色差**:在全部 6 种标准光源下,iPhone 与 **Fujifilm GFX 100 / X-T4** 的平均 $\Delta E_{00}$ 均落在 **$0.29\text{–}0.43$** 之间,ISO SMI 稳定在 **98 分**。在测色学中,人眼在严格并排对比下的刚可察觉色差阈值(JND)约为 $\Delta E_{00} \approx 1.0\text{–}2.0$,这意味着在标准色卡与宽带光源下,**iPhone 与富士传感器的硬件同色异谱差异远低于人眼分辨极限**。 2. **与人眼真值(True CIE XYZ)的差异大于与富士的差异**:第一列(iPhone vs. True CIE XYZ)的平均色差为 **$0.81\text{–}1.53$**(SMI 92–96),反而显著大于 iPhone 与富士之间的 $0.33$。这说明现代 CMOS 滤色片“大家偏离人眼的方向高度一致”——**跨相机对齐比对齐人眼真值更容易**。 3. **跨代际/跨体系差距增大**:iPhone 与 Sony A7S III 的平均 $\Delta E_{00}$ 为 **$0.37\text{–}0.92$**(SMI 95–98),仍处于人眼难以察觉的范围内;与滤色片特征迥异的 **ARRI D21** 在钨丝灯(Illuminant A, 3200K)下达到 **$1.50$**(SMI 92),开始触及人眼可辨边界。 --- ### 4.3 窄带 LED 极端色相偏转测试 ![图 3:窄带 LED 压力测试(FWHM = 15 nm)色相角偏转曲线](https://twn39.github.io/images/blog/metamerism_fig3_narrowband_led_hue.png) **图表内容**:模拟半高宽仅 $15\,\text{nm}$ 的单色窄带 LED 发光体(类似夜景霓虹灯、舞台灯光、汽车尾灯、LED 广告牌),在统一 D65 白平衡矩阵下,计算 iPhone 相对于 Fujifilm GFX 100(青绿)、Sony A7S III(蓝)和 ARRI D21(橙)的 CIELAB 色相角差值 $\Delta h_{ab}(\lambda) = h_{\text{iPhone}} - h_{\text{Target}}$。浅绿横带表示 $\pm 2^\circ$ 的人眼感知中性区。 **核心发现**: 1. **宽带“安全”不代表窄带“免疫”**:尽管图 2 中宽带反射色卡的平均色差不到 $0.5$,但在极窄带单色发光体下,两条 SSF 曲线哪怕只有几纳米的斜率错位,都会被瞬间放大为剧烈的色相偏转(Hue Twist)。 2. **两个高度一致的高风险波段**: - **青蓝霓虹波段($475\text{–}498\,\text{nm}$)**:iPhone 相对 Sony A7S III 出现高达 **$+26.3^\circ$(@ $490\,\text{nm}$)** 的色相偏转,相对 Fujifilm GFX 100 达到 **$+14.5^\circ$(@ $485\,\text{nm}$)**。这在实拍中常表现为:青色/湖蓝色霓虹灯牌在不同相机上分别偏蓝或偏青绿。 - **橙红 LED 波段($605\text{–}630\,\text{nm}$)**:三款专业相机在此区间集体出现 **$+17.8^\circ \sim +19.9^\circ$** 的显著峰谷(iPhone vs. Fuji GFX 100 在 $620\,\text{nm}$ 达 **$+19.9^\circ$**;vs. ARRI D21 在 $610\,\text{nm}$ 达 **$+17.8^\circ$**)。实拍中对应红色交通灯、刹车尾灯或暖橙霓虹灯在橙红与品红之间的色相漂移。 3. **远红端截断差异($> 650\,\text{nm}$)**:在 $670\,\text{nm}$ 附近,由于各相机 IR 截止滤镜(IR-Cut Filter)的滚降位置不同,色相偏移再次发散至 **$-15^\circ \sim -20^\circ$**。 4. **物理本质**:需要强调的是,窄带单色光下的色相偏转属于**信息丢失级别的物理现象**——在三维 RGB 投影中,窄带光源的能量只落在极窄波长上,无法通过全局 3×3 矩阵或固定色卡拟合的 6 项多项式根治。 --- ### 4.4 CIELAB 色度平面位移向量分析 ![图 4:CIELAB a\*b\* 平面同色异谱位移向量图(iPhone vs. Fujifilm GFX 100)](https://twn39.github.io/images/blog/metamerism_fig4_cielab_vectors.png) **图表内容**:将 ColorChecker 24 色块投影至 CIELAB 色度平面(横轴 $a^*$ 绿↔红,纵轴 $b^*$ 蓝↔黄),以 Fujifilm GFX 100 为起点,用箭头指向 iPhone 14 Pro Max 的位置。为便于观察微米级的位移方向,所有箭头长度均**等比放大 3 倍**。深青色箭头对应 D65 日光,玫红色箭头对应 RGB-LED 光源。 **核心发现**: 1. **核心肤色区几乎零漂移**:观察画面中右部的 `DarkSkin` 与 `LightSkin` 两个肤色色块——即便将位移向量放大了 3 倍,箭头依然几乎缩在圆点内部不可见(实际 $\Delta E_{00}$ 仅 $0.56$ / $<0.3$)。这证明在人像摄影最敏感的肤色区域,iPhone 与富士传感器本身几乎不存在硬件级偏色。 2. **中性灰轴绝对稳定**:原点 $(0, 0)$ 附近的 6 级中性灰块无任何偏移,验证了白平衡与线性矩阵的严格中性。 3. **最大残余偏移的位置与方向**: - 在 **D65 日光**下,24 色卡中最大单体色差仅出现在高饱和度的 `Orange`($\Delta E_{00} = 0.78$)和 `Green`($\Delta E_{00} = 0.73$),绿色轻微向更饱和的 $-a^*$ 方向外扩; - 在 **RGB-LED 离散峰值光源**下,各色块本身的绝对坐标已因光源显色性(CRI)发生大幅外扩(玫红色淡描边圆点),但即便在这种恶劣光源下,iPhone 相对富士的跨相机最大残差也仅出现在 `Orange`($\Delta E_{00} = 1.18$)与 `Red`($0.70$),其余绝大多数色块依然低于 $0.6$。 --- ## 5. 总结与对 Espresso 管线的工程启示 综合四项独立的光度学量化分析,我们可以得出以下客观、严谨的结论: 1. **常规自然光与混合白光下,传感器同色异谱并非主要矛盾** 在 D65、D50、钨丝灯、荧光灯及常规白光 LED 下,现代 Sony 系移动端传感器(iPhone Pro)与现代专业无反/中画幅相机(Fujifilm GFX 100、X-T4、Sony A7S III)具有极高的光谱子空间重合度(Vora $\nu = 0.972\text{–}0.981$)。只要前端 RAW 显影严格保留了场景线性度与准确的 DNG `ColorMatrix` 白平衡映射,两者在标准色卡上的硬件同色异谱均值仅 $\Delta E_{00} \approx 0.3\text{–}0.8$(ISO SMI 96–98),**低于人眼可感知阈值**。 2. **无需盲目引入高阶非线性跨相机拟合(如 Finlayson 6 项 RPCC)** 在交叉验证中,当基准误差已处于 $\Delta E_{00} \approx 0.3\text{–}0.4$ 的极低水平时,基于有限色卡样本强行拟合高阶多项式矩阵不仅收益微乎其微,反而存在过拟合特定光源、轻微破坏肤色线性度或在高光外推区域引发色彩反转的风险。**保持 ACES 2.0 架构下的纯净场景线性变换 + 原厂精确色域转换,是更科学、更稳健的工程选择。** 3. **真正决定“原厂胶片味”差异的瓶颈在后端,而非前端硬件** 用户日常感知到的“手机拍出来不像富士/电影机”,95% 以上并非来自传感器滤色片的物理同色异谱,而是来自四个完全可控的软件与光学环节: - **RAW 显影期的局部色调映射与对比度预设**(如 Apple ProRAW 默认 `boost` / `LTM` 过高导致与胶片 LUT 叠加发生 Double Compression); - **宽色域高光压缩与无截断直通**(Scene-Referred 线性域直通 ACEScct,杜绝高光硬裁切引发的色相漂移); - **原厂胶片色彩科学(3D LUT)与光学乳剂模拟**(颗粒、光晕、泛光); - **窄带光源极限场景的边界认知**(在 $480\text{–}495\,\text{nm}$ 青蓝霓虹与 $610\text{–}625\,\text{nm}$ 橙红 LED 强光下,传感器滤色片差异确实会带来 $15^\circ\text{–}26^\circ$ 的色相偏转,这是物理光学边界,需靠后期色相微调而非前置静态矩阵解决)。 4. **后续演进建议** 如需进一步消除上述 iPhone 14 Pro Max 反演数据的代际误差,后续可直接提取当前真机(如 **iPhone 17 Pro / 18 Pro Max**)拍摄的 ProRAW DNG `ColorMatrix1/2` 元数据,或通过标准 ColorChecker SG 实拍对比验证,将本套四维分析框架延伸为针对具体机型的持续回归测试基线。 --- ## 6. 常见问题(FAQ) ### iPhone ProRAW 套用富士或电影机原厂 LUT 时,传感器同色异谱色差有多大? 在 D65、D50、钨丝灯、荧光灯与白光 LED 等 6 种宽带照明条件下,iPhone 14 Pro Max 与 Fujifilm GFX 100 / X-T4 的光谱子空间重合度高达 Vora $\nu = 0.981$,ColorChecker 24 色卡平均 CIEDE2000 色差仅 **$0.29\text{–}0.43$**(ISO 17321 SMI = 98),远低于人眼可分辨阈值(JND $\approx 1.0\text{–}2.0$)。 ### 哪些极端光源会触发明显的跨相机同色异谱色偏? 在半高宽 $15\,\text{nm}$ 的窄带单色 LED 下,传感器滤色片差异会被放大:$475\text{–}498\,\text{nm}$ 青蓝霓虹波段相对 Sony A7S III 色相偏转可达 **$+26.3^\circ$**(相对 Fuji GFX 100 为 **$+14.5^\circ$**);$605\text{–}630\,\text{nm}$ 橙红 LED 波段相对三款专业相机均会出现 **$+17.8^\circ \sim +19.9^\circ$** 的色相偏移。 ### 为什么 Espresso 选择 ACES 2.0 场景线性转换,而不是引入 6 项 RPCC 多项式拟合? 在宽带基准误差已低至 $\Delta E_{00} \approx 0.3\text{–}0.4$ 时,基于有限色卡样本引入高阶非线性多项式不仅收益极微,反而可能过拟合特定光源或引发肤色线性度与高光外推伪影。保持纯净 ACES 2.0 场景线性域直通与精确色域转换更加稳健。