Colour Models#

Tristimulus Values, CIE xyY Colourspace and Chromaticity Coordinates#

colour

XYZ_to_xyY(XYZ)

Convert from CIE XYZ tristimulus values to CIE xyY colourspace.

xyY_to_XYZ(xyY)

Convert from CIE xyY colourspace to CIE XYZ tristimulus values.

XYZ_to_xy(XYZ)

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

xy_to_XYZ(xy)

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

xyY_to_xy(xyY)

Convert from CIE xyY colourspace to CIE xy chromaticity coordinates.

xy_to_xyY(xy[, Y])

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

Common Models#

colour

COLOURSPACE_MODELS

Colourspace models supporting a direct conversion to CIE XYZ tristimulus values.

colour.models

Jab_to_JCh(Jab)

Convert from Jab colour representation to JCh colour representation.

JCh_to_Jab(JCh)

Convert from JCh colour representation to Jab colour representation.

XYZ_to_Iab(XYZ, LMS_to_LMS_p_callable, ...)

Convert from CIE XYZ tristimulus values to IPT-like \(Iab\) colour representation.

Iab_to_XYZ(Iab, LMS_p_to_LMS_callable, ...)

Convert from IPT-like \(Iab\) colour representation to CIE XYZ tristimulus values.

CIE L*a*b* Colourspace#

colour

XYZ_to_Lab(XYZ[, illuminant])

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

Lab_to_XYZ(Lab[, illuminant])

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

CIE L*u*v* Colourspace#

colour

XYZ_to_Luv(XYZ[, illuminant])

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

Luv_to_XYZ(Luv[, illuminant])

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

Luv_to_uv(Luv[, illuminant])

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

uv_to_Luv(uv[, illuminant, L])

Return 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)

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

xy_to_Luv_uv(xy)

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

XYZ_to_CIE1976UCS(XYZ[, illuminant])

Convert from CIE XYZ tristimulus values to \(uv^pL\*\) colourspace.

CIE1976UCS_to_XYZ(uvL[, illuminant])

Convert from CIE XYZ tristimulus values to \(uv^pL\*\) colourspace.

CIE 1960 UCS Colourspace#

colour

XYZ_to_UCS(XYZ)

Convert from CIE XYZ tristimulus values to CIE 1960 UCS \(UVW\) colourspace.

UCS_to_XYZ(UVW)

Convert from CIE 1960 UCS \(UVW\) colourspace to CIE XYZ tristimulus values.

UCS_to_uv(UVW)

Return the uv chromaticity coordinates from given CIE 1960 UCS \(UVW\) colourspace array.

uv_to_UCS(uv[, V])

Return the CIE 1960 UCS \(UVW\) colourspace array from given uv chromaticity coordinates.

UCS_uv_to_xy(uv)

Return the CIE xy chromaticity coordinates from given CIE 1960 UCS \(UVW\) colourspace uv chromaticity coordinates.

xy_to_UCS_uv(xy)

Return the CIE 1960 UCS \(UVW\) colourspace uv chromaticity coordinates from given CIE xy chromaticity coordinates.

XYZ_to_CIE1960UCS(XYZ)

Convert from CIE XYZ tristimulus values to \(uvV\) colourspace.

CIE1960UCS_to_XYZ(uvV)

Convert from CIE XYZ tristimulus values to \(uvV\) colourspace.

CIE 1964 U*V*W* Colourspace#

colour

XYZ_to_UVW(XYZ[, illuminant])

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

UVW_to_XYZ(UVW[, illuminant])

Convert 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])

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

Hunter_Lab_to_XYZ(Lab[, XYZ_n, K_ab])

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

XYZ_to_K_ab_HunterLab1966(XYZ)

Convert 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])

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

Hunter_Rdab_to_XYZ(R_d_ab[, XYZ_n, K_ab])

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

DIN99 Colourspace and DIN99b, DIN99c, DIN99d Refined Formulas#

colour

Lab_to_DIN99(Lab[, k_E, k_CH, method])

Convert from CIE L*a*b* colourspace to DIN99 colourspace or one of the DIN99b, DIN99c, DIN99d refined formulas according to Cui et al. (2002).

DIN99_to_Lab(Lab_99[, k_E, k_CH, method])

Convert from DIN99 colourspace or one of the DIN99b, DIN99c, DIN99d refined formulas according to Cui et al. (2002) to CIE L*a*b* colourspace.

XYZ_to_DIN99(XYZ[, illuminant, k_E, k_CH, ...])

Convert from CIE XYZ tristimulus values to DIN99 colourspace or one of the DIN99b, DIN99c, DIN99d refined formulas according to Cui et al. (2002).

