Skip to content

Commit

Permalink
Implement support for "Kirk (2019)" "Yrg" colourspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed May 14, 2023
1 parent 996bb2f commit 1df6010
Show file tree
Hide file tree
Showing 11 changed files with 4,252 additions and 2,893 deletions.
6,481 changes: 3,588 additions & 2,893 deletions BIBLIOGRAPHY.bib

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,14 @@ Ragoo and Farup (2021) Optimised IPT Colourspace
>>> colour.XYZ_to_IPT_Ragoo2021([0.20654008, 0.12197225, 0.05136952])
array([ 0.42248243, 0.2910514 , 0.20410663])
Yrg Colourspace - Kirk (2019)
*****************************
.. code-block:: python
>>> colour.XYZ_to_Yrg([0.20654008, 0.12197225, 0.05136952])
array([ 0.13137801, 0.49037645, 0.37777388])
Y'CbCr Colour Encoding
**********************
Expand Down
4 changes: 4 additions & 0 deletions colour/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@
XYZ_to_sRGB,
XYZ_to_xy,
XYZ_to_xyY,
XYZ_to_Yrg,
YCbCr_to_RGB,
YCoCg_to_RGB,
YcCbcCrc_to_RGB,
Yrg_to_XYZ,
cctf_decoding,
cctf_encoding,
chromatically_adapted_primaries,
Expand Down Expand Up @@ -763,9 +765,11 @@ def __getattr__(self, attribute) -> Any:
"XYZ_to_sRGB",
"XYZ_to_xy",
"XYZ_to_xyY",
"XYZ_to_Yrg",
"YCbCr_to_RGB",
"YCoCg_to_RGB",
"YcCbcCrc_to_RGB",
"Yrg_to_XYZ",
"cctf_decoding",
"cctf_encoding",
"chromatically_adapted_primaries",
Expand Down
4 changes: 4 additions & 0 deletions colour/graph/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@
XYZ_to_sRGB,
XYZ_to_xy,
XYZ_to_xyY,
XYZ_to_Yrg,
YCbCr_to_RGB,
YCoCg_to_RGB,
YcCbcCrc_to_RGB,
Yrg_to_XYZ,
cctf_decoding,
cctf_encoding,
hdr_CIELab_to_XYZ,
Expand Down Expand Up @@ -753,6 +755,8 @@ def mired_to_CCT_D_uv(mired: ArrayLike) -> NDArrayFloat:
("Oklab", "CIE XYZ", Oklab_to_XYZ),
("CIE XYZ", "ProLab", XYZ_to_ProLab),
("ProLab", "CIE XYZ", ProLab_to_XYZ),
("CIE XYZ", "Yrg", XYZ_to_Yrg),
("Yrg", "CIE XYZ", Yrg_to_XYZ),
# RGB Colour Models
(
"CIE XYZ",
Expand Down
7 changes: 7 additions & 0 deletions colour/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
from .osa_ucs import XYZ_to_OSA_UCS, OSA_UCS_to_XYZ
from .prolab import XYZ_to_ProLab, ProLab_to_XYZ
from .ragoo2021 import XYZ_to_IPT_Ragoo2021, IPT_Ragoo2021_to_XYZ
from .yrg import LMS_to_Yrg, Yrg_to_LMS, XYZ_to_Yrg, Yrg_to_XYZ
from .datasets import (
DATA_MACADAM_1942_ELLIPSES,
CCS_ILLUMINANT_POINTER_GAMUT,
Expand Down Expand Up @@ -483,6 +484,12 @@
"XYZ_to_IPT_Ragoo2021",
"IPT_Ragoo2021_to_XYZ",
]
__all__ += [
"LMS_to_Yrg",
"Yrg_to_LMS",
"XYZ_to_Yrg",
"Yrg_to_XYZ",
]
__all__ += [
"HDR_IPT_METHODS",
"XYZ_to_hdr_IPT",
Expand Down
3 changes: 3 additions & 0 deletions colour/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"Oklab",
"hdr-CIELAB",
"hdr-IPT",
"Yrg",
)
if is_documentation_building(): # pragma: no cover
COLOURSPACE_MODELS = DocstringTuple(COLOURSPACE_MODELS)
Expand Down Expand Up @@ -117,6 +118,7 @@
"Oklab": ("$L$", "$a$", "$b$"),
"hdr-CIELAB": ("L hdr", "a hdr", "b hdr"),
"hdr-IPT": ("I hdr", "P hdr", "T hdr"),
"Yrg": ("Y", "r", "g"),
}
)
"""Colourspace models labels mapping."""
Expand Down Expand Up @@ -152,6 +154,7 @@
"Oklab": np.array([1, 1, 1]),
"hdr-CIELAB": np.array([100, 100, 100]),
"hdr-IPT": np.array([100, 100, 100]),
"Yrg": np.array([1, 1, 1]),
}
)
"""Colourspace models domain-range scale **'1'** to **'Reference'** mapping."""
Expand Down
Loading

0 comments on commit 1df6010

Please sign in to comment.