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
8 changes: 6 additions & 2 deletions 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.3 LANGUAGES CXX)
project(ThumbGen VERSION 0.1.4 LANGUAGES CXX)

find_package(OpenImageIO 3.2 CONFIG REQUIRED)
find_package(OpenColorIO 2.5 CONFIG REQUIRED)
Expand Down Expand Up @@ -68,7 +68,7 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_

add_library(thumbgen_core STATIC src/core.cpp src/colour_plan.cpp src/resize_srgb.cpp src/color_input.cpp src/cms_input.cpp src/cmyk_jpeg.cpp src/jpeg_rows.cpp src/selection.cpp src/files.cpp src/quantize.cpp src/data_preview.cpp src/data_image.cpp src/selected_input.cpp src/cryptomatte.cpp src/sampled_id.cpp src/deep_flatten.cpp src/deep_reader.cpp src/deep_selection.cpp)
option(THUMBGEN_PNG_SCANLINE "Use bounded native PNG16 decode for eligible integer colour sources" ON)
target_sources(thumbgen_core PRIVATE src/exr_rows.cpp src/png_rows.cpp src/tiff_rows.cpp
target_sources(thumbgen_core PRIVATE src/exr_rows.cpp src/png_rows.cpp src/tiff_rows.cpp src/psd_rows.cpp
src/other_rows.cpp src/hdr_rows.cpp src/dpx_rows.cpp src/bmp_rows.cpp src/webp_rows.cpp src/tga_rows.cpp)
if(THUMBGEN_PNG_SCANLINE)
target_compile_definitions(thumbgen_core PRIVATE THUMBGEN_PNG_SCANLINE=1)
Expand Down Expand Up @@ -554,6 +554,10 @@ if(BUILD_TESTING)
add_test(NAME public_bounded_other COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_bounded_other_cli.py --exe $<TARGET_FILE:thumbgen>
--schema-dir ${CMAKE_CURRENT_SOURCE_DIR}/schemas --runtime-dir $<TARGET_FILE_DIR:OpenImageIO::OpenImageIO>)
add_test(NAME public_bounded_psd COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_bounded_psd_cli.py --exe $<TARGET_FILE:thumbgen>
--runtime-dir $<TARGET_FILE_DIR:OpenImageIO::OpenImageIO>)
set_tests_properties(public_bounded_psd PROPERTIES TIMEOUT 120 LABELS "protocol;colour;scheduler")
set_tests_properties(public_bounded_png_tiff public_bounded_other
PROPERTIES TIMEOUT 360 LABELS "protocol;colour;scheduler")
add_test(NAME public_integer_colour COMMAND ${Python3_EXECUTABLE}
Expand Down
4 changes: 2 additions & 2 deletions 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.3` · [Apache-2.0](LICENSE)
`0.1.4` · [Apache-2.0](LICENSE)

## Where it fits

Expand Down Expand Up @@ -66,7 +66,7 @@ These are actual ThumbGen outputs from publicly redistributable EXR samples. [Im

Available for Windows x64 and Linux x64, including CentOS 7.9 and Rocky Linux 9 environments.

Read OpenEXR, PNG, JPEG, TIFF, WebP, TGA, BMP, Radiance HDR and DPX. Write JPEG, PNG and lossy WebP. See the [large-preview guide](docs/en/large-previews.md) for bounded layouts and budget settings. Run `thumbgen capabilities --json` to see the formats available in your copy.
Read OpenEXR, PNG, JPEG, TIFF, WebP, TGA, BMP, Radiance HDR, DPX and supported PSD composites. Write JPEG, PNG and lossy WebP. See the [large-preview guide](docs/en/large-previews.md) for bounded layouts and budget settings. Run `thumbgen capabilities --json` to see the formats available in your copy.

## Quick start

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

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

`0.1.3` · [Apache-2.0](LICENSE)
`0.1.4` · [Apache-2.0](LICENSE)

## 适用场景

Expand Down Expand Up @@ -66,7 +66,7 @@ PNG、JPEG、TIFF 等常见图片也能处理;支持 Alpha、方向、多 part

支持 Windows x64 和 Linux x64,已在 CentOS 7.9、Rocky Linux 9 等环境使用。

可读取 OpenEXR、PNG、JPEG、TIFF、WebP、TGA、BMP、Radiance HDR 和 DPX,输出 JPEG、PNG 和有损 WebP。支持有界解码的布局与预算设置见[大图预览](docs/large-previews.md)。可用 `thumbgen capabilities --json` 查看当前程序的格式支持。
可读取 OpenEXR、PNG、JPEG、TIFF、WebP、TGA、BMP、Radiance HDR、DPX 和受支持的 PSD 合成图,输出 JPEG、PNG 和有损 WebP。支持有界解码的布局与预算设置见[大图预览](docs/large-previews.md)。可用 `thumbgen capabilities --json` 查看当前程序的格式支持。

## 快速开始

Expand Down
2 changes: 2 additions & 0 deletions docs/color-cms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ thumbgen convert frame.exr --output preview.jpg --ocio-config config.ocio --inpu

受支持的单张 PNG、JPEG、TIFF、WebP 会自动应用 RGB 或灰度 ICC。自动选择输入空间且未指定配置、显示器或视图时,这类文件使用 `ocio://default`,不受 `OCIO` 环境变量影响。显式选择配置或显示器与视图时,遵循上文的项目配置规则。显式指定输入空间会覆盖嵌入配置。

受支持的 PSD v1 RGB 合成图也会自动应用其嵌入的 RGB ICC,并采用同样的配置优先级。含图层的 PSD 的存储合成图按单张图处理。自动使用的 ICC 超限、损坏或色彩模型不兼容时会报告错误。

用于 ICC 转换的项目配置须能解析标准非线性场景参考空间 `srgb_rec709_scene`。可直接用标准名声明该色彩空间,也可声明对应别名并设置同名 interop ID。CMYK ICC 仍遵循显式指定或从环境继承的项目配置。

带可靠 ICC 的四通道 CMYK TIFF,以及受支持的 8-bit baseline Adobe CMYK/YCCK JPEG,可以转为 RGB 预览。没有可靠 profile、分色布局不支持或 ICC 损坏时会报告错误;给 CMYK 强行指定 RGB 空间不能替代正确转换。
Expand Down
2 changes: 2 additions & 0 deletions docs/en/color-cms.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Input space comes from `--input-space` first, otherwise file metadata. With no s

Supported single-image PNG, JPEG, TIFF and WebP inputs automatically use RGB or grayscale ICC profiles. With automatic input space and no explicit config, display or view, these files use `ocio://default` regardless of `OCIO`. An explicit config or display/view request follows the project configuration rules above. An explicit input space overrides the embedded profile.

Supported PSD v1 RGB composites automatically use embedded RGB ICC profiles and follow the same configuration precedence. The stored composite counts as one image even when the PSD contains layers. An embedded profile selected automatically produces an error if it exceeds the profile limit, is damaged, or uses an incompatible color model.

A project config used for ICC must resolve the standard nonlinear scene-referred `srgb_rec709_scene` bridge. Use the canonical color-space name or a declared alias with that interop ID. CMYK ICC continues to use the project's configuration when one is supplied or inherited.

Four-channel CMYK TIFF and supported 8-bit baseline Adobe CMYK/YCCK JPEG inputs with reliable ICC profiles can produce RGB previews. Missing profiles, unsupported ink layouts or damaged ICC data cause errors. Assigning an RGB space to CMYK is not a substitute for proper conversion.
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.3-*.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 has no version or platform suffix; no renaming or moving is needed.
Download the matching `thumbgen-0.1.4-*.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.3-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
tar -xzf thumbgen-0.1.4-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
"$HOME/.local/opt/ThumbGen/bin/thumbgen" --version --json
```

Expand Down
3 changes: 3 additions & 0 deletions docs/en/large-previews.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ The balanced preset can decode eligible sources once for up to two preview sizes
| BMP | Uncompressed 24-bit RGB and 32-bit RGB(A). |
| TGA | Uncompressed, non-interleaved 24-bit RGB and 32-bit RGBA. The decoder retains a native frame. |
| WebP | Still lossy RGB/RGBA. The decoder retains compressed input and a native frame. Lossless and animated inputs use the checked full-image path where the layout fits its decoder limits. |
| PSD | Stored 8- or 16-bit RGB composites in PSD v1, with optional merged transparency. Supports Raw, PackBits RLE, ZIP and ZIP with prediction. |

PSD previews read the composite saved in the file. Other presets and custom color settings use the same decoder for supported composites through a budget-checked full-image path.

The bounded layouts use extents of at most 65,536 pixels per axis, with smaller limits where the format requires them. EXR bounds include an 8 MiB metadata allocation limit, a 1,048,576-entry offset table and a 64 MiB unpacked chunk limit. Preview workspace is also capped. Unsupported layouts, other presets, additional output sizes, and data/Deep previews use the applicable existing path when its limits allow. If the file fails validation or its plan exceeds a limit, the affected job reports an error before writing a preview.

Expand Down
2 changes: 2 additions & 0 deletions docs/en/selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ thumbgen convert multipart.exr --output preview.jpg --part-name beauty

With `--visualize auto` and the default selection policy, a unique unprefixed RGB(A) group can resolve ambiguity between parts when all remaining candidates are recognized auxiliary AOVs such as shadows or ambient occlusion. Without a color candidate, the same mode can preview a Cryptomatte family across parts. A unique object family named `crypto_object` or `CryptoObject` takes precedence over other families, regardless of case. Other ambiguities require an explicit part, channel group or Cryptomatte family.

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.

## Keep sequences consistent

Give related batch jobs the same `sequence_id` to keep their selected layers and channels consistent. A later frame with missing or changed channels reports an error instead of silently selecting another image.
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.3-*.zip` 或 `.tar.gz`,先核对随附的 `SHA256SUMS`。两个压缩包都只有固定的 `ThumbGen/` 外层目录,里面直接是 `bin/`、`share/`、`licenses/`,Linux 另有 `lib/`;目录名不含版本或平台,无需解压后改名或移动。
下载匹配平台的 `thumbgen-0.1.4-*.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.3-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
tar -xzf thumbgen-0.1.4-linux-x86_64-glibc217.tar.gz -C "$HOME/.local/opt"
"$HOME/.local/opt/ThumbGen/bin/thumbgen" --version --json
```

Expand Down
3 changes: 3 additions & 0 deletions docs/large-previews.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ thumbgen convert renders/frame.exr --output-dir previews --size 960x960 --size 4
| BMP | 无压缩的 24 位 RGB 和 32 位 RGB(A)。 |
| TGA | 无压缩、非交错的 24 位 RGB 和 32 位 RGBA。解码器保留完整原生帧。 |
| WebP | 有损静态 RGB/RGBA。解码器保留压缩输入和原生帧。无损和动画可在满足解码限制时使用整图路径。 |
| PSD | PSD v1 的 8 位、16 位 RGB 合成图,可含合并透明度。支持 Raw、PackBits RLE、ZIP 和带预测的 ZIP。 |

PSD 预览读取文件中保存的合成图。使用其他预设或自定义色彩设置时,仍可通过同一解码器处理受支持的合成图,整图路径也会检查解码预算。

有界布局每边最多 65,536 像素,格式本身可能有更低的限制。EXR 的限制包括 8 MiB 元数据分配、最多 1,048,576 个偏移表条目和 64 MiB 解包块。缩放工作缓冲区也有上限。其他布局、预设、更多输出尺寸以及数据或 Deep 预览,在满足对应限制时沿用现有处理路径。输入校验失败或超出计划限制时,该任务会在写出预览前报告错误。

Expand Down
2 changes: 2 additions & 0 deletions docs/selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ thumbgen convert multipart.exr --output preview.jpg --part-name beauty

`--visualize auto` 使用默认选择策略时,如果其他 part 的候选都是阴影或环境光遮蔽等已识别的辅助 AOV,可选用唯一一组无前缀 RGB(A)。没有颜色候选时,此模式可跨 part 预览 Cryptomatte 家族。多个家族中唯一的 `crypto_object` 或 `CryptoObject` 优先,名称不区分大小写。其他歧义需显式指定 part、通道组或 Cryptomatte 家族。

受支持的 PSD v1 文件在未指定 part 或通道组、自动选择颜色图像时使用存储的合成图。也可使用 `--part 0` 直接选择合成图,按需附加通道组。Raw 和 RLE 文件的 `inspect` 仍会列出可用图层,可按索引或名称显式选择。ZIP 和带预测的 ZIP 文件的 `inspect` 仅显示受支持的合成图。

## 连续帧保持一致

在批处理任务中使用相同的 `sequence_id`,即可固定同一组图层与通道。后续帧缺失或改变通道时报告错误,而不会悄悄选择另一张图。
Expand Down
3 changes: 3 additions & 0 deletions scripts/linux/stage-validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
python_tests.append('test_cryptomatte_cli.py')
if any(test['name'] == 'public_sampled_id' for test in suite['tests']):
python_tests.append('test_sampled_id_cli.py')
if any(test['name'] == 'public_bounded_psd' for test in suite['tests']):
python_tests.extend(('psd_fixtures.py', 'test_bounded_psd_cli.py'))
for name in (*python_tests, 'requirements.txt'):
shutil.copy2(repo / 'tests' / name, stage / 'tests' / name)
for path in (repo / 'schemas').glob('*.json'):
Expand All @@ -69,6 +71,7 @@
str(repo / 'tests/test_aov_cli.py'): '@TESTS@/test_aov_cli.py',
str(repo / 'tests/test_cryptomatte_cli.py'): '@TESTS@/test_cryptomatte_cli.py',
str(repo / 'tests/test_sampled_id_cli.py'): '@TESTS@/test_sampled_id_cli.py',
str(repo / 'tests/test_bounded_psd_cli.py'): '@TESTS@/test_bounded_psd_cli.py',
str(repo / 'schemas'): '@SCHEMAS@',
str(cache / 'sdk/lib'): '@LIB@',
str(tools_cache / 'tools/python-3.11.11/bin/python3'): '@PYTHON@'})
Expand Down
Loading
Loading