colour.models.rgb.transfer_functions.red_log Module

RED Log Encodings

Defines the RED log encodings:

References

[1]Sony Imageworks. (2012). make.py. Retrieved November 27, 2014, from https://github.com/imageworks/OpenColorIO-Configs/blob/master/nuke-default/make.py
[2]Nattress, G. (2016). Private Discussion with Shaw, N.
colour.models.rgb.transfer_functions.red_log.log_encoding_REDLog(x, black_offset=0.009955040995908344)[source]

Defines the REDLog log encoding curve / opto-electronic transfer function.

Parameters:
  • x (numeric or array_like) – Linear data \(x\).
  • black_offset (numeric or array_like) – Black offset.
Returns:

Non-linear data \(y\).

Return type:

numeric or ndarray

Examples

>>> log_encoding_REDLog(0.18)  
0.6376218...
colour.models.rgb.transfer_functions.red_log.log_decoding_REDLog(y, black_offset=0.009955040995908344)[source]

Defines the REDLog log decoding curve / electro-optical transfer function.

Parameters:
  • y (numeric or array_like) – Non-linear data \(y\).
  • black_offset (numeric or array_like) – Black offset.
Returns:

Linear data \(x\).

Return type:

numeric or ndarray

Examples

>>> log_decoding_REDLog(0.637621845988175)  
0.1...
colour.models.rgb.transfer_functions.red_log.log_encoding_REDLogFilm(x, black_offset=0.0107977516232771)[source]

Defines the REDLogFilm log encoding curve / opto-electronic transfer function.

Parameters:
  • x (numeric or array_like) – Linear data \(x\).
  • black_offset (numeric or array_like) – Black offset.
Returns:

Non-linear data \(y\).

Return type:

numeric or ndarray

Examples

>>> log_encoding_REDLogFilm(0.18)  
0.4573196...
colour.models.rgb.transfer_functions.red_log.log_decoding_REDLogFilm(y, black_offset=0.0107977516232771)[source]

Defines the REDLogFilm log decoding curve / electro-optical transfer function.

Parameters:
  • y (numeric or array_like) – Non-linear data \(y\).
  • black_offset (numeric or array_like) – Black offset.
Returns:

Linear data \(x\).

Return type:

numeric or ndarray

Examples

>>> log_decoding_REDLogFilm(0.457319613085418)  
0.1799999...
colour.models.rgb.transfer_functions.red_log.log_encoding_Log3G10(x, legacy_curve=False)[source]

Defines the Log3G10 log encoding curve / opto-electronic transfer function.

Parameters:
  • x (numeric or array_like) – Linear data \(x\).
  • legacy_curve (bool, optional) – Whether to use the v1 Log3G10 log encoding curve. Default is False.
Returns:

Non-linear data \(y\).

Return type:

numeric or ndarray

Notes

  • The v1 Log3G10 log encoding curve is the one used in REDCINE-X beta 42. Resolve 12.5.2 also uses the v1 curve. RED is planning to use v2 Log3G10 log encoding curve in the release version of the RED SDK. Use the legacy_curve=True argument to switch to the v1 curve for compatibility with the current (as of September 21, 2016) RED SDK.

  • The intent of the v1 Log3G10 log encoding curve is that zero maps to zero, 0.18 maps to 1/3, and 10 stops above 0.18 maps to 1.0. The name indicates this in a similar way to the naming conventions of Sony HyperGamma curves.

    The constants used in the functions do not in fact quite hit these values, but rather than use corrected constants, the functions here use the official RED values, in order to match the output of the RED SDK.

    For those interested, solving for constants which exactly hit 1/3 and 1.0 yields the following values:

    B = 25 * (np.sqrt(4093.0) - 3) / 9
    A = 1 / np.log10(B * 184.32 + 1)
    

    where the function takes the form:

    Log3G10(x) = A * np.log10(B * x + 1)
    

    Similarly for Log3G12, the values which hit exactly 1/3 and 1.0 are:

    B = 25 * (np.sqrt(16381.0) - 3) / 9
    A = 1 / np.log10(B * 737.28 + 1)
    

Examples

>>> log_encoding_Log3G10(0.18, legacy_curve=True)  
0.3333336...
>>> log_encoding_Log3G10(0.0)  
0.0915514...
colour.models.rgb.transfer_functions.red_log.log_decoding_Log3G10(y, legacy_curve=False)[source]

Defines the Log3G10 log decoding curve / electro-optical transfer function.

Parameters:
  • y (numeric or array_like) – Non-linear data \(y\).
  • legacy_curve (bool, optional) – Whether to use the v1 Log3G10 log encoding curve. Default is False.
Returns:

Linear data \(x\).

Return type:

numeric or ndarray

Examples

>>> log_decoding_Log3G10(1.0 / 3, legacy_curve=True)  
0.1799994...
>>> log_decoding_Log3G10(1.0)  
184.3223476...
colour.models.rgb.transfer_functions.red_log.log_encoding_Log3G12(x)[source]

Defines the Log3G12 log encoding curve / opto-electronic transfer function.

Parameters:x (numeric or array_like) – Linear data \(x\).
Returns:Non-linear data \(y\).
Return type:numeric or ndarray

Examples

>>> log_encoding_Log3G12(0.18)  
0.3333326...
colour.models.rgb.transfer_functions.red_log.log_decoding_Log3G12(y)[source]

Defines the Log3G12 log decoding curve / electro-optical transfer function.

Parameters:y (numeric or array_like) – Non-linear data \(y\).
Returns:Linear data \(x\).
Return type:numeric or ndarray

Examples

>>> log_decoding_Log3G12(1.0 / 3)  
0.1800015...