Colour Models

Tristimulus Values, CIE xyY Colourspace and Chromaticity Coordinates

colour

XYZ_to_xyY(XYZ[, illuminant])

Converts from CIE XYZ tristimulus values to CIE xyY colourspace and reference illuminant.

xyY_to_XYZ(xyY)

Converts from CIE xyY colourspace to CIE XYZ tristimulus values.

XYZ_to_xy(XYZ[, illuminant])

Returns the CIE xy chromaticity coordinates from given CIE XYZ tristimulus values.

xy_to_XYZ(xy)

Returns the CIE XYZ tristimulus values from given CIE xy chromaticity coordinates.

xyY_to_xy(xyY)

Converts from CIE xyY colourspace to CIE xy chromaticity coordinates.

xy_to_xyY(xy[, Y])

Converts from CIE xy chromaticity coordinates to CIE xyY colourspace by extending the array last dimension with given \(Y\) luminance.

Common Models

colour.models

Jab_to_JCh(Jab)

Converts from Jab* colour representation to JCh colour representation.

JCh_to_Jab(JCh)

Converts from JCh colour representation to Jab* colour representation.

CIE L*a*b* Colourspace

colour

XYZ_to_Lab(XYZ[, illuminant])

Converts from CIE XYZ tristimulus values to CIE L*a*b* colourspace.

Lab_to_XYZ(Lab[, illuminant])

Converts from CIE L*a*b* colourspace to CIE XYZ tristimulus values.

Lab_to_LCHab(Lab)

Converts from CIE L*a*b* colourspace to CIE L*C*Hab colourspace.

LCHab_to_Lab(LCHab)

Converts from CIE L*C*Hab colourspace to CIE L*a*b* colourspace.

CIE L*u*v* Colourspace

colour

XYZ_to_Luv(XYZ[, illuminant])

Converts from CIE XYZ tristimulus values to CIE L*u*v* colourspace.

Luv_to_XYZ(Luv[, illuminant])

Converts from CIE L*u*v* colourspace to CIE XYZ tristimulus values.

Luv_to_LCHuv(Luv)

Converts from CIE L*u*v* colourspace to CIE L*C*Huv colourspace.

LCHuv_to_Luv(LCHuv)

Converts from CIE L*C*Huv colourspace to CIE L*u*v* colourspace.

Luv_to_uv(Luv[, illuminant])

Returns the \(uv^p\) chromaticity coordinates from given CIE L*u*v* colourspace array.

uv_to_Luv(uv[, illuminant, Y])

Returns the CIE L*u*v* colourspace array from given \(uv^p\) chromaticity coordinates by extending the array last dimension with given \(L\) Lightness.

Luv_uv_to_xy(uv)

Returns the CIE xy chromaticity coordinates from given CIE L*u*v* colourspace \(uv^p\) chromaticity coordinates.

xy_to_Luv_uv(xy)

Returns the CIE L*u*v* colourspace \(uv^p\) chromaticity coordinates from given CIE xy chromaticity coordinates.

CIE 1960 UCS Colourspace

colour

XYZ_to_UCS(XYZ)

Converts from CIE XYZ tristimulus values to CIE 1960 UCS colourspace.

UCS_to_XYZ(UVW)

Converts from CIE 1960 UCS colourspace to CIE XYZ tristimulus values.

UCS_to_uv(UVW)

Returns the uv chromaticity coordinates from given CIE 1960 UCS colourspace array.

uv_to_UCS(uv[, V])

Returns the CIE 1960 UCS colourspace array from given uv chromaticity coordinates.

UCS_uv_to_xy(uv)

Returns the CIE xy chromaticity coordinates from given CIE 1960 UCS colourspace uv chromaticity coordinates.

xy_to_UCS_uv(xy)

Returns the CIE 1960 UCS colourspace uv chromaticity coordinates from given CIE xy chromaticity coordinates.

CIE 1964 U*V*W* Colourspace

colour

XYZ_to_UVW(XYZ[, illuminant])

Converts from CIE XYZ tristimulus values to CIE 1964 U*V*W* colourspace.

UVW_to_XYZ(UVW[, illuminant])

Converts CIE 1964 U*V*W* colourspace to CIE XYZ tristimulus values.

Hunter L,a,b Colour Scale

colour

XYZ_to_Hunter_Lab(XYZ[, XYZ_n, K_ab])

Converts from CIE XYZ tristimulus values to Hunter L,a,b colour scale.

Hunter_Lab_to_XYZ(Lab[, XYZ_n, K_ab])

Converts from Hunter L,a,b colour scale to CIE XYZ tristimulus values.

XYZ_to_K_ab_HunterLab1966(XYZ)

