kornia.color#

Color space conversions on tensors with channels at axis -3, plus color maps and sepia. Each operation documents its channel order and range.

Conventions#

Color tensors are channel-first, \((*, C, H, W)\). Float RGB inputs are unit-range nonlinear sRGB, except that rgb_to_xyz() takes linear RGB and the *rgb255* helpers use \([0, 255]\). rgb_to_linear_rgb() and linear_rgb_to_rgb() apply the sRGB transfer curve. HLS and HSV hue is measured in radians. The conversion pages define the remaining channel orders and ranges.

Note

Check a tutorial for color space conversions here.

Color conversion

Conversions between grayscale, RGB, BGR, RGBA, linear RGB, HLS, HSV, Lab, Luv, XYZ, YCbCr, YUV and Bayer RAW.

Colormap

Render single-channel images (depth, heat, edges) with a color map.

Sepia

The sepia tone effect.