Sepia#

Functions#

kornia.color.sepia(input, rescale=True, eps=1e-6)[source]#

Apply the sepia filter to an RGB tensor.

Parameters:
  • input (Tensor) – the input tensor with shape \((*, C, H, W)\).

  • rescale (bool, optional) – if True, rescale the output so the max channel value is 1. Default: True

  • eps (float, optional) – small constant added to the denominator for numerical stability. Default: 1e-6

Returns:

sepia-filtered tensor with shape \((*, C, H, W)\).

Return type:

torch.Tensor

Example

>>> input = torch.ones(3, 1, 1)
>>> sepia_from_rgb(input, rescale=False)
tensor([[[1.3510]],

        [[1.2030]],

        [[0.9370]]])

Modules#

class kornia.color.Sepia(rescale=True, eps=1e-6)[source]#

Apply the sepia filter to image tensors.

Parameters:
  • rescale (bool, optional) – if True, rescale the output so the max channel value is 1. Default: True

  • eps (float, optional) – small constant added to the denominator for numerical stability. Default: 1e-6

Returns:

sepia-filtered tensor with shape \((*, C, H, W)\).

Return type:

torch.Tensor

Example

>>> input = torch.ones(3, 1, 1)
>>> Sepia(rescale=False)(input)
tensor([[[1.3510]],

        [[1.2030]],

        [[0.9370]]])