Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Last active June 15, 2024 08:53
Show Gist options
  • Save KelSolaar/4a6ebe9ec3d389f0934b154fec8df51d to your computer and use it in GitHub Desktop.
Save KelSolaar/4a6ebe9ec3d389f0934b154fec8df51d to your computer and use it in GitHub Desktop.
Colour 0.4.5 - Current Changes

Colour 0.4.5 - Alpha Milestone

Features

Environment (#1239, @KelSolaar)

It is now possible to create a ~/.colour-science/colour-science.jenv JSON file from which Colour will load environment variables from:

{
  "COLOUR_SCIENCE__COLOUR__SHOW_WARNINGS_WITH_TRACEBACK": 1
}

The following new environment variables are now supported:

  • COLOUR_SCIENCE__FILTER_RUNTIME_WARNINGS: Filter Colour runtime warnings.
  • COLOUR_SCIENCE__FILTER_USAGE_WARNINGS: Filter Colour usage warnings.
  • COLOUR_SCIENCE__FILTER_COLOUR_WARNINGS: Filter Colour warnings, this also filters Colour usage and runtime warnings.
  • COLOUR_SCIENCE__FILTER_PYTHON_WARNINGS: Filter Python warnings.

Input and Output

  • The definitions reading from and writing to files now support the pathlib.Path type. (#ff4fe99337cc3ba0e4d1b9071bc22afb4db3c7f5, @KelSolaar)

colour.adaptation

  • Implement support for vK20 chromatic adaptation transform with colour.adaptation.matrix_chromatic_adaptation_vk20 and colour.adaptation.chromatic_adaptation_vK20 definitions. (#1131, @KelSolaar)

colour.characterisation

  • Add the ColorChecker SG chromaticity coordinates with the colour.CCS_COLOURCHECKERS["ColorCheckerSG - Before November 2014"] and colour.CCS_COLOURCHECKERS["ColorCheckerSG - After November 2014"] attribute keys.

image image

colour.colorimetry

  • PR: Use shape if passed, to also reshape the colour.continuous.AbstractContinuousSignal sub-classes in colour.colorimetry.sd_to_XYZ_integration definition. (#1250, @KelSolaar)

colour.models

  • Programmatically add polar conversions with the following definitions: (#1183, #1272, @KelSolaar)

  • colour.Lab_to_LCHab *

  • colour.LCHab_to_Lab *

  • colour.Luv_to_LCHuv *

  • colour.LCHuv_to_Luv *

  • colour.hdr_CIELab_to_hdr_CIELCHab

  • colour.hdr_CIELCHab_to_hdr_CIELab

  • colour.Hunter_Lab_to_Hunter_LCHab

  • colour.Hunter_LCHab_to_Hunter_Lab

  • colour.Hunter_Rdab_to_Hunter_RdCHab

  • colour.Hunter_RdCHab_to_Hunter_Rdab

  • colour.ICaCb_to_ICHab

  • colour.ICHab_to_ICaCb

  • colour.ICtCp_to_ICHtp

  • colour.ICHtp_to_ICtCp

  • colour.IgPgTg_to_IgCHpt

  • colour.IgCHpt_to_IgPgTg

  • colour.IPT_to_ICH

  • colour.ICH_to_IPT

  • colour.Izazbz_to_IzCHab

  • colour.IzCHab_to_Izazbz

  • colour.Jzazbz_to_JzCHab

  • colour.JzCHab_to_Jzazbz

  • colour.hdr_IPT_to_hdr_ICH

  • colour.hdr_ICH_to_hdr_IPT

  • colour.Oklab_to_Oklch

  • colour.Oklch_to_Oklab

  • colour.ProLab_to_ProLCHab

  • colour.ProLCHab_to_ProLab

  • colour.IPT_Ragoo2021_to_ICH_Ragoo2021

  • colour.ICH_Ragoo2021_to_IPT_Ragoo2021

* Now programmatically defined.

Fixes

colour.colorimetry

  • Fix issue where colour.colorimetry.sds_and_msds_to_msds definition did not always copy the converted spectral distributions and was causing seemingly random unit tests failure. (#891d364f1dd167d8ed0be0cc0c9bc10bd06281b2, @KelSolaar)

colour.models

  • Change Canon Cinema Gamut whitepoint to D55. (#c25934eabc39152b0182daca063561ed218a4068, @MrLixm, @KelSolaar)

colour.utilities

  • Ensure that caches are systematically cleared when changing dtype: It was causing seemingly random unit tests failure. (#8faeb095dc0706f21ffe5adaf1861010b3771e71, @KelSolaar)

Changes

colour.algebra

Object Name Author
colour.algebra.vector_dot vecmul @KelSolaar

colour.plotting

Object Signature Author
colour.plotting.plot_RGB_colourspace_section plot_RGB_colourspace_section(colourspace: (RGB_Colourspace | LiteralRGBColourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str]) ,model: LiteralColourspaceModel | str = "CIE xyY", axis: Literal["+z", "+x", "+y"] | str = "+z", origin: float = 0.5, normalise: bool = True,size: float = 1.0, show_section_colours: bool = True, show_section_contour: bool = True, segments: int = 64, **kwargs: Any) -> Tuple[Figure, Axes] @KelSolaar
@JGoldstone
Copy link

from colour/models/rgb/datasets/__init__.py there's this snippet:

# ----------------------------------------------------------------------------#
# ---                API Changes and Deprecation Management                ---#
# ----------------------------------------------------------------------------#
# v0.4.2
def _alexa_wide_gamut():
    usage_warning(
        'The "ALEXA Wide Gamut" RGB colourspace has been renamed to '
        '"ARRI Wide Gamut 3" for consistency with "ARRI" new naming '
        "convention."
    )

    return RGB_COLOURSPACE_ARRI_WIDE_GAMUT_3

What were you trying to do there with the "ARRI" in quotes like that (fourth-from-last world in warning)? If it's the business entity that you meant, then it would be "ARRI's", i.e. the possessive, without the surrounding double-quotes. Or was it something else you meant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment