Skip to content

Adding app required color spaces (ref spaces differ)

Doug Walker edited this page Apr 17, 2023 · 1 revision

app-required-base.ocio

ocio_profile_version: 2.1

environment:
  {}
search_path: ""
description: |
  Example of a user's base config to which an app will add color spaces.
  It uses Linear AWG3 as the scene-referred reference space.

roles:
  aces_interchange: ACES2065-1

shared_views:
  - !<View> {name: ACES 1.0 - SDR Video, view_transform: ACES 1.0 - SDR Video, display_colorspace: <USE_DISPLAY_NAME>}

displays:
  Rec.1886 Rec.709 - Display:
    - !<Views> [ACES 1.0 - SDR Video]

view_transforms:
  - !<ViewTransform>
    name: ACES 1.0 - SDR Video
    from_scene_reference: !<BuiltinTransform> {style: ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-VIDEO_1.0}

display_colorspaces:
  - !<ColorSpace>
    name: Rec.1886 Rec.709 - Display
    aliases: [rec1886_rec709_display]
    family: Display
    equalitygroup: ""
    bitdepth: 32f
    description: Convert CIE XYZ (D65 white) to Rec.1886/Rec.709 (HD video)
    isdata: false
    categories: [file-io]
    encoding: sdr-video
    allocation: uniform
    from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709}

colorspaces:
  - !<ColorSpace>
    name: ACES2065-1
    aliases: [aces2065_1, ACES - ACES2065-1, lin_ap0]
    family: ACES
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform
    to_scene_reference: !<GroupTransform>
      children:
        - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: Linear ARRI Wide Gamut 3
    aliases: [lin_arri_wide_gamut_3, Input - ARRI - Linear - ALEXA Wide Gamut, lin_alexawide]
    family: Input/ARRI
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform

app-required-input.ocio

ocio_profile_version: 2.1

environment:
  {}
search_path: ""

name: vendor-required-colorspaces
description: |
  Example of the color spaces and named transforms that a vendor might need to add to all user
  configs to enable its own color processing which must always be available.  These transforms
  are copies of what is in the CG config and will not be copied if they are already present.

roles:
  aces_interchange: ACES2065-1

inactive_colorspaces: []

colorspaces:
  - !<ColorSpace>
    name: ACES2065-1
    aliases: [aces2065_1, ACES - ACES2065-1, lin_ap0]
    description: The "Academy Color Encoding System" reference colorspace.
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform

  - !<ColorSpace>
    name: Linear Rec.709 (sRGB)
    aliases: [lin_rec709_srgb, Utility - Linear - Rec.709, lin_rec709, lin_srgb, Utility - Linear - sRGB]
    family: Utility
    description: |
      Convert ACES2065-1 to linear Rec.709 primaries, D65 white point
    isdata: false
    categories: [file-io, working-space]
    encoding: scene-linear
    from_scene_reference: !<GroupTransform>
      name: AP0 to Linear Rec.709 (sRGB)
      children:
        - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: sRGB - Texture
    aliases: [srgb_tx, Utility - sRGB - Texture, srgb_texture, Input - Generic - sRGB - Texture]
    family: Utility
    description: |
      Convert ACES2065-1 to sRGB
    isdata: false
    categories: [file-io]
    from_scene_reference: !<GroupTransform>
      name: AP0 to sRGB Rec.709
      children:
        - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}
        - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}

  - !<ColorSpace>
    name: Raw
    aliases: [Utility - Raw]
    family: Utility
    description: The utility "Raw" colorspace.
    isdata: true
    categories: [file-io]

named_transforms:
  - !<NamedTransform>
    name: sRGB - Curve
    aliases: [srgb_crv, Utility - Curve - sRGB, crv_srgb]
    description: |
      Convert generic linear RGB to generic gamma-corrected RGB
    family: Utility
    categories: [file-io]
    encoding: sdr-video
    inverse_transform: !<GroupTransform>
      name: Linear to sRGB
      children:
        - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}

app-required-merged.ocio

Note that the reference spaces are different, so when the color spaces are added from the input config, an extra matrix is added to the transform list. Note that the color space ACES2065-1 is present in both configs but the transforms are different. But regardless of whether the merge rules are to take the space from the base or input config, the transform in the merged color space will be the same (though some of the other color space attributes would differ).

Diff of base and merged configs:

