github colour-science/colour v0.4.0
Colour 0.4.0

latest releases: v0.4.6, v0.4.5, v0.4.4...
2 years ago

Colour 0.4.0 - Alpha Milestone

Over a year in the making, this release integrates most of the GSoC 2021 work from Cédric (@villirion), all the code from Geetansh (@SGeetansh) and the remaining GSoC 2020 code from Nishant (@njwardhan). We would like to thank them again for their great contributions!

Python 2.7 support has been dropped and the minimal version is Python 3.8 as per https://scientific-python.org/. The following minimal dependency versions are also required:

The highlights of this release are as follows:

  • Colour now runs on iOS and iPadOS with Pyto.
  • The import of colour is now 3.6 times faster.
  • Typing annotations have been added and the codebase is checked with Mypy.
  • The documentation has been updated and uses the pydata-sphinx-theme and has better compliance with PEP257.
  • The code formatter is now Black,
  • Many Python 3 features such as f-Strings or the dataclass decorator have been adopted.
  • The plotting API has been improved to be more consistent when setting the colours of some figures, e.g. spectral or planckian locus.
  • New colour appearance models:
    • Zhai and Luo (2018) chromatic adaptation model.
    • Kim, Weyrich and Kautz (2009) colour appearance model.
    • ZCAM colour appearance model.
    • Helmholtz-Kohlrausch effect estimation.
  • New colour models:
    • Oklab colour model.
    • Hanbury (2003) IHLS (Improved HLS) colourspace.
    • DIN99b, DIN99c, and DIN99d refined formulas.
    • ProLab colourspace.
    • Sarifuddin and Missaoui (2005) HCL colourspace.
  • New RGB colourspaces and transfer functions:
    • Nikon N-Gamut colourspace and the N-Log log encoding.
    • Blackmagic Wide Gamut colourspace and the associated Blackmagic Film Generation 5 OETF.
    • DaVinci Intermediate OETF.
    • RED Log3G10 encoding and decoding curves with linear extension.
  • Other notable features:
    • Huang et al. (2015) power-functions.
    • LUT 1D, LUT 3x1D and LUT 3D inversion.
    • UPRTek and Sekonic spectral data parsers.
    • SPImtx LUT input and output.
    • R'G'B' to Y'CbCr matrices computation.
    • Gamut ring/section plotting.
    • Rösch-MacAdam colour solid hue lines.
    • Support for OpenColorIO processor.

Thanks again to all the contributors to this release!

Features

Typing

  • The API has been fully annotated with typing annotations, a new colour.hints sub-package exporting all the hints has been created.

Performance

  • Import time has been reduced to ~1.5secs from 5.5secs on @KelSolaar's MacBook Pro (Retina, 13-inch, Mid 2014) by using a lazy load mechanism for the spectral data and delaying various imports in the colour.plotting.tm3018 module. See PR #840 for more information.
  • Repetitive spectral computations are now cached and a small cache management API has been created, see colour.utilities.CACHE_REGISTRY attribute for more information.
  • The colour.sd_to_XYZ and colour.msds_to_XYZ definitions now use the same n-dimensional code under the hood. Some minor numerical differences are expected as the explicit summations and multiplications have been replaced with np.dot.

colour.adaptation

GSoC - 2021

  • Implement support for Zhai and Luo (2018) chromatic adaptation model with colour.adaptation.chromatic_adaptation_Zhai2018 definition. (@villirion, @KelSolaar)

colour.appearance

GSoC - 2021

  • Implement support for Kim, Weyrich and Kautz (2009) colour appearance model with colour.XYZ_to_Kim2009 and colour.Kim2009_to_XYZ definitions. (@villirion, @KelSolaar)

  • Implement support for ZCAM colour appearance model with the colour.XYZ_to_ZCAM and colour.ZCAM_to_XYZ definitions. (@KelSolaar)
  • Implement support for Helmholtz-Kohlrausch effect estimation with colour.HelmholtzKohlrausch_effect_object_Nayatani1997 and colour.HelmholtzKohlrausch_effect_luminous_Nayatani1997 definitions. (@ilia3101, @KelSolaar)
  • Colour appearance models now use a dataclass-like class output instead of the namedtuple and thus are mutable.

