Colour 0.3.11
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 existingy
variable values ordefault
if outside tolerances. (@KelSolaar) - Implement
colour.kernel_nearest_neighbour
,colour.kernel_linear
,colour.kernel_sinc
,colour.kernel_lanczos
, andcolour.kernel_cardinal_spline
interpolating kernel definitions for use with the newcolour.KernelInterpolator
class performing interpolation of a 1-D function. (@KelSolaar)
colour.appearance
- Implement support for CAM16 colour appearance model with
colour.XYZ_to_CAM16
andcolour.CAM16_to_XYZ
definitions. (@KelSolaar)
colour.continuous
- Implement
colour.continuous.AbstractContinuousFunction
,colour.continuous.Signal
andcolour.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
andcolour.models.eotf_SMPTE240M
definitions. (@KelSolaar) - Implement
colour.oetf_reverse
andcolour.eotf_reverse
definitions andcolour.OETFS_REVERSE
andcolour.EOTFS_REVERSE
attributes defining relevant reverse OETF and EOTF conversions. (@KelSolaar, @nick-shaw, @KevinJW) - Implement
colour.legal_to_full
andcolour.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__
andcolour.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 returnsa
array closest element indexes to referenceb
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
andcolour.models.log_decoding_CanonLog3
definitions implementation was slightly incorrect, they have been reimplemented correctly. (@nick-shaw, @KelSolaar)colour.models.log_encoding_SLog2
andcolour.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
- As a consequence correlated colour temperature computations using Ohno (2013) method are slightly affected:
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')
- Signature:
colour.colorimetry
-
: (@KelSolaar)colour.DEFAULT_WAVELENGTH_DECIMALS
- Remove
-
: (@KelSolaar)colour.SpectralMapping
- Remove
-
colour.SpectralPowerDistribution
: (@KelSolaar)- Signature:
__init__(self, data=None, domain=None, **kwargs)
- Signature:
-
: (@KelSolaar)colour.SpectralPowerDistribution.data
- Remove
-
colour.SpectralPowerDistribution.title
: (@KelSolaar)- Name:
SpectralPowerDistribution.strict_name
- Name:
-
: (@KelSolaar)colour.SpectralPowerDistribution.items
- Remove
-
: (@KelSolaar)colour.SpectralPowerDistribution.__iter__
- Remove
-
: (@KelSolaar)colour.SpectralPowerDistribution.get
- Remove
-
colour.SpectralPowerDistribution.extrapolate
: (@KelSolaar)- Signature:
extrapolate(self, shape, extrapolator=None, extrapolator_args=None)
- Signature:
-
colour.SpectralPowerDistribution.interpolate
: (@KelSolaar)- Signature:
interpolate(self, shape, interpolator=None, interpolator_args=None)
- Signature:
-
colour.SpectralPowerDistribution.align
: (@KelSolaar)- Signature:
align(self, shape, interpolator=None, interpolator_args=None, extrapolator=None, extrapolator_args=None)
- Signature:
-
colour.SpectralPowerDistribution.trim_wavelengths
: (@KelSolaar)- Name:
SpectralPowerDistribution.trim
- Name:
-
: (@KelSolaar)colour.SpectralPowerDistribution.zeros
- Remove
-
colour.SpectralPowerDistribution.clone
: (@KelSolaar)- Name:
SpectralPowerDistribution.copy
- Name:
-
colour.MultiSpectralPowerDistribution
: (@KelSolaar)- Signature:
__init__(self, data=None, domain=None, labels=None, **kwargs)
- Signature:
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.mapping
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.data
- Remove
-
colour.MultiSpectralPowerDistribution.title
: (@KelSolaar)- Name:
MultiSpectralPowerDistribution.strict_name
- Name:
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.x
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.y
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.z
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.items
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.__iter__
- Remove
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.get
- Remove
-
colour.MultiSpectralPowerDistribution.extrapolate
: (@KelSolaar)- Signature:
extrapolate(self, shape, extrapolator=None, extrapolator_args=None)
- Signature:
-
colour.MultiSpectralPowerDistribution.interpolate
: (@KelSolaar)- Signature:
interpolate(self, shape, interpolator=None, interpolator_args=None)
- Signature:
-
colour.MultiSpectralPowerDistribution.align
: (@KelSolaar)- Signature:
align(self, shape, interpolator=None, interpolator_args=None, extrapolator=None, extrapolator_args=None)
- Signature:
-
colour.MultiSpectralPowerDistribution.trim_wavelengths
: (@KelSolaar)- Name:
MultiSpectralPowerDistribution.trim
- Name:
-
: (@KelSolaar)colour.MultiSpectralPowerDistribution.zeros
- Remove
-
colour.MultiSpectralPowerDistribution.clone
: (@KelSolaar)- Name:
MultiSpectralPowerDistribution.copy
- Name:
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).
- Signature:
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).
- Signature:
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).
- Signature:
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).
- Signature:
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).
- Signature:
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).
- Signature:
colour.models.log_encoding_VLog
: (@nick-shaw, @KelSolaar)- Signature:
log_encoding_VLog(L_in, bit_depth=10, out_legal=True, in_reflection=True)
- Signature:
colour.models.log_decoding_VLog
: (@nick-shaw, @KelSolaar)- Signature:
log_decoding_VLog(V_out, bit_depth=10, in_legal=True, out_reflection=True)
- Signature:
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.
- Signature:
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.
- Signature:
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.
- Signature:
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.
- Signature:
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.
- Signature:
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.
- Signature:
colour.models.eotf_ARIBSTDB67
: (@KelSolaar, @nick-shaw, @KevinJW)- Name:
oetf_reverse_ARIBSTDB67
- Name:
colour.models.eotf_BT709
: (@KelSolaar, @nick-shaw, @KevinJW)- Name:
oetf_reverse_BT709
- Name:
colour.models.oetf_BT1886
: (@KelSolaar, @nick-shaw, @KevinJW)- Name:
eotf_reverse_BT1886
- Name:
colour.models.eotf_sRGB
: (@KelSolaar, @nick-shaw, @KevinJW)- Name:
oetf_reverse_sRGB
- Name:
colour.models.ALEXA_WIDE_GAMUT_RGB_COLOURSPACE
: (@KelSolaar)- Name:
ALEXA_WIDE_GAMUT_COLOURSPACE
- Name:
colour.models.NTSC_RGB_COLOURSPACE
: (@KelSolaar)- Name:
NTSC_COLOURSPACE
- Name:
colour.models.PAL_SECAM_RGB_COLOURSPACE
: (@KelSolaar)- Name:
PAL_SECAM_COLOURSPACE
- Name:
colour.models.REC_709_COLOURSPACE
: (@KelSolaar, @nick-shaw, @KevinJW, @meshula)- Name:
BT709_COLOURSPACE
- Name:
colour.models.REC_2020_COLOURSPACE
: (@KelSolaar, @nick-shaw, @KevinJW, @meshula)- Name:
BT2020_COLOURSPACE
- Name:
colour.models.SMPTE_C_RGB_COLOURSPACE
: (@KelSolaar)- Name:
SMPTE_240M_COLOURSPACE
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
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)
- Name:
colour.utilities
: (@KelSolaar)colour.ArbitraryPrecisionMapping
- Remove