Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.24)
project(ThumbGen VERSION 0.1.5 LANGUAGES CXX)
project(ThumbGen VERSION 0.1.6 LANGUAGES CXX)

find_package(OpenImageIO 3.2 CONFIG REQUIRED)
find_package(OpenColorIO 2.5 CONFIG REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ThumbGen makes thumbnails from standard images and complex EXRs, fast. Decode on

Fast, EXR-aware previews for production pipelines.

`0.1.5` · [Apache-2.0](LICENSE)
`0.1.6` · [Apache-2.0](LICENSE)

## Where it fits

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ThumbGen 为普通图片和复杂 EXR 快速生成缩略图。一次解码输出

为制作管线提供快速、懂 EXR 的预览能力。

`0.1.5` · [Apache-2.0](LICENSE)
`0.1.6` · [Apache-2.0](LICENSE)

## 适用场景

Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ thumbgen convert frame.exr --output preview.jpg --ocio-config config.ocio --inpu

数据预览使用 `--visualize`、`--channels`、`--data-range MIN,MAX` 和 `--invalid-values black|magenta|error`,详见[数据预览](data-preview.md)。Deep 颜色使用 `--deep-mode flatten`,详见[Deep EXR](public-deep.md)。

使用 `--visualize auto` 在一次转换中选择颜色或 Cryptomatte 预览。未指定 part 或通道时,自动模式会尽力从存在歧义的平面 EXR 颜色或灰度候选中选出预览,并为回退选择告警。需要严格选择颜色时使用 `--visualize colour`。选择顺序、错误和连续帧锁定详见[图层选择与告警标记](selection.md)。
使用 `--visualize auto` 在一次转换中选择颜色、Cryptomatte 或 [Deep 不透明度预览](public-deep.md)。未指定 part 或通道时,自动模式会尽力从存在歧义的平面 EXR 颜色或灰度候选中选出预览,并为回退选择告警。需要严格选择颜色时使用 `--visualize colour`。选择顺序、错误和连续帧锁定详见[图层选择与告警标记](selection.md)。

## 执行预算与时限

Expand Down
2 changes: 1 addition & 1 deletion docs/en/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ thumbgen convert frame.exr --output preview.jpg --ocio-config config.ocio --inpu

Data previews use `--visualize`, `--channels`, `--data-range MIN,MAX` and `--invalid-values black|magenta|error`. See [data previews](data-preview.md). For Deep color, use `--deep-mode flatten`; see [Deep EXR](public-deep.md).

Use `--visualize auto` to select a color or Cryptomatte preview in one conversion. With no explicit part or channels, auto mode makes a best-effort choice among ambiguous flat EXR color or grayscale candidates and reports that choice as a warning. Use `--visualize colour` to require a strict color selection. See [layer selection and warning markers](selection.md) for ranking, errors and sequence locks.
Use `--visualize auto` to select a color, Cryptomatte or [Deep opacity preview](public-deep.md#automatic-opacity-preview) in one conversion. With no explicit part or channels, auto mode makes a best-effort choice among ambiguous flat EXR color or grayscale candidates and reports that choice as a warning. Use `--visualize colour` to require a strict color selection. See [layer selection and warning markers](selection.md) for ranking, errors and sequence locks.

## Resource budgets and timeouts

Expand Down
4 changes: 2 additions & 2 deletions docs/en/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Use the complete ThumbGen folder for your platform. Keep the supplied DLLs on Windows; preserve the bin/lib layout and executable permissions on Linux. Do not copy only the executable.

Download the matching `thumbgen-0.1.5-*.zip` or `.tar.gz` and check the accompanying `SHA256SUMS`. Both archives contain one fixed `ThumbGen/` directory, with `bin/`, `share/`, `licenses/` and, on Linux, `lib/` immediately underneath. The directory name is the same on both platforms and across versions, so you can use it directly after extraction.
Download the matching `thumbgen-0.1.6-*.zip` or `.tar.gz` and check the accompanying `SHA256SUMS`. Both archives contain one fixed `ThumbGen/` directory, with `bin/`, `share/`, `licenses/` and, on Linux, `lib/` immediately underneath. The directory name is the same on both platforms and across versions, so you can use it directly after extraction.

On Windows, extract into `%LOCALAPPDATA%/Programs/` to get `%LOCALAPPDATA%/Programs/ThumbGen/bin/thumbgen.exe`. In PowerShell:

Expand All @@ -16,7 +16,7 @@ On Linux, extract into `$HOME/.local/opt/` to get `$HOME/.local/opt/ThumbGen/bin

```sh
mkdir -p "$HOME/.local/opt"
tar -xzf thumbgen-0.1.5-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
tar -xzf thumbgen-0.1.6-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
"$HOME/.local/opt/ThumbGen/bin/thumbgen" --version --json
```

Expand Down
2 changes: 1 addition & 1 deletion docs/en/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ thumbgen batch --manifest jobs.json --json

`defaults` provides shared conversion options; each job's `options` can override them. Outputs can set their own size, format, quality and existing-file behavior. Use a unique `id` to match results. Optional `sequence_id` keeps [sequence selection](selection.md) consistent.

For a batch of color and Cryptomatte inputs, set `"defaults": {"visualization": "auto"}` to select a preview for each file in one batch. When the AOV is known, set its mode and channels directly in the job's `options`. Integrations can check for `auto` in the `visualization_modes` returned by `capabilities --json`.
Set `"defaults": {"visualization": "auto"}` to select a color, Cryptomatte or [Deep opacity preview](public-deep.md#automatic-opacity-preview) for each eligible file in one batch. An explicit `deep_mode: "reject"` in defaults or job options disables the opacity fallback. When the AOV is known, set its mode and channels directly in the job's `options`. Integrations can check for `auto` in the `visualization_modes` returned by `capabilities --json`.

## Read results

Expand Down
16 changes: 15 additions & 1 deletion docs/en/public-deep.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Documentation](README.md) · [简体中文](../public-deep.md)

Deep files must be flattened to make ordinary images. Enable this explicitly with `--deep-mode flatten`; it is not automatic.
Deep color requires explicit flattening with `--deep-mode flatten`.

```sh
thumbgen convert deep.exr --output preview.png --deep-mode flatten --input-space linear
Expand All @@ -11,6 +11,20 @@ thumbgen convert deep.exr --output preview.jpg --deep-mode flatten --background

Inputs should contain associated color in the correct linear color space. Replace `linear` with the actual name in your project configuration when needed.

## Automatic opacity preview

```sh
thumbgen convert coverage.exr --output preview.jpg --visualize auto
```

If normal selection finds no eligible image, auto mode can preview one unambiguous Deep part containing only base-layer `A`, `Z` and optional `ZBack` (case-insensitive). It requires HALF or FLOAT channels and uses the same native reader, sample sweep and limits as Deep color. Extra or layered channels, multiple opacity candidates and files declaring Cryptomatte families are excluded. RGB Deep still requires explicit color flattening.

Omit `deep_mode` from both batch defaults and job options to enable this fallback. An explicit `reject` disables it, including when inherited from batch defaults. Explicit part or channel selectors, `--visualize colour` and `--deep-mode flatten` also leave it disabled.

The preview maps accumulated coverage directly to grayscale. Zero coverage is black, one is white, and 50% coverage encodes near 128 in 8-bit output. The display window defines the canvas and areas outside the data window have zero coverage. Both opaque background settings use this same grayscale scale. A transparent PNG or WebP uses white with coverage in the alpha channel. Coverage bypasses all OCIO transforms, including inherited and explicitly configured transforms.

The result reports `deep.policy = "deep-opacity-sweep-v1"` and a `TG_EXR_AUTO_DEEP_OPACITY` warning. See [automatic selection and sequence locks](selection.md#monitor-automatic-selection).

## Supported inputs

Deep scanline / tiled level 0 is supported with HALF / FLOAT color, Alpha and depth channels. NONE, RLE and ZIPS compression are available; query `capabilities --json` for other compression support. Missing channels, unsupported layouts and exceeded sample limits produce errors.
Expand Down
7 changes: 4 additions & 3 deletions docs/en/selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ thumbgen convert multipart.exr --output preview.jpg --part-name beauty

With `--visualize auto` and no explicit part or channels, ThumbGen makes a best-effort choice among flat EXR color or grayscale candidates. It first applies the requested selection policy. Under the default policy, it can select a unique unprefixed RGB(A) group without a warning when the other candidates are recognized auxiliary AOVs such as shadow, ambient occlusion or Fresnel. If multiple candidates still remain, it chooses the unique unprefixed RGB(A) group if there is one, or the first eligible candidate in part and group order. A fallback warning means the chosen view may differ from the intended view. Check `selection.candidates` and `selection.chosen.reason`, or set the part and channels explicitly for a known view.

Without a color candidate, automatic mode can preview a Cryptomatte family across parts. Under the default policy, a unique `crypto_object` or `CryptoObject` family (case-insensitive) takes precedence over other families. If automatic selection cannot resolve a supported mapping, the job fails with its original error. Data-only inputs require their dedicated visualization, and unknown layouts require inspection or an upstream conversion. Color management, decoding and output errors retain their own diagnostics. ThumbGen does not switch mappings or retry another candidate after a failure.
Without a color candidate, automatic mode can preview a Cryptomatte family across flat parts. Under the default policy, a unique `crypto_object` or `CryptoObject` family (case-insensitive) takes precedence over other families. Auto can also select a unique [Deep opacity mapping](public-deep.md#automatic-opacity-preview) when `deep_mode` is omitted. If automatic selection cannot resolve a supported mapping, the job fails with its original error. Data-only inputs require their dedicated visualization, and unknown layouts require inspection or an upstream conversion. Color management, decoding and output errors retain their own diagnostics. ThumbGen does not switch mappings or retry another candidate after a failure.

### Monitor automatic selection

Expand All @@ -31,12 +31,13 @@ Both text and JSONL CLI modes write one standalone stderr line per result that r
```text
TG_EXR_AUTO_SELECTION_FALLBACK selected_part=1 selected_group="RGB" candidate_count=3
TG_EXR_AUTO_SELECTION_UNRESOLVED error_code=visualization_required
TG_EXR_AUTO_DEEP_OPACITY selected_part=0 preview=grayscale_coverage
```

`selected_part` is zero-based, `selected_group` is a JSON string, and `candidate_count` counts the eligible choices after the selection policy. To find both markers in captured stderr, run the following command.
`selected_part` is zero-based, `selected_group` is a JSON string, and `candidate_count` counts the eligible choices after the selection policy. The opacity marker records the selected mapping once per job, including jobs with multiple outputs or a subsequent decode or output error.

```sh
grep -E '^TG_EXR_AUTO_SELECTION_(FALLBACK|UNRESOLVED) ' thumbgen.stderr.log
grep -E '^TG_EXR_AUTO_(SELECTION_(FALLBACK|UNRESOLVED)|DEEP_OPACITY) ' thumbgen.stderr.log
```

For supported PSD v1 files, automatic color selection uses the stored composite when you omit both part and channel group. You can also select the composite directly with `--part 0` and optionally specify a channel group. For Raw and RLE files, `inspect` still lists available layers and you can select one explicitly by index or name. For ZIP and ZIP with prediction, `inspect` shows the supported composite only.
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

使用适合平台的完整 ThumbGen 程序目录。Windows 需要保留随附 DLL;Linux 需要保留 bin/lib 相对位置和执行权限。不要只复制单个可执行文件。

下载匹配平台的 `thumbgen-0.1.5-*.zip` 或 `.tar.gz`,先核对随附的 `SHA256SUMS`。两个压缩包都只有固定的 `ThumbGen/` 外层目录,里面直接是 `bin/`、`share/`、`licenses/`,Linux 另有 `lib/`;目录名不含版本或平台,无需解压后改名或移动。
下载匹配平台的 `thumbgen-0.1.6-*.zip` 或 `.tar.gz`,先核对随附的 `SHA256SUMS`。两个压缩包都只有固定的 `ThumbGen/` 外层目录,里面直接是 `bin/`、`share/`、`licenses/`,Linux 另有 `lib/`;目录名不含版本或平台,无需解压后改名或移动。

Windows 解压到 `%LOCALAPPDATA%/Programs/`,得到 `%LOCALAPPDATA%/Programs/ThumbGen/bin/thumbgen.exe`。PowerShell 可运行:

Expand All @@ -16,7 +16,7 @@ Linux 解压到 `$HOME/.local/opt/`,得到 `$HOME/.local/opt/ThumbGen/bin/thum

```sh
mkdir -p "$HOME/.local/opt"
tar -xzf thumbgen-0.1.5-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
tar -xzf thumbgen-0.1.6-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
"$HOME/.local/opt/ThumbGen/bin/thumbgen" --version --json
```

Expand Down
2 changes: 1 addition & 1 deletion docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ thumbgen batch --manifest jobs.json --json

`defaults` 设置通用转换选项,任务的 `options` 可以覆盖它;输出可以单独指定 size、format、quality 和 existing。`id` 必须唯一,用来关联返回结果。`sequence_id` 可选,用于[连续帧选择](selection.md)。

混合颜色图和 Cryptomatte 时,可设置 `"defaults": {"visualization": "auto"}`,一次批处理即可按文件选择预览。对已知 AOV,可在任务的 `options` 直接指定模式和通道。接入端可检查 `capabilities --json` 的 `visualization_modes` 是否包含 `auto`。
设置 `"defaults": {"visualization": "auto"}`,即可在一次批处理中为符合条件的文件选择颜色、Cryptomatte 或 [Deep 不透明度预览](public-deep.md)。在默认项或任务选项中显式设置 `deep_mode: "reject"` 会关闭不透明度回退。对已知 AOV,可在任务的 `options` 直接指定模式和通道。接入端可检查 `capabilities --json` 的 `visualization_modes` 是否包含 `auto`。

## 读取结果

Expand Down
16 changes: 15 additions & 1 deletion docs/public-deep.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[文档目录](README.md) · [English](en/public-deep.md)

Deep 文件需要先展平才能生成普通图片。使用 `--deep-mode flatten` 明确开启;默认不自动展平。
要生成 Deep 彩色预览,需用 `--deep-mode flatten` 明确开启展平。

```sh
thumbgen convert deep.exr --output preview.png --deep-mode flatten --input-space linear
Expand All @@ -11,6 +11,20 @@ thumbgen convert deep.exr --output preview.jpg --deep-mode flatten --background

输入应为关联颜色,并使用正确的线性色彩空间。项目空间不是 `linear` 时,请换成实际配置里的名称。

## 自动不透明度预览

```sh
thumbgen convert coverage.exr --output preview.jpg --visualize auto
```

常规选择找不到可用图像时,自动模式可预览唯一符合条件的 Deep part。该 part 只能含根层级的 `A`、`Z` 和可选的 `ZBack`(不区分大小写),且通道必须是 HALF 或 FLOAT。预览沿用 Deep 彩色展平的原生解码器、样本合成算法和限额。额外通道、分层通道、多个不透明度候选和声明了 Cryptomatte 系列的文件均不触发此回退。RGB Deep 仍需明确启用彩色展平。

批处理中,默认项和任务选项均省略 `deep_mode` 时才启用此回退。显式设置 `reject` 会关闭它,包括从批处理默认项继承的设置。显式指定 part 或通道、使用 `--visualize colour` 或 `--deep-mode flatten` 也会关闭此回退。

累计覆盖率直接映射到灰度。零覆盖为黑,完全覆盖为白,50% 覆盖在 8 位输出中约为 128。画布以显示窗口为准,数据窗口外的覆盖率为零。黑底和白底设置使用同一灰度刻度。透明 PNG 或 WebP 使用白色,Alpha 为覆盖率。覆盖率不经过 OCIO 处理,包括继承或显式配置的变换。

结果包含 `deep.policy = "deep-opacity-sweep-v1"` 及 `TG_EXR_AUTO_DEEP_OPACITY` 告警。参见[图层选择与告警标记](selection.md)。

## 支持范围

支持 Deep scanline / tiled 的 level 0,颜色、Alpha 和深度通道为 HALF / FLOAT。NONE、RLE、ZIPS 压缩可用;其他压缩的可用性请查询 `capabilities --json`。缺少必要通道、不支持的布局和超出样本限制会报告错误。
Expand Down
7 changes: 4 additions & 3 deletions docs/selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ thumbgen convert multipart.exr --output preview.jpg --part-name beauty

使用 `--visualize auto` 且未指定 part 或通道时,ThumbGen 尽力从平面 EXR 的颜色或灰度候选中选出预览。它先应用指定的选择策略。默认策略下,如果其他候选都是阴影、环境光遮蔽或 Fresnel 等已识别的辅助 AOV,可直接使用唯一一组无前缀 RGB(A),无需告警。如果仍有多个候选,则优先使用唯一一组无前缀 RGB(A),否则按现有 part 和通道组顺序使用第一个合适的候选。出现回退告警时,预览可能与预期画面不同。可查看 `selection.candidates` 和 `selection.chosen.reason`,或显式指定所需画面的 part 和通道组。

没有颜色候选时,自动模式可跨 part 预览 Cryptomatte 家族。默认策略优先多个家族中唯一的 `crypto_object` 或 `CryptoObject`,名称不区分大小写。自动模式无法选出受支持的映射时,任务以原错误失败。纯数据输入需要专用预览模式,未知布局需要检查通道或在上游转换。色彩管理、解码和输出失败沿用各自的错误诊断。失败后不会切换映射或尝试其他候选。
没有颜色候选时,自动模式可跨平面 part 预览 Cryptomatte 家族。默认策略优先多个家族中唯一的 `crypto_object` 或 `CryptoObject`,名称不区分大小写。省略 `deep_mode` 时,自动模式也可选择唯一的 [Deep 不透明度映射](public-deep.md)。自动模式无法选出受支持的映射时,任务以原错误失败。纯数据输入需要专用预览模式,未知布局需要检查通道或在上游转换。色彩管理、解码和输出失败沿用各自的错误诊断。失败后不会切换映射或尝试其他候选。

### 监控自动选择

Expand All @@ -31,12 +31,13 @@ thumbgen convert multipart.exr --output preview.jpg --part-name beauty
```text
TG_EXR_AUTO_SELECTION_FALLBACK selected_part=1 selected_group="RGB" candidate_count=3
TG_EXR_AUTO_SELECTION_UNRESOLVED error_code=visualization_required
TG_EXR_AUTO_DEEP_OPACITY selected_part=0 preview=grayscale_coverage
```

`selected_part` 是从 0 开始的索引,`selected_group` 是 JSON 字符串,`candidate_count` 是应用选择策略后剩余的合格候选数。可用以下命令从捕获的标准错误中筛选两类告警。
`selected_part` 是从 0 开始的索引,`selected_group` 是 JSON 字符串,`candidate_count` 是应用选择策略后剩余的合格候选数。不透明度告警每个任务记录一次,即使任务有多个输出,或在选择后出现解码或输出错误。

```sh
grep -E '^TG_EXR_AUTO_SELECTION_(FALLBACK|UNRESOLVED) ' thumbgen.stderr.log
grep -E '^TG_EXR_AUTO_(SELECTION_(FALLBACK|UNRESOLVED)|DEEP_OPACITY) ' thumbgen.stderr.log
```

受支持的 PSD v1 文件在未指定 part 或通道组、自动选择颜色图像时使用存储的合成图。也可使用 `--part 0` 直接选择合成图,按需附加通道组。Raw 和 RLE 文件的 `inspect` 仍会列出可用图层,可按索引或名称显式选择。ZIP 和带预测的 ZIP 文件的 `inspect` 仅显示受支持的合成图。
Expand Down
2 changes: 1 addition & 1 deletion include/thumbgen/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct Options {
std::string preset = "balanced", input_space = "auto", background = "black";
std::string ocio_config, display, view, channels, part_name, selection_policy = "primary";
std::string visualization="colour",invalid_values="magenta";
std::string deep_mode="reject";
std::string deep_mode; // Omitted. An explicit "reject" disables the automatic opacity preview.
int deep_samples_per_pixel=4096;
std::vector<double> data_range;
int part = -1, threads = 4;
Expand Down
Loading
Loading