colour.characterisation

  • Various ACES Input Device Transform computation objects have been updated to generate additional data and support more features for the Academy Input Device Transform (IDT) calculator. (@KelSolaar, @aforsythe)
  • Add colour.camera_RGB_to_ACES2065_1 definition. (@KelSolaar, @aforsythe)

colour.colorimetry

  • Implement support for spectral uniformity computation with colour.spectral_uniformity definition. (@KelSolaar)
  • Add colour.TVS_ILLUMINANTS attribute providing a reference for the CIE XYZ tristimulus values of the CIE illuminants. (@KelSolaar)
  • Ensure that colour.SpectralShape and dict KeysView class instances can be passed as domain to colour.SpectralDistribution and colour.MutliSpectralDistributions classes. (@KelSolaar)
  • The colour.colorimetry.yellowness_ASTME313 definition has been updated to use the recommended Yellowness Index equation as given by ASTME313. The alternative method has been renamed to colour.colorimetry.yellowness_ASTME313_alternative. (@KelSolaar, @romanovar)

colour.difference

  • Implement support for STRESS index computation according to García et al. (2007) method with colour.index_stress definition and colour.INDEX_STRESS_METHODS attribute. (@KelSolaar)
  • Implement support for Huang et al. (2015) power-functions improving colour-difference formulas with colour.difference.power_function_Huang2015 definition. (@KelSolaar)

colour.io

GSoC - 2020

  • Implement support for LUT 1D, LUT 3x1D and LUT 3D inversion with the colour.LUT1D.invert, colour.LUT3x1D.invert and colour.LUT3D.invert methods. (@njwardhan, @KelSolaar)

GSoC - 2021

  • Implement support for UPRTek and Sekonic spectral data parsers with the colour.SpectralDistribution_UPRTek and colour.SpectralDistribution_Sekonic classes. (@SGeetansh, @KelSolaar)

  • Implement support for OpenColorIO processor with colour.io.process_image_OpenColorIO definition. (@KelSolaar)
  • Implement support for SPImtx LUT input and output with new colour.io.read_LUT_SonySPImtx and colour.io.write_LUT_SonySPImtx definitions and colour.io.LUTOperatorMatrix support class. (@nick-shaw, @KelSolaar, @zachlewis)
  • The colour.io.tm2714.Header_IESTM2714 class can now be hashed and compared for equality. (@JGoldstone)

colour.models

GSoC - 2021

  • Implement support for Hanbury (2003) IHLS (Improved HLS) colourspace with colour.RGB_to_IHLS and colour.IHLS_to_RGB definitions. (@SGeetansh, @KelSolaar)
  • Implement support for DIN99b, DIN99c, and DIN99d refined formulas in colour.Lab_to_DIN99 and colour.DIN99_to_Lab definitions. (@SGeetansh)
  • Implement support for ProLab colourspace with colour.ProLab_to_XYZ and colour.XYZ_to_ProLab definitions. (@SGeetansh, @KelSolaar)

  • Implement support for Sarifuddin and Missaoui (2005) HCL colourspace with colour.RGB_to_HCL and colour.HCL_to_RGB definitions. (@Saransh-cpp, @KelSolaar)
  • Implement wrapper colour.XYZ_to_ICTCP and colour.ICTCP_to_XYZ definitions. (@KelSolaar)
  • Implement wrapper colour.XYZ_to_CAM02LCD, colour.CAM02LCD_to_XYZ, colour.XYZ_to_CAM02SCD, colour.CAM02SCD_to_XYZ, colour.XYZ_to_CAM02UCS and
    colour.CAM02UCS_to_XYZ definitions. (@KelSolaar)
  • Implement wrapper colour.XYZ_to_CAM16LCD, colour.CAM16LCD_to_XYZ, colour.XYZ_to_CAM16SCD, colour.CAM16SCD_to_XYZ, colour.XYZ_to_CAM16UCS and
    colour.CAM16UCS_to_XYZ definitions. (@KelSolaar)
  • Implement support for R'G'B' to Y'CbCr matrices computation with colour.matrix_YCbCr and colour.offset_YCbCr definitions. (@KelSolaar, @nick-shaw)
  • Implement support for Oklab colour model with colour.XYZ_to_Oklab and colour.Oklab_to_XYZ definitions. (@KelSolaar)
  • Implement support for Nikon N-Gamut colourspace and the N-Log log encoding and decoding curves with colour.models.RGB_COLOURSPACE_N_GAMUT class and colour.models.log_encoding_NLOG and colour.models.log_decoding_NLOG definitions. (@sobotka, @KelSolaar)
  • Implement support for RED Log3G10 encoding and decoding curves that uses a linear extension as given in the final version of White Paper on REDWideGamutRGB and Log3G10. (@jedypod)
  • Implement support for Blackmagic Wide Gamut colourspace and the associated Blackmagic Film Generation 5 OETF and its inverse with colour.models.RGB_COLOURSPACE_BLACKMAGIC_WIDE_GAMUT attribute, colour.models.oetf_BlackmagicFilmGeneration5 and colour.models.oetf_inverse_BlackmagicFilmGeneration5 definitions. (@KelSolaar)
  • Implement support for DaVinci Intermediate OETF and its inverse with colour.models.oetf_DaVinciIntermediate and colour.models.oetf_inverse_DaVinciIntermediate definitions. (@fredsavoir, @KelSolaar)