Converts from whitepoint CIE XYZ tristimulus values to Hunter L,a,b \(K_{a}\) and \(K_{b}\) chromaticity coefficients.

Hunter Rd,a,b Colour Scale

colour

XYZ_to_Hunter_Rdab(XYZ[, XYZ_n, K_ab])

Converts from CIE XYZ tristimulus values to Hunter Rd,a,b colour scale.

Hunter_Rdab_to_XYZ(R_d_ab[, XYZ_n, K_ab])

Converts from Hunter Rd,a,b colour scale to CIE XYZ tristimulus values.

DIN99 Colourspace

colour

Lab_to_DIN99(Lab[, k_E, k_CH])

Converts from CIE L*a*b* colourspace to DIN99 colourspace.

DIN99_to_Lab(Lab_99[, k_E, k_CH])

Converts from DIN99 colourspace to CIE L*a*b* colourspace.

CAM02-LCD, CAM02-SCD, and CAM02-UCS Colourspaces - Luo, Cui and Li (2006)

colour

JMh_CIECAM02_to_CAM02LCD(JMh)

Converts from CIECAM02 \(JMh\) correlates array to *Luo et al.

CAM02LCD_to_JMh_CIECAM02(Jpapbp)

Converts from *Luo et al.

JMh_CIECAM02_to_CAM02SCD(JMh)

Converts from CIECAM02 \(JMh\) correlates array to *Luo et al.

CAM02SCD_to_JMh_CIECAM02(Jpapbp)

Converts from *Luo et al.

JMh_CIECAM02_to_CAM02UCS(JMh)

Converts from CIECAM02 \(JMh\) correlates array to *Luo et al.

CAM02UCS_to_JMh_CIECAM02(Jpapbp)

Converts from *Luo et al.

CAM16-LCD, CAM16-SCD, and CAM16-UCS Colourspaces - Li et al. (2017)

colour

JMh_CAM16_to_CAM16LCD(JMh, *[, coefficients])

Converts from CAM16 \(JMh\) correlates array to *Li et al.

CAM16LCD_to_JMh_CAM16(Jpapbp, *[, coefficients])

Converts from *Li et al.

JMh_CAM16_to_CAM16SCD(JMh, *[, coefficients])

Converts from CAM16 \(JMh\) correlates array to *Li et al.

CAM16SCD_to_JMh_CAM16(Jpapbp, *[, coefficients])

Converts from *Li et al.

JMh_CAM16_to_CAM16UCS(JMh, *[, coefficients])

Converts from CAM16 \(JMh\) correlates array to *Li et al.

CAM16UCS_to_JMh_CAM16(Jpapbp, *[, coefficients])

Converts from *Li et al.

IPT Colourspace

colour

XYZ_to_IPT(XYZ)

Converts from CIE XYZ tristimulus values to IPT colourspace.

IPT_to_XYZ(IPT)

Converts from IPT colourspace to CIE XYZ tristimulus values.

IPT_hue_angle(IPT)

Computes the hue angle in degrees from IPT colourspace.

hdr-CIELAB Colourspace

colour

XYZ_to_hdr_CIELab(XYZ[, illuminant, Y_s, …])

Converts from CIE XYZ tristimulus values to hdr-CIELAB colourspace.

hdr_CIELab_to_XYZ(Lab_hdr[, illuminant, …])

Converts from hdr-CIELAB colourspace to CIE XYZ tristimulus values.

HDR_CIELAB_METHODS

Supported hdr-CIELAB colourspace computation methods.

hdr-IPT Colourspace

colour

XYZ_to_hdr_IPT(XYZ[, Y_s, Y_abs, method])

Converts from CIE XYZ tristimulus values to hdr-IPT colourspace.

hdr_IPT_to_XYZ(IPT_hdr[, Y_s, Y_abs, method])

Converts from hdr-IPT colourspace to CIE XYZ tristimulus values.

HDR_IPT_METHODS

Supported hdr-IPT colourspace computation methods.

OSA UCS Colourspace

colour

XYZ_to_OSA_UCS(XYZ)

Converts from CIE XYZ tristimulus values under the CIE 1964 10 Degree Standard Observer to OSA UCS colourspace.

OSA_UCS_to_XYZ(Ljg[, optimisation_kwargs])

Converts from OSA UCS colourspace to CIE XYZ tristimulus values under the CIE 1964 10 Degree Standard Observer.

\(JzAzBz\) Colourspace

colour

XYZ_to_JzAzBz(XYZ_D65[, constants])

Converts from CIE XYZ tristimulus values to \(J_zA_zB_z\) colourspace.

JzAzBz_to_XYZ(JzAzBz[, constants])

Converts from \(J_zA_zB_z\) colourspace to CIE XYZ tristimulus values.

