colour.models.log_encoding_SLog

colour.models.log_encoding_SLog(x, bit_depth=10, out_normalised_code_value=True, in_reflection=True, **kwargs)[source]

Defines the Sony S-Log log encoding curve / opto-electronic transfer function.

Parameters:
  • x (numeric or array_like) – Reflection or \(IRE / 100\) input light level \(x\) to a camera.
  • bit_depth (int, optional) – Bit depth used for conversion.
  • out_normalised_code_value (bool, optional) – Whether the non-linear Sony S-Log data \(y\) is encoded as normalised code values.
  • in_reflection (bool, optional) – Whether the light level \(x\) to a camera is reflection.
Other Parameters:
 

**kwargs (dict, optional) – Keywords arguments for deprecation management.

Returns:

Non-linear Sony S-Log data \(y\).

Return type:

numeric or ndarray

Notes

Domain Scale - Reference Scale - 1
x [0, 1] [0, 1]
Range Scale - Reference Scale - 1
y [0, 1] [0, 1]

References

[SonyCorporation2012a]

Examples

>>> log_encoding_SLog(0.18)  # doctest: +ELLIPSIS
0.3849708...

The values of IRE and CV of S-Log2 @ISO800 table in [SonyCorporation2012a] are obtained as follows:

>>> x = np.array([0, 18, 90]) / 100
>>> np.around(log_encoding_SLog(x, 10, False) * 100).astype(np.int)
array([ 3, 38, 65])
>>> np.around(log_encoding_SLog(x) * (2 ** 10 - 1)).astype(np.int)
array([ 90, 394, 636])