Grading Transforms

GradingPrimaryTransform

class PyOpenColorIO.GradingPrimaryTransform

Primary color correction controls.

This transform is for making basic color correction adjustments to an image such as brightness, contrast, or saturation.

The controls are customized for linear, logarithmic, and video color encodings. - Linear controls: Exposure, Contrast, Pivot, Offset, Saturation, Black Clip, White Clip. - Log controls: Brightness, Contrast, Pivot, Log Gamma, Saturation, Black Clip, White Clip, Black Pivot White Pivot. - Video controls : Lift, Gamma, Gain, Offset, Saturation, Black Clip, White Clip, Black Pivot White Pivot.

The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.

GradingPrimaryTransform(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingPrimaryTransform, values: PyOpenColorIO.PyOpenColorIO.GradingPrimary, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingPrimaryTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection
getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata
getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle

Adjusts the behavior of the transform for log, linear, or video color space encodings.

getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType
getValue() PyOpenColorIO.PyOpenColorIO.GradingPrimary
isDynamic() bool

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingPrimaryTransform only one can have dynamic parameters.

makeDynamic() None
makeNonDynamic() None
setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None

Note that this only affects the evaluation and not the values stored in the object.

setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None

Will reset value to style’s defaults if style is not the current style.

setValue(values: PyOpenColorIO.PyOpenColorIO.GradingPrimary) None

Throws if value is not valid.

validate() None

Will throw if data is not valid.

GradingPrimary

class PyOpenColorIO.GradingPrimary

Grading primary values.

NoClampBlack = -1.7976931348623157e+308
NoClampWhite = 1.7976931348623157e+308
GradingPrimary(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None
property brightness
property clampBlack
property clampWhite
property contrast
property exposure
property gain
property gamma
property lift
property offset
property pivot
property pivotBlack
property pivotWhite
property saturation
validate(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None

The valid range for each parameter varies.

GradingRGBM

class PyOpenColorIO.GradingRGBM

Used by the grading transforms to hold the red, green, blue, and master components of a single parameter. The master component affects all three channels (RGB).

GradingRGBM(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBM) -> None

  2. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBM, red: typing.SupportsFloat | typing.SupportsIndex, green: typing.SupportsFloat | typing.SupportsIndex, blue: typing.SupportsFloat | typing.SupportsIndex, master: typing.SupportsFloat | typing.SupportsIndex) -> None

property blue
property green
property master
property red

GradingRGBCurveTransform

class PyOpenColorIO.GradingRGBCurveTransform

RGB curve color correction controls.

This transform allows for modifying tone reproduction via B-spline curves.

There is an R, G, and B curve followed by a Master curve (that applies to R, G, and B). Each curve is specified via the x and y coordinates of its control points. A monotonic spline is fit to the control points. The x coordinates must be non-decreasing. When the grading style is linear, the units for the control points are photographic stops relative to 0.18.

The control points are dynamic, so they may be adjusted even after the Transform is included in a Processor.

GradingRGBCurveTransform(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurveTransform, values: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

getBypassLinToLog() bool

The scene-linear grading style applies a lin-to-log transform to the pixel values before going through the curve. However, in some cases (e.g. drawing curves in a UI) it may be useful to bypass the lin-to-log. Default value is false.

getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection
getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata
getSlope(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType, index: SupportsInt | SupportsIndex) float

It is possible to provide a desired slope value for each control point. The number of slopes is always the same as the number of control points and so the control points must be set before setting the slopes. The slopes are primarily intended for use by config authors looking to match a specific shape with as few control points as possible, they are not intended to be exposed to a user interface for direct manipulation. When a curve is being generated for creative purposes it is better to let OCIO calculate the slopes automatically.

getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle

Adjusts the behavior of the transform for log, linear, or video color space encodings.

getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType
getValue() PyOpenColorIO.PyOpenColorIO.GradingRGBCurve
isDynamic() bool

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingRGBCurveTransform only one can have dynamic parameters.

makeDynamic() None
makeNonDynamic() None
setBypassLinToLog(bypass: bool) None
setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None

Note that this only affects the evaluation and not the values stored in the object.

setSlope(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType, index: SupportsInt | SupportsIndex, slope: SupportsFloat | SupportsIndex) None
setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None

Will reset value to style’s defaults if style is not the current style.

setValue(values: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve) None

Throws if value is not valid.

slopesAreDefault(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType) bool
validate() None

Will throw if data is not valid.

GradingRGBCurve

class PyOpenColorIO.GradingRGBCurve

A set of red, green, blue and master curves. It is used by RGBCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingRGBCurve).

GradingRGBCurve(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle) -> None

Do not use (needed only for pybind11).

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, red: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, green: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, blue: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, master: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>) -> None

property blue
property green
isIdentity() bool
property master
property red
validate() None

GradingHueCurveTransform

class PyOpenColorIO.GradingHueCurveTransform

Hue curve color correction controls.

This transform provides eight spline curves to make the following adjustments:

  • Hue-Hue: Map input hue to output hue (where a diagonal line is the identity).

  • Hue-Sat: Adjust saturation as a function of hue (a value of 1.0 is the identity).

  • Hue-Lum: Adjust luma as a function of hue (a value of 1.0 is the identity).

  • Lum-Sat: Adjust saturation as a function of luma (a value of 1.0 is the identity).

  • Sat-Sat: Adjust saturation as a function of saturation (a diagonal is the identity).

  • Lum-Lum: Adjust luma as a function of luma, maintaining hue & sat (diagonal is identity).

  • Sat-Lum: Adjust luma as a function of saturation (a value of 1.0 is the identity).

  • Hue-FX : Map input hue to delta output hue (a value of 0.0 is the identity).

The algorithm is different for scene-linear, logarithmic, and video color spaces, so initialize the style argument appropriately before setting the curves.

An RGB-to-HSY FixedFunction is used to convert RGB into a hue, saturation, luma color space. However, there is an option to bypass that conversion to use an outboard transform.

Like the GradingRGBCurveTransform, the curves are defined by the x and y coordinates of a set of control points. A spline will be fit to the control points. Monotonicity is preserved for curves where the diagonal is the identity. For curves that take luma as input, if the style is scene-linear, the units are in photographic stops relative to 0.18. For log and video, the luma is scaled the same as the input RGB.

The hue variable is [0,1] and is periodic. For example, -0.2, 0.8, and 1.8 are equivalent. The domain of the curves is [0,1] and control points outside that domain are mapped into it. A hue of 0 or 1 corresponds to a magenta hue.

The control points are dynamic, so they may be adjusted even after the Transform is included in a Processor. However, creating a curve or setting the parameters will call the GradingBSplineCurveImpl::validate function, which will throw an exception if the control points do not meet certain requirements, for example that the X-coordinates are non-decreasing Please review that function for details on the validation. Applications that provide a UI to edit curves must ensure that they prevent users from creating control points that are not valid.

The transform is invertible as long as the curves allow it. For example, if saturation is mapped to zero, obviously that cannot be resaturated. Care should be taken with the Hue-FX curve because it is possible to fold hues over on themselves, which also cannot be inverted. In most cases the Hue-FX curve is not necessary since the Hue-Hue curve provides similar functionality with the added benefit of being strictly invertible.

GradingHueCurveTransform(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurveTransform, values: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingHueCurveTransform.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurveTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingHueCurveTransform.

getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection
getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata
getRGBToHSY() PyOpenColorIO.PyOpenColorIO.HSYTransformStyle

By default, the input is transformed into HSY space to apply the hue curves and then the result is transformed back to RGB. However, this may be set to HSY_TRANSFORM_NONE to bypass this in order to use other hue/sat/luma type transforms applied separately before and after this transform.

getSlope(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType, index: SupportsInt | SupportsIndex) float

It is possible to provide a desired slope value for each control point. The number of slopes is always the same as the number of control points and so the control points must be set before setting the slopes. The slopes are primarily intended for use by config authors looking to match a specific shape with as few control points as possible, they are not intended to be exposed to a user interface for direct manipulation. When a curve is being generated for creative purposes it is better to let OCIO calculate the slopes automatically.

getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle

Adjusts the behavior of the transform for log, linear, or video color space encodings.

getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType
getValue() PyOpenColorIO.PyOpenColorIO.GradingHueCurve
isDynamic() bool

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingHueCurveTransform only one can have dynamic parameters.

makeDynamic() None
makeNonDynamic() None
setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None

Note that this only affects the evaluation and not the values stored in the object.

setRGBToHSY(style: PyOpenColorIO.PyOpenColorIO.HSYTransformStyle) None
setSlope(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType, index: SupportsInt | SupportsIndex, slope: SupportsFloat | SupportsIndex) None
setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None

Will reset value to style’s defaults if style is not the current style.

setValue(values: PyOpenColorIO.PyOpenColorIO.GradingHueCurve) None

Throws if value is not valid.

slopesAreDefault(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType) bool
validate() None

Will throw if data is not valid.

GradingHueCurve

class PyOpenColorIO.GradingHueCurve

A set of HUE/SAT/LUM curves. It is used by GradingHueCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingHueCurve).

GradingHueCurve(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle) -> None

Do not use (needed only for pybind11).

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, arg0: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg1: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg2: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg3: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg4: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg5: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg6: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg7: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve) -> None