RGB Colourspace and Transformations

colour

XYZ_to_RGB(XYZ, illuminant_XYZ, …[, …])

Converts from CIE XYZ tristimulus values to RGB colourspace array.

RGB_to_XYZ(RGB, illuminant_RGB, …[, …])

Converts given RGB colourspace array to CIE XYZ tristimulus values.

RGB_to_RGB(RGB, input_colourspace, …[, …])

Converts given RGB colourspace array from given input RGB colourspace to output RGB colourspace using given chromatic adaptation method.

RGB_to_RGB_matrix(input_colourspace, …[, …])

Computes the matrix \(M\) converting from given input RGB colourspace to output RGB colourspace using given chromatic adaptation method.

Ancillary Objects

colour

XYZ_to_sRGB(XYZ[, illuminant, …])

Converts from CIE XYZ tristimulus values to sRGB colourspace.

sRGB_to_XYZ(RGB[, illuminant, …])

Converts from sRGB colourspace to CIE XYZ tristimulus values.

RGB Colourspace Derivation

colour

normalised_primary_matrix(primaries, whitepoint)

Computes the Normalised Primary Matrix (NPM) converting a RGB colourspace array to CIE XYZ tristimus values using given primaries and whitepoint \(xy\) chromaticity coordinates.

chromatically_adapted_primaries(primaries, …)

Chromatically adapts given primaries \(xy\) chromaticity coordinates from test whitepoint_t to reference whitepoint_r.

primaries_whitepoint(npm)

Computes the primaries and whitepoint \(xy\) chromaticity coordinates using given Normalised Primary Matrix (NPM).

RGB_luminance(RGB, primaries, whitepoint)

Returns the luminance \(Y\) of given RGB components from given primaries and whitepoint.

RGB_luminance_equation(primaries, whitepoint)

Returns the luminance equation from given primaries and whitepoint.

RGB Colourspaces

colour

RGB_Colourspace(name, primaries, whitepoint)

Implements support for the RGB colourspaces datasets from colour.models.datasets.aces_rgb, etc….

RGB_COLOURSPACES

Aggregated RGB colourspaces.

colour.models

RGB_COLOURSPACE_ACES2065_1

ACES2065-1 colourspace, base encoding, used for exchange of full fidelity images and archiving.

RGB_COLOURSPACE_ACESCC

ACEScc colourspace, a working space for color correctors, target for ASC-CDL values created on-set.

RGB_COLOURSPACE_ACESCCT

ACEScct colourspace, an alternative working space for colour correctors, intended to be transient and internal to software or hardware systems, and is specifically not intended for interchange or archiving.

RGB_COLOURSPACE_ACESPROXY

ACESproxy colourspace, a lightweight encoding for transmission over HD-SDI (or other production transmission schemes), onset look management.

RGB_COLOURSPACE_ACESCG

ACEScg colourspace, a working space for paint/compositor applications that don’t support ACES2065-1 or ACEScc.

RGB_COLOURSPACE_ADOBE_RGB1998

Adobe RGB (1998) colourspace.

RGB_COLOURSPACE_ADOBE_WIDE_GAMUT_RGB

Adobe Wide Gamut RGB colourspace.

RGB_COLOURSPACE_ALEXA_WIDE_GAMUT

ARRI ALEXA Wide Gamut colourspace.

RGB_COLOURSPACE_APPLE_RGB

Apple RGB colourspace.

RGB_COLOURSPACE_BEST_RGB

Best RGB colourspace.

RGB_COLOURSPACE_BETA_RGB

Beta RGB colourspace.

RGB_COLOURSPACE_BT470_525

ITU-R BT.470 - 525 colourspace.

RGB_COLOURSPACE_BT470_625

ITU-R BT.470 - 625 colourspace.

RGB_COLOURSPACE_BT709

ITU-R BT.709 colourspace.

RGB_COLOURSPACE_BT2020

ITU-R BT.2020 colourspace.

RGB_COLOURSPACE_CIE_RGB

CIE RGB colourspace.

RGB_COLOURSPACE_CINEMA_GAMUT

Canon Cinema Gamut colourspace.

RGB_COLOURSPACE_COLOR_MATCH_RGB

ColorMatch RGB colourspace.

RGB_COLOURSPACE_DCDM_XYZ

DCDM XYZ colourspace.

RGB_COLOURSPACE_DCI_P3

DCI-P3 colourspace.

RGB_COLOURSPACE_DCI_P3_P

DCI-P3+ colourspace.

RGB_COLOURSPACE_DISPLAY_P3

Display P3 colourspace.

RGB_COLOURSPACE_DON_RGB_4

Don RGB 4 colourspace.