DIN99_to_XYZ(Lab_99[, illuminant, k_E, ...])

Convert from DIN99 colourspace or one of the DIN99b, DIN99c, DIN99d refined formulas according to Cui et al. (2002) to CIE XYZ tristimulus values.

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

colour

JMh_CIECAM02_to_CAM02LCD(JMh)

Convert from CIECAM02 \(JMh\) correlates array to Luo et al. (2006) CAM02-LCD colourspace \(J'a'b'\) array.

CAM02LCD_to_JMh_CIECAM02(Jpapbp)

Convert from Luo et al. (2006) CAM02-LCD colourspace \(J'a'b'\) array to CIECAM02 \(JMh\) correlates array.

JMh_CIECAM02_to_CAM02SCD(JMh)

Convert from CIECAM02 \(JMh\) correlates array to Luo et al. (2006) CAM02-SCD colourspace \(J'a'b'\) array.

CAM02SCD_to_JMh_CIECAM02(Jpapbp)

Convert from Luo et al. (2006) CAM02-SCD colourspace \(J'a'b'\) array to CIECAM02 \(JMh\) correlates array.

JMh_CIECAM02_to_CAM02UCS(JMh)

Convert from CIECAM02 \(JMh\) correlates array to Luo et al. (2006) CAM02-UCS colourspace \(J'a'b'\) array.

CAM02UCS_to_JMh_CIECAM02(Jpapbp)

Convert from Luo et al. (2006) CAM02-UCS colourspace \(J'a'b'\) array to CIECAM02 \(JMh\) correlates array.

XYZ_to_CAM02LCD(XYZ, **kwargs)

Convert from CIE XYZ tristimulus values to Luo et al. (2006) CAM02-LCD colourspace \(J'a'b'\) array.

CAM02LCD_to_XYZ(Jpapbp, **kwargs)

Convert from Luo et al. (2006) CAM02-LCD colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

XYZ_to_CAM02SCD(XYZ, **kwargs)

Convert from CIE XYZ tristimulus values to Luo et al. (2006) CAM02-SCD colourspace \(J'a'b'\) array.

CAM02SCD_to_XYZ(Jpapbp, **kwargs)

Convert from Luo et al. (2006) CAM02-SCD colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

XYZ_to_CAM02UCS(XYZ, **kwargs)

Convert from CIE XYZ tristimulus values to Luo et al. (2006) CAM02-UCS colourspace \(J'a'b'\) array.

CAM02UCS_to_XYZ(Jpapbp, **kwargs)

Convert from Luo et al. (2006) CAM02-UCS colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

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

colour

JMh_CAM16_to_CAM16LCD(JMh, *[, coefficients])

Convert from CAM16 \(JMh\) correlates array to Li et al. (2017) CAM16-LCD colourspace \(J'a'b'\) array.

CAM16LCD_to_JMh_CAM16(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-LCD colourspace \(J'a'b'\) array to CAM16 \(JMh\) correlates array.

JMh_CAM16_to_CAM16SCD(JMh, *[, coefficients])

Convert from CAM16 \(JMh\) correlates array to Li et al. (2017) CAM16-SCD colourspace \(J'a'b'\) array.

CAM16SCD_to_JMh_CAM16(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-SCD colourspace \(J'a'b'\) array to CAM16 \(JMh\) correlates array.

JMh_CAM16_to_CAM16UCS(JMh, *[, coefficients])

Convert from CAM16 \(JMh\) correlates array to Li et al. (2017) CAM16-UCS colourspace \(J'a'b'\) array.

CAM16UCS_to_JMh_CAM16(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-UCS colourspace \(J'a'b'\) array to CAM16 \(JMh\) correlates array.

XYZ_to_CAM16LCD(XYZ, *[, coefficients])

Convert from CIE XYZ tristimulus values to Li et al. (2017) CAM16-LCD colourspace \(J'a'b'\) array.

CAM16LCD_to_XYZ(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-LCD colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

XYZ_to_CAM16SCD(XYZ, *[, coefficients])

Convert from CIE XYZ tristimulus values to Li et al. (2017) CAM16-SCD colourspace \(J'a'b'\) array.

CAM16SCD_to_XYZ(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-SCD colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

XYZ_to_CAM16UCS(XYZ, *[, coefficients])

Convert from CIE XYZ tristimulus values to Li et al. (2017) CAM16-UCS colourspace \(J'a'b'\) array.

CAM16UCS_to_XYZ(Jpapbp, *[, coefficients])

Convert from Li et al. (2017) CAM16-UCS colourspace \(J'a'b'\) array to CIE XYZ tristimulus values.

\(IC_AC_B\) Colourspace#

colour

XYZ_to_ICaCb(XYZ)

Convert from CIE XYZ tristimulus values to \(IC_AC_B\) colourspace.

ICaCb_to_XYZ(ICaCb)

Convert from \(IC_AC_B\) tristimulus values to CIE XYZ colourspace.

\(I_GP_GT_G\) Colourspace#

colour

XYZ_to_IgPgTg(XYZ)

Convert from CIE XYZ tristimulus values to \(I_GP_GT_G\) colourspace.

IgPgTg_to_XYZ(IgPgTg)

Convert from \(I_GP_GT_G\) colourspace to CIE XYZ tristimulus values.

IPT Colourspace#

colour

XYZ_to_IPT(XYZ)

Convert from CIE XYZ tristimulus values to IPT colourspace.

IPT_to_XYZ(IPT)

Convert from IPT colourspace to CIE XYZ tristimulus values.

IPT_hue_angle(IPT)

Compute the hue angle in degrees from IPT colourspace.

Ragoo and Farup (2021) Optimised IPT Colourspace#

colour

XYZ_to_IPT_Ragoo2021(XYZ)

Convert from CIE XYZ tristimulus values to Ragoo and Farup (2021) Optimised IPT colourspace.

IPT_Ragoo2021_to_XYZ(IPT)

Convert from Ragoo and Farup (2021) Optimised IPT colourspace to CIE XYZ tristimulus values.

hdr-CIELAB Colourspace#

colour

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

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

hdr_CIELab_to_XYZ(Lab_hdr[, illuminant, ...])

Convert 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])

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

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

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

HDR_IPT_METHODS

Supported hdr-IPT colourspace computation methods.

Oklab Colourspace#

colour

XYZ_to_Oklab(XYZ)

Convert from CIE XYZ tristimulus values to Oklab colourspace.

Oklab_to_XYZ(Lab)

Convert from Oklab colourspace to CIE XYZ tristimulus values.

OSA UCS Colourspace#

colour

XYZ_to_OSA_UCS(XYZ)

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

OSA_UCS_to_XYZ(Ljg[, optimisation_kwargs])

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

ProLab Colourspace#

colour

XYZ_to_ProLab(XYZ[, illuminant])

Convert from CIE XYZ tristimulus values to ProLab colourspace.

ProLab_to_XYZ(ProLab[, illuminant])

Convert from ProLab colourspace to CIE XYZ tristimulus values.

Yrg Colourspace - Kirk (2019)#

colour

XYZ_to_Yrg(XYZ)

Convert from CIE XYZ tristimulus values to Kirk (2019) Yrg colourspace.

Yrg_to_XYZ(Yrg)

Convert from Kirk (2019) Yrg colourspace to CIE XYZ tristimulus values.

colour.models

LMS_to_Yrg(LMS)

Convert from LMS colourspace to Kirk (2019) Yrg colourspace.

Yrg_to_LMS(Yrg)

Convert from Kirk (2019) Yrg colourspace to LMS colourspace.

\(Jzazbz\) Colourspace#

colour

XYZ_to_Jzazbz(XYZ_D65[, constants])

Convert from CIE XYZ tristimulus values to \(J_za_zb_z\) colourspace.

Jzazbz_to_XYZ(Jzazbz[, constants])

Convert from \(J_za_zb_z\) colourspace to CIE XYZ tristimulus values.

Ancillary Objects

colour.models

IZAZBZ_METHODS

Supported \(I_za_zb_z\) computation methods.

XYZ_to_Izazbz(XYZ_D65[, constants, method])

Convert from CIE XYZ tristimulus values to \(I_za_zb_z\) colourspace.

Izazbz_to_XYZ(Izazbz[, constants, method])

Convert from \(I_za_zb_z\) colourspace to CIE XYZ tristimulus values.

Polar Conversions#

colour

COLOURSPACE_MODELS_POLAR_CONVERSIONS

Built-in immutable sequence.

Lab_to_LCHab(Jab)

Convert from Lab colourspace to LCHab colourspace.

LCHab_to_Lab(JCh)

Convert from LCHab colourspace to Lab colourspace.

Luv_to_LCHuv(Jab)

Convert from Luv colourspace to LCHuv colourspace.

LCHuv_to_Luv(JCh)

Convert from LCHuv colourspace to Luv colourspace.

hdr_CIELab_to_hdr_CIELCHab(Jab)

Convert from hdr_CIELab colourspace to hdr_CIELCHab colourspace.

hdr_CIELCHab_to_hdr_CIELab(JCh)

Convert from hdr_CIELCHab colourspace to hdr_CIELab colourspace.

Hunter_Lab_to_Hunter_LCHab(Jab)

Convert from Hunter_Lab colourspace to Hunter_LCHab colourspace.

Hunter_LCHab_to_Hunter_Lab(JCh)

Convert from Hunter_LCHab colourspace to Hunter_Lab colourspace.

Hunter_Rdab_to_Hunter_RdCHab(Jab)

Convert from Hunter_Rdab colourspace to Hunter_RdCHab colourspace.

Hunter_RdCHab_to_Hunter_Rdab(JCh)

Convert from Hunter_RdCHab colourspace to Hunter_Rdab colourspace.

ICaCb_to_ICHab(Jab)

Convert from ICaCb colourspace to ICHab colourspace.

ICHab_to_ICaCb(JCh)

Convert from ICHab colourspace to ICaCb colourspace.

ICtCp_to_ICHtp(Jab)

Convert from ICtCp colourspace to ICHtp colourspace.

ICHtp_to_ICtCp(JCh)

Convert from ICHtp colourspace to ICtCp colourspace.

IgPgTg_to_IgCHpt(Jab)

Convert from IgPgTg colourspace to IgCHpt colourspace.

IgCHpt_to_IgPgTg(JCh)

Convert from IgCHpt colourspace to IgPgTg colourspace.

IPT_to_ICH(Jab)

Convert from IPT colourspace to ICH colourspace.

ICH_to_IPT(JCh)

Convert from ICH colourspace to IPT colourspace.

Izazbz_to_IzCHab(Jab)

Convert from Izazbz colourspace to IzCHab colourspace.

IzCHab_to_Izazbz(JCh)

Convert from IzCHab colourspace to Izazbz colourspace.

Jzazbz_to_JzCHab(Jab)

Convert from Jzazbz colourspace to JzCHab colourspace.

JzCHab_to_Jzazbz(JCh)

Convert from JzCHab colourspace to Jzazbz colourspace.

hdr_IPT_to_hdr_ICH(Jab)

Convert from hdr_IPT colourspace to hdr_ICH colourspace.

hdr_ICH_to_hdr_IPT(JCh)

Convert from hdr_ICH colourspace to hdr_IPT colourspace.

Oklab_to_Oklch(Jab)

Convert from Oklab colourspace to Oklch colourspace.

Oklch_to_Oklab(JCh)

Convert from Oklch colourspace to Oklab colourspace.

ProLab_to_ProLCHab(Jab)

Convert from ProLab colourspace to ProLCHab colourspace.

ProLCHab_to_ProLab(JCh)

Convert from ProLCHab colourspace to ProLab colourspace.

IPT_Ragoo2021_to_ICH_Ragoo2021(Jab)

Convert from IPT_Ragoo2021 colourspace to ICH_Ragoo2021 colourspace.

ICH_Ragoo2021_to_IPT_Ragoo2021(JCh)

Convert from ICH_Ragoo2021 colourspace to IPT_Ragoo2021 colourspace.

RGB Colourspace and Transformations#

colour

XYZ_to_RGB(XYZ, colourspace[, illuminant, ...])

Convert from CIE XYZ tristimulus values to RGB colourspace array.

RGB_to_XYZ(RGB, colourspace[, illuminant, ...])

Convert given RGB colourspace array to CIE XYZ tristimulus values.

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

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

matrix_RGB_to_RGB(input_colourspace, ...[, ...])

Compute 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, ...])

Convert from CIE XYZ tristimulus values to sRGB colourspace.

sRGB_to_XYZ(RGB[, illuminant, ...])

Convert from sRGB colourspace to CIE XYZ tristimulus values.

RGB Colourspace Derivation#

colour

normalised_primary_matrix(primaries, whitepoint)

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

chromatically_adapted_primaries(primaries, ...)

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

primaries_whitepoint(npm)

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

RGB_luminance(RGB, primaries, whitepoint)

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

RGB_luminance_equation(primaries, whitepoint)

Return the luminance equation from given primaries and whitepoint.

RGB Colourspaces#

colour

RGB_Colourspace(name, primaries, whitepoint)

Implement 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_ARRI_WIDE_GAMUT_3

ARRI Wide Gamut 3 colourspace.

RGB_COLOURSPACE_ARRI_WIDE_GAMUT_4

ARRI Wide Gamut 4 colourspace.

RGB_COLOURSPACE_APPLE_RGB

Apple RGB colourspace.

RGB_COLOURSPACE_BEST_RGB

Best RGB colourspace.

RGB_COLOURSPACE_BETA_RGB

Beta RGB colourspace.

RGB_COLOURSPACE_BLACKMAGIC_WIDE_GAMUT

Blackmagic Wide Gamut colourspace.

RGB_COLOURSPACE_BT470_525

Recommendation ITU-R BT.470 - 525 colourspace.

RGB_COLOURSPACE_BT470_625

Recommendation ITU-R BT.470 - 625 colourspace.

RGB_COLOURSPACE_BT709

Recommendation ITU-R BT.709 colourspace.

RGB_COLOURSPACE_BT2020

RecommendationITU-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_DAVINCI_WIDE_GAMUT

DaVinci Wide Gamut 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_DJI_D_GAMUT

DJI_D-Gamut colourspace.

RGB_COLOURSPACE_DON_RGB_4

Don RGB 4 colourspace.

RGB_COLOURSPACE_EBU_3213_E

*EBU Tech.

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_FILMLIGHT_E_GAMUT

FilmLight E-Gamut colourspace.

RGB_COLOURSPACE_H273_GENERIC_FILM

Recommendation ITU-T H.273 Generic Film (colour filters using Illuminant C) colourspace.

RGB_COLOURSPACE_H273_22_UNSPECIFIED

Recommendation ITU-T H.273 row 22 colourspace as given in Table 2 - Interpretation of colour primaries (ColourPrimaries) value.

RGB_COLOURSPACE_PROTUNE_NATIVE

Protune Native colourspace.

RGB_COLOURSPACE_MAX_RGB

Max RGB colourspace.

RGB_COLOURSPACE_N_GAMUT

Nikon N-Gamut 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_PLASA_ANSI_E154

PLASA ANSI E1.54 colourspace.

RGB_COLOURSPACE_RUSSELL_RGB

Russell RGB colourspace.

RGB_COLOURSPACE_SHARP_RGB

Sharp RGB colourspace.

RGB_COLOURSPACE_SMPTE_240M

SMPTE 240M colourspace.

RGB_COLOURSPACE_SMPTE_C

SMPTE C colourspace.

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

Smits (1999) 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])

Encode 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])

Decode 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, ...])

Define a typical gamma encoding / decoding function.

linear_function(a)

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

colour.models

cctf_encoding_ROMMRGB(X[, bit_depth, out_int])

Define the ROMM RGB encoding colour component transfer function (Encoding CCTF).

cctf_decoding_ROMMRGB(X_p[, bit_depth, in_int])

Define the ROMM RGB decoding colour component transfer function (Encoding CCTF).

cctf_encoding_RIMMRGB(X[, bit_depth, ...])

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

cctf_decoding_RIMMRGB(X_p[, bit_depth, ...])

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

Aliases

colour.models

cctf_encoding_ProPhotoRGB(X[, bit_depth, ...])

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

cctf_decoding_ProPhotoRGB(X_p[, bit_depth, ...])

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

Ancillary Objects

colour.models

exponent_function_basic(x[, exponent, style])

Define the basic exponent transfer function.

exponent_function_monitor_curve(x[, ...])

Define the Monitor Curve exponent transfer function.

logarithmic_function_basic(x[, style, base])

Define the basic logarithmic function.

logarithmic_function_quasilog(x[, style, ...])

Define the quasilog logarithmic function.

logarithmic_function_camera(x[, style, ...])

Define the camera logarithmic function.

Opto-Electronic Transfer Functions#

colour

oetf(value[, function])

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

OETFS

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

oetf_inverse(value[, function])

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

OETF_INVERSES

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

colour.models

oetf_ARIBSTDB67(E[, r, constants])

Define ARIB STD-B67 (Hybrid Log-Gamma) opto-electrical transfer function (OETF).

oetf_inverse_ARIBSTDB67(E_p[, r, constants])

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

oetf_BlackmagicFilmGeneration5(x[, constants])

Define the Blackmagic Film Generation 5 opto-electronic transfer function (OETF).

oetf_inverse_BlackmagicFilmGeneration5(y[, ...])

Define the Blackmagic Film Generation 5 inverse opto-electronic transfer function (OETF).

oetf_DaVinciIntermediate(L[, constants])

Define the DaVinci Intermediate opto-electronic transfer function.

oetf_inverse_DaVinciIntermediate(V[, constants])

Define the DaVinci Intermediate inverse opto-electronic transfer function (OETF).

oetf_BT2020(E[, is_12_bits_system, constants])

Define Recommendation ITU-R BT.2020 opto-electronic transfer function (OETF).

oetf_inverse_BT2020(E_p[, ...])

Define Recommendation ITU-R BT.2020 inverse opto-electronic transfer function (OETF).

oetf_BT2100_HLG(E[, constants])

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

oetf_inverse_BT2100_HLG(E_p[, constants])

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

oetf_BT2100_PQ(E)

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

oetf_inverse_BT2100_PQ(E_p)

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

oetf_BT601(L)

Define Recommendation ITU-R BT.601-7 opto-electronic transfer function (OETF).

oetf_inverse_BT601(E)

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

oetf_BT709(L)

Define Recommendation ITU-R BT.709-6 opto-electronic transfer function (OETF).

oetf_inverse_BT709(V)

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

oetf_H273_Log(L_c)

Define Recommendation ITU-T H.273 opto-electronic transfer function (OETF) for logarithmic encoding (100:1 range).

oetf_inverse_H273_Log(V)

Define Recommendation ITU-T H.273 inverse-opto-electronic transfer function (OETF) for logarithmic encoding (100:1 range).

oetf_H273_LogSqrt(L_c)

Define Recommendation ITU-T H.273 opto-electronic transfer function (OETF) for logarithmic encoding (100*Sqrt(10):1 range).

oetf_inverse_H273_LogSqrt(V)

Define Recommendation ITU-T H.273 inverse-opto-electronic transfer function (OETF) for logarithmic encoding (100*Sqrt(10):1 range).

oetf_H273_IEC61966_2(L_c)

Define Recommendation ITU-T H.273 opto-electronic transfer function (OETF) for IEC 61966-2 family of transfer functions (2-1 sRGB, 2-1 sYCC, 2-4 xvYCC).

oetf_inverse_H273_IEC61966_2(V)

Define Recommendation ITU-T H.273 inverse opto-electronic transfer function (OETF) for IEC 61966-2 family of transfer functions (2-1 sRGB, 2-1 sYCC, 2-4 xvYCC).

oetf_SMPTE240M(L_c)

Define SMPTE 240M opto-electrical transfer function (OETF).

Electro-Optical Transfer Functions#

colour

eotf(value[, function])

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

EOTFS

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

eotf_inverse(value[, function])

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

EOTF_INVERSES

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

colour.models

eotf_DCDM(XYZ_p[, in_int])

Define the DCDM electro-optical transfer function (EOTF).

eotf_inverse_DCDM(XYZ[, out_int])

Define the DCDM inverse electro-optical transfer function (EOTF).

eotf_DICOMGSDF(J[, in_int, constants])

Define the DICOM - Grayscale Standard Display Function electro-optical transfer function (EOTF).

eotf_inverse_DICOMGSDF(L[, out_int, constants])

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

eotf_BT1886(V[, L_B, L_W])

Define Recommendation ITU-R BT.1886 electro-optical transfer function (EOTF).

eotf_inverse_BT1886(L[, L_B, L_W])

Define Recommendation ITU-R BT.1886 inverse electro-optical transfer function (EOTF).

BT2100_HLG_EOTF_METHODS

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

eotf_BT2100_HLG(E_p[, L_B, L_W, gamma, ...])

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

BT2100_HLG_EOTF_INVERSE_METHODS

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

eotf_inverse_BT2100_HLG(F_D[, L_B, L_W, ...])

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

eotf_BT2100_PQ(E_p)

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

eotf_inverse_BT2100_PQ(F_D)

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

eotf_H273_ST428_1(V)

Define the SMPTE ST 428-1 (2019) electro-optical transfer function (EOTF).

eotf_inverse_H273_ST428_1(L_o)

Define Recommendation ITU-T H.273 inverse electro-optical transfer function (EOTF) for SMPTE ST 428-1 (2019).

eotf_SMPTE240M(V_r)

Define SMPTE 240M electro-optical transfer function (EOTF).

eotf_ST2084(N[, L_p, constants])

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

eotf_inverse_ST2084(C[, L_p, constants])

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

eotf_sRGB(V)

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

eotf_inverse_sRGB(L)

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

Opto-Optical Transfer Functions#

colour

ootf(value[, function])

Map 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])

Map 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_BT2100_HLG(E[, L_B, L_W, gamma, method])

Define 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_BT2100_HLG(F_D[, L_B, L_W, ...])

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

ootf_BT2100_PQ(E)

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

ootf_inverse_BT2100_PQ(F_D)

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

Log Encoding and Decoding#

colour

log_encoding(value[, function])

Encode scene-referred exposure values to \(R'G'B'\) video component signal value using given log encoding function.

LOG_ENCODINGS

Supported log encoding functions.

log_decoding(value[, function])

Decode \(R'G'B'\) video component signal value to scene-referred exposure values using given log decoding function.

LOG_DECODINGS

Supported log decoding functions.

colour.models

log_encoding_ACEScc(lin_AP1)

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

log_decoding_ACEScc(ACEScc)

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

log_encoding_ACEScct(lin_AP1[, constants])

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

log_decoding_ACEScct(ACEScct[, constants])

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

log_encoding_ACESproxy(lin_AP1[, bit_depth, ...])

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

log_decoding_ACESproxy(ACESproxy[, ...])

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

log_encoding_AppleLogProfile(R[, constants])

Define the Apple Log Profile log encoding curve.

log_decoding_AppleLogProfile(P[, constants])

Define the Apple Log Profile log decoding curve.

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

Define the ARRI LogC3 log encoding curve / opto-electronic transfer function.

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

Define the ARRI LogC3 log decoding curve / electro-optical transfer function.

log_encoding_CanonLog2(x[, bit_depth, ...])

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

log_decoding_CanonLog2(clog2[, bit_depth, ...])

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

log_encoding_CanonLog3(x[, bit_depth, ...])

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

log_decoding_CanonLog3(clog3[, bit_depth, ...])

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

log_encoding_CanonLog(x[, bit_depth, ...])

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

log_decoding_CanonLog(clog[, bit_depth, ...])

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

log_encoding_Cineon(x[, black_offset])

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

log_decoding_Cineon(y[, black_offset])

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

log_encoding_ERIMMRGB(X[, bit_depth, ...])

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

log_decoding_ERIMMRGB(X_p[, bit_depth, ...])

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

log_encoding_FLog(in_r[, bit_depth, ...])

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

log_decoding_FLog(out_r[, bit_depth, ...])

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

log_encoding_FLog2(in_r[, bit_depth, ...])

Define the Fujifilm F-Log2 log encoding curve / opto-electronic transfer function.

log_decoding_FLog2(out_r[, bit_depth, ...])

Define the Fujifilm F-Log2 log decoding curve / electro-optical transfer function.

log_encoding_LLog(LSR[, bit_depth, ...])

Define the Leica L-Log log encoding curve / opto-electronic transfer function.

log_decoding_LLog(LLog[, bit_depth, ...])

Define the Leica L-Log log decoding curve / electro-optical transfer function.

log_encoding_Log2(lin[, middle_grey, ...])

Define the common Log2 encoding function.

log_decoding_Log2(log_norm[, middle_grey, ...])

Define the common Log2 decoding function.

LOG3G10_ENCODING_METHODS

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

log_encoding_Log3G10(x[, method])

Define 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])

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

log_encoding_Log3G12(x)

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

log_decoding_Log3G12(y)

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

log_encoding_NLog(y[, bit_depth, ...])

Define the Nikon N-Log log encoding curve / opto-electronic transfer function.

log_decoding_NLog(x[, bit_depth, ...])

Define the Nikon N-Log log decoding curve / electro-optical transfer function.

log_encoding_Panalog(x[, black_offset])

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

log_decoding_Panalog(y[, black_offset])

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

log_encoding_PivotedLog(x[, log_reference, ...])

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

log_decoding_PivotedLog(y[, log_reference, ...])

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

log_encoding_Protune(x)

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

log_decoding_Protune(y)

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

log_encoding_REDLog(x[, black_offset])

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

log_decoding_REDLog(y[, black_offset])

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

log_encoding_REDLogFilm(x[, black_offset])

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

log_decoding_REDLogFilm(y[, black_offset])

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

log_encoding_SLog(x[, bit_depth, ...])

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

log_decoding_SLog(y[, bit_depth, ...])

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

log_encoding_SLog2(x[, bit_depth, ...])

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

log_decoding_SLog2(y[, bit_depth, ...])

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

log_encoding_SLog3(x[, bit_depth, ...])

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

log_decoding_SLog3(y[, bit_depth, ...])

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

log_encoding_VLog(L_in[, bit_depth, ...])

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

log_decoding_VLog(V_out[, bit_depth, ...])

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

log_encoding_ViperLog(x)

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

log_decoding_ViperLog(y)

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

Colour Encodings#

Y’CbCr Colour Encoding#

colour

WEIGHTS_YCBCR

Implement a delimiter and case-insensitive dict-like object with support for slugs, i.e., SEO friendly and human-readable version of the keys but also canonical keys, i.e., slugified keys without delimiters.

matrix_YCbCr([K, bits, is_legal, is_int])

Compute the Y'CbCr to R'G'B' matrix for given weights, bit-depth, range legality and representation.

offset_YCbCr([bits, is_legal, is_int])

Compute the R'G'B' to Y'CbCr offsets for given bit-depth, range legality and representation.

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

Convert 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, ...])

Convert an array of Y'CbCr colour encoding values to the corresponding R'G'B' values array.

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

Convert an array of RGB linear values to the corresponding Yc'Cbc'Crc' colour encoding values array.

YcCbcCrc_to_RGB(YcCbcCrc[, in_bits, ...])

Convert 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])

Convert 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])

Convert 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])

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

YCoCg Colour Encoding#

colour

RGB_to_YCoCg(RGB)

Convert an array of R'G'B' values to the corresponding YCoCg colour encoding values array.

YCoCg_to_RGB(YCoCg)

Convert 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[, method, L_p])

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

ICtCp_to_RGB(ICtCp[, method, L_p])

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

XYZ_to_ICtCp(XYZ[, illuminant, ...])

Convert from CIE XYZ tristimulus values to \(IC_TC_P\) colour encoding.

ICtCp_to_XYZ(ICtCp[, illuminant, ...])

Convert from \(IC_TC_P\) colour encoding to CIE XYZ tristimulus values.

RGB Representations#

Prismatic Colourspace#

colour

RGB_to_Prismatic(RGB)

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

Prismatic_to_RGB(Lrgb)

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

HSV Colourspace#

colour

RGB_to_HSV(RGB)

Convert from RGB colourspace to HSV colourspace.

HSV_to_RGB(HSV)

Convert from HSV colourspace to RGB colourspace.

HSL Colourspace#

colour

RGB_to_HSL(RGB)

Convert from RGB colourspace to HSL colourspace.

HSL_to_RGB(HSL)

Convert from HSL colourspace to RGB colourspace.

HCL Colourspace#

colour

RGB_to_HCL(RGB[, gamma, Y_0])

Convert from RGB colourspace to HCL colourspace according to Sarifuddin and Missaoui (2005) method.

HCL_to_RGB(HCL[, gamma, Y_0])

Convert from HCL colourspace to RGB colourspace according to Sarifuddin and Missaoui (2005) method.

CMY Colourspace#

colour

RGB_to_CMY(RGB)

Convert from RGB colourspace to CMY colourspace.

CMY_to_RGB(CMY)

Convert from CMY colourspace to CMY colourspace.

CMY_to_CMYK(CMY)

Convert from CMY colourspace to CMYK colourspace.

CMYK_to_CMY(CMYK)

Convert from CMYK colourspace to CMY colourspace.

IHLS - Hanbury (2003)#

colour

RGB_to_IHLS(RGB)

Convert from RGB colourspace to IHLS (Improved HLS) colourspace.

IHLS_to_RGB(HYS)

Convert from IHLS (Improved HLS) colourspace to RGB colourspace.

Recommendation ITU-T H.273 Code points for Video Signal Type Identification#

colour

COLOUR_PRIMARIES_ITUTH273

ColourPrimaries indicates the chromaticity coordinates of the source colour primaries as specified in Table 3 of [InternationalOfStandardization21] and [InternationalTUnion21] in terms of the CIE 1931 definition of x and y, which shall be interpreted as specified by ISO/ CIE 11664-1.

TRANSFER_CHARACTERISTICS_ITUTH273

TransferCharacteristics, as specified in Table 3 of [InternationalOfStandardization21] and [InternationalTUnion21], either indicates the reference opto-electronic transfer characteristic function of the source picture as a function of a source input linear optical intensity input Lc with a nominal real-valued range of 0 to 1 or indicates the inverse of the reference electro-optical transfer characteristic function as a function of an output linear optical intensity Lo with a nominal real-valued range of 0 to 1.

MATRIX_COEFFICIENTS_ITUTH273

MatrixCoefficients describes the matrix coefficients used in deriving luma and chroma signals from the green, blue and red or X, Y and Z primaries, as specified in Table 4 and equations 11 to 77 of [InternationalOfStandardization21] and [InternationalTUnion21].

Ancillary Objects

colour.models

describe_video_signal_colour_primaries(...)

Describe given video signal colour primaries code point.

describe_video_signal_transfer_characteristics(...)

Describe given video signal transfer characteristics code point.

describe_video_signal_matrix_coefficients(...)

Describe given video signal matrix coefficients code point.

Pointer’s Gamut#

colour

CCS_ILLUMINANT_POINTER_GAMUT

ndarray(shape, dtype=float, buffer=None, offset=0,

DATA_POINTER_GAMUT_VOLUME

ndarray(shape, dtype=float, buffer=None, offset=0,

CCS_POINTER_GAMUT_BOUNDARY

ndarray(shape, dtype=float, buffer=None, offset=0,