getDrawCurveOnly() bool

Enable drawCurveOnly mode to return the output value of a spline curve without any of the other associated processing of the RGB values. This is useful when the curves need to be graphed independently in a user interface. To use this, set the curve parameters on the Hue-Sat curve. The R, G, and B values will be sent through that curve with the interpretation that they are the input axis to the curve (which would be hue, sat, or luma) rather than RGB. This mode does not apply the RGB-to-HSY or Lin-to-Log, so for scene-linear curves the luma values are interpreted as already being in the logarithmic (f-stop) space. The forward curve evaluation is done regardless of the transform direction.

property hue_fx
property hue_hue
property hue_lum
property hue_sat
isIdentity() bool
property lum_lum
property lum_sat
property sat_lum
property sat_sat
setDrawCurveOnly(drawcurveonly: bool) None
validate() None

GradingControlPoint

class PyOpenColorIO.GradingControlPoint

2D control point used by GradingBSplineCurve.

GradingControlPoint(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingControlPoint) -> None

  2. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingControlPoint, x: typing.SupportsFloat | typing.SupportsIndex = 0.0, y: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None

property x
property y

GradingBSplineCurve

class PyOpenColorIO.GradingBSplineCurve

A BSpline curve defined with GradingControlPoint.

GradingBSplineCurve(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex) -> None

