Color conversion#
Conversions between color spaces, on float image tensors of shape \((*, C, H, W)\) with values in
\([0, 1]\). Every conversion exists as a function and as an nn.Module; each page below documents
one color scheme.
All functions#
Convert a RGB image to grayscale version of image. |
|
Convert a BGR image to grayscale. |
|
Convert a grayscale image to RGB version of image. |
|
Convert a RGB image to BGR. |
|
Convert a BGR image to RGB. |
|
Convert an image from RGB to RGB [0, 255] for visualization purposes. |
|
Convert an image from RGB [0, 255] to RGB for visualization purposes. |
|
Convert an image from RGB [0, 255] to surface normals for visualization purposes. |
|
Convert surface normals to RGB [0, 255] for visualization purposes. |
|
Convert an image from RGB to RGBA. |
|
Convert an image from BGR to RGBA. |
|
Convert an image from RGBA to RGB using alpha compositing. |
|
Convert an image from RGBA to BGR. |
|
Convert an sRGB image to linear RGB. |
|
Convert a linear RGB image to sRGB. |
|
Convert an RGB image to HLS. |
|
Convert a HLS image to RGB. |
|
Convert an image from RGB to HSV. |
|
Convert an image from HSV to RGB. |
|
Convert a RGB image to Lab. |
|
Convert a Lab image to RGB. |
|
Convert a RGB image to Luv. |
|
Convert a Luv image to RGB. |
|
Convert a RGB image to XYZ. |
|
Convert a XYZ image to RGB. |
|
Convert an RGB image to YCbCr. |
|
Convert an YCbCr image to RGB. |
|
Convert an RGB image to YUV. |
|
Convert an YUV image to RGB. |
|
Convert an RGB image to YUV 420 (subsampled). |
|
Convert an YUV420 image to RGB. |
|
Convert an RGB image to YUV 422 (subsampled). |
|
Convert an YUV422 image to RGB. |
|
Convert a RGB image to RAW version of image with the specified color filter array. |
|
Convert a raw bayer image to RGB version of image. |
|
Convert the raw bayer image to RGB version of it and resize width and height by half. |