colour.plotting

  • Implement support for gamut ring/section plotting with the colour.plotting.plot_visible_spectrum_section and colour.plotting.plot_RGB_colourspace_section definitions. (@KelSolaar)
figure, axes = plot_visible_spectrum_section(
    model='DIN99', origin=0.5, section_opacity=0.15, standalone=False)

bounding_box = [
    axes.get_xlim()[0],
    axes.get_xlim()[1],
    axes.get_ylim()[0],
    axes.get_ylim()[1]
]

section_colours = colour.notation.HEX_to_RGB(
    colour.plotting.CONSTANTS_COLOUR_STYLE.colour.cycle[:4])

origins = []
legend_lines = []
for i, RGB in zip(np.arange(0.5, 0.9, 0.1), section_colours):
    origins.append(i * 100)
    plot_RGB_colourspace_section(
        colourspace='sRGB',
        model='DIN99',
        origin=i,
        section_colours=RGB,
        section_opacity=0.15,
        contour_colours=RGB,
        axes=axes,
        standalone=False)
    legend_lines.append(
        Line2D([0], [0], color=RGB, label='{0}%'.format(i * 100)))

axes.legend(handles=legend_lines)

colour.plotting.render(
    title='Visible Spectrum - 50% - sRGB Sections - {0}% -  DIN99'.format(
        origins),
    axes=axes,
    bounding_box=bounding_box)

image

  • Improve zorder across the colour.plotting sub-package and implement various new parameters to customize better figures such as the Chromaticity Diagram.

image

colour.volume

  • Implement support to generate the Rösch-MacAdam colour solid hue lines with the colour.volume.XYZ_outer_surface/colour.volume.solid_RoschMacAdam definition. (@KelSolaar)
import colour

figure, axes = colour.plotting.plot_chromaticity_diagram_CIE1931(
    standalone=False)

bins = len(colour.volume.spectrum.SPECTRAL_SHAPE_OUTER_SURFACE_XYZ.range())

xy = colour.XYZ_to_xy(
    colour.volume.solid_RoschMacAdam(
        point_order='Pulse Wave Width', filter_jagged_points=True)[1:-1])