Create a BSpline curve with a specified number of control points.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex, huecurvetype: PyOpenColorIO.PyOpenColorIO.HueCurveType) -> None

Create a BSpline curve with a specified number of control points.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex, splinetype: PyOpenColorIO.PyOpenColorIO.BSplineType) -> None

Create a BSpline curve with a specified number of control points.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg0: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None

  2. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg0: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], arg1: PyOpenColorIO.PyOpenColorIO.HueCurveType) -> None

getControlPoints() PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
getSlopes() list[float]
getSplineType() PyOpenColorIO.PyOpenColorIO.BSplineType
setNumControlPoints(size: SupportsInt | SupportsIndex) None
setSlopes(arg0: collections.abc.Sequence[SupportsFloat | SupportsIndex]) None
setSplineType(splinetype: PyOpenColorIO.PyOpenColorIO.BSplineType) None
slopesAreDefault() bool
validate() None
class PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
self[arg0: SupportsInt | SupportsIndex] PyOpenColorIO.PyOpenColorIO.GradingControlPoint
iter(self) PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
len(self) int
next(self) PyOpenColorIO.PyOpenColorIO.GradingControlPoint
self[arg0: SupportsInt | SupportsIndex] = arg1: PyOpenColorIO.PyOpenColorIO.GradingControlPoint None

GradingToneTransform

class PyOpenColorIO.GradingToneTransform

Tonal color correction controls.

This transform is for making fine adjustments to tone reproduction in specific tonal ranges.

There are five tonal controls and each one has two parameters to control its range: - Blacks (start, width) - Shadows(start, pivot) - Midtones(center, width) - Highlights(start, pivot) - Whites(start, width)

The transform has three styles that adjust the response and default ranges for linear, logarithimic, and video color encodings. The defaults vary based on the style. When the style is linear, the units for start/width/etc. are photographic stops relative to 0.18.

Each control allows R, G, B adjustments and a Master adjustment.

There is also an S-contrast control for imparting an S-shape curve.

The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.

GradingToneTransform(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingToneTransform, values: PyOpenColorIO.PyOpenColorIO.GradingTone, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingToneTransform.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingToneTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingToneTransform.

getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection
getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata
getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle

Adjusts the behavior of the transform for log, linear, or video color space encodings.

getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType
getValue() PyOpenColorIO.PyOpenColorIO.GradingTone
isDynamic() bool

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingToneTransform only one can have dynamic parameters.

makeDynamic() None
makeNonDynamic() None
setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None

Note that this only affects the evaluation and not the values stored in the object.

setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None

Will reset value to style’s defaults if style is not the current style.

setValue(values: PyOpenColorIO.PyOpenColorIO.GradingTone) None
validate() None

Will throw if data is not valid.

GradingTone

class PyOpenColorIO.GradingTone

Grading tone values.

GradingTone(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None
property blacks
property highlights
property midtones
property scontrast
property shadows
validate() None

The valid range for each parameter varies. The client is expected to enforce these bounds in the UI.

property whites

GradingRGBMSW

class PyOpenColorIO.GradingRGBMSW

Used by the grading tone transforms to hold the red, green, blue, master, start, and width components of a single parameter. The master component affects all three channels (RGB). The start and width components control the range of tones affected. Although this struct simply uses “start” and “width” for all the range values, the actual user-facing name changes based on the parameter.

GradingRGBMSW(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW) -> None

  2. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW, red: typing.SupportsFloat | typing.SupportsIndex, green: typing.SupportsFloat | typing.SupportsIndex, blue: typing.SupportsFloat | typing.SupportsIndex, master: typing.SupportsFloat | typing.SupportsIndex, start: typing.SupportsFloat | typing.SupportsIndex, width: typing.SupportsFloat | typing.SupportsIndex) -> None

  3. __init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW, start: typing.SupportsFloat | typing.SupportsIndex, width: typing.SupportsFloat | typing.SupportsIndex) -> None

property blue
property green
property master
property red
property start
property width