Skip to content

Commit

Permalink
Implement support for "PLASA ANSI E1.54" colourspace.
Browse files Browse the repository at this point in the history
Closes #1192.
  • Loading branch information
KelSolaar committed Aug 19, 2023
1 parent de00593 commit 8c090f9
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 1 deletion.
13 changes: 13 additions & 0 deletions BIBLIOGRAPHY.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2975,6 +2975,12 @@ @misc{Ottosson2020
urldate = {2020-12-24},
howpublished = {https://bottosson.github.io/posts/oklab/},
}
@misc{PLASANorthAmerica2015,
title = {{{ANSI E1}}.54 - 2015 - {{PLASA Standard}} for
{{Color Communication}} in {{Entertainment Lighting}}},
author = {{PLASA North America}},
year = 2015,
}
@misc{Panasonic2014a,
title = {{{VARICAM V-Log}}/{{V-Gamut}}},
author = {{Panasonic}},
Expand Down Expand Up @@ -3931,6 +3937,13 @@ @misc{Wikipedia2015
urldate = {2021-04-04},
howpublished = {https://en.wikipedia.org/wiki/HCL\_color\_space},
}
@misc{Wood2014,
title = {Making the Same Color Twice - {{A}} Proposed
{{PLASA}} Standard for Color Communication},
author = {Wood, Mike},
year = 2014,
urldate = {2023-08-13},
}
@article{Wyszecki1963b,
title = {Proposal for a {{New Color-Difference Formula}}},
author = {Wyszecki, G{\"u}nter},
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ RGB Colourspaces
'NTSC (1953)',
'NTSC (1987)',
'P3-D65',
'PLASA ANSI E1.54',
'Pal/Secam',
'ProPhoto RGB',
'Protune Native',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- Blackmagic Wide Gamut
- DCI-P3
- ICC D50
- PLASA ANSI E1.54
Illuminants whose chromaticity coordinates are defined at 15 decimal places
have been computed according to practise *ASTM E308-15* method.
Expand Down Expand Up @@ -65,6 +66,9 @@
- :cite:`InternationalColorConsortium2010` : International Color Consortium.
(2010). Specification ICC.1:2010 (Profile version 4.3.0.0) (pp. 1-130).
http://www.color.org/specification/ICC1v43_2010-12.pdf
- :cite:`PLASANorthAmerica2015` : PLASA North America. (2015). ANSI E1.54 -
2015 - PLASA Standard for Color Communication in Entertainment Lighting.
https://webstore.ansi.org/preview-pages/ESTA/preview_ANSI+E1.54-2015.pdf
- :cite:`TheAcademyofMotionPictureArtsandSciences2014q` : The Academy of
Motion Picture Arts and Sciences, Science and Technology Council, & Academy
Color Encoding System (ACES) Project Subcommittee. (2014). Technical
Expand Down Expand Up @@ -97,6 +101,7 @@
"CCS_ILLUMINANTS_DCI_STANDARD_OBSERVER_2_DEGREE_CIE1931",
"CCS_ILLUMINANTS_ICC_STANDARD_OBSERVER_2_DEGREE_CIE1931",
"CCS_ILLUMINANTS_ISO_STANDARD_OBSERVER_2_DEGREE_CIE1931",
"CCS_ILLUMINANTS_PLASA_STANDARD_OBSERVER_2_DEGREE_CIE1931",
"CCS_ILLUMINANTS_CIE_STANDARD_OBSERVER_10_DEGREE_CIE1964",
"CCS_ILLUMINANTS_ISO_STANDARD_OBSERVER_10_DEGREE_CIE1964",
"CCS_ILLUMINANTS",
Expand Down Expand Up @@ -267,6 +272,18 @@
:cite:`InternationalOrganizationforStandardization2002`
"""

CCS_ILLUMINANTS_PLASA_STANDARD_OBSERVER_2_DEGREE_CIE1931: (
CanonicalMapping
) = CanonicalMapping({"PLASA ANSI E1.54": np.array([0.4254, 0.4044])})
"""
Chromaticity coordinates of the *PLASA* illuminants for the
*CIE 1931 2 Degree Standard Observer*.
References
----------
:cite:`PLASANorthAmerica2015`
"""

CCS_ILLUMINANTS_CIE_STANDARD_OBSERVER_10_DEGREE_CIE1964: (
CanonicalMapping
) = CanonicalMapping(
Expand Down Expand Up @@ -424,7 +441,7 @@
----------
:cite:`CIETC1-482004h`, :cite:`DigitalCinemaInitiatives2007b`,
:cite:`InternationalOrganizationforStandardization2002`,
:cite:`InternationalColorConsortium2010`,
:cite:`InternationalColorConsortium2010`, :cite:`PLASANorthAmerica2015`
:cite:`TheAcademyofMotionPictureArtsandSciences2014q`, :cite:`Wikipedia2006a`
Aliases:
Expand Down Expand Up @@ -462,3 +479,7 @@
CCS_ILLUMINANTS["CIE 1964 10 Degree Standard Observer"].update(
CCS_ILLUMINANTS_ISO_STANDARD_OBSERVER_10_DEGREE_CIE1964
)

CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"].update(
CCS_ILLUMINANTS_PLASA_STANDARD_OBSERVER_2_DEGREE_CIE1931
)
2 changes: 2 additions & 0 deletions colour/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@
RGB_COLOURSPACE_RIMM_RGB,
RGB_COLOURSPACE_ERIMM_RGB,
RGB_COLOURSPACE_PROPHOTO_RGB,
RGB_COLOURSPACE_PLASA_ANSI_E154,
RGB_COLOURSPACE_RUSSELL_RGB,
RGB_COLOURSPACE_SHARP_RGB,
RGB_COLOURSPACE_SMPTE_240M,
Expand Down Expand Up @@ -726,6 +727,7 @@
"RGB_COLOURSPACE_RIMM_RGB",
"RGB_COLOURSPACE_ERIMM_RGB",
"RGB_COLOURSPACE_PROPHOTO_RGB",
"RGB_COLOURSPACE_PLASA_ANSI_E154",
"RGB_COLOURSPACE_RUSSELL_RGB",
"RGB_COLOURSPACE_SHARP_RGB",
"RGB_COLOURSPACE_SMPTE_240M",
Expand Down
2 changes: 2 additions & 0 deletions colour/models/rgb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
RGB_COLOURSPACE_RIMM_RGB,
RGB_COLOURSPACE_ERIMM_RGB,
RGB_COLOURSPACE_PROPHOTO_RGB,
RGB_COLOURSPACE_PLASA_ANSI_E154,
RGB_COLOURSPACE_RUSSELL_RGB,
RGB_COLOURSPACE_SHARP_RGB,
RGB_COLOURSPACE_SMPTE_240M,
Expand Down Expand Up @@ -481,6 +482,7 @@
"RGB_COLOURSPACE_RIMM_RGB",
"RGB_COLOURSPACE_ERIMM_RGB",
"RGB_COLOURSPACE_PROPHOTO_RGB",
"RGB_COLOURSPACE_PLASA_ANSI_E154",
"RGB_COLOURSPACE_RUSSELL_RGB",
"RGB_COLOURSPACE_SHARP_RGB",
"RGB_COLOURSPACE_SMPTE_240M",
Expand Down
2 changes: 2 additions & 0 deletions colour/models/rgb/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
RGB_COLOURSPACE_ERIMM_RGB,
RGB_COLOURSPACE_PROPHOTO_RGB,
)
from .plasa_ansi_e154 import RGB_COLOURSPACE_PLASA_ANSI_E154
from .russell_rgb import RGB_COLOURSPACE_RUSSELL_RGB
from .sharp import RGB_COLOURSPACE_SHARP_RGB
from .smpte_240m import RGB_COLOURSPACE_SMPTE_240M
Expand Down Expand Up @@ -157,6 +158,7 @@
"RGB_COLOURSPACE_RIMM_RGB",
"RGB_COLOURSPACE_ERIMM_RGB",
"RGB_COLOURSPACE_PROPHOTO_RGB",
"RGB_COLOURSPACE_PLASA_ANSI_E154",
"RGB_COLOURSPACE_RUSSELL_RGB",
"RGB_COLOURSPACE_SHARP_RGB",
"RGB_COLOURSPACE_SMPTE_240M",
Expand Down
99 changes: 99 additions & 0 deletions colour/models/rgb/datasets/plasa_ansi_e154.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
"""
PLASA ANSI E1.54 Colourspace
============================
Defines the *PLASA ANSI E1.54* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_PLASA_ANSI_E154`.
References
----------
- :cite:`Wood2014` : Wood, M. (2014). Making the same color twice - A
proposed PLASA standard for color communication. Retrieved August 13, 2023,
from https://www.mikewoodconsulting.com/articles/\
Protocol%20Fall%202014%20-%20Color%20Communication.pdf
- :cite:`PLASANorthAmerica2015` : PLASA North America. (2015). ANSI E1.54 -
2015 - PLASA Standard for Color Communication in Entertainment Lighting.
https://webstore.ansi.org/preview-pages/ESTA/preview_ANSI+E1.54-2015.pdf
"""

from __future__ import annotations

import numpy as np

from colour.colorimetry import CCS_ILLUMINANTS
from colour.hints import NDArrayFloat
from colour.models.rgb import (
RGB_Colourspace,
linear_function,
normalised_primary_matrix,
)
from colour.models.rgb.datasets import RGB_COLOURSPACE_RIMM_RGB

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"
__maintainer__ = "Colour Developers"
__email__ = "[email protected]"
__status__ = "Production"

__all__ = [
"PRIMARIES_PLASA_ANSI_E154",
"WHITEPOINT_NAME_PLASA_ANSI_E154",
"CCS_WHITEPOINT_PLASA_ANSI_E154",
"MATRIX_PLASA_ANSI_E154_TO_XYZ",
"MATRIX_XYZ_TO_PLASA_ANSI_E154",
"RGB_COLOURSPACE_PLASA_ANSI_E154",
]

PRIMARIES_PLASA_ANSI_E154: NDArrayFloat = RGB_COLOURSPACE_RIMM_RGB.primaries
"""*PLASA ANSI E1.54* colourspace primaries."""

WHITEPOINT_NAME_PLASA_ANSI_E154: str = "PLASA ANSI E1.54"
"""*PLASA ANSI E1.54* colourspace whitepoint name."""

CCS_WHITEPOINT_PLASA_ANSI_E154: NDArrayFloat = CCS_ILLUMINANTS[
"CIE 1931 2 Degree Standard Observer"
][WHITEPOINT_NAME_PLASA_ANSI_E154]
"""*PLASA ANSI E1.54* colourspace whitepoint chromaticity coordinates."""

MATRIX_PLASA_ANSI_E154_TO_XYZ: NDArrayFloat = normalised_primary_matrix(
PRIMARIES_PLASA_ANSI_E154, CCS_WHITEPOINT_PLASA_ANSI_E154
)
"""*PLASA ANSI E1.54* colourspace to *CIE XYZ* tristimulus values matrix."""

MATRIX_XYZ_TO_PLASA_ANSI_E154: NDArrayFloat = np.linalg.inv(
MATRIX_PLASA_ANSI_E154_TO_XYZ
)
"""*CIE XYZ* tristimulus values to *PLASA ANSI E1.54* colourspace matrix."""

RGB_COLOURSPACE_PLASA_ANSI_E154: RGB_Colourspace = RGB_Colourspace(
"PLASA ANSI E1.54",
PRIMARIES_PLASA_ANSI_E154,
CCS_WHITEPOINT_PLASA_ANSI_E154,
WHITEPOINT_NAME_PLASA_ANSI_E154,
MATRIX_PLASA_ANSI_E154_TO_XYZ,
MATRIX_XYZ_TO_PLASA_ANSI_E154,
linear_function,
linear_function,
)
RGB_COLOURSPACE_PLASA_ANSI_E154.__doc__ = """
*PLASA ANSI E1.54* colourspace.
Notes
-----
The `[0.4254, 0.4044]` whitepoint chromaticity coordinates are described by
:cite:`Wood2014` to be that of a "2° Planckian source at 3,200 K". However, we
can show that the chromaticity coordinates should be `[0.4234, 0.3990]`::
sd = colour.sd_blackbody(3200)
colour.XYZ_to_xy(
colour.sd_to_XYZ(
sd, colour.MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]
)
).round(4)
References
----------
:cite:`PLASANorthAmerica2015`, :cite:`Wood2014`
"""
1 change: 1 addition & 0 deletions docs/colour.models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ RGB Colourspaces
RGB_COLOURSPACE_RIMM_RGB
RGB_COLOURSPACE_ERIMM_RGB
RGB_COLOURSPACE_PROPHOTO_RGB
RGB_COLOURSPACE_PLASA_ANSI_E154
RGB_COLOURSPACE_RUSSELL_RGB
RGB_COLOURSPACE_SMPTE_240M
RGB_COLOURSPACE_SMPTE_C
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ RGB Colourspaces
'NTSC (1953)',
'NTSC (1987)',
'P3-D65',
'PLASA ANSI E1.54',
'Pal/Secam',
'ProPhoto RGB',
'Protune Native',
Expand Down

0 comments on commit 8c090f9

Please sign in to comment.