for i, j in enumerate(range(0, xy.shape[0], (bins - 1) // 2)):
    hue_lines = np.vstack([xy[j:j + (bins - 1) // 2, :], xy[-1]])
    axes.plot(hue_lines[:, 0], hue_lines[:, 1], c='k')

colour.plotting.render()

image

Fixes

colour

  • Ensure that colour runs on iOS and iPadOS. (@KelSolaar)

image

colour.colorimetry

  • Ensure that the cache used by colour.sd_to_XYZ definition returns a copy of the data. (@KelSolaar)

colour.plotting

  • Fix IES TM-30-18 Colour Rendition Report Local Color Fidelity sub-plot values. (@KelSolaar, @Paul-Sims)

Changes

colour.algebra

Object Signature Author
colour.algebra.lerp lerp(x: FloatingOrArrayLike, a: FloatingOrArrayLike = 0, b: FloatingOrArrayLike = 1, clip: Boolean = False) -> NDArray @KelSolaar

colour.biochemistry

Object Name Author
colour.biochemistry.reaction_rate_MichealisMenten reaction_rate_MichaelisMenten @KelSolaar
colour.biochemistry.substrate_concentration_MichealisMenten substrate_concentration_MichaelisMenten ...

colour.characterisation

Object Signature Author
colour.characterisation.training_data_sds_to_XYZ training_data_sds_to_XYZ(training_data: MultiSpectralDistributions, cmfs: MultiSpectralDistributions, illuminant: SpectralDistribution, chromatic_adaptation_transform: Union[Literal["Bianco 2010", "Bianco PC 2010", "Bradford", "CAT02 Brill 2008", "CAT02", "CAT16", "CMCCAT2000", "CMCCAT97", "Fairchild", "Sharp", "Von Kries", "XYZ Scaling", ], str, ] = "CAT02") -> NDArray @KelSolaar
colour.matrix_idt matrix_idt(sensitivities: RGB_CameraSensitivities, illuminant: SpectralDistribution, training_data: Optional[MultiSpectralDistributions] = None, cmfs: Optional[MultiSpectralDistributions] = None, optimisation_factory: Callable = optimisation_factory_rawtoaces_v1, optimisation_kwargs: Optional[Dict] = None, chromatic_adaptation_transform: Union[Literal["Bianco 2010", "Bianco PC 2010", "Bradford", "CAT02 Brill 2008", "CAT02", "CAT16", "CMCCAT2000", "CMCCAT97", "Fairchild", "Sharp", "Von Kries", "XYZ Scaling", ], str, ] = "CAT02", additional_data: Boolean = False) -> Union[Tuple[NDArray, NDArray, NDArray, NDArray], Tuple[NDArray, NDArray]] ...
colour.sd_to_aces_relative_exposure_values sd_to_aces_relative_exposure_values(sd: SpectralDistribution, illuminant: Optional[SpectralDistribution] = None, apply_chromatic_adaptation: Boolean = False, chromatic_adaptation_transform: Union[Literal["Bianco 2010", "Bianco PC 2010", "Bradford", "CAT02 Brill 2008", "CAT02", "CAT16", "CMCCAT2000", "CMCCAT97", "Fairchild", "Sharp", "Von Kries", "XYZ Scaling", ], str, ] = "CAT02") -> NDArray ...

colour.colorimetry

  • colour.SpectralShape class must always be initialised with the start, end and interval parameters. (@KelSolaar)
Object Signature Author
colour.colorimetric_purity colorimetric_purity(xy: ArrayLike, xy_n: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None) -> FloatingOrNDArray @KelSolaar
colour.colorimetry.msds_to_XYZ_ASTME308 msds_to_XYZ_ASTME308(msds: MultiSpectralDistributions, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, use_practice_range: Boolean = True, mi_5nm_omission_method: Boolean = True, mi_20nm_interpolation_method: Boolean = True, k: Optional[Number] = None) -> NDArray ...
colour.colorimetry.msds_to_XYZ_integration msds_to_XYZ_integration(msds: Union[ArrayLike, SpectralDistribution, MultiSpectralDistributions], cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, k: Optional[Number] = None, shape: Optional[SpectralShape] = None) -> NDArray ...
colour.colorimetry.sd_gaussian_fwhm sd_gaussian_fwhm(peak_wavelength: Floating, fwhm: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.colorimetry.sd_gaussian_normal sd_gaussian_normal(mu: Floating, sigma: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.colorimetry.sd_single_led_Ohno2005 sd_single_led_Ohno2005(peak_wavelength: Floating, fwhm: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.colorimetry.sd_to_XYZ_ASTME308 sd_to_XYZ_ASTME308(sd: SpectralDistribution, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, use_practice_range: Boolean = True, mi_5nm_omission_method: Boolean = True, mi_20nm_interpolation_method: Boolean = True, k: Optional[Number] = None) -> NDArray ...
colour.colorimetry.sd_to_XYZ_integration sd_to_XYZ_integration(sd: Union[ArrayLike, SpectralDistribution, MultiSpectralDistributions], cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, k: Optional[Number] = None, shape: Optional[SpectralShape] = None) -> NDArray ...
colour.colorimetry.sd_to_XYZ_tristimulus_weighting_factors_ASTME308 sd_to_XYZ_tristimulus_weighting_factors_ASTME308(sd: SpectralDistribution, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, k: Optional[Number] = None) -> NDArray ...
colour.colorimetry.yellowness_ASTME313 yellowness_ASTME313(XYZ: ArrayLike, C_XZ: ArrayLike = YELLOWNESS_COEFFICIENTS_ASTME313["CIE 1931 2 Degree Standard Observer" ]["D65"]) -> FloatingOrNDArray ...
colour.complementary_wavelength complementary_wavelength(xy: ArrayLike, xy_n: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None) -> Tuple[NDArray, NDArray, NDArray] ...
colour.dominant_wavelength dominant_wavelength(xy: ArrayLike, xy_n: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, inverse: bool = False) -> Tuple[NDArray, NDArray, NDArray] ...
colour.excitation_purity excitation_purity(xy: ArrayLike, xy_n: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None) -> FloatingOrNDArray ...
colour.luminous_efficacy luminous_efficacy(sd: SpectralDistribution, lef: Optional[SpectralDistribution] = None) -> Floating ...
colour.luminous_efficiency luminous_efficiency(sd: SpectralDistribution, lef: Optional[SpectralDistribution] = None) -> Floating ...
colour.luminous_flux luminous_flux(sd: SpectralDistribution, lef: Optional[SpectralDistribution] = None, K_m: Floating = CONSTANT_K_M) -> Floating ...
colour.mesopic_weighting_function mesopic_weighting_function(wavelength: FloatingOrArrayLike, L_p: Floating, source: Union[Literal["Blue Heavy", "Red Heavy"], str] = "Blue Heavy", method: Union[Literal["MOVE", "LRC"], str] = "MOVE", photopic_lef: Optional[SpectralDistribution] = None, scotopic_lef: Optional[SpectralDistribution] = None) -> FloatingOrNDArray ...
colour.msds_constant msds_constant(k: Floating, labels: Sequence, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> MultiSpectralDistributions ...
colour.msds_ones msds_ones(labels: Sequence, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> MultiSpectralDistributions ...
colour.msds_to_XYZ msds_to_XYZ(msds: Union[ArrayLike, SpectralDistribution, MultiSpectralDistributions], cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, k: Optional[Number] = None, method: Union[Literal["ASTM E308", "Integration"], str] = "ASTM E308", **kwargs: Any) -> NDArray ...
colour.msds_zeros msds_zeros(labels: Sequence, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> MultiSpectralDistributions ...
colour.sd_constant sd_constant(k: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.sd_gaussian sd_gaussian(mu_peak_wavelength: Floating, sigma_fwhm: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Union[Literal["Normal", "FWHM"], str] = "Normal", **kwargs: Any) -> SpectralDistribution ...
colour.sd_mesopic_luminous_efficiency_function sd_mesopic_luminous_efficiency_function(L_p: Floating, source: Union[Literal["Blue Heavy", "Red Heavy"], str] = "Blue Heavy", method: Union[Literal["MOVE", "LRC"], str] = "MOVE", photopic_lef: Optional[SpectralDistribution] = None, scotopic_lef: Optional[SpectralDistribution] = None) -> SpectralDistribution ...
colour.sd_multi_leds_Ohno2005 sd_multi_leds_Ohno2005(peak_wavelengths: ArrayLike, fwhm: ArrayLike, peak_power_ratios: Optional[ArrayLike] = None, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.sd_multi_leds sd_multi_leds(peak_wavelengths: ArrayLike, fwhm: ArrayLike, peak_power_ratios: Optional[ArrayLike] = None, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Union[Literal["Ohno 2005"], str] = "Ohno 2005", **kwargs: Any) -> SpectralDistribution ...
colour.sd_ones sd_ones(shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.sd_single_led sd_single_led(peak_wavelength: Floating, fwhm: Floating, shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, method: Union[Literal["Ohno 2005"], str] = "Ohno 2005", **kwargs: Any) -> SpectralDistribution ...
colour.sd_to_XYZ sd_to_XYZ(sd: Union[ArrayLike, SpectralDistribution, MultiSpectralDistributions], cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, k: Optional[Number] = None, method: Union[Literal["ASTM E308", "Integration"], str] = "ASTM E308", **kwargs: Any) -> NDArray ...
colour.sd_zeros sd_zeros(shape: SpectralShape = SPECTRAL_SHAPE_DEFAULT, **kwargs: Any) -> SpectralDistribution ...
colour.wavelength_to_XYZ wavelength_to_XYZ(wavelength: FloatingOrNDArray, cmfs: Optional[MultiSpectralDistributions] = None) -> NDArray ...
colour.yellowness yellowness(XYZ: ArrayLike, method: Union[ Literal["ASTM D1925", "ASTM E313", "ASTM E313 Alternative"], str ] = "ASTM E313", **kwargs: Any) -> FloatingOrNDArray ...

colour.geometry

Object Name Author
colour.geometry.PLANE_TO_AXIS_MAPPING MAPPING_PLANE_TO_AXIS @KelSolaar
Object Signature Author
colour.geometry.primitive_grid primitive_grid(width: Floating = 1, height: Floating = 1, width_segments: Integer = 1, height_segments: Integer = 1, axis: Literal[ "-x", "+x", "-y", "+y", "-z", "+z", "xy", "xz", "yz", "yx", "zx", "zy" ] = "+z", dtype_vertices: Optional[Type[DTypeFloating]] = None, dtype_indexes: Optional[Type[DTypeInteger]] = None) -> Tuple[NDArray, NDArray, NDArray] @KelSolaar
colour.geometry.primitive_cube primitive_cube(width: Floating = 1, height: Floating = 1, depth: Floating = 1, width_segments: Integer = 1, height_segments: Integer = 1, depth_segments: Integer = 1, planes: Optional[ Literal[ "-x", "+x", "-y", "+y", "-z", "+z", "xy", "xz", "yz", "yx", "zx", "zy", ] ] = None, dtype_vertices: Optional[Type[DTypeFloating]] = None, dtype_indexes: Optional[Type[DTypeInteger]] = None) -> Tuple[NDArray, NDArray, NDArray] ...

colour.io

Object Name Author
colour.LUT1D.as_LUT convert @KelSolaar
colour.LUT3x1D.as_LUT convert ...
colour.LUT3D.as_LUT convert ...
Object Signature Author
colour.read_spectral_data_from_csv_file read_spectral_data_from_csv_file(path: str, **kwargs: Any) -> Dict[str, NDArray] @KelSolaar
colour.read_sds_from_csv_file read_sds_from_csv_file(path: str, **kwargs: Any) -> Dict[str, SpectralDistribution] ...
colour.write_sds_to_csv_file write_sds_to_csv_file(sds: Dict[str, SpectralDistribution], path: str) -> Boolean ...

colour.models

Object Signature Author
colour.Lab_to_DIN99 Lab_to_DIN99(Lab: ArrayLike, k_E: Floating = 1, k_CH: Floating = 1, method: Union[ Literal["ASTMD2244-07", "DIN99", "DIN99b", "DIN99c", "DIN99d"], str ] = "DIN99") -> NDArray @SGeetansh
colour.DIN99_to_Lab DIN99_to_Lab(Lab_99: ArrayLike, k_E: Floating = 1, k_CH: Floating = 1, method: Union[ Literal["ASTMD2244-07", "DIN99", "DIN99b", "DIN99c", "DIN99d"], str ] = "DIN99") -> NDArray @SGeetansh
Object Name Author
colour.RGB_to_ICTCP RGB_to_ICtCp @KelSolaar
colour.ICTCP_to_RGB ICtCp_to_RGB ...
colour.RGB_to_IGPGTG RGB_to_IgPgTg ...
colour.IGPGTG_to_RGB IgPgTg_to_RGB ...
colour.XYZ_to_JzAzBz XYZ_to_Jzazbz ...
colour.JzAzBz_to_XYZ Jzazbz_to_XYZ ...

colour.plotting

Object Signature Author
colour.plotting.plot_constant_hue_loci plot_constant_hue_loci(data: ArrayLike, model: Union[ Literal[ "CAM02LCD", "CAM02SCD", "CAM02UCS", "CAM16LCD", "CAM16SCD", "CAM16UCS", "CIE XYZ", "CIE xyY", "CIE Lab", "CIE Luv", "CIE UCS", "CIE UVW", "DIN99", "Hunter Lab", "Hunter Rdab", "ICaCb", "ICtCp", "IPT", "IgPgTg", "Jzazbz", "OSA UCS", "Oklab", "hdr-CIELAB", "hdr-IPT", ], str, ] = "CIE Lab", scatter_kwargs: Optional[Dict] = None, convert_kwargs: Optional[Dict] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] @KelSolaar
colour.plotting.plot_corresponding_chromaticities_prediction plot_corresponding_chromaticities_prediction(experiment: Union[ Literal[1, 2, 3, 4, 6, 8, 9, 11, 12], CorrespondingColourDataset ] = 1, model: Union[ Literal[ "CIE 1994", "CMCCAT2000", "Fairchild 1990", "Von Kries", "Zhai 2018", ], str, ] = "Von Kries", corresponding_chromaticities_prediction_kwargs: Optional[Dict] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] ...
colour.plotting.plot_RGB_colourspaces_gamuts plot_RGB_colourspaces_gamuts(colourspaces: Union[ RGB_Colourspace, str, Sequence[Union[RGB_Colourspace, str]] ], reference_colourspace: Union[ Literal[ "CAM02LCD", "CAM02SCD", "CAM02UCS", "CAM16LCD", "CAM16SCD", "CAM16UCS", "CIE XYZ", "CIE xyY", "CIE Lab", "CIE Luv", "CIE UCS", "CIE UVW", "DIN99", "Hunter Lab", "Hunter Rdab", "ICaCb", "ICtCp", "IPT", "IgPgTg", "Jzazbz", "OSA UCS", "Oklab", "hdr-CIELAB", "hdr-IPT", ], str, ] = "CIE xyY", segments: Integer = 8, show_grid: Boolean = True, grid_segments: Integer = 10, show_spectral_locus: Boolean = False, spectral_locus_colour: Optional[Union[ArrayLike, str]] = None, cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", chromatically_adapt: Boolean = False, convert_kwargs: Optional[Dict] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] ...
colour.plotting.plot_RGB_scatter plot_RGB_scatter(RGB: ArrayLike, colourspace: Union[ RGB_Colourspace, str, Sequence[Union[RGB_Colourspace, str]] ], reference_colourspace: Union[ Literal[ "CAM02LCD", "CAM02SCD", "CAM02UCS", "CAM16LCD", "CAM16SCD", "CAM16UCS", "CIE XYZ", "CIE xyY", "CIE Lab", "CIE Luv", "CIE UCS", "CIE UVW", "DIN99", "Hunter Lab", "Hunter Rdab", "ICaCb", "ICtCp", "IPT", "IgPgTg", "Jzazbz", "OSA UCS", "Oklab", "hdr-CIELAB", "hdr-IPT", ], str, ] = "CIE xyY", colourspaces: Optional[ Union[RGB_Colourspace, str, Sequence[Union[RGB_Colourspace, str]]] ] = None, segments: Integer = 8, show_grid: Boolean = True, grid_segments: Integer = 10, show_spectral_locus: Boolean = False, spectral_locus_colour: Optional[Union[ArrayLike, str]] = None, points_size: Floating = 12, cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", chromatically_adapt: Boolean = False, convert_kwargs: Optional[Dict] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] ...
colour.plotting.plot_planckian_locus_in_chromaticity_diagram_CIE1931 plot_planckian_locus_in_chromaticity_diagram_CIE1931(illuminants: Union[str, Sequence[str]], chromaticity_diagram_callable_CIE1931: Callable = plot_chromaticity_diagram_CIE1931, annotate_kwargs: Optional[Union[Dict, List[Dict]]] = None, plot_kwargs: Optional[Union[Dict, List[Dict]]] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] ...
colour.plotting.plot_planckian_locus_in_chromaticity_diagram_CIE1960UCS plot_planckian_locus_in_chromaticity_diagram_CIE1960UCS(illuminants: Union[str, Sequence[str]], chromaticity_diagram_callable_CIE1960UCS: Callable = plot_chromaticity_diagram_CIE1960UCS, annotate_kwargs: Optional[Union[Dict, List[Dict]]] = None, plot_kwargs: Optional[Union[Dict, List[Dict]]] = None, **kwargs: Any) -> Tuple[plt.Figure, plt.Axes] ...

colour.recovery

Object Signature Author
colour.recovery.find_coefficients_Jakob2019 find_coefficients_Jakob2019(XYZ: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, coefficients_0: ArrayLike = zeros(3), max_error: Floating = JND_CIE1976 / 100, dimensionalise: Boolean = True) -> Tuple[NDArray, Floating] @KelSolaar
colour.recovery.spectral_primary_decomposition_Mallett2019 spectral_primary_decomposition_Mallett2019(colourspace: RGB_Colourspace, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, metric: Callable = np.linalg.norm, metric_args: Tuple = tuple(), optimisation_kwargs: Optional[Dict] = None) -> MultiSpectralDistributions ...
colour.recovery.XYZ_to_sd_Jakob2019 XYZ_to_sd_Jakob2019(XYZ: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, optimisation_kwargs: Optional[Dict] = None, additional_data: Boolean = False) -> Union[Tuple[SpectralDistribution, Floating], SpectralDistribution] ...
colour.recovery.XYZ_to_sd_Meng2015 XYZ_to_sd_Meng2015(XYZ: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, optimisation_kwargs: Optional[Dict] = None) -> SpectralDistribution ...
colour.recovery.XYZ_to_sd_Otsu2018 XYZ_to_sd_Otsu2018(XYZ: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, dataset: Dataset_Otsu2018 = DATASET_REFERENCE_OTSU2018, clip: Boolean = True) -> SpectralDistribution ...

colour.temperature

Object Access Author
colour.temperature.CCT_to_uv_Ohno2013 CCT_to_uv_Ohno2013(CCT_D_uv: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None) -> NDArray @KelSolaar
colour.temperature.uv_to_CCT_Ohno2013 uv_to_CCT_Ohno2013(uv: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, start: Floating = CCT_MINIMAL, end: Floating = CCT_MAXIMAL, count: Integer = CCT_SAMPLES, iterations: Integer = CCT_CALCULATION_ITERATIONS) -> NDArray ...

colour.utilities

Object Access Author
colour.utilities.lerp colour.algebra.lerp @KelSolaar
colour.utilities.linear_conversion colour.algebra.linear_conversion ...
colour.utilities.matrix_dot colour.algebra.matrix_dot ...
colour.utilities.normalise_maximum colour.algebra.normalise_maximum ...
colour.utilities.vector_dot colour.algebra.vector_dot ...
Object Name Author
colour.utilities.set_int _precision set_default_int_dtype @KelSolaar
colour.utilities.set_float_precision set_default_float_dtype ...

colour.volume

Object Signature Author
colour.is_within_visible_spectrum is_within_visible_spectrum(XYZ: ArrayLike, cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, tolerance: Optional[Floating] = None, **kwargs: Any) -> NDArray @KelSolaar
colour.RGB_colourspace_limits RGB_colourspace_limits(colourspace: RGB_Colourspace) -> NDArray @KelSolaar, @ramparvathaneni
colour.volume.generate_pulse_waves generate_pulse_waves(bins: Integer, pulse_order: Union[Literal["Bins", "Pulse Wave Width"], str] = "Bins", filter_jagged_pulses: Boolean = False) -> NDArray ...
colour.volume.XYZ_outer_surface XYZ_outer_surface(cmfs: Optional[MultiSpectralDistributions] = None, illuminant: Optional[SpectralDistribution] = None, point_order: Union[Literal["Bins", "Pulse Wave Width"], str] = "Bins", filter_jagged_points: Boolean = False, **kwargs: Any) -> NDArray ...

Don't miss a new colour release

NewReleases is sending notifications on new releases.