Skip to content

Instantly share code, notes, and snippets.

@zachlewis
Last active March 11, 2025 17:41
Show Gist options
  • Save zachlewis/7bc0af1118debea90519d0a49ae446e2 to your computer and use it in GitHub Desktop.
Save zachlewis/7bc0af1118debea90519d0a49ae446e2 to your computer and use it in GitHub Desktop.
egamut2_ocio2_demo
ocio_profile_version: 2.2
name: example-egamut2-config_v1.0
description: |
Demonstrates the use of EGamut2 D65 as the scene reference space and the rest of the display color space / view transform architecture
search_path:
- ./luts
family_separator: /
roles:
aces_interchange: ap0ln
cie_xyz_d65_interchange: xyzd65
color_timing: eg2lg
compositing_log: eg2lg
compositing_linear: eg2ln
data: nc
default: eg2ln
scene_linear: eg2ln
srgb_linear: rec709ln
texture_paint: eg2ln
matte_paint: eg2ln
file_rules:
- !<Rule> {name: ColorSpaceNamePathSearch}
- !<Rule> {name: Default, colorspace: default}
shared_views:
- !<View> {name: Bypass, colorspace: nc}
- !<View> {name: Display, view_transform: colorimetry, display_colorspace: <USE_DISPLAY_NAME>}
- !<View> {name: K1S1, view_transform: arri_k1s1_rec709_shader, display_colorspace: <USE_DISPLAY_NAME>}
- !<View> {name: TCam3, view_transform: fl_tcam3_sdr_video, display_colorspace: <USE_DISPLAY_NAME>}
displays:
Rec.709 video:
- !<Views> [TCam3, K1S1, Display, Bypass]
sRGB (~2.22):
- !<Views> [TCam3, K1S1, Display, Bypass]
sRGB Display:
- !<Views> [TCam3, K1S1, Display, Bypass]
Rec.2100-PQ:
# This display needs a custom TCam3 view, because the shared TCam3 view isn't suitable for a PQ display
- !<View> {name: TCam3, view_transform: fl_tcam3_hdr_1k, display_colorspace: rec2100pq}
# The shared view *would* be suitable for an SDR-preview-in-HDR-display, but the "TCam3" view name is now taken for the display
# So we create a new view, reference an SDR (hopefully rec.709 limited) view transform intended for gamma 2.4 / rec709, but output in Rec.2020 / PQ
- !<View> {name: TCam3 (SDR preview), view_transform: fl_tcam3_sdr_video, display_colorspace: rec2100pq}
- !<Views> [Display, Bypass]
# We can hide and re-order displays and views with the active lists
active_views: [TCam3, Display, Bypass]
active_displays: [sRGB Display, Rec.709 video]
# And we're only adding the ACES2065-1 colorspace to satisfy the OCIO-2.2 profile requirements
# for an aces_interchange space. But this profile is compatible with OCIO-2.1, if you'd like to experiment.
inactive_colorspaces: [ACES2065-1]
# The default view transform is the bridge between scene RGB and display XYZ reference spaces.
# It's used for colorimetric "Display" / "Un-tone-mapped" views, and for standard colorspace
# conversions between the display colorspaces and the regular color spaces
default_view_transform: colorimetry
view_transforms:
# View Transforms are DRTs, expecting your scene reference as an input, and your display reference as an output
- !<ViewTransform>
name: colorimetry
to_scene_reference: !<MatrixTransform> {name: D65-adapted CIE XYZ to EGamut2, matrix: [1.35702367254585, -0.237033581941448, -0.119990090604401, 0, -0.438325988676953, 1.29442894440374, 0.143897044273212, 0, 0.100252080766426, 0.0641140083985013, 0.835633910835072, 0, 0, 0, 0, 1]}
# Just showing off here
- !<ViewTransform>
name: arri_k1s1_rec709_shader
from_scene_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: Linear EGamut2, dst: ACES2065-1}
- !<BuiltinTransform> {style: ARRI_ALEXA-LOGC-EI800-AWG_to_ACES2065-1, direction: inverse}
- !<GradingRGBCurveTransform>
style: log
master: {control_points: [0, 0, 0.06896552, 0.02795742, 0.137931, 0.0655087, 0.2068966, 0.1188965, 0.2758621, 0.1955241, 0.3448276, 0.3109463, 0.4137931, 0.4441377, 0.4827586, 0.5752721, 0.5517241, 0.7034314, 0.6206896, 0.8261872, 0.6896552, 0.9104496, 0.7586207, 0.9591234, 0.8275862, 0.983741, 0.8965517, 0.9934393, 0.9655172, 0.9973552, 1.034483, 1.003448, 1.103448, 1.010345, 1.172414, 1.017241, 1.241379, 1.024138, 1.310345, 1.031034, 1.37931, 1.037931, 1.448276, 1.044828, 1.517241, 1.051724, 1.586207, 1.058621, 1.655172, 1.065517, 1.724138, 1.072414, 1.793103, 1.07931, 1.862069, 1.086207, 1.931034, 1.093103, 2, 1.1]}
- !<ExponentWithLinearTransform> {gamma: 2.725, offset: 0.097}
- !<MatrixTransform> {matrix: [1.485007, -0.401216, -0.083791, 0, -0.033732, 1.282887, -0.249155, 0, 0.010776, -0.122018, 1.111242, 0, 0, 0, 0, 1]}
- !<RangeTransform> {min_in_value: 0, min_out_value: 0}
- !<ExponentWithLinearTransform> {gamma: 2.725, offset: 0.097, direction: inverse}
- !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709, direction: inverse}
# If you know the exact encoding of an output-referred LUT, you can ues a builtintransform to
# invert out the display encoding;
- !<ViewTransform>
name: fl_tcam3_sdr_video
from_scene_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: Linear EGamut2, dst: TLog EGamut2}
- !<FileTransform> {src: FilmLight_TLog_EGamut2_2_Video_Full.cub}
- !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709, direction: inverse}
# ...or you could simply ColorSpaceTransform your way out to XYZ D65.
- !<ViewTransform>
name: fl_tcam3_hdr_1k
from_scene_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: Linear EGamut2, dst: TLog EGamut2}
- !<FileTransform> {src: FilmLight_TLog_EGamut2_2_Rec2084_Rec2020_10000nits.cub}
- !<ColorSpaceTransform> {src: Rec.2100-PQ, dst: XYZ D65}
display_colorspaces:
- !<ColorSpace>
name: XYZ D65
aliases: [xyzd65]
encoding: display-linear
- !<ColorSpace>
name: Rec.1886 Rec.709
aliases: [Rec.709 video, rec709g24]
encoding: sdr-video
from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.1886-REC.709}
- !<ColorSpace>
name: sRGB (~2.22)
aliases: [rec709srgb]
encoding: sdr-video
from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_sRGB}
- !<ColorSpace>
name: Gamma 2.2 Rec.709
aliases: [sRGB Display]
encoding: sdr-video
from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_G2.2-Rec.709}
- !<ColorSpace>
name: Rec.2100-PQ
aliases: [rec2100pq]
encoding: hdr-video
from_display_reference: !<BuiltinTransform> {style: DISPLAY - CIE-XYZ-D65_to_REC.2100-PQ}
colorspaces:
- !<ColorSpace>
name: Linear EGamut2
aliases: [eg2ln]
encoding: scene-linear
- !<ColorSpace>
name: ACES2065-1
aliases: [ap0ln]
encoding: scene-linear
to_scene_reference: !<MatrixTransform> {name: AP0 to EGamut2, matrix: [1.25992000102997, -0.180662006139756, -0.0792595967650415, 0, 0.00486135017126798, 0.944082021713261, 0.0510565005242827, 0, 0.121235996484756, 0.0466471016407016, 0.832117021083833, 0, 0, 0, 0, 1]}
- !<ColorSpace>
name: Linear Rec.709
aliases: [rec709ln]
encoding: scene-linear
to_scene_reference: !<MatrixTransform> {name: Rec.709 to EGamut2, matrix: [0.536292888652421, 0.326736387063327, 0.136969122409424, 0, 0.0877891264176234, 0.775510559265133, 0.136700186726053, 0, 0.0720834599557859, 0.177196393820362, 0.750720265433145, 0, 0, 0, 0, 1]}
- !<ColorSpace>
name: TLog EGamut2
aliases: [eg2lg]
encoding: log
to_scene_reference: !<LogCameraTransform> {name: FilmLight T-Log Decoding, base: 2.71828182845905, log_side_slope: 0.0923290259657735, log_side_offset: 0.552012656860665, lin_side_offset: 0.00570482440424738, lin_side_break: 0, linear_slope: 16.1843764896659, direction: inverse}
- !<ColorSpace>
name: Non-color data
aliases: [nc]
description: Non-color data
encoding: data
isdata: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment