Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

IdentifyBuiltinColorSpace heuristics failure edgecases: ACEScc, ADX16, CIE-XYZ-D65

オープン
#2,222 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp, python

調査の方向性

まず、提供された Python 再現コードを ocio://studio-config-latest に対して実行し、最適化フラグと非アクティブな色空間の設定ごとに IdentifyBuiltinColorSpace の結果を比較します。次に、Config::IdentifyBuiltinColorSpace と、ACEScc、ADX16、CIE XYZ-D65 BuiltinTransform のマッチングパスを調査します。一覧にある同等の色空間が一貫して識別され、要求された可視性と最適化の動作がカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Feature Request

Apparently, ACEScc, ADX16, and both CIE XYZ-D65 spaces from ocio://studio-config-latest (as of OCIO v2.5.0) are evading our out-of-the-box matching / identification algorithms.

I've been noticing that, very occasionally, Config::IdentifyBuiltinColorSpace has trouble matching certain color spaces among configs that really do share functionally identical definitions, and should, by all accounts, be recognized as equivalent.

I wrote a little function to assess which color spaces in a given config IdentifyBuiltinColorSpace seems to have the most trouble with -- essentially, I'm using the exact same config for both the srcConfig and the builtinConfig, and just collecting the color spaces that can't be found in their own configs.

In exploring this, I found that both optimization flags (unsurprisingly) and color space visibility (surprisingly) affect the rate of success.

Insights:

  • It would be useful if there were a way to force Config.IdentifyBuiltinColorSpace to always attempt to failover to searching inactive color spaces.
  • It would be nice if IdentifyBuiltinColorSpace exposed an optional optimizationFlags argument as a means of fine-tuning the equivalency "tolerance"

Findings:

  • "ADX16" color spaces based off of the ADX16_to_ACES2065-1 BuiltinTransform can be matched when using DRAFT optimization or higher
  • "ACEScc" and "ACESproxy10i" color spaces based off of the ACEScc_to_ACES2065-1 ACESproxy10i_to_ACES2065-1 BuiltinTransform styles respectively remain "unmatchable", regardless of optimization settings.

Here's a python snippet if you wanna mess around:

import PyOpenColorIO as ocio
import os

def get_unmatchable_color_spaces(
    config: ocio.Config, 
    optimization: ocio.OptimizationFlags | int | None = None,
    exclude_inactive: bool = False, 
    verbose: bool = False,
) -> list[str]:
    
    # Optimization Flags affect the identification heuristics. The API doesn't expose a way
    # to directly control the optimization flags used for identifying color spaces, but we
    # can temporarily adjust the $OCIO_OPTIMIZATION_FLAGS environment variable
    # if we want to temporarily override the global optimization behavior

    # Preserve the previous environment to restore later.
    prev_env = dict(os.environ)
    if optimization:
        # Temporarily set $OCIO_OPTIMIZATION_FLAGS to the requested value.
        os.environ[ocio.OCIO_OPTIMIZATION_FLAGS_ENVVAR] = str(int(optimization))

    
    # Color space visiblity affects the identification heuristics.
    # To maximize the likelihood of finding a match, we can temporarily
    # activate all color spaces. 

    # Store the old inactive color spaces to restore later.
    old_invisible_color_spaces = config.getInactiveColorSpaces()
    
    if not exclude_inactive:
        # Temporarily make all color spaces visible.
        config.setInactiveColorSpaces("")

    
    # Iterate over all the color spaces in the config, and collect names of 
    # color spaces that steadfastly refuse to be matched!
    problem_spaces = []
    for cs_name in config.getColorSpaceNames(
        ocio.SEARCH_REFERENCE_SPACE_ALL, 
        ocio.COLORSPACE_ALL
    ):
        # Try to match each color space in the config to... itself!
        try:
            matched_space = ocio.Config.IdentifyBuiltinColorSpace(config, config, cs_name)
        except ocio.Exception as e:
            if verbose:
                ocio.LogMessage(ocio.LOGGING_LEVEL_WARNING, str(e))
            problem_spaces.append(cs_name)

    # Cleanup -- restore the previous environment and config state.`
    os.environ.clear()
    os.environ.update(prev_env)
    config.setInactiveColorSpaces(old_invisible_color_spaces)
    
    return sorted(problem_spaces)
studio_config_modified = ocio.Config.CreateFromFile("ocio://studio-config-latest")

# Add an ACESproxy10i color space to the studio-config, because I suspect it'll also fail to match itself.
studio_config_modified.addColorSpace(
    ocio.ColorSpace(
        ocio.REFERENCE_SPACE_SCENE,
        name="ACESproxy10i",
        toReference= ocio.BuiltinTransform("ACESproxy10i_to_ACES2065-1")
    )
)

print(f"""
Unmatchable color spaces: {studio_config_modified.getName()}
---

 - Default IdentifyBuiltinColorSpace behavior: 
   {get_unmatchable_color_spaces(studio_config_modified, exclude_inactive=True)}
 
 - Ignore visibility + no optimizations: 
   {get_unmatchable_color_spaces(studio_config_modified, optimization=ocio.OPTIMIZATION_NONE)}
 
-  Ignore visibility + draft optimizations: 
   {get_unmatchable_color_spaces(studio_config_modified, optimization=ocio.OPTIMIZATION_DRAFT)}
""")

Unmatchable color spaces: studio-config-v4.0.0_aces-v2.0_ocio-v2.5
---

 - Default IdentifyBuiltinColorSpace behavior: 
   ['ACEScc', 'ACESproxy10i', 'ADX16', 'CIE XYZ-D65 - Display-referred', 'CIE XYZ-D65 - Scene-referred']
 
 - Ignore visibility + no optimizations: 
   ['ACEScc', 'ACESproxy10i', 'ADX16']
 
-  Ignore visibility + draft optimizations: 
   ['ACEScc', 'ACESproxy10i']
主要言語
C++
スター
2.1k
フォーク
503
平均マージ
7日 16時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AcademySoftwareFoundation/OpenColorIO のほかの issue

AcademySoftwareFoundation/OpenColorIO の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。