RGB_COLOURSPACE_ECI_RGB_V2

ECI RGB v2 colourspace.

RGB_COLOURSPACE_EKTA_SPACE_PS_5

Ekta Space PS 5 colourspace.

RGB_COLOURSPACE_F_GAMUT

Fujifilm F-Gamut colourspace.

RGB_COLOURSPACE_PROTUNE_NATIVE

Protune Native colourspace.

RGB_COLOURSPACE_MAX_RGB

Max RGB colourspace.

RGB_COLOURSPACE_NTSC1953

NTSC (1953) colourspace.

RGB_COLOURSPACE_NTSC1987

NTSC (1987) colourspace.

RGB_COLOURSPACE_P3_D65

P3-D65 colourspace.

RGB_COLOURSPACE_PAL_SECAM

Pal/Secam colourspace.

RGB_COLOURSPACE_RED_COLOR

REDcolor colourspace.

RGB_COLOURSPACE_RED_COLOR_2

REDcolor2 colourspace.

RGB_COLOURSPACE_RED_COLOR_3

REDcolor3 colourspace.

RGB_COLOURSPACE_RED_COLOR_4

REDcolor4 colourspace.

RGB_COLOURSPACE_RED_WIDE_GAMUT_RGB

REDWideGamutRGB colourspace.

RGB_COLOURSPACE_DRAGON_COLOR

DRAGONcolor colourspace.

RGB_COLOURSPACE_DRAGON_COLOR_2

DRAGONcolor2 colourspace.

RGB_COLOURSPACE_ROMM_RGB

ROMM RGB colourspace.

RGB_COLOURSPACE_RIMM_RGB

RIMM RGB colourspace.

RGB_COLOURSPACE_ERIMM_RGB

ERIMM RGB colourspace.

RGB_COLOURSPACE_PROPHOTO_RGB

ProPhoto RGB colourspace, an alias colourspace for ROMM RGB.

RGB_COLOURSPACE_RUSSELL_RGB

Russell RGB colourspace.

RGB_COLOURSPACE_SMPTE_240M

SMPTE 240M colourspace.

RGB_COLOURSPACE_SMPTE_C

Implements support for the RGB colourspaces datasets from colour.models.datasets.aces_rgb, etc….

RGB_COLOURSPACE_S_GAMUT

S-Gamut colourspace.

RGB_COLOURSPACE_S_GAMUT3

S-Gamut3 colourspace.

RGB_COLOURSPACE_S_GAMUT3_CINE

S-Gamut3.Cine colourspace.

RGB_COLOURSPACE_VENICE_S_GAMUT3

Venice S-Gamut3 colourspace.

RGB_COLOURSPACE_VENICE_S_GAMUT3_CINE

Venice S-Gamut3.Cine colourspace.

RGB_COLOURSPACE_sRGB

sRGB colourspace.

RGB_COLOURSPACE_V_GAMUT

Panasonic V-Gamut colourspace.

RGB_COLOURSPACE_XTREME_RGB

Xtreme RGB colourspace.

Colour Component Transfer Functions

colour

cctf_encoding(value[, function])

