Colour v0.3.11 Release Notes

Release Date: 2018-02-19 // about 6 years ago
  • Colour 0.3.11 - Alpha Milestone

    ๐Ÿš€ This release is an important milestone on The Road to Stable. The spectral backend has been entirely overhauled and is based on a continuous signal implementation. It is backward incompatible but we think that the ease of use and speed improvements are worth it.

    It requires minimal code changes from an usage standpoint compared to previous version, e.g. colour.SpectralPowerDistribution instantiation now requires spectral data as first argument:

    Colour 0.3.11

    \>\>\> data = { ...500: 0.0651, ...520: 0.0705, ...540: 0.0772, ...560: 0.0870, ...580: 0.1128, ...600: 0.1360... } \>\>\> SpectralPowerDistribution(data)
    

    Colour 0.3.10

    \>\>\> data = { ...500: 0.0651, ...520: 0.0705, ...540: 0.0772, ...560: 0.0870, ...580: 0.1128, ...600: 0.1360... } \>\>\> SpectralPowerDistribution('Sample', data)
    

    ๐Ÿ“š The documentation has been entirely rewritten with an improved presentation and layout, the bibliography and cross-references have been fixed and overall it should be much easier and accessible than the interim automatic version previously used. It still misses a lot of context content but we will be gradually addressing that in future versions.

    ๐Ÿ‘€ As part of some import API changes, a deprecation system has been implement so that only key objects are exposed at the colour top level namespace. The colour.plotting sub-package is also affected. As a result you might see warnings as such:

    \>\>\> import colour\>\>\> colour.tsplit/Users/kelsolaar/Documents/Development/colour-science/colour/colour/utilities/verbose.py:141: ColourWarning: "colour.tsplit" object access is deprecated and will change to "colour.utilities.tsplit" in a future release. warn(\*args, \*\*kwargs)\<function tsplit at 0x103152c08\>
    

    ๐Ÿ”„ Please adjust your access accordingly to the warnings and the updated documentation. You can also find the related API changes exposed into the colour.API_CHANGES and colour.plotting.API_CHANGES attributes.

    ๐Ÿšง We have also started to use Invoke to provide automation in our regular maintenance tasks.

    ๐Ÿ”‹ Features

    colour.adaptation

    • Implement colour.chromatic_adaptation definition wrapping the following definitions: (@KelSolaar)
      • colour.adaptation.chromatic_adaptation_CIE1994
      • colour.adaptation.chromatic_adaptation_CMCCAT2000
      • colour.adaptation.chromatic_adaptation_Fairchild1990
      • colour.adaptation.chromatic_adaptation_VonKries

    colour.algebra

    • ๐Ÿ‘• Implement colour.NullInterpolator class: a call within given tolerances will return existing y variable values or default if outside tolerances. (@KelSolaar)
    • Implement colour.kernel_nearest_neighbour, colour.kernel_linear, colour.kernel_sinc, colour.kernel_lanczos, and colour.kernel_cardinal_spline interpolating kernel definitions for use with the new colour.KernelInterpolator class performing interpolation of a 1-D function. (@KelSolaar)

    colour.appearance

    • Implement support for CAM16 colour appearance model with colour.XYZ_to_CAM16 and colour.CAM16_to_XYZ definitions. (@KelSolaar)

    colour.continuous

    • ๐Ÿšฆ Implement colour.continuous.AbstractContinuousFunction, colour.continuous.Signal and colour.continuous.MultiSignal classes implementing support for continuous functions/signals representation. (@KelSolaar, @MichaelMauderer)

    colour.difference

    Implement support for Li et al. (2017) CAM16 based uniform colourspaces colour difference with colour.difference.delta_E_CAM16LCD, colour.difference.delta_E_CAM16SCD, and colour.difference.delta_E_CAM16UCS definitions. (@KelSolaar)

    • colour.delta_E wrapper definition has been improved and accepts the following methods: (@KelSolaar)
      • CIE 1976
      • CIE 1994
      • CIE 2000
      • CMC
      • CAM02-LCD
      • CAM02-SCD
      • CAM02-UCS
      • CAM16-LCD
      • CAM16-SCD
      • CAM16-UCS

    colour.models

    • Implement support for ITU-R BT.2100 transfer functions with the following definitions: (@KelSolaar, @nick-shaw)
      • colour.models.oetf_BT2100_PQ
      • colour.models.oetf_reverse_BT2100_PQ
      • colour.models.eotf_BT2100_PQ
      • colour.models.eotf_reverse_BT2100_PQ
      • colour.models.ootf_BT2100_PQ
      • colour.models.ootf_reverse_BT2100_PQ
      • colour.models.oetf_BT2100_HLG
      • colour.models.oetf_reverse_BT2100_HLG
      • colour.models.eotf_BT2100_HLG
      • colour.models.eotf_reverse_BT2100_HLG
      • colour.models.ootf_BT2100_HLG
      • colour.models.ootf_reverse_BT2100_HLG
    • Implement support for SMPTE 240M transfer functions with colour.models.oetf_SMPTE240M and colour.models.eotf_SMPTE240M definitions. (@KelSolaar)
    • Implement colour.oetf_reverse and colour.eotf_reverse definitions and colour.OETFS_REVERSE and colour.EOTFS_REVERSE attributes defining relevant reverse OETF and EOTF conversions. (@KelSolaar, @nick-shaw, @KevinJW)
    • Implement colour.legal_to_full and colour.full_to_legal definitions providing conversions between full range and legal range. (@KelSolaar)
    • Implement colour.CV_range definition returning the Code Value range for given bit depth, range legality and representation. (@nick-shaw)
    • Implement support for Li et al. (2017) CAM16 based uniform colourspaces with colour.JMh_CAM16_to_CAM16LCD, colour.CAM16LCD_to_JMh_CAM16, colour.JMh_CAM16_to_CAM16SCD, colour.CAM16SCD_to_JMh_CAM16, colour.JMh_CAM16_to_CAM16UCS, CAM16UCS_to_JMh_CAM16 definitions. (@KelSolaar)
    • Implement colour.RGB_Colourspace. __str__ and colour.RGB_Colourspace. __repr__ methods.
      (@KelSolaar)

    colour.recovery

    • Implement colour.XYZ_to_spectral definition wrapping the following definitions: (@KelSolaar)
      • colour.recovery.XYZ_to_spectral_Meng2015
      • colour.recovery.RGB_to_spectral_Smits1999

    colour.utilities

    • Implement colour.utilities.closest_indexes definition that returns a array closest element indexes to reference b array elements. (@KelSolaar)
    • Implement colour..utilities.fill_nan definition that fills given array NaNs either through linear interpolation or with given constant value. (@KelSolaar)
    • Implement colour.utilities.ndarray_write context manager that sets given array writeable to perform an operation and then read-only. (@KelSolaar)
    • Implement colour.utilities.first_item definition that returns the first item of given iterable. (@KelSolaar)

    ๐Ÿ›  Fixes

    colour.models

    • colour.models.log_encoding_CanonLog3 and colour.models.log_decoding_CanonLog3 definitions implementation was slightly incorrect, they have been reimplemented correctly. (@nick-shaw, @KelSolaar)
    • colour.models.log_encoding_SLog2 and colour.models.log_decoding_SLog2 definitions implementation was incorrect, they have been reimplemented correctly. (@nick-shaw, @KelSolaar)

    colour.plotting

    • ๐Ÿ‘ป colour.plotting.display definition was raising an exception when attempting to save a figure. (@KelSolaar)

    colour.recovery

    • colour.recovery.XYZ_to_spectral_Meng2015 definition recovered spectral power distribution has been scaled by 100. (@KelSolaar)

    colour.temperature

    • colour.temperature.uv_to_CCT_Ohno2013 definition was incorrectly using parabolic solution. (@brandondube, @KelSolaar)
      • As a consequence correlated colour temperature computations using Ohno (2013) method are slightly affected:
      • CCT: 6507.51282029, 0.00322336 ---> 6507.47380460, 0.00322335
      • CQS: 75.3424278440688 ---> 75.342591389578701

    colour.utilities

    • colour.utilities.is_iterable definition does not consume consumes the first item of given iterator. (@KelSolaar, @MichaelMauderer)

    colour.volume

    • MacAdam (1935) Optimal Colour Stimuli data for D65 illuminant taken from Centore (2012) had a reproduction error.

    ๐Ÿ”„ Changes

    colour.adaptation

    • colour.adaptation.chromatic_adaptation_CMCCAT2000: (@KelSolaar)
      • Signature: chromatic_adaptation_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, surround=CMCCAT2000_VIEWING_CONDITIONS['Average'], direction='Forward')

    colour.colorimetry

    colour.DEFAULT_WAVELENGTH_DECIMALS: (@KelSolaar)

    - Remove

    colour.SpectralMapping: (@KelSolaar)

    - Remove

    colour.SpectralPowerDistribution: (@KelSolaar)

    - Signature: __init__ (self, data=None, domain=None, **kwargs)

    colour.SpectralPowerDistribution.data: (@KelSolaar)

    - Remove

    colour.SpectralPowerDistribution.title: (@KelSolaar)

    - Name: SpectralPowerDistribution.strict_name

    colour.SpectralPowerDistribution.items: (@KelSolaar)

    - Remove

    colour.SpectralPowerDistribution. __iter__: (@KelSolaar)

    - Remove

    colour.SpectralPowerDistribution.get: (@KelSolaar)

    - Remove

    colour.SpectralPowerDistribution.extrapolate: (@KelSolaar)

    - Signature: extrapolate(self, shape, extrapolator=None, extrapolator_args=None)

    colour.SpectralPowerDistribution.interpolate: (@KelSolaar)

    - Signature: interpolate(self, shape, interpolator=None, interpolator_args=None)

    colour.SpectralPowerDistribution.align: (@KelSolaar)

    - Signature: align(self, shape, interpolator=None, interpolator_args=None, extrapolator=None, extrapolator_args=None)

    colour.SpectralPowerDistribution.trim_wavelengths: (@KelSolaar)

    - Name: SpectralPowerDistribution.trim

    colour.SpectralPowerDistribution.zeros: (@KelSolaar)

    - Remove

    ๐Ÿ‘ฏ colour.SpectralPowerDistribution.clone: (@KelSolaar)

    - Name: SpectralPowerDistribution.copy

    colour.MultiSpectralPowerDistribution: (@KelSolaar)

    - Signature: __init__ (self, data=None, domain=None, labels=None, **kwargs)

    colour.MultiSpectralPowerDistribution.mapping: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.data: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.title: (@KelSolaar)

    - Name: MultiSpectralPowerDistribution.strict_name

    colour.MultiSpectralPowerDistribution.x: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.y: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.z: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.items: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution. __iter__: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.get: (@KelSolaar)

    - Remove

    colour.MultiSpectralPowerDistribution.extrapolate: (@KelSolaar)

    - Signature: extrapolate(self, shape, extrapolator=None, extrapolator_args=None)

    colour.MultiSpectralPowerDistribution.interpolate: (@KelSolaar)

    - Signature: interpolate(self, shape, interpolator=None, interpolator_args=None)

    colour.MultiSpectralPowerDistribution.align: (@KelSolaar)

    - Signature: align(self, shape, interpolator=None, interpolator_args=None, extrapolator=None, extrapolator_args=None)

    colour.MultiSpectralPowerDistribution.trim_wavelengths: (@KelSolaar)

    - Name: MultiSpectralPowerDistribution.trim

    colour.MultiSpectralPowerDistribution.zeros: (@KelSolaar)

    - Remove

    ๐Ÿ‘ฏ colour.MultiSpectralPowerDistribution.clone: (@KelSolaar)

    • Name: MultiSpectralPowerDistribution.copy

    colour.models

    • colour.models.log_encoding_SLog: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_SLog(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The return value is now in legal range (studio swing).
    • colour.models.log_decoding_SLog: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_SLog(y, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The input value is now in legal range (studio swing).
    • colour.models.log_encoding_SLog2: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_SLog2(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The return value is now in legal range (studio swing).
    • colour.models.log_decoding_SLog2: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_SLog2(y, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The input value is now in legal range (studio swing).
    • colour.models.log_encoding_SLog3: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_SLog3(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The return value is now in legal range (studio swing).
    • colour.models.log_decoding_SLog3: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_SLog3(y, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The input value is now in legal range (studio swing).
    • colour.models.log_encoding_VLog: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_VLog(L_in, bit_depth=10, out_legal=True, in_reflection=True)
    • colour.models.log_decoding_VLog: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_VLog(V_out, bit_depth=10, in_legal=True, out_reflection=True)
    • colour.models.log_encoding_CanonLog: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_CanonLog(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The input value is now reflection according to ACES IDT.
    • colour.models.log_decoding_CanonLog: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_CanonLog(clog_ire, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The output value is now reflection according to ACES IDT.
    • colour.models.log_encoding_CanonLog2: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_CanonLog2(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The input value is now reflection according to ACES IDT.
    • colour.models.log_decoding_CanonLog2: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_CanonLog2(clog2_ire, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The output value is now reflection according to ACES IDT.
    • colour.models.log_encoding_CanonLog3: (@nick-shaw, @KelSolaar)
      • Signature: log_encoding_CanonLog3(x, bit_depth=10, out_legal=True, in_reflection=True)
      • Note: The input value is now reflection according to ACES IDT.
    • colour.models.log_decoding_CanonLog3: (@nick-shaw, @KelSolaar)
      • Signature: log_decoding_CanonLog3(clog3_ire, bit_depth=10, in_legal=True, out_reflection=True)
      • Note: The output value is now reflection according to ACES IDT.
    • colour.models.eotf_ARIBSTDB67: (@KelSolaar, @nick-shaw, @KevinJW)
      • Name: oetf_reverse_ARIBSTDB67
    • colour.models.eotf_BT709: (@KelSolaar, @nick-shaw, @KevinJW)
      • Name: oetf_reverse_BT709
    • colour.models.oetf_BT1886: (@KelSolaar, @nick-shaw, @KevinJW)
      • Name: eotf_reverse_BT1886
    • colour.models.eotf_sRGB: (@KelSolaar, @nick-shaw, @KevinJW)
      • Name: oetf_reverse_sRGB
    • colour.models.ALEXA_WIDE_GAMUT_RGB_COLOURSPACE: (@KelSolaar)
      • Name: ALEXA_WIDE_GAMUT_COLOURSPACE
    • colour.models.NTSC_RGB_COLOURSPACE: (@KelSolaar)
      • Name: NTSC_COLOURSPACE
    • colour.models.PAL_SECAM_RGB_COLOURSPACE: (@KelSolaar)
      • Name: PAL_SECAM_COLOURSPACE
    • colour.models.REC_709_COLOURSPACE: (@KelSolaar, @nick-shaw, @KevinJW, @meshula)
      • Name: BT709_COLOURSPACE
    • colour.models.REC_2020_COLOURSPACE: (@KelSolaar, @nick-shaw, @KevinJW, @meshula)
      • Name: BT2020_COLOURSPACE
    • colour.models.SMPTE_C_RGB_COLOURSPACE: (@KelSolaar)
      • Name: SMPTE_240M_COLOURSPACE

    colour.plotting

    • colour.plotting.CIE_1931_chromaticity_diagram_plot: (@brandondube, @KelSolaar)
      • Name: chromaticity_diagram_plot_CIE1931
      • Signature: `chromaticity_diagram_plot_CIE1931(cmfs='CIE 1931 2 Degree Standard Observer', show_diagram_colours=True, use_cached_diagram_colours=True, **kwargs)
    • colour.plotting.CIE_1960_UCS_chromaticity_diagram_plot: (@brandondube, @KelSolaar)
      • Name: chromaticity_diagram_plot_CIE1960UCS
      • Signature: `chromaticity_diagram_plot_CIE1960UCS(cmfs='CIE 1931 2 Degree Standard Observer', show_diagram_colours=True, use_cached_diagram_colours=True, **kwargs)
    • colour.plotting.CIE_1976_UCS_chromaticity_diagram_plot: (@brandondube, @KelSolaar)
      • Name: chromaticity_diagram_plot_CIE1976UCS
      • Signature: `chromaticity_diagram_plot_CIE1976UCS(cmfs='CIE 1931 2 Degree Standard Observer', show_diagram_colours=True, use_cached_diagram_colours=True, **kwargs)
    • colour.plotting.spds_CIE_1931_chromaticity_diagram_plot: (@KelSolaar)
      • Name: spds_chromaticity_diagram_plot_CIE1931
      • Signature: spds_chromaticity_diagram_plot_CIE1931(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, chromaticity_diagram_callable_CIE1931=(chromaticity_diagram_plot_CIE1931), **kwargs)
    • colour.plotting.spds_CIE_1960_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: spds_chromaticity_diagram_plot_CIE1960UCS
      • Signature: spds_chromaticity_diagram_plot_CIE1960UCS(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, chromaticity_diagram_callable_CIE1960UCS=(chromaticity_diagram_plot_CIE1960UCS), **kwargs)
    • colour.plotting.spds_CIE_1976_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: spds_chromaticity_diagram_plot_CIE1976UCS
      • Signature: spds_chromaticity_diagram_plot_CIE1976UCS(spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True, chromaticity_diagram_callable_CIE1976UCS=(chromaticity_diagram_plot_CIE1976UCS), **kwargs)
    • colour.plotting.RGB_colourspaces_CIE_1931_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_colourspaces_chromaticity_diagram_plot_CIE1931
      • Signature: RGB_colourspaces_chromaticity_diagram_plot_CIE1931(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', chromaticity_diagram_callable_CIE1931=(chromaticity_diagram_plot_CIE1931), **kwargs)
    • colour.plotting.RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_colourspaces_chromaticity_diagram_plot_CIE1960UCS
      • Signature: RGB_colourspaces_chromaticity_diagram_plot_CIE1960UCS(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', chromaticity_diagram_callable_CIE1960UCS=(chromaticity_diagram_plot_CIE1960UCS), **kwargs)
    • colour.plotting.RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_colourspaces_chromaticity_diagram_plot_CIE1976UCS
      • Signature: RGB_colourspaces_chromaticity_diagram_plot_CIE1976UCS(colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer', chromaticity_diagram_callable_CIE1976UCS=(chromaticity_diagram_plot_CIE1976UCS), **kwargs)
    • colour.plotting.RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1931
      • Signature: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1931(RGB, colourspace='sRGB', chromaticity_diagram_callable_CIE1931=(RGB_colourspaces_CIE_1931_chromaticity_diagram_plot), **kwargs)
    • colour.plotting.RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1960UCS
      • Signature: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1960UCS(RGB, colourspace='sRGB', chromaticity_diagram_callable_CIE1960UCS=(RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot), **kwargs)
    • colour.plotting.RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1976UCS
      • Signature: RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1976UCS(RGB, colourspace='sRGB', chromaticity_diagram_callable_CIE1976UCS=(RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot), **kwargs)
    • colour.plotting.planckian_locus_CIE_1931_chromaticity_diagram_plot: (@KelSolaar)
      • Name: planckian_locus_chromaticity_diagram_plot_CIE1931
      • Signature: planckian_locus_chromaticity_diagram_plot_CIE1931(illuminants=None, chromaticity_diagram_callable_CIE1931=(chromaticity_diagram_plot_CIE1931), **kwargs)
    • colour.plotting.planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot: (@KelSolaar)
      • Name: planckian_locus_chromaticity_diagram_plot_CIE1960UCS
      • Signature: planckian_locus_chromaticity_diagram_plot_CIE1960UCS(illuminants=None, chromaticity_diagram_callable_CIE1960UCS=(chromaticity_diagram_plot_CIE1960UCS), **kwargs)

    colour.utilities

    • colour.ArbitraryPrecisionMapping: (@KelSolaar)
      • Remove