% diff app-required-base.ocio app-required-merged.ocio
7,8c7
<   Example of a user's base config to which an app will add color spaces.
<   It uses Linear AWG3 as the scene-referred reference space.
---
>   Merge of app-required-base.ocio and app-required-input.ocio.
40a40,79
>     name: Linear Rec.709 (sRGB)
>     aliases: [lin_rec709_srgb, Utility - Linear - Rec.709, lin_rec709, lin_srgb, Utility - Linear - sRGB]
>     family: Utility
>     description: |
>       Convert ACES2065-1 to linear Rec.709 primaries, D65 white point
>     isdata: false
>     categories: [file-io, working-space]
>     encoding: scene-linear
>     from_scene_reference: !<GroupTransform>
>       name: AP0 to Linear Rec.709 (sRGB)
>       children:
>         # Note the addition of an AWG3 to AP0 matrix.
>         - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}
>         - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}
>
>   - !<ColorSpace>
>     name: sRGB - Texture
>     aliases: [srgb_tx, Utility - sRGB - Texture, srgb_texture, Input - Generic - sRGB - Texture]
>     family: Utility
>     description: |
>       Convert ACES2065-1 to sRGB
>     isdata: false
>     categories: [file-io]
>     from_scene_reference: !<GroupTransform>
>       name: AP0 to sRGB Rec.709
>       children:
>         # Note the addition of an AWG3 to AP0 matrix.
>         - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}
>         - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}
>         - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}
>
>   - !<ColorSpace>
>     name: Raw
>     aliases: [Utility - Raw]
>     family: Utility
>     description: The utility "Raw" colorspace.
>     isdata: true
>     categories: [file-io]
>
>   - !<ColorSpace>
59a99,112
>
> named_transforms:
>   - !<NamedTransform>
>     name: sRGB - Curve
>     aliases: [srgb_crv, Utility - Curve - sRGB, crv_srgb]
>     description: |
>       Convert generic linear RGB to generic gamma-corrected RGB
>     family: Utility
>     categories: [file-io]
>     encoding: sdr-video
>     inverse_transform: !<GroupTransform>
>       name: Linear to sRGB
>       children:
>         - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}
ocio_profile_version: 2.1

environment:
  {}
search_path: ""
description: |
  Merge of app-required-base.ocio and app-required-input.ocio.

roles:
  aces_interchange: ACES2065-1

shared_views:
  - !<View> {name: ACES 1.0 - SDR Video, view_transform: ACES 1.0 - SDR Video, display_colorspace: <USE_DISPLAY_NAME>}

displays:
  Rec.1886 Rec.709 - Display:
    - !<Views> [ACES 1.0 - SDR Video]

view_transforms:
  - !<ViewTransform>
    name: ACES 1.0 - SDR Video
    from_scene_reference: !<BuiltinTransform> {style: ACES-OUTPUT - ACES2065-1_to_CIE-XYZ-D65 - SDR-VIDEO_1.0}

display_colorspaces:
  - !<ColorSpace>
    name: Rec.1886 Rec.709 - Display
    aliases: [rec1886_rec709_display]
    family: Display
    equalitygroup: ""
    bitdepth: 32f
    description: Convert CIE XYZ (D65 white) to Rec.1886/Rec.709 (HD video)
    isdata: false
    categories: [file-io]
    encoding: sdr-video
    allocation: uniform
    from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709}

colorspaces:
  - !<ColorSpace>
    name: Linear Rec.709 (sRGB)
    aliases: [lin_rec709_srgb, Utility - Linear - Rec.709, lin_rec709, lin_srgb, Utility - Linear - sRGB]
    family: Utility
    description: |
      Convert ACES2065-1 to linear Rec.709 primaries, D65 white point
    isdata: false
    categories: [file-io, working-space]
    encoding: scene-linear
    from_scene_reference: !<GroupTransform>
      name: AP0 to Linear Rec.709 (sRGB)
      children:
        # Note the addition of an AWG3 to AP0 matrix.
        - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}
        - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: sRGB - Texture
    aliases: [srgb_tx, Utility - sRGB - Texture, srgb_texture, Input - Generic - sRGB - Texture]
    family: Utility
    description: |
      Convert ACES2065-1 to sRGB
    isdata: false
    categories: [file-io]
    from_scene_reference: !<GroupTransform>
      name: AP0 to sRGB Rec.709
      children:
        # Note the addition of an AWG3 to AP0 matrix.
        - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}
        - !<MatrixTransform> {matrix: [2.52168618674388, -1.13413098823972, -0.387555198504164, 0, -0.276479914229922, 1.37271908766826, -0.096239173438334, 0, -0.0153780649660342, -0.152975335867399, 1.16835340083343, 0, 0, 0, 0, 1]}
        - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}

  - !<ColorSpace>
    name: Raw
    aliases: [Utility - Raw]
    family: Utility
    description: The utility "Raw" colorspace.
    isdata: true
    categories: [file-io]

  - !<ColorSpace>
    name: ACES2065-1
    aliases: [aces2065_1, ACES - ACES2065-1, lin_ap0]
    family: ACES
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform
    to_scene_reference: !<GroupTransform>
      children:
        - !<MatrixTransform> {matrix: [0.680345100399, 0.234676102332, 0.084978797269, 0, 0.085766538119, 1.015425672258, -0.101192210377, 0, 0.002123354187, -0.058210065174, 1.056086710987, 0, 0, 0, 0, 1]}

  - !<ColorSpace>
    name: Linear ARRI Wide Gamut 3
    aliases: [lin_arri_wide_gamut_3, Input - ARRI - Linear - ALEXA Wide Gamut, lin_alexawide]
    family: Input/ARRI
    isdata: false
    categories: [file-io]
    encoding: scene-linear
    allocation: uniform

named_transforms:
  - !<NamedTransform>
    name: sRGB - Curve
    aliases: [srgb_crv, Utility - Curve - sRGB, crv_srgb]
    description: |
      Convert generic linear RGB to generic gamma-corrected RGB
    family: Utility
    categories: [file-io]
    encoding: sdr-video
    inverse_transform: !<GroupTransform>
      name: Linear to sRGB
      children:
        - !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}