module documentation

Undocumented

Function lab_to_linear_rgb Convert a Lab image to RGB.
Function lab_to_rgb Undocumented
Function linear_rgb_to_lab Convert a RGB image to Lab.
Function linear_rgb_to_rgb Undocumented
Function linear_rgb_to_xyz Convert a RGB image to XYZ.
Function rgb_to_lab Undocumented
Function rgb_to_linear_rgb Undocumented
Function xyz_to_linear_rgb Convert a XYZ image to RGB.
def lab_to_linear_rgb(image: torch.Tensor, clip: bool = True) -> torch.Tensor: (source)

Convert a Lab image to RGB.

The L channel is assumed to be in the range of [0, 100]. a and b channels are in the range of [ − 128, 127].

Example

>>> input = torch.rand(2, 3, 4, 5)
>>> output = lab_to_rgb(input)  # 2x3x4x5
Parameters
image:torch.TensorLab image to be converted to RGB with shape (*, 3, H, W).
clip:boolWhether to apply clipping to insure output RGB values in range [0, 1].
Returns
torch.TensorLab version of the image with shape (*, 3, H, W). The output RGB image are in the range of [0, 1].
def lab_to_rgb(image: torch.Tensor, clip: bool = True) -> torch.Tensor: (source)

Undocumented

def linear_rgb_to_lab(image: torch.Tensor) -> torch.Tensor: (source)

Convert a RGB image to Lab.

_static/img/rgb_to_lab.png

The input RGB image is assumed to be in the range of [0, 1]. Lab color is computed using the D65 illuminant and Observer 2.

Example

>>> input = torch.rand(2, 3, 4, 5)
>>> output = rgb_to_lab(input)  # 2x3x4x5
Parameters
image:torch.TensorRGB Image to be converted to Lab with shape (*, 3, H, W).
Returns
torch.TensorLab version of the image with shape (*, 3, H, W). The L channel values are in the range 0..100. a and b are in the range -128..127.
def linear_rgb_to_rgb(image: torch.Tensor) -> torch.Tensor: (source)

Undocumented

def linear_rgb_to_xyz(image: torch.Tensor) -> torch.Tensor: (source)

Convert a RGB image to XYZ.

_static/img/rgb_to_xyz.png

Example

>>> input = torch.rand(2, 3, 4, 5)
>>> output = rgb_to_xyz(input)  # 2x3x4x5
Parameters
image:torch.TensorRGB Image to be converted to XYZ with shape (*, 3, H, W).
Returns
torch.TensorXYZ version of the image with shape (*, 3, H, W).
def rgb_to_lab(image: torch.Tensor) -> torch.Tensor: (source)

Undocumented

def rgb_to_linear_rgb(image: torch.Tensor) -> torch.Tensor: (source)

Undocumented

def xyz_to_linear_rgb(image: torch.Tensor) -> torch.Tensor: (source)

Convert a XYZ image to RGB.

Example

>>> input = torch.rand(2, 3, 4, 5)
>>> output = xyz_to_rgb(input)  # 2x3x4x5
Parameters
image:torch.TensorXYZ Image to be converted to RGB with shape (*, 3, H, W).
Returns
torch.TensorRGB version of the image with shape (*, 3, H, W).