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.GradingPrimaryTransform, values: PyOpenColorIO.GradingPrimary, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

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

Creates an instance of GradingPrimaryTransform.

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

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

getTransformType() PyOpenColorIO.TransformType
getValue() 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.TransformDirection) None

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

setStyle(style: PyOpenColorIO.GradingStyle) None

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

setValue(values: 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.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.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.GradingRGBM) -> None

  2. __init__(self: PyOpenColorIO.GradingRGBM, red: float, green: float, blue: float, master: float) -> 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 along with 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.GradingRGBCurveTransform, values: PyOpenColorIO.GradingRGBCurve, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingPrimaryTransform.

  1. __init__(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: 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.TransformDirection
getFormatMetadata() PyOpenColorIO.FormatMetadata
getSlope(channel: PyOpenColorIO.RGBCurveType, index: int) 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.GradingStyle

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

getTransformType() PyOpenColorIO.TransformType
getValue() 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.TransformDirection) None

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

setSlope(channel: PyOpenColorIO.RGBCurveType, index: int, slope: float) None
setStyle(style: PyOpenColorIO.GradingStyle) None

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

setValue(values: PyOpenColorIO.GradingRGBCurve) None

Throws if value is not valid.

slopesAreDefault(channel: 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.GradingRGBCurve, style: PyOpenColorIO.GradingStyle) -> None

Do not use (needed only for pybind11).

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

property blue
property green
property master
property red

GradingControlPoint

class PyOpenColorIO.GradingControlPoint

2D control point used by GradingBSplineCurve.

GradingControlPoint(*args, **kwargs)

Overloaded function.

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

  2. __init__(self: PyOpenColorIO.GradingControlPoint, x: float = 0.0, y: float = 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.GradingBSplineCurve, size: int) -> None

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

  1. __init__(self: PyOpenColorIO.GradingBSplineCurve, arg0: List[float]) -> None

Create a BSpline curve with a list of control points.

getControlPoints() PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
setNumControlPoints(size: int) None
validate() None
class PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
self[arg0: int] PyOpenColorIO.GradingControlPoint
iter(self) PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator
len(self) int
next(self) PyOpenColorIO.GradingControlPoint
self[arg0: int] = arg1: 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.GradingToneTransform, values: PyOpenColorIO.GradingTone, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of GradingToneTransform.

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

Creates an instance of GradingToneTransform.

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

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

getTransformType() PyOpenColorIO.TransformType
getValue() 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.TransformDirection) None

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

setStyle(style: PyOpenColorIO.GradingStyle) None

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

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

Will throw if data is not valid.

GradingTone

class PyOpenColorIO.GradingTone

Grading tone values.

GradingTone(arg0: 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.GradingRGBMSW) -> None

  2. __init__(self: PyOpenColorIO.GradingRGBMSW, red: float, green: float, blue: float, master: float, start: float, width: float) -> None

  3. __init__(self: PyOpenColorIO.GradingRGBMSW, start: float, width: float) -> None

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