module documentation
Undocumented
Function | lab |
Convert a Lab image to RGB. |
Function | lab |
Undocumented |
Function | linear |
Convert a RGB image to Lab. |
Function | linear |
Undocumented |
Function | linear |
Convert a RGB image to XYZ. |
Function | rgb |
Undocumented |
Function | rgb |
Undocumented |
Function | xyz |
Convert a XYZ image to RGB. |
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.Tensor | Lab image to be converted to RGB with shape (*, 3, H, W). |
clip:bool | Whether to apply clipping to insure output RGB values in range [0, 1]. |
Returns | |
torch.Tensor | Lab version of the image with shape (*, 3, H, W). The output RGB image are in the range of [0, 1]. |
Convert a RGB image to Lab.
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.Tensor | RGB Image to be converted to Lab with shape (*, 3, H, W). |
Returns | |
torch.Tensor | Lab 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. |
Convert a RGB image to XYZ.
Example
>>> input = torch.rand(2, 3, 4, 5) >>> output = rgb_to_xyz(input) # 2x3x4x5
Parameters | |
image:torch.Tensor | RGB Image to be converted to XYZ with shape (*, 3, H, W). |
Returns | |
torch.Tensor | XYZ version of the image with shape (*, 3, H, W). |