A tool for creating and appending1 custom display colorspaces to existing OpenColorIO (OCIO) configurations, using measured display data including custom primaries, white point, luminance, and EOTF characteristics.
The goal is of this system is to have the renderer or compositor handle the color transformation to the display's native gamut, rather than having an unknown algorithm in the display do the transformation.
- Display Characterization: Create colorspaces from measured display data
- Single EOTF Support: PQ, HLG, or Gamma EOTF based on measured display response
- Advanced Gamut Mapping: Multiple strategies for handling out-of-gamut colors
- YAML Configuration: Easy-to-edit YAML configuration files
- Validation: Comprehensive validation of display measurements
- Flexible Validation: External validation settings file automatically loaded by scripts
- Base Config Selection: Load OCIO configurations using the
ocio://
scheme with structured version selection
-
Install UV (if not already installed):
# On Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # On macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install dependencies and create virtual environment:
uv sync
-
Edit configuration files:
display_config.yaml
- Your display measurements and base config selectionvalidation_settings.yaml
- Validation parameters (optional, uses defaults if missing)
-
Generate custom configuration:
uv run ./OCIODisplayGen.py
-
Install dependencies:
pip install -e .
-
Edit configuration files:
display_config.yaml
- Your display measurements and base config selectionvalidation_settings.yaml
- Validation parameters (optional, uses defaults if missing)
-
Generate custom configuration:
python OCIODisplayGen.py
Contains your display measurements and base OCIO configuration selection:
- Native primary coordinates (red, green, blue)
- White point
- Luminance characteristics (black level, peak luminance)
- Measured EOTF settings
- Viewing conditions
- Gamut mapping strategy
- Base OCIO configuration selection (type, versions)
- Validation mode settings
# display_config.yaml
display:
name: "Sony BVM-HX310"
# Validation mode settings
validation:
strict_mode: false # Enable strict mode (errors instead of warnings)
primaries:
red: [0.708, 0.292]
green: [0.170, 0.797]
blue: [0.131, 0.046]
white_point: [0.3127, 0.3290]
luminance:
black_level: 0.001
peak_luminance: 1000.0
# Measured display response (EOTF)
eotf:
type: "PQ" # Measured EOTF: "PQ", "HLG", or "GAMMA"
# gamma_value: 2.4 # Only include if type is "GAMMA"
gamut_mapping: "soft_clip"
ocio:
base_config:
type: "studio" # studio, aces, or custom
config_version: "v2.1.0" # config version
aces_version: "v1.3" # ACES version
ocio_version: "v2.3" # OCIO version
The system loads base configurations using the ocio://
scheme, which provides access to pre-built OCIO configurations:
studio
: Studio workflow configuration (default)aces
: ACES-only configurationcustom
: Custom configuration
config_version
: Configuration version (e.g., "v2.1.0", "v2.0.0")aces_version
: ACES version (e.g., "v1.3", "v1.2")ocio_version
: OCIO version (e.g., "v2.3", "v2.2")
The system constructs URLs in the format:
ocio://{type}-config-{config_version}_aces-{aces_version}_ocio-{ocio_version}
Available base configurations:
ocio://studio-config-v2.1.0_aces-v1.3_ocio-2.3
- Latest studio workflowocio://aces-config-v2.1.0_aces-v1.3_ocio-2.3
- Latest ACES-only workflow
clip
: Hard clipping at gamut boundaryperceptual
: Perceptual gamut mapping (preserves relationships)saturation
: Saturation-preserving mappingrelative
: Relative colorimetric mappingabsolute
: Absolute colorimetric mappingsoft_clip
: Roll-off approach preserving response through most of gamutadaptive
: Content-aware adaptive mappinghue_preserving
: Hue-preserving mapping with saturation compression
-
Set OCIO environment variable:
# On Windows (PowerShell) $env:OCIO = "C:\path\to\your\custom_display_config.ocio" # On macOS/Linux export OCIO=/path/to/your/custom_display_config.ocio
-
Select display colorspace in your application:
- Use the generated display colorspace for your measured display
- Display Characterization Guide - Detailed setup and usage
- Gamut Mapping Guide - Gamut mapping strategies explained
- Python 3.8+
- PyOpenColorIO
- colour-science
- PyYAML (for YAML configuration)
BSD 3-Clause License - see LICENSE file for details.
Footnotes
-
We append/modify rather than creating a dedicated OCIO config because many (?) systems such as Disguise that can use OCIO can only load one config at a time, and cannot merge OCIO components at runtime. ↩