colour.models.log_encoding_Log2#

colour.models.log_encoding_Log2(lin: ArrayLike, middle_grey: float = 0.18, min_exposure: float = -6.5, max_exposure: float = 6.5) NDArrayFloat[source]#

Define the common Log2 encoding function.

Parameters:
  • lin (ArrayLike) – Linear data to undergo encoding.

  • middle_grey (float) – Middle Grey exposure value.

  • min_exposure (float) – Minimum exposure level.

  • max_exposure (float) – Maximum exposure level.

Returns:

Non-linear Log2 encoded data.

Return type:

numpy.ndarray

Notes

  • The common Log2 encoding function can be used to build linear to logarithmic shapers in the ACES OCIO configuration.

  • A (48-nits OCIO) shaper having values in a linear domain, can be encoded to a logarithmic domain:

    Shaper Domain

    Shaper Range

    [0.002, 16.291]

    [0, 1]

References

[TheAoMPAaSciencesScienceaTCouncilAcademyCESACESPSubcommitteeb]

Examples

>>> log_encoding_Log2(0.18)
0.5