Encodes linear \(RGB\) values to non linear \(R'G'B'\) values using given encoding colour component transfer function (Encoding CCTF).

CCTF_ENCODINGS

Supported encoding colour component transfer functions (Encoding CCTFs), a collection of the functions defined by colour.LOG_ENCODINGS, colour.OETFS, colour.EOTF_INVERSES attributes, the colour.models.cctf_encoding_ProPhotoRGB(), colour.models.cctf_encoding_RIMMRGB(), colour.models.cctf_encoding_ROMMRGB() definitions and 3 gamma encoding functions (1 / 2.2, 1 / 2.4, 1 / 2.6).

cctf_decoding(value[, function])

Decodes non-linear \(R'G'B'\) values to linear \(RGB\) values using given decoding colour component transfer function (Decoding CCTF).

CCTF_DECODINGS

Supported decoding colour component transfer functions (Decoding CCTFs), a collection of the functions defined by colour.LOG_DECODINGS, colour.EOTFS, colour.OETF_INVERSES attributes, the colour.models.cctf_decoding_ProPhotoRGB(), colour.models.cctf_decoding_RIMMRGB(), colour.models.cctf_decoding_ROMMRGB() definitions and 3 gamma decoding functions (2.2, 2.4, 2.6).

gamma_function(a[, exponent, …])

Defines a typical gamma encoding / decoding function.

linear_function(a)

Defines a typical linear encoding / decoding function, essentially a pass-through function.

colour.models

cctf_encoding_ROMMRGB(X[, bit_depth, out_int])

Defines the ProPhoto RGB encoding colour component transfer function (Encoding CCTF).

cctf_decoding_ROMMRGB(X_p[, bit_depth, in_int])

Defines the ProPhoto RGB decoding colour component transfer function (Encoding CCTF).

cctf_encoding_RIMMRGB(X[, bit_depth, …])

Defines the RIMM RGB encoding colour component transfer function (Encoding CCTF).

cctf_decoding_RIMMRGB(X_p[, bit_depth, …])

Defines the RIMM RGB decoding colour component transfer function (Encoding CCTF).

Aliases

colour.models

cctf_encoding_ProPhotoRGB(X[, bit_depth, …])

Defines the ProPhoto RGB encoding colour component transfer function (Encoding CCTF).

cctf_decoding_ProPhotoRGB(X_p[, bit_depth, …])

Defines the ProPhoto RGB decoding colour component transfer function (Encoding CCTF).

Ancillary Objects

colour.models

exponent_function_basic(x[, exponent, style])

Defines the basic exponent transfer function.

exponent_function_monitor_curve(x[, …])

Defines the Monitor Curve exponent transfer function.

logarithmic_function_basic(x[, style, base])

Defines the basic logarithmic function.

logarithmic_function_quasilog(x[, style, …])

Defines the quasilog logarithmic function.

logarithmic_function_camera(x[, style, …])

Defines the camera logarithmic function.

Opto-Electronic Transfer Functions

colour

oetf(value[, function])

Encodes estimated tristimulus values in a scene to \(R'G'B'\) video component signal value using given opto-electronic transfer function (OETF / OECF).

OETFS

Supported opto-electrical transfer functions (OETFs / OECFs).

oetf_inverse(value[, function])

Decodes \(R'G'B'\) video component signal value to tristimulus values at the display using given inverse opto-electronic transfer function (OETF / OECF).

OETF_INVERSES

Supported inverse opto-electrical transfer functions (OETFs / OECFs).

colour.models

oetf_ARIBSTDB67(E[, r, constants])

Defines ARIB STD-B67 (Hybrid Log-Gamma) opto-electrical transfer function (OETF / OECF).

oetf_inverse_ARIBSTDB67(E_p[, r, constants])

Defines ARIB STD-B67 (Hybrid Log-Gamma) inverse opto-electrical transfer function (OETF / OECF).

oetf_HLG_BT2100(E[, constants])

Defines Recommendation ITU-R BT.2100 Reference HLG opto-electrical transfer function (OETF / OECF).

oetf_inverse_HLG_BT2100(E_p[, constants])

Defines Recommendation ITU-R BT.2100 Reference HLG inverse opto-electrical transfer function (OETF / OECF).

oetf_PQ_BT2100(E)

Defines Recommendation ITU-R BT.2100 Reference PQ opto-electrical transfer function (OETF / OECF).

oetf_inverse_PQ_BT2100(E_p)

Defines Recommendation ITU-R BT.2100 Reference PQ inverse opto-electrical transfer function (OETF / OECF).

oetf_BT601(L)

Defines Recommendation ITU-R BT.601-7 opto-electronic transfer function (OETF / OECF).

oetf_inverse_BT601(E)

Defines Recommendation ITU-R BT.601-7 inverse opto-electronic transfer function (OETF / OECF).

oetf_BT709(L)

Defines Recommendation ITU-R BT.709-6 opto-electronic transfer function (OETF / OECF).

oetf_inverse_BT709(V)

Defines Recommendation ITU-R BT.709-6 inverse opto-electronic transfer function (OETF / OECF).

oetf_SMPTE240M(L_c)

Defines SMPTE 240M opto-electrical transfer function (OETF / OECF).

Electro-Optical Transfer Functions

colour

eotf(value[, function])

Decodes \(R'G'B'\) video component signal value to tristimulus values at the display using given electro-optical transfer function (EOTF / EOCF).

EOTFS

Supported electro-optical transfer functions (EOTFs / EOCFs).

eotf_inverse(value[, function])

Encodes estimated tristimulus values in a scene to \(R'G'B'\) video component signal value using given inverse electro-optical transfer function (EOTF / EOCF).

EOTF_INVERSES

Supported inverse electro-optical transfer functions (EOTFs / EOCFs).

colour.models

eotf_DCDM(XYZ_p[, in_int])

Defines the DCDM electro-optical transfer function (EOTF / EOCF).

eotf_inverse_DCDM(XYZ[, out_int])

Defines the DCDM inverse electro-optical transfer function (EOTF / EOCF).

eotf_DICOMGSDF(J[, in_int])

Defines the DICOM - Grayscale Standard Display Function electro-optical transfer function (EOTF / EOCF).

eotf_inverse_DICOMGSDF(L[, out_int])

Defines the DICOM - Grayscale Standard Display Function inverse electro-optical transfer function (EOTF / EOCF).

eotf_BT1886(V[, L_B, L_W])

Defines Recommendation ITU-R BT.1886 electro-optical transfer function (EOTF / EOCF).

eotf_inverse_BT1886(L[, L_B, L_W])

Defines Recommendation ITU-R BT.1886 inverse electro-optical transfer function (EOTF / EOCF).

eotf_BT2020(E_p[, is_12_bits_system, constants])

Defines Recommendation ITU-R BT.2020 electro-optical transfer function (EOTF / EOCF).

eotf_inverse_BT2020(E[, is_12_bits_system, …])

Defines Recommendation ITU-R BT.2020 inverse electro-optical transfer function (EOTF / EOCF).

BT2100_HLG_EOTF_METHODS

Supported Recommendation ITU-R BT.2100 Reference HLG electro-optical transfer function (EOTF / EOCF).

eotf_HLG_BT2100(E_p[, L_B, L_W, gamma, …])

Defines Recommendation ITU-R BT.2100 Reference HLG electro-optical transfer function (EOTF / EOCF).

BT2100_HLG_EOTF_INVERSE_METHODS

Supported Recommendation ITU-R BT.2100 Reference HLG inverse electro-optical transfer function (EOTF / EOCF).

eotf_inverse_HLG_BT2100(F_D[, L_B, L_W, …])

Defines Recommendation ITU-R BT.2100 Reference HLG inverse electro-optical transfer function (EOTF / EOCF).

eotf_PQ_BT2100(E_p)

Defines Recommendation ITU-R BT.2100 Reference PQ electro-optical transfer function (EOTF / EOCF).

eotf_inverse_PQ_BT2100(F_D)

Defines Recommendation ITU-R BT.2100 Reference PQ inverse electro-optical transfer function (EOTF / EOCF).

eotf_SMPTE240M(V_r)

Defines SMPTE 240M electro-optical transfer function (EOTF / EOCF).

eotf_ST2084(N[, L_p, constants])

Defines SMPTE ST 2084:2014 optimised perceptual electro-optical transfer function (EOTF / EOCF).

eotf_inverse_ST2084(C[, L_p, constants])

Defines SMPTE ST 2084:2014 optimised perceptual inverse electro-optical transfer function (EOTF / EOCF).

eotf_sRGB(V)

Defines the IEC 61966-2-1:1999 sRGB electro-optical transfer function (EOTF / EOCF).

eotf_inverse_sRGB(L)

Defines the IEC 61966-2-1:1999 sRGB inverse electro-optical transfer function (EOTF / EOCF).

Opto-Optical Transfer Functions

colour

ootf(value[, function])

Maps relative scene linear light to display linear light using given opto-optical transfer function (OOTF / OOCF).

OOTFS

Supported opto-optical transfer functions (OOTFs / OOCFs).

ootf_inverse(value[, function])

Maps relative display linear light to scene linear light using given inverse opto-optical transfer function (OOTF / OOCF).

OOTF_INVERSES

Supported inverse opto-optical transfer functions (OOTFs / OOCFs).

colour.models

BT2100_HLG_OOTF_METHODS

Supported Recommendation ITU-R BT.2100 Reference HLG opto-optical transfer function (OOTF / OOCF).

ootf_HLG_BT2100(E[, L_B, L_W, gamma, method])

Defines Recommendation ITU-R BT.2100 Reference HLG opto-optical transfer function (OOTF / OOCF).

BT2100_HLG_OOTF_INVERSE_METHODS

Supported Recommendation ITU-R BT.2100 Reference HLG inverse opto-optical transfer function (OOTF / OOCF).

ootf_inverse_HLG_BT2100(F_D[, L_B, L_W, …])

Defines Recommendation ITU-R BT.2100 Reference HLG inverse opto-optical transfer function (OOTF / OOCF).

ootf_PQ_BT2100(E)

Defines Recommendation ITU-R BT.2100 Reference PQ opto-optical transfer function (OOTF / OOCF).

ootf_inverse_PQ_BT2100(F_D)

Defines Recommendation ITU-R BT.2100 Reference PQ inverse opto-optical transfer function (OOTF / OOCF).

Log Encoding and Decoding

colour

log_encoding(value[, function])

Encodes linear-light values to \(R'G'B'\) video component signal value using given log function.

LOG_ENCODINGS

Supported log encoding functions.

log_decoding(value[, function])

Decodes \(R'G'B'\) video component signal value to linear-light values using given log function.

LOG_DECODINGS

Supported log decoding functions.

colour.models

log_encoding_ACEScc(lin_AP1)

Defines the ACEScc colourspace log encoding / opto-electronic transfer function.

log_decoding_ACEScc(ACEScc)

Defines the ACEScc colourspace log decoding / electro-optical transfer function.

log_encoding_ACEScct(lin_AP1[, constants])

Defines the ACEScct colourspace log encoding / opto-electronic transfer function.

log_decoding_ACEScct(ACEScct[, constants])

Defines the ACEScct colourspace log decoding / electro-optical transfer function.

log_encoding_ACESproxy(lin_AP1[, bit_depth, …])

Defines the ACESproxy colourspace log encoding curve / opto-electronic transfer function.

log_decoding_ACESproxy(ACESproxy[, …])

Defines the ACESproxy colourspace log decoding curve / electro-optical transfer function.

log_encoding_ALEXALogC(x[, firmware, method, EI])

Defines the ARRI ALEXA Log C log encoding curve / opto-electronic transfer function.

log_decoding_ALEXALogC(t[, firmware, method, EI])

Defines the ARRI ALEXA Log C log decoding curve / electro-optical transfer function.

log_encoding_CanonLog2(x[, bit_depth, …])

Defines the Canon Log 2 log encoding curve / opto-electronic transfer function.

log_decoding_CanonLog2(clog2[, bit_depth, …])

Defines the Canon Log 2 log decoding curve / electro-optical transfer function.

log_encoding_CanonLog3(x[, bit_depth, …])

Defines the Canon Log 3 log encoding curve / opto-electronic transfer function.

log_decoding_CanonLog3(clog3[, bit_depth, …])

Defines the Canon Log 3 log decoding curve / electro-optical transfer function.

log_encoding_CanonLog(x[, bit_depth, …])

Defines the Canon Log log encoding curve / opto-electronic transfer function.

log_decoding_CanonLog(clog[, bit_depth, …])

Defines the Canon Log log decoding curve / electro-optical transfer function.

log_encoding_Cineon(x[, black_offset])

Defines the Cineon log encoding curve / opto-electronic transfer function.

log_decoding_Cineon(y[, black_offset])

Defines the Cineon log decoding curve / electro-optical transfer function.

log_encoding_ERIMMRGB(X[, bit_depth, …])

Defines the ERIMM RGB log encoding curve / opto-electronic transfer function (OETF / OECF).

log_decoding_ERIMMRGB(X_p[, bit_depth, …])

Defines the ERIMM RGB log decoding curve / electro-optical transfer function (EOTF / EOCF).

log_encoding_FLog(in_r[, bit_depth, …])

Defines the Fujifilm F-Log log encoding curve / opto-electronic transfer function.

log_decoding_FLog(out_r[, bit_depth, …])

Defines the Fujifilm F-Log log decoding curve / electro-optical transfer function.

log_encoding_Log2(lin[, middle_grey, …])

Defines the common Log2 encoding function.

log_decoding_Log2(log_norm[, middle_grey, …])

Defines the common Log2 decoding function.

LOG3G10_ENCODING_METHODS

Supported Log3G10 log encoding curve / opto-electronic transfer function methods.

log_encoding_Log3G10(x[, method])

Defines the Log3G10 log encoding curve / opto-electronic transfer function.

LOG3G10_DECODING_METHODS

Supported Log3G10 log decoding curve / electro-optical transfer function methods.

log_decoding_Log3G10(y[, method])

Defines the Log3G10 log decoding curve / electro-optical transfer function.

log_encoding_Log3G12(x)

Defines the Log3G12 log encoding curve / opto-electronic transfer function.

log_decoding_Log3G12(y)

Defines the Log3G12 log decoding curve / electro-optical transfer function.

log_encoding_Panalog(x[, black_offset])

Defines the Panalog log encoding curve / opto-electronic transfer function.

log_decoding_Panalog(y[, black_offset])

Defines the Panalog log decoding curve / electro-optical transfer function.

log_encoding_PivotedLog(x[, log_reference, …])

Defines the Josh Pines style Pivoted Log log encoding curve / opto-electronic transfer function.

log_decoding_PivotedLog(y[, log_reference, …])

Defines the Josh Pines style Pivoted Log log decoding curve / electro-optical transfer function.

log_encoding_Protune(x)

Defines the Protune log encoding curve / opto-electronic transfer function.

log_decoding_Protune(y)

Defines the Protune log decoding curve / electro-optical transfer function.

log_encoding_REDLog(x[, black_offset])

Defines the REDLog log encoding curve / opto-electronic transfer function.

log_decoding_REDLog(y[, black_offset])

Defines the REDLog log decoding curve / electro-optical transfer function.

log_encoding_REDLogFilm(x[, black_offset])

Defines the REDLogFilm log encoding curve / opto-electronic transfer function.

log_decoding_REDLogFilm(y[, black_offset])

Defines the REDLogFilm log decoding curve / electro-optical transfer function.

log_encoding_SLog(x[, bit_depth, …])

Defines the Sony S-Log log encoding curve / opto-electronic transfer function.

log_decoding_SLog(y[, bit_depth, …])

Defines the Sony S-Log log decoding curve / electro-optical transfer function.

log_encoding_SLog2(x[, bit_depth, …])

Defines the Sony S-Log2 log encoding curve / opto-electronic transfer function.

log_decoding_SLog2(y[, bit_depth, …])

Defines the Sony S-Log2 log decoding curve / electro-optical transfer function.

log_encoding_SLog3(x[, bit_depth, …])

Defines the Sony S-Log3 log encoding curve / opto-electronic transfer function.

log_decoding_SLog3(y[, bit_depth, …])

Defines the Sony S-Log3 log decoding curve / electro-optical transfer function.

log_encoding_VLog(L_in[, bit_depth, …])

Defines the Panasonic V-Log log encoding curve / opto-electronic transfer function.

log_decoding_VLog(V_out[, bit_depth, …])

Defines the Panasonic V-Log log decoding curve / electro-optical transfer function.

log_encoding_ViperLog(x)

Defines the Viper Log log encoding curve / opto-electronic transfer function.

log_decoding_ViperLog(y)

Defines the Viper Log log decoding curve / electro-optical transfer function.

Colour Encodings

Y’CbCr Colour Encoding

colour

RGB_to_YCbCr(RGB[, K, in_bits, in_legal, …])

Converts an array of R’G’B’ values to the corresponding Y’CbCr colour encoding values array.

YCbCr_to_RGB(YCbCr[, K, in_bits, in_legal, …])

Converts an array of Y’CbCr colour encoding values to the corresponding R’G’B’ values array.

WEIGHTS_YCBCR

Implements a case-insensitive mutable mapping / dict object.

RGB_to_YcCbcCrc(RGB[, out_bits, out_legal, …])

Converts an array of RGB linear values to the corresponding Yc’Cbc’Crc’ colour encoding values array.

YcCbcCrc_to_RGB(YcCbcCrc[, in_bits, …])

Converts an array of Yc’Cbc’Crc’ colour encoding values to the corresponding RGB array of linear values.

Ancillary Objects

colour

full_to_legal(CV[, bit_depth, in_int, out_int])

Converts given code value \(CV\) or float equivalent of a code value at a given bit depth from full range (full swing) to legal range (studio swing).

legal_to_full(CV[, bit_depth, in_int, out_int])

Converts given code value \(CV\) or float equivalent of a code value at a given bit depth from legal range (studio swing) to full range (full swing).

CV_range([bit_depth, is_legal, is_int])

Returns the code value \(CV\) range for given bit depth, range legality and representation.

YCoCg Colour Encoding

colour

RGB_to_YCoCg(RGB)

Converts an array of R’G’B’ values to the corresponding YCoCg colour encoding values array.

YCoCg_to_RGB(YCoCg)

Converts an array of YCoCg colour encoding values to the corresponding R’G’B’ values array.

\(IC_TC_P\) Colour Encoding

colour

RGB_to_ICTCP(RGB[, L_p])

Converts from ITU-R BT.2020 colourspace to \(IC_TC_P\) colour encoding.

ICTCP_to_RGB(ICTCP[, L_p])

Converts from \(IC_TC_P\) colour encoding to ITU-R BT.2020 colourspace.

RGB Representations

Prismatic Colourspace

colour

RGB_to_Prismatic(RGB)

Converts from RGB colourspace to Prismatic \(L\rho\gamma\beta\) colourspace array.

Prismatic_to_RGB(Lrgb)

Converts from Prismatic \(L\rho\gamma\beta\) colourspace array to RGB colourspace.

HSV Colourspace

colour

RGB_to_HSV(RGB)

Converts from RGB colourspace to HSV colourspace.

HSV_to_RGB(HSV)

Converts from HSV colourspace to RGB colourspace.

HSL Colourspace

colour

RGB_to_HSL(RGB)

Converts from RGB colourspace to HSL colourspace.

HSL_to_RGB(HSL)

Converts from HSL colourspace to RGB colourspace.

CMY Colourspace

colour

RGB_to_CMY(RGB)

Converts from RGB colourspace to CMY colourspace.

CMY_to_RGB(CMY)

Converts from CMY colourspace to CMY colourspace.

CMY_to_CMYK(CMY)

Converts from CMY colourspace to CMYK colourspace.

CMYK_to_CMY(CMYK)

Converts from CMYK colourspace to CMY colourspace.