diff --git a/.style.yapf b/.style.yapf
new file mode 100644
index 0000000000..45e56e93f0
--- /dev/null
+++ b/.style.yapf
@@ -0,0 +1,180 @@
+[style]
+# Align closing bracket with visual indentation.
+align_closing_bracket_with_visual_indent=True
+
+# Allow dictionary keys to exist on multiple lines. For example:
+#
+# x = {
+# ('this is the first element of a tuple',
+# 'this is the second element of a tuple'):
+# value,
+# }
+allow_multiline_dictionary_keys=False
+
+# Allow lambdas to be formatted on more than one line.
+allow_multiline_lambdas=False
+
+# Insert a blank line before a class-level docstring.
+blank_line_before_class_docstring=False
+
+# Insert a blank line before a 'def' or 'class' immediately nested
+# within another 'def' or 'class'. For example:
+#
+# class Foo:
+# # <------ this blank line
+# def method():
+# ...
+blank_line_before_nested_class_or_def=False
+
+# Do not split consecutive brackets. Only relevant when
+# dedent_closing_brackets is set. For example:
+#
+# call_func_that_takes_a_dict(
+# {
+# 'key1': 'value1',
+# 'key2': 'value2',
+# }
+# )
+#
+# would reformat to:
+#
+# call_func_that_takes_a_dict({
+# 'key1': 'value1',
+# 'key2': 'value2',
+# })
+coalesce_brackets=False
+
+# The column limit.
+column_limit=79
+
+# Indent width used for line continuations.
+continuation_indent_width=4
+
+# Put closing brackets on a separate line, dedented, if the bracketed
+# expression can't fit in a single line. Applies to all kinds of brackets,
+# including function definitions and calls. For example:
+#
+# config = {
+# 'key1': 'value1',
+# 'key2': 'value2',
+# } # <--- this bracket is dedented and on a separate line
+#
+# time_series = self.remote_client.query_entity_counters(
+# entity='dev3246.region1',
+# key='dns.query_latency_tcp',
+# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
+# start_ts=now()-timedelta(days=3),
+# end_ts=now(),
+# ) # <--- this bracket is dedented and on a separate line
+dedent_closing_brackets=False
+
+# Place each dictionary entry onto its own line.
+each_dict_entry_on_separate_line=True
+
+# The regex for an i18n comment. The presence of this comment stops
+# reformatting of that line, because the comments are required to be
+# next to the string they translate.
+i18n_comment=
+
+# The i18n function call names. The presence of this function stops
+# reformattting on that line, because the string it has cannot be moved
+# away from the i18n comment.
+i18n_function_call=
+
+# Indent the dictionary value if it cannot fit on the same line as the
+# dictionary key. For example:
+#
+# config = {
+# 'key1':
+# 'value1',
+# 'key2': value1 +
+# value2,
+# }
+indent_dictionary_value=True
+
+# The number of columns to use for indentation.
+indent_width=4
+
+# Join short lines into one line. E.g., single line 'if' statements.
+join_multiple_lines=True
+
+# Use spaces around default or named assigns.
+spaces_around_default_or_named_assign=False
+
+# Use spaces around the power operator.
+spaces_around_power_operator=True
+
+# The number of spaces required before a trailing comment.
+spaces_before_comment=2
+
+# Insert a space between the ending comma and closing bracket of a list,
+# etc.
+space_between_ending_comma_and_closing_bracket=True
+
+# Split before arguments if the argument list is terminated by a
+# comma.
+split_arguments_when_comma_terminated=False
+
+# Set to True to prefer splitting before '&', '|' or '^' rather than
+# after.
+split_before_bitwise_operator=False
+
+# Split before a dictionary or set generator (comp_for). For example, note
+# the split before the 'for':
+#
+# foo = {
+# variable: 'Hello world, have a nice day!'
+# for variable in bar if variable != 42
+# }
+split_before_dict_set_generator=True
+
+# If an argument / parameter list is going to be split, then split before
+# the first argument.
+split_before_first_argument=False
+
+# Set to True to prefer splitting before 'and' or 'or' rather than
+# after.
+split_before_logical_operator=False
+
+# Split named assignments onto individual lines.
+split_before_named_assigns=True
+
+# The penalty for splitting right after the opening bracket.
+split_penalty_after_opening_bracket=30
+
+# The penalty for splitting the line after a unary operator.
+split_penalty_after_unary_operator=10000
+
+# The penalty for splitting right before an if expression.
+split_penalty_before_if_expr=0
+
+# The penalty of splitting the line around the '&', '|', and '^'
+# operators.
+split_penalty_bitwise_operator=300
+
+# The penalty for characters over the column limit.
+split_penalty_excess_character=4500
+
+# The penalty incurred by adding a line split to the unwrapped line. The
+# more line splits added the higher the penalty.
+split_penalty_for_added_line_split=30
+
+# The penalty of splitting a list of "import as" names. For example:
+#
+# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
+# long_argument_2,
+# long_argument_3)
+#
+# would reformat to something like:
+#
+# from a_very_long_or_indented_module_name_yada_yad import (
+# long_argument_1, long_argument_2, long_argument_3)
+split_penalty_import_names=0
+
+# The penalty of splitting the line around the 'and' and 'or'
+# operators.
+split_penalty_logical_operator=300
+
+# Use the Tab character for indentation.
+use_tabs=False
+
diff --git a/BIBLIOGRAPHY.bib b/BIBLIOGRAPHY.bib
index 4973582f8f..7e1a6050c0 100644
--- a/BIBLIOGRAPHY.bib
+++ b/BIBLIOGRAPHY.bib
@@ -1,187 +1,78 @@
-@incollection{InternationalTelecommunicationUnion1998,
-author = {{International Telecommunication Union}},
-booktitle = {Recommendation ITU-R BT.470-6},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/International Telecommunication Union - 1998 - CONVENTIONAL TELEVISION SYSTEMS.pdf:pdf},
-pages = {1--36},
-title = {{CONVENTIONAL TELEVISION SYSTEMS}},
-url = {http://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf},
-year = {1998}
-}
-@misc{mansencal_2015_17370,
-author = {Mansencal, Thomas and Mauderer, Michael and Parsons, Michael},
-doi = {10.5281/zenodo.17370},
-month = {may},
-title = {{Colour 0.3.5}},
-url = {http://dx.doi.org/10.5281/zenodo.17370},
-year = {2015}
-}
-@misc{TheAcademyofMotionPictureArtsandSciences2016,
-author = {{The Academy of Motion Picture Arts and Sciences}},
-title = {{Specification S-2016-001 - ACEScct, A Quasi-Logarithmic Encoding of ACES Data for use within Color Grading Systems}},
-url = {https://github.com/ampas/aces-dev/tree/v1.0.3/documents},
-urldate = {2016-10-10},
-year = {2016}
-}
-@misc{Centore,
-author = {Centore, Paul},
-title = {{Munsell Resources}},
-url = {http://www.99main.com/{~}centore/MunsellResources/MunsellResources.html},
-urldate = {2014-07-26}
-}
-@misc{Centore2014d,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
-}
-@misc{Wikipediao,
-author = {Wikipedia},
-title = {{Wide-gamut RGB color space}},
-url = {http://en.wikipedia.org/wiki/Wide-gamut{\_}RGB{\_}color{\_}space},
-urldate = {2014-04-13}
-}
-@article{Brill2008,
-abstract = {The color-appearance model CIECAM02 has several problems. which can result in mathematical instabilities, due to the position of the chromatic-adaptation primaries relative to the spectrum locus and to the presumed physiological cone primaries. To keep a corresponding (adapted) color within the positive gamut given by the chromatic adaptation primaries, the gamut must he within the cone primary octant. To contain adapted colors within the positive cone-primary octan, it suffices to truncate the action of adaptation at the boundary of that octant. Such modifications may be needed to avoid the mathematical problems in CIECAM02.},
-author = {Brill, Michael H. and S{\"{u}}sstrunk, Sabine},
-doi = {10.1002/col.20432},
-issn = {03612317},
-journal = {Color Research {\&} Application},
-keywords = {CIECAM02,Chromatic adaptation,Color appearance,Gamut,Model,Primary},
-month = {oct},
-number = {5},
-pages = {424--426},
-title = {{Repairing gamut problems in CIECAM02: A progress report}},
-url = {http://doi.wiley.com/10.1002/col.20432},
-volume = {33},
-year = {2008}
-}
-@misc{DigitalCinemaInitiatives2007,
-author = {{Digital Cinema Initiatives}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Digital Cinema Initiatives - 2007 - Digital Cinema System Specification - Version 1.1.pdf:pdf},
-title = {{Digital Cinema System Specification - Version 1.1}},
-url = {http://www.dcimovies.com/archives/spec{\_}v1{\_}1/DCI{\_}DCinema{\_}System{\_}Spec{\_}v1{\_}1.pdf},
-year = {2007}
-}
-@misc{Lindbloom2007a,
-author = {Lindbloom, Bruce},
-title = {{Spectral Power Distribution of a CIE D-Illuminant}},
-url = {http://www.brucelindbloom.com/Eqn{\_}DIlluminant.html},
-urldate = {2014-04-05},
-year = {2007}
+@misc{AdobeSystems2013a,
+author = {{Adobe Systems}},
+title = {{Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng{\_}sdk{\_}1{\_}3/dng{\_}sdk/source/dng{\_}temperature.cpp::dng{\_}temperature::xy{\_}coord}},
+url = {https://www.adobe.com/support/downloads/dng/dng{\_}sdk.html},
+year = {2013}
}
-@article{Fairchild1996,
-abstract = {The prediction of color appearance using the RLAB color space has been tested for a variety of viewing conditions and stimulus types. These tests have shown that RLAB performs well for complex stimuli and not-so-well for simple stimuli. This article reviews the various psychophysical results, interprets their differences, and describes evolutionary enhancements to the RLAB model that simplify it and improve its performance. (C) 1996 John Wiley {\&} Sons, Inc.},
-author = {Fairchild, Mark D.},
-doi = {10.1002/(SICI)1520-6378(199610)21:5<338::AID-COL3>3.0.CO;2-Z},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild - 1996 - Refinement of the RLAB color space.pdf:pdf},
-journal = {Color Research {\&} Application},
-keywords = {color appearance,color spaces,color-appearance models},
-number = {5},
-pages = {338--346},
-title = {{Refinement of the RLAB color space}},
-url = {http://doi.wiley.com/10.1002/(SICI)1520-6378(199610)21:5{\%}3C338::AID-COL3{\%}3E3.3.CO;2-Y https://ritdml.rit.edu/bitstream/handle/1850/7857/MFairchildArticle12-06-1998.pdf},
-volume = {21},
-year = {1996}
+@misc{AdobeSystems2013,
+author = {{Adobe Systems}},
+title = {{Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng{\_}sdk{\_}1{\_}3/dng{\_}sdk/source/dng{\_}temperature.cpp::dng{\_}temperature::Set{\_}xy{\_}coord}},
+url = {https://www.adobe.com/support/downloads/dng/dng{\_}sdk.html},
+year = {2013}
}
-@misc{Nattress2016,
-author = {Nattress, Graeme},
-title = {{Private Discussion with Shaw, N.}},
-year = {2016}
+@misc{AdobeSystems2005,
+author = {{Adobe Systems}},
+file = {::},
+number = {May},
+title = {{Adobe RGB (1998) Color Image Encoding}},
+url = {http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf},
+volume = {2704},
+year = {2005}
}
@misc{ANSI2003,
author = {ANSI},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/ANSI - 2003 - Specification of ROMM RGB.pdf:pdf},
+file = {::},
pages = {1--2},
title = {{Specification of ROMM RGB}},
url = {http://www.color.org/ROMMRGB.pdf},
year = {2003}
}
-@book{CIETC1-382005b,
-author = {{CIE TC 1-38}},
-booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
-chapter = {10},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-38 - 2005 - Table V. Values of the c-coefficients of Equ.s 6 and 7.pdf:pdf},
-isbn = {978-3-901-90641-1},
-pages = {19--20},
-title = {{EXTRAPOLATION}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
-year = {2005}
-}
-@article{Nayatani1995,
-author = {Nayatani, Yoshinobu and Sobagaki, Hiroaki and Yano, Kenjiro Hashimoto Tadashi},
-doi = {10.1002/col.5080200305},
-issn = {1520-6378},
-journal = {Color Research {\&} Application},
-keywords = {color-vision model,lightness dependency of chroma,nonlinear color-appearance model},
-number = {3},
-pages = {156--167},
-publisher = {Wiley Subscription Services, Inc., A Wiley Company},
-title = {{Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation}},
-url = {http://dx.doi.org/10.1002/col.5080200305},
-volume = {20},
-year = {1995}
-}
-@incollection{CIETC1-482004,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-chapter = {APPENDIX E},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop//CIE TC 1-48 - 2004 - APPENDIX E. INFORMATION ON THE USE OF PLANCK'S EQUATION FOR STANDARD AIR.pdf:pdf},
-isbn = {978-3-901-90633-6},
-pages = {77--82},
-title = {{APPENDIX E. INFORMATION ON THE USE OF PLANCK'S EQUATION FOR STANDARD AIR}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
-year = {2004}
-}
-@misc{EasyRGBe,
-author = {EasyRGB},
-title = {{CMY —{\textgreater} CMYK}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=13{\#}text13},
-urldate = {2014-05-18}
+@misc{ARRI2012,
+author = {ARRI},
+file = {::},
+number = {June},
+pages = {1--12},
+title = {{ALEXA - Log C Curve - Usage in VFX}},
+url = {http://www.arri.com/?eID=registration{\&}file{\_}uid=8026},
+year = {2012}
}
-@misc{Lindbloom2003,
-author = {Lindbloom, Bruce},
-title = {{Delta E (CIE 1976)}},
-url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE76.html},
-urldate = {2014-02-24},
-year = {2003}
+@article{AssociationofRadioIndustriesandBusinesses2015,
+author = {{Association of Radio Industries and Businesses}},
+file = {::},
+journal = {Arib Std-B67},
+title = {{Essential Parameter Values for the Extended Image Dynamic Range Television (EIDRTV) System for Programme Production}},
+url = {http://www.arib.or.jp/english/html/overview/std-b67.html},
+year = {2015}
}
-@misc{Wikipedias,
-author = {Wikipedia},
-title = {{Approximation}},
-url = {http://en.wikipedia.org/wiki/Color{\_}temperature{\#}Approximation},
-urldate = {2014-06-28}
+@misc{ASTMInternational,
+author = {{ASTM International}},
+doi = {10.1520/D1535-08E01},
+file = {::},
+keywords = {D1535,Munsell,Munsell color order system,Munsell notation,color},
+pages = {1--29},
+title = {{ASTM D1535-08e1 - Standard Practice for Specifying Color by the Munsell System}},
+url = {http://www.astm.org/Standards/D1535.htm http://www.scribd.com/doc/89648322/ASTM-D1535-08e1-Standard-Practice-for-Specifying-Color-by-the-Munsell-System http://www.astm.org/DATABASE.CART/HISTORICAL/D1535-89.htm https://law.resource.org/pub/us/cfr/ibr/003/a},
+urldate = {2014-09-25},
+year = {1989}
}
-@misc{Lindbloom2003f,
-author = {Lindbloom, Bruce},
-title = {{A Continuity Study of the CIE L* Function}},
-url = {http://brucelindbloom.com/LContinuity.html},
-urldate = {2014-02-24},
-year = {2003}
+@article{ASTMInternational2011,
+abstract = {This standard is issued under the fixed designation E2022; the number immediately following the designation indicates the year of original adoption or, in the case of revision, the year of last revision. A number in parentheses indicates the year of last reapproval. A superscript epsilon) indicates an editorial change since the last revision or reapproval.},
+author = {{ASTM International}},
+doi = {10.1520/E2022-11},
+file = {::},
+pages = {1--10},
+title = {{ASTM E2022–11 - Standard Practice for Calculation of Weighting Factors for Tristimulus Integration}},
+volume = {i},
+year = {2011}
}
-@misc{Trieu2015,
-author = {Trieu, Tashi},
-title = {{Private Discussion with Mansencal, T.}},
+@article{ASTMInternational2015,
+author = {{ASTM International}},
+doi = {10.1520/E0308-15},
+file = {:Users/kelsolaar/Documents/Mendeley Desktop/ASTM International - 2015 - ASTM E308–15 - Standard Practice for Computing the Colors of Objects by Using the CIE System.pdf:pdf},
+pages = {1--47},
+title = {{ASTM E308–15 - Standard Practice for Computing the Colors of Objects by Using the CIE System}},
year = {2015}
}
-@book{Fairchild2013e,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {11},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {4418--4495},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{FAIRCHILD'S 1990 MODEL}},
-year = {2013}
-}
-@misc{Lindbloom2009,
-author = {Lindbloom, Bruce},
-title = {{Delta E (CIE 2000)}},
-url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE2000.html},
-urldate = {2014-02-24},
-year = {2009}
-}
@misc{BabelColor2012,
author = {BabelColor},
title = {{The ColorChecker (since 1976!)}},
@@ -189,172 +80,274 @@ @misc{BabelColor2012
urldate = {2014-09-26},
year = {2012}
}
-@incollection{Fairchild2013d,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {11},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {4810--5085},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{Chromatic Adaptation Models}},
-year = {2013}
-}
@misc{BabelColor2012a,
author = {BabelColor},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/BabelColor - 2012 - ColorChecker RGB and spectra.xls:xls},
+file = {::},
title = {{ColorChecker RGB and spectra}},
url = {http://www.babelcolor.com/download/ColorChecker{\_}RGB{\_}and{\_}spectra.xls},
year = {2012}
}
-@misc{Kienzle2011,
-author = {Kienzle, Paul and Patel, Nikunj and Krycka, James},
-title = {{refl1d.numpyerrors - Refl1D v0.6.19 documentation}},
-url = {http://www.reflectometry.org/danse/docs/refl1d/{\_}modules/refl1d/numpyerrors.html},
-urldate = {2015-01-30},
-year = {2011}
-}
-@article{Glasser1958,
-abstract = {A visually uniform color coordinate system, based upon simple mathematical formulas, is described. This system resembles the Adams chromatic-value system but replaces the quintic-parabola function with a cube-root function. For colors having reflectances greater than 0.5{\%} the color spacing obtained agrees with Munsell spacing as closely as the modified Adams system. At lower reflectances an expanded color spacing over that of the Munsell system is provided. The cube-root equations can be solved directly for color coordinate differences in terms of simple functions of the difference in colorimeter readings or tristimulus values. The computation of color coordinates in this system is simpler and requires less computational precision than other visually uniform color coordinate systems. A simple slide rule for computing color differences in cube-root color coordinates is described. A modification of the cube-root color coordinate system which provides nearly perfect representation of the spacing of Munsell colors is described, and the appropriateness of the assumptions required to obtain this behavior is discussed.},
-author = {Glasser, L. G. and McKinney, A. H. and Reilly, C. D. and Schnelle, P. D.},
-doi = {10.1364/JOSA.48.000736},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Glasser et al. - 1958 - Cube-Root Color Coordinate System.pdf:pdf},
-journal = {J. Opt. Soc. Am.},
-month = {oct},
-number = {10},
-pages = {736--740},
-publisher = {OSA},
-title = {{Cube-Root Color Coordinate System}},
-url = {http://www.opticsinfobase.org/abstract.cfm?URI=josa-48-10-736},
-volume = {48},
-year = {1958}
+@article{Bianco2010,
+author = {Bianco, S. and Schettini, R.},
+doi = {10.1002/col.20573},
+file = {::},
+issn = {03612317},
+journal = {Color Research {\&} Application},
+month = {jun},
+number = {3},
+pages = {184--192},
+title = {{Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization}},
+url = {http://doi.wiley.com/10.1002/col.20573 http://web.stanford.edu/{~}sujason/ColorBalancing/Papers/Two New von Kries Based Chromatic Adaptation.pdf},
+volume = {35},
+year = {2010}
}
-@article{InternationalTelecommunicationUnion2011,
-author = {{International Telecommunication Union}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/International Telecommunication Union - 2011 - Recommendation ITU-T T.871 - Information technology – Digital compression and coding of.pdf:pdf},
-keywords = {871,T,T.871},
-title = {{Recommendation ITU-T T.871 - Information technology – Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF)}},
-url = {https://www.itu.int/rec/dologin{\_}pub.asp?lang=e{\&}id=T-REC-T.871-201105-I!!PDF-E{\&}type=items},
-year = {2011}
+@article{Bodhaine1999,
+abstract = {Many different techniques are used for the calculation of Rayleigh optical depth in the atmosphere. In some cases differences among these techniques can be important, especially in the UV region of the spectrum and under clean atmospheric conditions. The authors recommend that the calculation of Rayleigh optical depth be approached by going back to the first principles of Rayleigh scattering theory rather than the variety of curve- fitting techniques currently in use. A survey of the literature was conducted in order to determine the latest values of the physical constants necessary and to review the methods available for the calculation of Rayleigh optical depth. The recommended approach requires the accurate calculation of the refractive index of air based on the latest published measurements. Calculations estimating Rayleigh optical depth should be done as accurately as possible because the inaccuracies that arise can equal or even exceed other quantities being estimated, such as aerosol optical depth, particularly in the UV region of the spectrum. All of the calculations are simple enough to be done easily in a spreadsheet.},
+author = {Bodhaine, Barry A. and Wood, Norman B. and Dutton, Ellsworth G. and Slusser, James R.},
+doi = {10.1175/1520-0426(1999)016%3C1854:ORODC%3E2.0.CO;2},
+file = {::},
+journal = {Journal of Atmospheric {\ldots}},
+number = {11 PART 2},
+pages = {1854--1861},
+title = {{On Rayleigh optical depth calculations}},
+url = {http://journals.ametsoc.org/doi/abs/10.1175/1520-0426(1999)016{\%}253C1854:ORODC{\%}253E2.0.CO;2},
+volume = {16},
+year = {1999}
}
-@misc{TheAcademyofMotionPictureArtsandSciences2014b,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Academy Color Encoding System (ACES) Project Subcomm(4).pdf:pdf},
-pages = {1--12},
-title = {{Specification S-2014-003 - ACEScc , A Logarithmic Encoding of ACES Data for use within Color Grading Systems}},
-url = {https://github.com/ampas/aces-dev/tree/master/documents},
+@misc{Bourke,
+author = {Bourke, Paul},
+title = {{Intersection point of two line segments in 2 dimensions}},
+url = {http://paulbourke.net/geometry/pointlineplane/},
+urldate = {2016-01-15}
+}
+@article{Breneman1987,
+abstract = {While each of his or her two eyes was independently adapted to a different illuminant in viewing a complex visual field, each of a number of observers matched a series of test colors seen by one eye with a juxtaposed variable stimulus seen by the other eye. The 2 degrees test and matching stimuli were located centrally in the complex adapting field, which subtended an angle of 31 degrees X 24 degrees. In making the matches, the observer viewed the test and matching stimuli for a series of brief intervals (approximately 1 sec) while viewing the complex adapting field with normal eye movements. Nine experiments were performed with different pairs of illuminants and different illuminances ranging from that of an average living room to that of a scene illuminated with hazy sunlight. In three other experiments each of the observer's two eyes was adapted to a different illuminance of D55. The amount of adaptation was more nearly complete at high levels of illuminance than at low levels, and the proportional amount of adaptation was less for the "blue" receptors. When adaptation coefficients were determined from the actual adaptation differences (e.g., from corresponding tristimulus values for matching neutrals) rather than from the adapting illuminants, a linear von Kries transformation based on experimentally determined visual primaries gave corresponding chromaticities that were in good agreement with the results obtained in each of the chromatic-adaptation experiments, except at the lowest illuminances. The results of the experiments in which each eye was adapted to different levels of the same illuminant indicated again that adaptation to the different levels was incomplete, the proportional amount of adaptation being less at low illuminances and for the "blue" receptors. This caused a change in chromatic adaptation with the level of illuminance even when the chromaticities of the adapting lights were equal. The results of these experiments also indicated that higher purities are needed in order to produce the same absolute color appearances at low levels of illuminance.},
+author = {Breneman, E J},
+doi = {10.1364/JOSAA.4.001115},
+issn = {1084-7529},
+journal = {Journal of the Optical Society of America. A, Optics and image science},
+pages = {1115--1129},
+pmid = {3598755},
+title = {{Corresponding chromaticities for different states of adaptation to complex visual fields.}},
+volume = {4},
+year = {1987}
+}
+@article{Brill2008,
+abstract = {The color-appearance model CIECAM02 has several problems. which can result in mathematical instabilities, due to the position of the chromatic-adaptation primaries relative to the spectrum locus and to the presumed physiological cone primaries. To keep a corresponding (adapted) color within the positive gamut given by the chromatic adaptation primaries, the gamut must he within the cone primary octant. To contain adapted colors within the positive cone-primary octan, it suffices to truncate the action of adaptation at the boundary of that octant. Such modifications may be needed to avoid the mathematical problems in CIECAM02.},
+author = {Brill, Michael H. and S{\"{u}}sstrunk, Sabine},
+doi = {10.1002/col.20432},
+issn = {03612317},
+journal = {Color Research {\&} Application},
+keywords = {CIECAM02,Chromatic adaptation,Color appearance,Gamut,Model,Primary},
+month = {oct},
+number = {5},
+pages = {424--426},
+title = {{Repairing gamut problems in CIECAM02: A progress report}},
+url = {http://doi.wiley.com/10.1002/col.20432},
+volume = {33},
+year = {2008}
+}
+@misc{Broadbent2009,
+author = {Broadbent, A. D.},
+title = {{Calculation from the original experimental data of the CIE 1931 RGB standard observer spectral chromaticity co-ordinates and color matching functions}},
+url = {http://www.cis.rit.edu/mcsl/research/1931.php},
+urldate = {2014-06-12},
+year = {2009}
+}
+@misc{Canon,
+author = {Canon},
+title = {{EOS C300 Mark II - EOS C300 Mark II Input Transform Version 2.0 (for Cinema Gamut / BT.2020)}},
+url = {https://www.usa.canon.com/internet/portal/us/home/support/details/cameras/cinema-eos/eos-c300-mark-ii},
+urldate = {2016-08-23}
+}
+@misc{Canon2014,
+author = {Canon},
+title = {{EOS C500 Firmware Update}},
+url = {https://www.usa.canon.com/internet/portal/us/home/explore/product-showcases/cameras-and-lenses/cinema-eos-firmware/c500},
+urldate = {2016-08-02},
year = {2014}
}
-@book{Wyszecki2000,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {138--139},
-publisher = {Wiley},
-title = {{Table 1(3.3.3)}},
-year = {2000}
+@misc{Castro2014,
+author = {Castro, Saullo},
+title = {{Numpy: Fastest way of computing diagonal for each row of a 2d array}},
+url = {http://stackoverflow.com/questions/26511401/numpy-fastest-way-of-computing-diagonal-for-each-row-of-a-2d-array/26517247{\#}26517247},
+urldate = {2014-08-22},
+year = {2014}
}
-@article{Machado2010,
-author = {Machado, Gm},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Machado - 2010 - A model for simulation of color vision deficiency and a color contrast enhancement technique for dichromats.pdf:pdf},
-keywords = {Anomalous Trichromacy,Color Perception,Color Vision Deficiency,Color-Contrast Enhancement,Dichromacy,Models of Color Vision,Recoloring Algorithm,Simulation of Color Vision Deficiency},
-title = {{A model for simulation of color vision deficiency and a color contrast enhancement technique for dichromats}},
-url = {http://www.lume.ufrgs.br/handle/10183/26950},
-year = {2010}
+@inproceedings{Centore2014g,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/BoundingRenotationHues.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
}
-@book{Wyszecki2000i,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {228},
-publisher = {Wiley},
-title = {{Table 1(3.11) Isotemperature Lines}},
-year = {2000}
+@misc{Centore2014,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
}
-@incollection{SMPTE1993,
-abstract = {color white whitepoint matrix Scope This practice is intended to define the numerical procedures for deriving basic color equations for color television and other systems using additive display devices. These equations are first, the normalized reference primary matrix which defines the relationship between RGB signals and CIE tristimulus values XYZ; then, the system luminance equation; and finally, the color primary transformation matrix for transforming signals from one set of reference primaries to another set of reference primaries or to a set of display primaries.},
-author = {{Society of Motion Picture and Television Engineers}},
-booktitle = {RP 177:1993},
-doi = {10.5594/S9781614821915},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop//SMPTE - 1993 - RP 177-1993 Derivation of Basic Television Color Equations.pdf:pdf},
-isbn = {978-1-61482-191-5},
-month = {jan},
-pages = {1--4},
-title = {{Derivation of Basic Television Color Equations}},
-url = {http://standards.smpte.org/content/978-1-61482-191-5/rp-177-1993/SEC1.abstract http://car.france3.mars.free.fr/HD/INA- 26 jan 06/SMPTE normes et confs/rp177.pdf},
-volume = {RP 177:199},
-year = {1993}
+@misc{Centore2014i,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
}
-@book{CIETC1-482004a,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-isbn = {978-3-901-90633-6},
-pages = {1--82},
-title = {{CIE 015:2004 Colorimetry, 3rd Edition}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
-year = {2004}
+@misc{Centore2014e,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/xyYtoMunsell.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
}
-@misc{Lindbloom2009c,
-author = {Lindbloom, Bruce},
-title = {{Chromatic Adaptation}},
-url = {http://brucelindbloom.com/Eqn{\_}ChromAdapt.html},
-urldate = {2014-02-24},
-year = {2009}
+@inproceedings{Centore2014a,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
}
-@misc{,
-title = {{Tritanopia – Blue-Yellow Color Blindness}},
-url = {http://www.color-blindness.com/tritanopia-blue-yellow-color-blindness/},
-urldate = {2015-07-04}
+@misc{Centore2014j,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToASTMHue.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore2014c,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyY.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore2014h,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore2014f,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/FindHueOnRenotationOvoid.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore2014d,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore2014b,
+author = {Centore, Paul},
+title = {{MunsellAndKubelkaMunkToolboxApr2014 - GeneralRoutines/CIELABtoApproxMunsellSpec.m}},
+url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+year = {2014}
+}
+@misc{Centore,
+author = {Centore, Paul},
+title = {{Munsell Resources}},
+url = {http://www.99main.com/{~}centore/MunsellResources/MunsellResources.html},
+urldate = {2014-07-26}
+}
+@article{Centore2012,
+author = {Centore, Paul},
+doi = {10.1002/col.20715},
+file = {::},
+issn = {03612317},
+journal = {Color Research {\&} Application},
+keywords = {algorithm,inverse renotation,munsell,open source,renotation},
+month = {dec},
+number = {6},
+pages = {455--464},
+title = {{An open-source inversion algorithm for the Munsell renotation}},
+url = {http://onlinelibrary.wiley.com/doi/10.1002/col.20715/full http://www.99main.com/{~}centore/ColourSciencePapers/OpenSourceInverseRenotationArticle.pdf http://doi.wiley.com/10.1002/col.20715},
+volume = {37},
+year = {2012}
+}
+@misc{CIE,
+author = {CIE},
+file = {::},
+title = {{CIE 15:2004 Tables Data}},
+url = {https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.tables.xls}
+}
+@misc{CIEa,
+author = {CIE},
+file = {::},
+title = {{CIE Spectral Data}},
+url = {http://files.cie.co.at/204.xls}
+}
+@book{CIETC1-321994,
+author = {{CIE TC 1-32}},
+file = {::},
+isbn = {978-3-900734-51-0},
+pages = {1--18},
+title = {{CIE 109-1994 A Method of Predicting Corresponding Colours under Different Chromatic and Illuminance Adaptations}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=34},
+year = {1994}
}
@book{CIETC1-362006,
author = {{CIE TC 1-36}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-36 - 2006 - CIE 170-12006 Fundamental Chromaticity Diagram with Physiological Axes - Part 1.pdf:pdf},
+file = {::},
isbn = {978-3-901-90646-6},
pages = {1--56},
title = {{CIE 170-1:2006 Fundamental Chromaticity Diagram with Physiological Axes - Part 1}},
url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=48},
year = {2006}
}
-@misc{Houston2015,
-author = {Houston, Jim},
-title = {{Private Discussion with Mansencal, T.}},
-year = {2015}
+@incollection{CIETC1-382005d,
+author = {{CIE TC 1-38}},
+booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
+chapter = {9},
+isbn = {978-3-901-90641-1},
+pages = {14--19},
+title = {{9. INTERPOLATION}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
+year = {2005}
}
-@misc{EasyRGBc,
-author = {EasyRGB},
-title = {{CMY —{\textgreater} RGB}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=12{\#}text12},
-urldate = {2014-05-18}
+@incollection{CIETC1-382005c,
+author = {{CIE TC 1-38}},
+booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
+chapter = {9.2.4},
+isbn = {978-3-901-90641-1},
+pages = {1--27},
+title = {{9.2.4 Method of interpolation for uniformly spaced independent variable}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
+year = {2005}
}
-@book{Hunt2004,
-address = {Chichester, UK},
-author = {Hunt, Robert W. G.},
-doi = {10.1002/0470024275},
-edition = {6},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Hunt - 2004 - The Reproduction of Colour.pdf:pdf},
-isbn = {978-0-470-02425-6},
-month = {sep},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{The Reproduction of Colour}},
-url = {http://doi.wiley.com/10.1002/0470024275},
-year = {2004}
+@incollection{CIETC1-382005b,
+author = {{CIE TC 1-38}},
+booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
+chapter = {10},
+isbn = {978-3-901-90641-1},
+pages = {19--20},
+title = {{EXTRAPOLATION}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
+year = {2005}
}
-@article{Spaulding2000,
-abstract = {A new color encoding specification known as Reference Output Medium Metric RGB (ROMM RGB) is defined. This color encoding is intended to be used for storing, interchanging and manipulating images that exist in a rendered image state without imposing the gamut limitations normally associated with device-specific color spaces. ROMM RGB was designed to provide a large enough color gamut to encompass most common output devices, while simultaneously satisfying a number of other important criteria. It is defined in a way that is tightly linked to the ICC profile connection space (PCS) and is suitable for use as an Adobe PhotoshopTM working color space. A companion color encoding specification, known as Reference Input Medium Metric RGB (RIMM RGB), is also defined. This encoding can be used to represent images in an unrendered scene image state.},
-author = {Spaulding, K E and Woolfe, G J and Giorgianni, E J},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Spaulding, Woolfe, Giorgianni - 2000 - Reference InputOutput Medium Metric RGB Color Encodings (RIMMROMM RGB).pdf:pdf},
-pages = {1--8},
-title = {{Reference Input/Output Medium Metric RGB Color Encodings (RIMM/ROMM RGB)}},
-url = {http://www.photo-lovers.org/pdf/color/romm.pdf},
-year = {2000}
+@incollection{CIETC1-382005a,
+author = {{CIE TC 1-38}},
+booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
+chapter = {Table V},
+isbn = {978-3-901-90641-1},
+pages = {19},
+title = {{Table V. Values of the c-coefficients of Equ.s 6 and 7.}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
+year = {2005}
}
-@article{InternationalTelecommunicationUnion2011a,
-author = {{International Telecommunication Union}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/International Telecommunication Union - 2011 - Recommendation ITU-R BT.1886 - Reference electro-optical transfer function for flat panel.pdf:pdf},
-title = {{Recommendation ITU-R BT.1886 - Reference electro-optical transfer function for flat panel displays used in HDTV studio production BT Series Broadcasting service}},
-year = {2011}
+@book{CIETC1-382005,
+author = {{CIE TC 1-38}},
+isbn = {978-3-901-90641-1},
+pages = {1--27},
+title = {{CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
+year = {2005}
+}
+@incollection{CIETC1-482004b,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+chapter = {8.2},
+isbn = {978-3-901-90633-6},
+pages = {24},
+title = {{CIE 1976 uniform colour spaces}},
+url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
+year = {2004}
}
@incollection{CIETC1-482004b,
author = {{CIE TC 1-48}},
@@ -366,72 +359,34 @@ @incollection{CIETC1-482004b
url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
year = {2004}
}
-@misc{MunsellColorScience,
-author = {{Munsell Color Science}},
-title = {{Munsell Colours Data}},
-url = {http://www.cis.rit.edu/research/mcsl2/online/munsell.php},
-urldate = {2014-08-20}
-}
-@misc{CVRL,
-author = {CVRL},
-title = {{Cone Fundamentals}},
-url = {http://www.cvrl.org/cones.htm},
-urldate = {2014-06-23}
-}
-@article{Ohno2014,
-author = {Ohno, Yoshi},
-doi = {10.1080/15502724.2014.839020},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Ohno - 2014 - Practical Use and Calculation of CCT and Duv.pdf:pdf},
-issn = {1550-2724},
-journal = {LEUKOS},
-keywords = {Duv,Planckian locus,chromaticity,correlated color temperature,duv,light source,planckian locus},
-month = {jan},
-number = {1},
-pages = {47--55},
-title = {{Practical Use and Calculation of CCT and Duv}},
-url = {http://www.tandfonline.com/doi/abs/10.1080/15502724.2014.839020 http://dx.doi.org/10.1080/15502724.2014.839020},
-volume = {10},
-year = {2014}
-}
-@article{Lu2016,
-abstract = {High Dynamic Range (HDR) and Wider Colour Gamut (WCG) content represents a greater range of luminance levels and a more complete reproduction of colours found in real⁃world scenes. The current video distribution environments deliver Standard Dynamic Range (SDR) signal Y′CbCr. For HDR and WCG content, it is desirable to examine if such signal format still works well for compression, and to know if the overall system performance can be further improved by exploring different signal formats. In this paper, ITP (ICTCP) colour space is presented. The paper concentrates on examining the two aspects of ITP colour space: 1) ITP characteristics in terms of signal quantization at a given bit depth; 2) ITP compression performance. The analysis and simulation results show that ITP 10 bit has better properties than Y′CbCr⁃PQ 10bit in colour quantization, constant luminance, hue property and chroma subsampling, and it also has good compression efficiency. Therefore it is desirable to adopt ITP colour space as a new signal format for HDR/WCG video compression.},
-author = {Lu, Taoran and Pu, Fangjun and Yin, Peng and Chen, Tao and Husak, Walt and Pytlarz, Jaclyn and Atkins, Robin and Froehlich, Jan and Su, Guan-Ming},
-doi = {10.3969/j.},
-journal = {ZTE Communications},
-keywords = {HDR,ICT CP,ITP,WCG,Y′CbCr},
-number = {1},
-pages = {32--38},
-title = {{ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution}},
-volume = {14},
-year = {2016}
-}
-@book{Wyszecki2000j,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-isbn = {978-0471399186},
-pages = {1--968},
-publisher = {Wiley},
-title = {{Color Science: Concepts and Methods, Quantitative Data and Formulae}},
-year = {2000}
-}
-@article{Li2007,
-author = {Li, Changjun and Perales, Esther and Luo, Ming Ronnier and Mart{\'{i}}nez-verd{\'{u}}, Francisco},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Li et al. - 2007 - The Problem with CAT02 and Its Correction.pdf:pdf},
-number = {July},
-pages = {1--10},
-title = {{The Problem with CAT02 and Its Correction}},
-year = {2007}
+@incollection{CIETC1-482004d,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+chapter = {3.1},
+isbn = {978-3-901-90633-6},
+pages = {12--13},
+title = {{3.1 Recommendations concerning standard physical data of illuminants}},
+url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
+year = {2004}
}
-@misc{Wikipediak,
-author = {Wikipedia},
-title = {{White points of standard illuminants}},
-url = {http://en.wikipedia.org/wiki/Standard{\_}illuminant{\#}White{\_}points{\_}of{\_}standard{\_}illuminants},
-urldate = {2014-02-24}
+@incollection{CIETC1-482004e,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+chapter = {9.1},
+isbn = {978-3-901-90633-6},
+pages = {32--33},
+title = {{9.1 Dominant wavelength and purity}},
+url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
+year = {2004}
}
-@misc{Wikipediap,
-author = {Wikipedia},
-title = {{CIELUV}},
-url = {http://en.wikipedia.org/wiki/CIELUV},
-urldate = {2014-02-24}
+@book{CIETC1-482004a,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+isbn = {978-3-901-90633-6},
+pages = {1--82},
+title = {{CIE 015:2004 Colorimetry, 3rd Edition}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
+year = {2004}
}
@incollection{CIETC1-482004c,
author = {{CIE TC 1-48}},
@@ -443,61 +398,43 @@ @incollection{CIETC1-482004c
url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
year = {2004}
}
-@misc{Ruana,
-author = {Ruana, Rob},
-title = {pockets.iterators},
-url = {https://github.com/RobRuana/pockets/blob/master/pockets/iterators.py},
-urldate = {2016-08-14}
-}
-@misc{Wikipediae,
-author = {Wikipedia},
-title = {{The reverse transformation}},
-url = {http://en.wikipedia.org/wiki/CIELUV{\#}The{\_}reverse{\_}transformation},
-urldate = {2014-02-24}
-}
-@book{Wyszecki2000e,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {158--163},
-publisher = {Wiley},
-title = {{Integration Replace by Summation}},
-year = {2000}
+@incollection{CIETC1-482004b,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+chapter = {7.2.2.1},
+isbn = {978-3-901-90633-6},
+pages = {24},
+title = {{Extrapolation}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
+year = {2004}
}
-@book{CIETC1-382005a,
-author = {{CIE TC 1-38}},
-booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
-chapter = {Table V},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-38 - 2005 - Table V. Values of the c-coefficients of Equ.s 6 and 7.pdf:pdf},
-isbn = {978-3-901-90641-1},
-pages = {19},
-title = {{Table V. Values of the c-coefficients of Equ.s 6 and 7.}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
-year = {2005}
+@incollection{CIETC1-482004,
+author = {{CIE TC 1-48}},
+booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
+chapter = {APPENDIX E},
+file = {::},
+isbn = {978-3-901-90633-6},
+pages = {77--82},
+title = {{APPENDIX E. INFORMATION ON THE USE OF PLANCK'S EQUATION FOR STANDARD AIR}},
+url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
+year = {2004}
}
-@misc{Wikipediay,
-author = {Wikipedia},
-title = {{Mesopic weighting function}},
-url = {http://en.wikipedia.org/wiki/Mesopic{\_}vision{\#}Mesopic{\_}weighting{\_}function},
-urldate = {2014-06-20}
+@misc{Cottrell,
+author = {Cottrell, Russell},
+title = {{The Russell RGB working color space}},
+url = {http://www.russellcottrell.com/photo/downloads/RussellRGB.icc http://www.russellcottrell.com/photo/RussellRGB.htm}
}
-@book{CIETC1-382005,
-author = {{CIE TC 1-38}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-38 - 2005 - Table V. Values of the c-coefficients of Equ.s 6 and 7.pdf:pdf},
-isbn = {978-3-901-90641-1},
-pages = {1--27},
-title = {{CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
-year = {2005}
+@misc{CVRLa,
+author = {CVRL},
+title = {{Stiles {\&} Burch individual 2-deg colour matching data}},
+url = {http://www.cvrl.org/stilesburch2{\_}ind.htm},
+urldate = {2014-02-24}
}
-@book{CIETC1-321994,
-author = {{CIE TC 1-32}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-32 - 1994 - CIE 109-1994 A Method of Predicting Corresponding Colours under Different Chromatic and Illuminance Adaptations.pdf:pdf},
-isbn = {978-3-900734-51-0},
-pages = {1--18},
-title = {{CIE 109-1994 A Method of Predicting Corresponding Colours under Different Chromatic and Illuminance Adaptations}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=34},
-year = {1994}
+@misc{CVRLg,
+author = {CVRL},
+title = {{Stiles {\&} Burch individual 10-deg colour matching data}},
+url = {http://www.cvrl.org/stilesburch10{\_}ind.htm},
+urldate = {2014-02-24}
}
@misc{CVRLe,
author = {CVRL},
@@ -505,62 +442,17 @@ @misc{CVRLe
url = {http://www.cvrl.org/lumindex.htm},
urldate = {2014-04-19}
}
-@misc{Wikipediaw,
-author = {Wikipedia},
-title = {{CIE 1931 color space}},
-url = {http://en.wikipedia.org/wiki/CIE{\_}1931{\_}color{\_}space},
-urldate = {2014-02-24}
-}
-@book{Wyszecki2000h,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {837--839},
-publisher = {Wiley},
-title = {{Table I(6.5.3) Whiteness Formulae (Whiteness Measure Denoted by W)}},
-year = {2000}
-}
-@misc{Pointer1980,
-author = {Pointer, Michael R.},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Pointer - 1980 - Pointer's Gamut Data.xls:xls},
-title = {{Pointer's Gamut Data}},
-url = {http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls http://www.cis.rit.edu/research/mcsl2/online/cie.php},
-year = {1980}
-}
-@misc{Lindbloom2014,
-author = {Lindbloom, Bruce},
-title = {{RGB Working Space Information}},
-url = {http://www.brucelindbloom.com/WorkingSpaceInfo.html},
-urldate = {2014-04-11},
-year = {2014}
-}
-@book{Fairchild2004a,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {CIECAM02},
-edition = {2},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild - 2004 - Color Appearance Models.pdf:pdf},
-isbn = {978-0470012161},
-pages = {289--301},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{CIECAM02}},
-year = {2004}
-}
-@misc{CIE,
-author = {CIE},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE - Unknown - CIE 152004 Tables Data.xls:xls},
-title = {{CIE 15:2004 Tables Data}},
-url = {https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.tables.xls}
+@misc{CVRLd,
+author = {CVRL},
+title = {{CIE (2012) 2-deg XYZ “physiologically-relevant” colour matching functions}},
+url = {http://www.cvrl.org/database/text/cienewxyz/cie2012xyz2.htm},
+urldate = {2014-06-25}
}
-@misc{AdobeSystems2005,
-author = {{Adobe Systems}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Adobe Systems - 2005 - Adobe RGB (1998) Color Image Encoding.pdf:pdf},
-number = {May},
-title = {{Adobe RGB (1998) Color Image Encoding}},
-url = {http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf},
-volume = {2704},
-year = {2005}
+@misc{CVRL,
+author = {CVRL},
+title = {{Cone Fundamentals}},
+url = {http://www.cvrl.org/cones.htm},
+urldate = {2014-06-23}
}
@misc{CVRLb,
author = {CVRL},
@@ -568,93 +460,57 @@ @misc{CVRLb
url = {http://www.cvrl.org/database/text/cienewxyz/cie2012xyz10.htm},
urldate = {2014-06-25}
}
-@book{Fairchild2013h,
-author = {Fairchild, Mark D.},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {1--10831},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{Color Appearance Models}},
-year = {2013}
-}
-@article{Stearns1988,
-author = {Stearns, E. I. and Stearns, R. E.},
-doi = {10.1002/col.5080130410},
-issn = {1520-6378},
-journal = {Color Research {\&} Application},
-number = {4},
-pages = {257--259},
-publisher = {Wiley Subscription Services, Inc., A Wiley Company},
-title = {{An example of a method for correcting radiance data for Bandpass error}},
-url = {http://dx.doi.org/10.1002/col.5080130410},
-volume = {13},
-year = {1988}
-}
-@misc{Centore2014i,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
-}
-@misc{HunterLab2008a,
-author = {HunterLab},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/HunterLab - 2008 - Hunter L,a,b Color Scale.pdf:pdf},
-number = {9},
-pages = {1--4},
-title = {{Hunter L,a,b Color Scale}},
-url = {http://www.hunterlab.se/wp-content/uploads/2012/11/Hunter-L-a-b.pdf},
-volume = {8},
-year = {2008}
-}
-@misc{SonyCorporationa,
-author = {{Sony Corporation}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Sony Corporation - Unknown - Technical Summary for S-Gamut3.CineS-Log3 and S-Gamut3S-Log3.pdf:pdf},
-pages = {1--7},
-title = {{Technical Summary for S-Gamut3.Cine/S-Log3 and S-Gamut3/S-Log3}},
-url = {http://community.sony.com/sony/attachments/sony/large-sensor-camera-F5-F55/12359/2/TechnicalSummary{\_}for{\_}S-Gamut3Cine{\_}S-Gamut3{\_}S-Log3{\_}V1{\_}00.pdf}
-}
-@article{SocietyofMotionPictureandTelevisionEngineers1999,
-author = {{Society of Motion Picture and Television Engineers}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Society of Motion Picture and Television Engineers - 1999 - ANSISMPTE 240M-1995 - Signal Parameters - 1125-Line High-Definition Producti.pdf:pdf},
-pages = {1--7},
-title = {{ANSI/SMPTE 240M-1995 - Signal Parameters - 1125-Line High-Definition Production Systems}},
-url = {http://car.france3.mars.free.fr/HD/INA- 26 jan 06/SMPTE normes et confs/s240m.pdf},
-year = {1999}
+@misc{CVRLc,
+author = {CVRL},
+title = {{Older CIE Standards}},
+url = {http://cvrl.ioo.ucl.ac.uk/cie.htm},
+urldate = {2014-02-24}
}
-@article{ASTMInternational2011,
-abstract = {This standard is issued under the fixed designation E2022; the number immediately following the designation indicates the year of original adoption or, in the case of revision, the year of last revision. A number in parentheses indicates the year of last reapproval. A superscript epsilon) indicates an editorial change since the last revision or reapproval.},
-author = {{ASTM International}},
-doi = {10.1520/E2022-11},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/ASTM International - 2011 - ASTM E2022–11 - Standard Practice for Calculation of Weighting Factors for Tristimulus Integration.pdf:pdf},
-pages = {1--10},
-title = {{ASTM E2022–11 - Standard Practice for Calculation of Weighting Factors for Tristimulus Integration}},
-volume = {i},
-year = {2011}
+@misc{CVRLf,
+author = {CVRL},
+title = {{New CIE XYZ functions transformed from the CIE (2006) LMS functions}},
+url = {http://cvrl.ioo.ucl.ac.uk/ciexyzpr.htm},
+urldate = {2014-02-24}
}
-@misc{HutchColor,
-author = {HutchColor},
-title = {{DonRGB4 (4 K)}},
-url = {http://www.hutchcolor.com/profiles/DonRGB4.zip http://www.hutchcolor.com/profiles.html}
+@article{Darrodi2015,
+author = {Darrodi, Maryam Mohammadzadeh and Finlayson, Graham and Goodman, Teresa and Mackiewicz, Michal},
+doi = {10.1364/JOSAA.32.000381},
+file = {::},
+issn = {1084-7529},
+journal = {Journal of the Optical Society of America A},
+number = {3},
+pages = {381},
+title = {{Reference data set for camera spectral sensitivity estimation}},
+url = {http://www.opticsinfobase.org/abstract.cfm?URI=josaa-32-3-381},
+volume = {32},
+year = {2015}
}
-@misc{ASTMInternational,
-author = {{ASTM International}},
-doi = {10.1520/D1535-08E01},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/ASTM International - 1989 - ASTM D1535-08e1 - Standard Practice for Specifying Color by the Munsell System.pdf:pdf},
-keywords = {D1535,Munsell,Munsell color order system,Munsell notation,color},
-pages = {1--29},
-title = {{ASTM D1535-08e1 - Standard Practice for Specifying Color by the Munsell System}},
-url = {http://www.astm.org/Standards/D1535.htm http://www.scribd.com/doc/89648322/ASTM-D1535-08e1-Standard-Practice-for-Specifying-Color-by-the-Munsell-System http://www.astm.org/DATABASE.CART/HISTORICAL/D1535-89.htm https://law.resource.org/pub/us/cfr/ibr/003/a},
-urldate = {2014-09-25},
-year = {1989}
+@article{Davis2010,
+abstract = {The color rendering index (CRI) has been shown to have deficiencies when applied to white light-emitting-diode–based sources. Furthermore, evidence suggests that the restricted scope of the CRI unnecessarily penalizes some light sources with desirable color qualities. To solve the problems of the CRI and include other dimensions of color quality, the color quality scale (CQS) has been developed. Although the CQS uses many of elements of the CRI, there are a number of fundamental differences. Like the CRI, the CQS is a test-samples method that compares the appearance of a set of reflective samples when illuminated by the test lamp to their appearance under a reference illuminant. The CQS uses a larger set of reflective samples, all of high chroma, and combines the color differences of the samples with a root mean square. Additionally, the CQS does not penalize light sources for causing increases in the chroma of object colors but does penalize sources with smaller rendered color gamut areas. The scale of the CQS is converted to span 0–100, and the uniform object color space and chromatic adaptation transform used in the calculations are updated. Supplementary scales have also been developed for expert users.},
+author = {Davis, Wendy and Ohno, Yoshi},
+doi = {10.1117/1.3360335},
+isbn = {0091-3286},
+journal = {Optical Engineering},
+number = {3},
+pages = {33602--33616},
+title = {{Color quality scale}},
+url = {http://dx.doi.org/10.1117/1.3360335},
+volume = {49},
+year = {2010}
}
-@article{TheAcademyofMotionPictureArtsandSciences2015,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Academy Color Encoding System (ACES) Project Subcom(13).pdf:pdf},
-pages = {1--9},
-title = {{Specification S-2014-004 - ACEScg – A Working Space for CGI Render and Compositing}},
-url = {https://github.com/ampas/aces-dev/tree/master/documents},
-year = {2015}
+@misc{DigitalCinemaInitiatives2007,
+author = {{Digital Cinema Initiatives}},
+file = {::},
+title = {{Digital Cinema System Specification - Version 1.1}},
+url = {http://www.dcimovies.com/archives/spec{\_}v1{\_}1/DCI{\_}DCinema{\_}System{\_}Spec{\_}v1{\_}1.pdf},
+year = {2007}
+}
+@article{Dolby2016,
+author = {Dolby},
+file = {::},
+title = {{WHAT IS ICTCP? - INTRODUCTION}},
+url = {https://www.dolby.com/us/en/technologies/dolby-vision/ICtCp-white-paper.pdf},
+year = {2016}
}
@misc{EasyRGBa,
author = {EasyRGB},
@@ -662,208 +518,316 @@ @misc{EasyRGBa
url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=14{\#}text14},
urldate = {2014-05-18}
}
-@article{Fairman1985,
-author = {Fairman, Hugh S.},
-doi = {10.1002/col.5080100407},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairman - 1985 - The calculation of weight factors for tristimulus integration.pdf:pdf},
-issn = {03612317},
-journal = {Color Research {\&} Application},
-number = {4},
-pages = {199--203},
-title = {{The calculation of weight factors for tristimulus integration}},
-url = {http://doi.wiley.com/10.1002/col.5080100407},
-volume = {10},
-year = {1985}
+@misc{EasyRGB,
+author = {EasyRGB},
+title = {{HSV —{\textgreater} RGB}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=21{\#}text21},
+urldate = {2014-05-18}
}
-@misc{Wikipedial,
-author = {Wikipedia},
-title = {{CAT02}},
-url = {http://en.wikipedia.org/wiki/CIECAM02{\#}CAT02},
-urldate = {2014-02-24}
+@misc{EasyRGBd,
+author = {EasyRGB},
+title = {{RGB —{\textgreater} HSV}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=20{\#}text20},
+urldate = {2014-05-18}
}
-@misc{SocietyofMotionPictureandTelevisionEngineers2014,
-abstract = {This standard specifies an EOTF characterizing high-dynamic-range reference displays used primarily for mastering non-broadcast content. This standard also specifies an Inverse-EOTF derived from the EOTF.},
-author = {{Society of Motion Picture and Television Engineers}},
-doi = {10.5594/SMPTE.ST2084.2014},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Society of Motion Picture and Television Engineers - 2014 - SMPTE ST 20842014 - Dynamic Range Electro-Optical Transfer Function of Maste.pdf:pdf},
-pages = {1--14},
-title = {{SMPTE ST 2084:2014 - Dynamic Range Electro-Optical Transfer Function of Mastering Reference Displays}},
-url = {http://www.techstreet.com/products/1883436},
-year = {2014}
+@misc{EasyRGBg,
+author = {EasyRGB},
+title = {{HSL —{\textgreater} RGB}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=19{\#}text19},
+urldate = {2014-05-18}
}
-@misc{Mansencal2015,
-author = {Mansencal, Thomas},
-title = {{RED Colourspaces Derivation}},
-url = {http://colour-science.org/posts/red-colourspaces-derivation},
-urldate = {2015-05-20},
-year = {2015}
+@misc{EasyRGBe,
+author = {EasyRGB},
+title = {{CMY —{\textgreater} CMYK}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=13{\#}text13},
+urldate = {2014-05-18}
}
-@misc{Wikipediaj,
-author = {Wikipedia},
-title = {{ISO 31-11}},
-url = {https://en.wikipedia.org/wiki/ISO{\_}31-11},
-urldate = {2016-07-31}
+@misc{EasyRGBf,
+author = {EasyRGB},
+title = {{RGB —{\textgreater} HSL}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=18{\#}text18},
+urldate = {2014-05-18}
}
-@misc{Centore2014g,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/BoundingRenotationHues.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@misc{EasyRGBc,
+author = {EasyRGB},
+title = {{CMY —{\textgreater} RGB}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=12{\#}text12},
+urldate = {2014-05-18}
}
-@misc{AdobeSystems2013,
-author = {{Adobe Systems}},
-title = {{Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng{\_}sdk{\_}1{\_}3/dng{\_}sdk/source/dng{\_}temperature.cpp::dng{\_}temperature::Set{\_}xy{\_}coord}},
-url = {https://www.adobe.com/support/downloads/dng/dng{\_}sdk.html},
-year = {2013}
+@misc{EasyRGBb,
+author = {EasyRGB},
+title = {{RGB —{\textgreater} CMY}},
+url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=11{\#}text11},
+urldate = {2014-05-18}
}
-@misc{Centore2014h,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@misc{Erdem,
+author = {Erdem, U. Murat},
+title = {{Fast Line Segment Intersection}},
+url = {http://www.mathworks.com/matlabcentral/fileexchange/27205-fast-line-segment-intersection},
+urldate = {2016-01-15}
}
-@book{Westland2012d,
-author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
-booktitle = {Computational Colour Science Using MATLAB},
-chapter = {4.3},
-edition = {2},
-isbn = {978-0-470-66569-5},
-pages = {29--37},
-title = {{Interpolation Methods}},
-year = {2012}
+@article{Erdogan,
+abstract = {There are many different systems for analyzing and representing the color of an object perceived by a human observer. For the purposes of unambiguously specifying the color an observer sees when looking through an optical filter at a well-defined light source, we have found the CIE Color Specification System to be the most accurate (for a simple and clear description, see [1]). In this article we briefly describe the method to calculate the three main parameters that fully specify color in this system: luminosity, dominant wavelength, and excitation purity. These terms specifically refer to the definitions in the CIE system given below, but they have analogies in many other systems. A set of more general terms often used to qualitatively describe color are: brightness, hue, and saturation (analogous to luminosity, dominant wavelength, and excitation purity, respectively). These terms (and others) are often used interchangeably. Here we will adhere to the official terms assigned to the CIE system to avoid any ambiguity.},
+author = {Erdogan, Turan},
+file = {::},
+pages = {7},
+title = {{How to Calculate Luminosity, Dominant Wavelength, and Excitation Purity}},
+url = {http://www.semrock.com/Data/Sites/1/semrockpdfs/whitepaper{\_}howtocalculateluminositywavelengthandpurity.pdf}
}
-@misc{Saeedn,
-author = {Saeedn},
-title = {{Extend a line segment a specific distance}},
-url = {http://stackoverflow.com/questions/7740507/extend-a-line-segment-a-specific-distance},
-urldate = {2016-01-16}
+@misc{EuropeanColorInitiative2002,
+author = {{European Color Initiative}},
+title = {{ECI RGB v2}},
+url = {http://www.eci.org/{\_}media/downloads/icc{\_}profiles{\_}from{\_}eci/ecirgbv20.zip http://www.eci.org/en/colourstandards/workingcolorspaces},
+year = {2002}
}
-@misc{Wikipediac,
-author = {Wikipedia},
-title = {{HSL and HSV}},
-url = {http://en.wikipedia.org/wiki/HSL{\_}and{\_}HSV},
-urldate = {2014-09-10}
+@article{Fairchild1998,
+abstract = {The colorimetric characterization of a flat-panel LCD monitor, the Apple Studio Display, using traditional CRT characterization techniques was evaluated. The results showed that the display performed up to the manufacturer's specifications in terms of luminance and contrast. However, the traditional CRT gain-offset-gamma (GOG) model for characterization was inadequate and a model with one-dimensional lookup tables followed by a 3x3 matrix was developed. The LUT model performed excellently with average CIE94 color differences between measured and predicted colors of approximately 1.0.},
+author = {Fairchild, M. and Wyble, D.},
+file = {::},
+pages = {22},
+title = {{Colorimetric Characterization of The Apple Studio Display (flat panel LCD)}},
+url = {https://ritdml.rit.edu/handle/1850/4368},
+year = {1998}
}
-@misc{Wikipediag,
-author = {Wikipedia},
-title = {{CIECAM02}},
-url = {http://en.wikipedia.org/wiki/CIECAM02},
-urldate = {2014-08-14}
+@incollection{Fairchild2013d,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {11},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {4810--5085},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{Chromatic Adaptation Models}},
+year = {2013}
}
-@misc{Canon,
-author = {Canon},
-title = {{EOS C300 Mark II - EOS C300 Mark II Input Transform Version 2.0 (for Cinema Gamut / BT.2020)}},
-url = {https://www.usa.canon.com/internet/portal/us/home/support/details/cameras/cinema-eos/eos-c300-mark-ii},
-urldate = {2016-08-23}
+@incollection{Fairchild2013e,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {11},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {4418--4495},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{FAIRCHILD'S 1990 MODEL}},
+year = {2013}
}
-@misc{Wikipediaq,
-author = {Wikipedia},
-title = {{Whiteness}},
-url = {http://en.wikipedia.org/wiki/Whiteness},
-urldate = {2014-09-17}
+@incollection{Fairchild2013f,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {20.3},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {6197--6223},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{IPT Colourspace}},
+year = {2013}
}
-@book{IESComputerCommittee2014,
-author = {{IES Computer Committee} and {TM-27-14 Working Group}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/IES Computer Committee, TM-27-14 Working Group - 2014 - IES Standard Format for the Electronic Transfer of Spectral Data Electronic Tran.pdf:pdf},
-isbn = {978-0879952952},
-pages = {1--16},
-title = {{IES Standard Format for the Electronic Transfer of Spectral Data Electronic Transfer of Spectral Data}},
-year = {2014}
+@incollection{Fairchild2013b,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {13},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {5563--5824},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{The RLAB Model}},
+year = {2013}
}
-@misc{Wikipediam,
-author = {Wikipedia},
-title = {{Rayleigh scattering}},
-url = {http://en.wikipedia.org/wiki/Rayleigh{\_}scattering},
-urldate = {2014-09-23}
+@incollection{Fairchild2013,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {14.3},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {6025--6178},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{LLAB Model}},
+year = {2013}
}
-@misc{Canon2014,
-author = {Canon},
-title = {{EOS C500 Firmware Update}},
-url = {https://www.usa.canon.com/internet/portal/us/home/explore/product-showcases/cameras-and-lenses/cinema-eos-firmware/c500},
-urldate = {2016-08-02},
-year = {2014}
+@incollection{Fairchild2013g,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {14.2},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {5852--5991},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{ATD Model}},
+year = {2013}
+}
+@incollection{Fairchild2013c,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {12},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {5094--5556},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{The Hunt Model}},
+year = {2013}
+}
+@incollection{Fairchild2013a,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {11},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {4810--5085},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{The Nayatani et al. Model}},
+year = {2013}
+}
+@book{Fairchild2013h,
+author = {Fairchild, Mark D.},
+edition = {3},
+isbn = {B00DAYO8E2},
+pages = {1--10831},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{Color Appearance Models}},
+year = {2013}
}
-@misc{EasyRGBb,
-author = {EasyRGB},
-title = {{RGB —{\textgreater} CMY}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=11{\#}text11},
-urldate = {2014-05-18}
+@incollection{Fairchild2004a,
+author = {Fairchild, Mark D.},
+booktitle = {Color Appearance Models},
+chapter = {CIECAM02},
+edition = {2},
+file = {::},
+isbn = {978-0470012161},
+pages = {289--301},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{CIECAM02}},
+year = {2004}
}
-@incollection{CIETC1-482004e,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-chapter = {9.1},
-isbn = {978-3-901-90633-6},
-pages = {32--33},
-title = {{9.1 Dominant wavelength and purity}},
-url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
+@book{Fairchild2004,
+author = {Fairchild, Mark D.},
+edition = {2},
+file = {::},
+isbn = {978-0470012161},
+pages = {1--409},
+publisher = {Wiley},
+series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
+title = {{Color Appearance Models}},
year = {2004}
}
-@book{CIETC1-382005c,
-author = {{CIE TC 1-38}},
-booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
-chapter = {9.2.4},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-38 - 2005 - Table V. Values of the c-coefficients of Equ.s 6 and 7.pdf:pdf},
-isbn = {978-3-901-90641-1},
-pages = {1--27},
-title = {{9.2.4 Method of interpolation for uniformly spaced independent variable}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
-year = {2005}
+@misc{Fairchild,
+author = {Fairchild, Mark D.},
+title = {{Fairchild YSh}},
+url = {http://rit-mcsl.org/fairchild//files/FairchildYSh.zip}
}
-@misc{HutchColorb,
-author = {HutchColor},
-title = {{XtremeRGB (4 K)}},
-url = {http://www.hutchcolor.com/profiles/XtremeRGB.zip http://www.hutchcolor.com/profiles.html}
+@article{Fairchild1996,
+abstract = {The prediction of color appearance using the RLAB color space has been tested for a variety of viewing conditions and stimulus types. These tests have shown that RLAB performs well for complex stimuli and not-so-well for simple stimuli. This article reviews the various psychophysical results, interprets their differences, and describes evolutionary enhancements to the RLAB model that simplify it and improve its performance. (C) 1996 John Wiley {\&} Sons, Inc.},
+author = {Fairchild, Mark D.},
+doi = {10.1002/(SICI)1520-6378(199610)21:5<338::AID-COL3>3.0.CO;2-Z},
+file = {::},
+journal = {Color Research {\&} Application},
+keywords = {color appearance,color spaces,color-appearance models},
+number = {5},
+pages = {338--346},
+title = {{Refinement of the RLAB color space}},
+url = {http://doi.wiley.com/10.1002/(SICI)1520-6378(199610)21:5{\%}3C338::AID-COL3{\%}3E3.3.CO;2-Y https://ritdml.rit.edu/bitstream/handle/1850/7857/MFairchildArticle12-06-1998.pdf},
+volume = {21},
+year = {1996}
}
-@misc{Hettinger,
-author = {Hettinger, Raymond},
-title = {{Python hashable dicts}},
-url = {http://stackoverflow.com/a/16162138/931625},
-urldate = {2014-08-08}
+@article{Fairchild1991,
+abstract = {A mathematical model of chromatic adaptation for calculating corresponding colors across changes of illumination based on the Hunt color appearance model is formulated and tested. This model consists of a modified von Kries transform that accounts for incomplete levels of adaptation. The model predicts that adaptation will be less complete as the saturation of the adapting stimulus increases and more complete as the luminance of the adapting stimulus increases. An experiment is described in which achromatic appearance is measured for various adapting conditions. The model is tested with these experimental results as well as results from another study and found to be significantly better at predicting corresponding colors than other proposed models.},
+author = {Fairchild, Mark D.},
+doi = {10.1002/col.5080160406},
+file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild - 1991 - Formulation and testing of an incomplete-chromatic-adaptation model.pdf:pdf},
+issn = {03612317},
+journal = {Color Research {\&} Application},
+month = {aug},
+number = {4},
+pages = {243--250},
+title = {{Formulation and testing of an incomplete-chromatic-adaptation model}},
+url = {http://doi.wiley.com/10.1002/col.5080160406},
+volume = {16},
+year = {1991}
}
-@misc{Centore2014b,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - GeneralRoutines/CIELABtoApproxMunsellSpec.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@inproceedings{Fairchild2010,
+author = {Fairchild, Mark D. and Wyble, David R.},
+booktitle = {Proc. of Color and Imaging Conference},
+file = {::},
+isbn = {9781629932156},
+issn = {21669635},
+keywords = {Copyright 2010 Society for Imaging Science and Tec},
+pages = {322--326},
+title = {{hdr-CIELAB and hdr-IPT: Simple Models for Describing the Color of High-Dynamic-Range and Wide-Color-Gamut Images}},
+url = {http://www.ingentaconnect.com/content/ist/cic/2010/00002010/00000001/art00057},
+year = {2010}
}
-@misc{TheAcademyofMotionPictureArtsandSciences2014c,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Academy Color Encoding System (ACES) Project Subcomm(8).pdf:pdf},
-pages = {1--16},
-title = {{Specification S-2013-001 - ACESproxy , an Integer Log Encoding of ACES Image Data}},
-url = {https://github.com/ampas/aces-dev/tree/master/documents},
-year = {2014}
+@article{Fairman1985,
+author = {Fairman, Hugh S.},
+doi = {10.1002/col.5080100407},
+file = {::},
+issn = {03612317},
+journal = {Color Research {\&} Application},
+number = {4},
+pages = {199--203},
+title = {{The calculation of weight factors for tristimulus integration}},
+url = {http://doi.wiley.com/10.1002/col.5080100407},
+volume = {10},
+year = {1985}
}
-@book{Wyszecki2000b,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {776--777},
-publisher = {Wiley},
-title = {{Table I(3.7)}},
-year = {2000}
+@misc{Gaggioni,
+author = {Gaggioni, Hugo and Dhanendra, Patel and Yamashita, Jin and Kawada, N. and Endo, K. and Clark, Curtis},
+file = {::},
+pages = {1--13},
+title = {{S-Log: A new LUT for digital production mastering and interchange applications}},
+url = {http://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog{\_}manual.pdf},
+volume = {709}
}
-@misc{Wikipediar,
-author = {Wikipedia},
-title = {{Relation to CIE XYZ}},
-url = {http://en.wikipedia.org/wiki/CIE{\_}1960{\_}color{\_}space{\#}Relation{\_}to{\_}CIE{\_}XYZ},
-urldate = {2014-02-24}
+@article{Glasser1958,
+abstract = {A visually uniform color coordinate system, based upon simple mathematical formulas, is described. This system resembles the Adams chromatic-value system but replaces the quintic-parabola function with a cube-root function. For colors having reflectances greater than 0.5{\%} the color spacing obtained agrees with Munsell spacing as closely as the modified Adams system. At lower reflectances an expanded color spacing over that of the Munsell system is provided. The cube-root equations can be solved directly for color coordinate differences in terms of simple functions of the difference in colorimeter readings or tristimulus values. The computation of color coordinates in this system is simpler and requires less computational precision than other visually uniform color coordinate systems. A simple slide rule for computing color differences in cube-root color coordinates is described. A modification of the cube-root color coordinate system which provides nearly perfect representation of the spacing of Munsell colors is described, and the appropriateness of the assumptions required to obtain this behavior is discussed.},
+author = {Glasser, L. G. and McKinney, A. H. and Reilly, C. D. and Schnelle, P. D.},
+doi = {10.1364/JOSA.48.000736},
+file = {::},
+journal = {J. Opt. Soc. Am.},
+month = {oct},
+number = {10},
+pages = {736--740},
+publisher = {OSA},
+title = {{Cube-Root Color Coordinate System}},
+url = {http://www.opticsinfobase.org/abstract.cfm?URI=josa-48-10-736},
+volume = {48},
+year = {1958}
}
-@misc{X-Rite2012,
-author = {X-Rite and Pantone},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/X-Rite, Pantone - 2012 - Color iQC and Color iMatch Color Calculations Guide.pdf:pdf},
-number = {July},
-pages = {1--31},
-title = {{Color iQC and Color iMatch Color Calculations Guide}},
-url = {http://www.xrite.com/documents/literature/en/09{\_}Color{\_}Calculations{\_}en.pdf},
-year = {2012}
+@misc{GoPro2016,
+author = {GoPro and Duiker, Haarm-Pieter and Mansencal, Thomas},
+title = {gopro.py},
+url = {https://github.com/hpd/OpenColorIO-Configs/blob/master/aces{\_}1.0.3/python/aces{\_}ocio/colorspaces/gopro.py},
+urldate = {2017-04-12},
+year = {2016}
+}
+@inproceedings{Guth1995,
+abstract = {Previous and recent revisions of the ATD model for color perception$\backslash$nand visual adaption are incorporated into the version that is fully$\backslash$ndescribed in this paper.},
+author = {Guth, S. Lee},
+booktitle = {IS{\&}T/SPIE's Symposium on Electronic {\ldots}},
+doi = {10.1117/12.206546},
+editor = {Walowit, Eric},
+file = {::},
+keywords = {chromatic adaptation,color appearances,color discriminations,color models},
+month = {apr},
+pages = {12--26},
+title = {{Further applications of the ATD model for color vision}},
+url = {http://proceedings.spiedigitallibrary.org/data/Conferences/SPIEP/53372/12{\_}1.pdf http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=991324},
+volume = {2414},
+year = {1995}
}
@article{Hernandez-Andres1999,
abstract = {Natural outdoor illumination daily undergoes large changes in its correlated color temperature (CCT), yet existing equations for calculating CCT from chromaticity coordinates span only part of this range. To improve both the gamut and accuracy of these CCT calculations, we use chromaticities calculated from our measurements of nearly 7000 daylight and skylight spectra to test an equation that accurately maps CIE 1931 chromaticities x and y into CCT. We extend the work of McCamy [Color Res. Appl. 12, 285-287 (1992)] by using a chromaticity epicenter for CCT and the inverse slope of the line that connects it to x and y. With two epicenters for different CCT ranges, our simple equation is accurate across wide chromaticity and CCT ranges (3000-10(6) K) spanned by daylight and skylight.},
author = {Hern{\'{a}}ndez-Andr{\'{e}}s, J. and Lee, Raymond L. and Romero, Javier},
doi = {10.1364/AO.38.005703},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Hern{\'{a}}ndez-Andr{\'{e}}s, Lee, Romero - 1999 - Calculating correlated color temperatures across the entire gamut of daylight and skylight chro.pdf:pdf},
+file = {::},
institution = {Departamento de Optica, Facultad de Ciencias, Universidad de Granada, Granada 18071, Spain.},
journal = {Applied optics},
number = {27},
@@ -872,123 +836,188 @@ @article{Hernandez-Andres1999
volume = {38},
year = {1999}
}
-@book{Fairchild2013a,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {11},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {4810--5085},
+@misc{Hettinger,
+author = {Hettinger, Raymond},
+title = {{Python hashable dicts}},
+url = {http://stackoverflow.com/a/16162138/931625},
+urldate = {2014-08-08}
+}
+@misc{Hewlett-PackardDevelopmentCompany2009,
+author = {{Hewlett-Packard Development Company}},
+file = {::},
+pages = {1--3},
+title = {{Understanding the HP DreamColor LP2480zx DCI-P3 Emulation Color Space}},
+url = {http://www.hp.com/united-states/campaigns/workstations/pdfs/lp2480zx-dci--p3-emulation.pdf},
+year = {2009}
+}
+@misc{Holmes,
+author = {Holmes, Joseph},
+title = {{Ekta Space PS 5}},
+url = {http://www.josephholmes.com/Ekta{\_}Space.zip http://www.josephholmes.com/profiles.html}
+}
+@misc{Houston2015,
+author = {Houston, Jim},
+title = {{Private Discussion with Mansencal, T.}},
+year = {2015}
+}
+@book{Hunt2004,
+address = {Chichester, UK},
+author = {Hunt, Robert W. G.},
+doi = {10.1002/0470024275},
+edition = {6},
+file = {::},
+isbn = {978-0-470-02425-6},
+month = {sep},
publisher = {Wiley},
series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{The Nayatani et al. Model}},
-year = {2013}
+title = {{The Reproduction of Colour}},
+url = {http://doi.wiley.com/10.1002/0470024275},
+year = {2004}
}
-@misc{Ruana,
-author = {Ruana, Rob},
-title = {sphinxcontrib.napoleon},
-url = {https://bitbucket.org/birkenfeld/sphinx-contrib/src/21e3b2dc70a43d3f7e8942c4aaf078f66e1c575b/napoleon/sphinxcontrib/napoleon/docstring.py},
-urldate = {2016-08-14}
+@misc{HunterLab2012,
+author = {HunterLab},
+file = {::},
+keywords = {a rd,b rd,hunter rd,opponent color scale,rd a b,rdab},
+title = {{Hunter Rd,a,b Color Scale – History and Application}},
+url = {https://hunterlabdotcom.files.wordpress.com/2012/07/an-1016-hunter-rd-a-b-color-scale-update-12-07-03.pdf},
+year = {2012}
}
-@misc{TheAcademyofMotionPictureArtsandSciences,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-title = {{Academy Color Encoding System}},
-url = {http://www.oscars.org/science-technology/council/projects/aces.html},
-urldate = {2014-02-24}
+@misc{HunterLab2008,
+author = {HunterLab},
+file = {::},
+keywords = {ASTM illuminant},
+number = {2},
+pages = {1--6},
+title = {{Illuminant Factors in Universal Software and EasyMatch Coatings}},
+url = {https://support.hunterlab.com/hc/en-us/article{\_}attachments/201437785/an02{\_}02.pdf},
+volume = {14},
+year = {2008}
+}
+@misc{HunterLab2008a,
+author = {HunterLab},
+file = {::},
+number = {9},
+pages = {1--4},
+title = {{Hunter L,a,b Color Scale}},
+url = {http://www.hunterlab.se/wp-content/uploads/2012/11/Hunter-L-a-b.pdf},
+volume = {8},
+year = {2008}
+}
+@misc{HutchColorc,
+author = {HutchColor},
+title = {{MaxRGB (4 K)}},
+url = {http://www.hutchcolor.com/profiles/MaxRGB.zip http://www.hutchcolor.com/profiles.html}
+}
+@inproceedings{HutchColorb,
+author = {HutchColor},
+title = {{XtremeRGB (4 K)}},
+url = {http://www.hutchcolor.com/profiles/XtremeRGB.zip http://www.hutchcolor.com/profiles.html}
+}
+@misc{HutchColor,
+author = {HutchColor},
+title = {{DonRGB4 (4 K)}},
+url = {http://www.hutchcolor.com/profiles/DonRGB4.zip http://www.hutchcolor.com/profiles.html}
}
@misc{HutchColora,
author = {HutchColor},
title = {{BestRGB (4 K)}},
url = {http://www.hutchcolor.com/profiles/BestRGB.zip http://www.hutchcolor.com/profiles.html}
}
-@misc{Spiker2015,
-author = {Spiker, Nick},
-title = {{Private Discussion with Mansencal, T.}},
-url = {http://www.repairfaq.org/sam/repspec/ http://www.invisiblelightimages.com/},
-year = {2015}
+@book{IESComputerCommittee2014,
+author = {{IES Computer Committee} and {TM-27-14 Working Group}},
+file = {::},
+isbn = {978-0879952952},
+pages = {1--16},
+title = {{IES Standard Format for the Electronic Transfer of Spectral Data Electronic Transfer of Spectral Data}},
+year = {2014}
}
-@article{Smits1999,
-abstract = {The desire for accuracy and realism in images requires a physically-based rendering system. Often this can mean using a full spectral representation, as RGB represen- tations have limitations in some situations4. The spectral representation does come at some cost, not ...},
-author = {Smits, Brian},
-doi = {10.1080/10867651.1999.10487511},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Smits - 1999 - An RGB-to-Spectrum Conversion for Reflectances.pdf:pdf},
-issn = {1086-7651},
-journal = {Journal of Graphics Tools},
-month = {jan},
-number = {4},
-pages = {11--22},
-publisher = {AK Peters, Ltd.},
-title = {{An RGB-to-Spectrum Conversion for Reflectances}},
-url = {http://www.cs.utah.edu/{~}bes/papers/color/ http://www.tandfonline.com/doi/abs/10.1080/10867651.1999.10487511},
-volume = {4},
+@article{InternationalElectrotechnicalCommission1999,
+author = {{International Electrotechnical Commission}},
+pages = {51},
+title = {{IEC 61966-2-1:1999 - Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB}},
+url = {https://webstore.iec.ch/publication/6169},
year = {1999}
}
-@misc{Centore2014a,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@article{InternationalTelecommunicationUnion2011,
+author = {{International Telecommunication Union}},
+file = {::},
+keywords = {871,T,T.871},
+title = {{Recommendation ITU-T T.871 - Information technology – Digital compression and coding of continuous-tone still images: JPEG File Interchange Format (JFIF)}},
+url = {https://www.itu.int/rec/dologin{\_}pub.asp?lang=e{\&}id=T-REC-T.871-201105-I!!PDF-E{\&}type=items},
+year = {2011}
}
-@misc{Wikipedian,
-author = {Wikipedia},
-title = {{Surfaces}},
-url = {http://en.wikipedia.org/wiki/Gamut{\#}Surfaces},
-urldate = {2014-09-10}
+@article{InternationalTelecommunicationUnion2011a,
+author = {{International Telecommunication Union}},
+file = {::},
+title = {{Recommendation ITU-R BT.1886 - Reference electro-optical transfer function for flat panel displays used in HDTV studio production BT Series Broadcasting service}},
+year = {2011}
}
-@misc{Wikipedia,
-author = {Wikipedia},
-title = {{YCbCr}},
-url = {https://en.wikipedia.org/wiki/YCbCr},
-urldate = {2016-02-29}
+@incollection{InternationalTelecommunicationUnion1998,
+author = {{International Telecommunication Union}},
+booktitle = {Recommendation ITU-R BT.470-6},
+file = {::},
+pages = {1--36},
+title = {{CONVENTIONAL TELEVISION SYSTEMS}},
+url = {http://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.470-6-199811-S!!PDF-E.pdf},
+year = {1998}
}
-@book{Westland2012,
-author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
-booktitle = {Computational Colour Science Using MATLAB},
-chapter = {4.4},
-edition = {2},
-isbn = {978-0-470-66569-5},
-pages = {38},
-title = {{Extrapolation Methods}},
-year = {2012}
+@techreport{InternationalTelecommunicationUnion2015,
+abstract = {The role of the Radiocommunication Sector is to ensure the rational, equitable, efficient and economical use of the radio-frequency spectrum by all radiocommunication services, including satellite services, and carry out studies without limit of frequency range on the basis of which Recommendations are adopted. The regulatory and policy functions of the Radiocommunication Sector are performed by World and Regional Radiocommunication Conferences and Radiocommunication Assemblies supported by Study Groups},
+author = {{International Telecommunication Union}},
+file = {::},
+pages = {1--8},
+title = {{Recommendation ITU-R BT.2020 - Parameter values for ultra-high definition television systems for production and international programme exchange}},
+url = {https://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.2020-2-201510-I!!PDF-E.pdf},
+volume = {1},
+year = {2015}
}
-@misc{Sastanin,
-author = {Sastanin},
-title = {{How to make scipy.interpolate give an extrapolated result beyond the input range?}},
-url = {http://stackoverflow.com/a/2745496/931625},
-urldate = {2014-08-08}
+@techreport{InternationalTelecommunicationUnion2015,
+author = {{International Telecommunication Union}},
+file = {::},
+pages = {1--32},
+title = {{Recommendation ITU-R BT.709-6 - Parameter values for the HDTV standards for production and international programme exchange BT Series Broadcasting service}},
+url = {https://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf},
+volume = {5},
+year = {2015}
}
-@book{Fairchild2013f,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {20.3},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {6197--6223},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{IPT Colourspace}},
-year = {2013}
+@article{Kang2002,
+author = {Kang, Bongsoon and Moon, Ohak and Hong, Changhee and Lee, Honam and Cho, Bonghwan and Kim, Youngsun},
+file = {::},
+journal = {Journal of the Korean {\ldots}},
+keywords = {chromaticity,cie-xyz,color temperature,hdtv},
+number = {6},
+pages = {865--871},
+title = {{Design of advanced color: Temperature control system for HDTV applications}},
+url = {http://cat.inist.fr/?aModele=afficheN{\&}cpsidt=14448733 http://icpr.snu.ac.kr/resource/wop.pdf/J01/2002/041/R06/J012002041R060865.pdf},
+volume = {41},
+year = {2002}
}
-@misc{TheAcademyofMotionPictureArtsandSciences2014,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Academy Color Encoding System (ACES) Project Subcomm(5).pdf:pdf},
-pages = {1--8},
-title = {{Technical Bulletin TB-2014-012 - Academy Color Encoding System Version 1.0 Component Names}},
-url = {https://github.com/ampas/aces-dev/tree/master/documents},
-year = {2014}
+@misc{Kienzle2011,
+author = {Kienzle, Paul and Patel, Nikunj and Krycka, James},
+title = {{refl1d.numpyerrors - Refl1D v0.6.19 documentation}},
+url = {http://www.reflectometry.org/danse/docs/refl1d/{\_}modules/refl1d/numpyerrors.html},
+urldate = {2015-01-30},
+year = {2011}
}
-@incollection{SMPTE2004,
-abstract = {cie Scope This practice specifies the chromaticity values of the red, green, and blue visible radiation emitted by the primaries and the chromaticity of the white point for professional monitors used in systems based on SMPTE C colorimetry.},
-author = {{Society of Motion Picture and Television Engineers}},
-booktitle = {RP 145:2004},
-doi = {10.5594/S9781614821649},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Society of Motion Picture and Television Engineers - 2004 - SMPTE C Color Monitor Colorimetry.pdf:pdf},
-isbn = {978-1-61482-164-9},
-month = {jan},
-title = {{SMPTE C Color Monitor Colorimetry}},
-url = {http://standards.smpte.org/content/978-1-61482-164-9/rp-145-2004/SEC1.abstract},
-volume = {RP 145:200},
-year = {2004}
+@article{COL:COL5080100109,
+author = {Krystek, M},
+doi = {10.1002/col.5080100109},
+issn = {1520-6378},
+journal = {Color Research {\&} Application},
+number = {1},
+pages = {38--40},
+publisher = {Wiley Subscription Services, Inc., A Wiley Company},
+title = {{An algorithm to calculate correlated colour temperature}},
+url = {http://dx.doi.org/10.1002/col.5080100109},
+volume = {10},
+year = {1985}
+}
+@misc{Laurent2012,
+author = {Laurent},
+title = {{Reproducibility of python pseudo-random numbers across systems and versions?}},
+url = {http://stackoverflow.com/questions/8786084/reproducibility-of-python-pseudo-random-numbers-across-systems-and-versions},
+urldate = {2015-01-20},
+year = {2012}
}
@article{Li2002,
abstract = {CMCCAT97 is a chromatic adaptation transform included in CIECAM97s, the CIE 1997 colour appearance model, for describing colour appearance under different viewing conditions and is recommended by, the Colour Measurement Committee of the Society, of Dyers and Colourists for predicting the degree of colour inconstancy, of surface colours. Among the many, transforms tested, this transform gave the most accurate predictions to a number of experimental data sets. However, the structure of CMCCAT97 is considered complicated and causes problems when applications require the use of its reverse mode. This article describes a simplified version of CMCCAT97-CMCCAT2000-which not only, is significantly, simpler and eliminates the problems of reversibility, but also gives a more accurate prediction to almost all experimental data sets than does the original transform. (C) 2002 John Wiley {\&} Sons, Inc.},
@@ -1006,19 +1035,20 @@ @article{Li2002
volume = {27},
year = {2002}
}
-@article{Bianco2010,
-author = {Bianco, S. and Schettini, R.},
-doi = {10.1002/col.20573},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Bianco, Schettini - 2010 - Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization.pdf:pdf},
-issn = {03612317},
-journal = {Color Research {\&} Application},
-month = {jun},
-number = {3},
-pages = {184--192},
-title = {{Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization}},
-url = {http://doi.wiley.com/10.1002/col.20573 http://web.stanford.edu/{~}sujason/ColorBalancing/Papers/Two New von Kries Based Chromatic Adaptation.pdf},
-volume = {35},
-year = {2010}
+@article{Li2007,
+author = {Li, Changjun and Perales, Esther and Luo, Ming Ronnier and Mart{\'{i}}nez-verd{\'{u}}, Francisco},
+file = {::},
+number = {July},
+pages = {1--10},
+title = {{The Problem with CAT02 and Its Correction}},
+year = {2007}
+}
+@misc{Lindbloom2014,
+author = {Lindbloom, Bruce},
+title = {{RGB Working Space Information}},
+url = {http://www.brucelindbloom.com/WorkingSpaceInfo.html},
+urldate = {2014-04-11},
+year = {2014}
}
@misc{Lindbloom2003e,
author = {Lindbloom, Bruce},
@@ -1027,11 +1057,79 @@ @misc{Lindbloom2003e
urldate = {2014-02-24},
year = {2003}
}
+@misc{Lindbloom2009b,
+author = {Lindbloom, Bruce},
+title = {{xyY to XYZ}},
+url = {http://www.brucelindbloom.com/Eqn{\_}xyY{\_}to{\_}XYZ.html},
+urldate = {2014-02-24},
+year = {2009}
+}
+@misc{Lindbloom2007a,
+author = {Lindbloom, Bruce},
+title = {{Spectral Power Distribution of a CIE D-Illuminant}},
+url = {http://www.brucelindbloom.com/Eqn{\_}DIlluminant.html},
+urldate = {2014-04-05},
+year = {2007}
+}
+@misc{Lindbloom2003f,
+author = {Lindbloom, Bruce},
+title = {{A Continuity Study of the CIE L* Function}},
+url = {http://brucelindbloom.com/LContinuity.html},
+urldate = {2014-02-24},
+year = {2003}
+}
+@misc{Lindbloom2009a,
+author = {Lindbloom, Bruce},
+title = {{Delta E (CMC)}},
+url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CMC.html},
+urldate = {2014-02-24},
+year = {2009}
+}
+@misc{Lindbloom2011,
+author = {Lindbloom, Bruce},
+title = {{Delta E (CIE 1994)}},
+url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE94.html},
+urldate = {2014-02-24},
+year = {2011}
+}
+@misc{Lindbloom2003,
+author = {Lindbloom, Bruce},
+title = {{Delta E (CIE 1976)}},
+url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE76.html},
+urldate = {2014-02-24},
+year = {2003}
+}
+@misc{Lindbloom2009,
+author = {Lindbloom, Bruce},
+title = {{Delta E (CIE 2000)}},
+url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE2000.html},
+urldate = {2014-02-24},
+year = {2009}
+}
+@misc{Lindbloom2009c,
+author = {Lindbloom, Bruce},
+title = {{Chromatic Adaptation}},
+url = {http://brucelindbloom.com/Eqn{\_}ChromAdapt.html},
+urldate = {2014-02-24},
+year = {2009}
+}
+@article{Lu2016,
+abstract = {High Dynamic Range (HDR) and Wider Colour Gamut (WCG) content represents a greater range of luminance levels and a more complete reproduction of colours found in real⁃world scenes. The current video distribution environments deliver Standard Dynamic Range (SDR) signal Y′CbCr. For HDR and WCG content, it is desirable to examine if such signal format still works well for compression, and to know if the overall system performance can be further improved by exploring different signal formats. In this paper, ITP (ICTCP) colour space is presented. The paper concentrates on examining the two aspects of ITP colour space: 1) ITP characteristics in terms of signal quantization at a given bit depth; 2) ITP compression performance. The analysis and simulation results show that ITP 10 bit has better properties than Y′CbCr⁃PQ 10bit in colour quantization, constant luminance, hue property and chroma subsampling, and it also has good compression efficiency. Therefore it is desirable to adopt ITP colour space as a new signal format for HDR/WCG video compression.},
+author = {Lu, Taoran and Pu, Fangjun and Yin, Peng and Chen, Tao and Husak, Walt and Pytlarz, Jaclyn and Atkins, Robin and Froehlich, Jan and Su, Guan-Ming},
+doi = {10.3969/j.},
+journal = {ZTE Communications},
+keywords = {HDR,ICT CP,ITP,WCG,Y′CbCr},
+number = {1},
+pages = {32--38},
+title = {{ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution}},
+volume = {14},
+year = {2016}
+}
@article{Lu2016a,
abstract = {High Dynamic Range (HDR) and Wider Colour Gamut (WCG) content represents a greater range of luminance levels and a more complete reproduction of colours found in real⁃world scenes. The current video distribution environments deliver Standard Dynamic Range (SDR) signal Y′CbCr. For HDR and WCG content, it is desirable to examine if such signal format still works well for compression, and to know if the overall system performance can be further improved by exploring different signal formats. In this paper, ITP (ICTCP) colour space is presented. The paper concentrates on examining the two aspects of ITP colour space: 1) ITP characteristics in terms of signal quantization at a given bit depth; 2) ITP compression performance. The analysis and simulation results show that ITP 10 bit has better properties than Y′CbCr⁃PQ 10bit in colour quantization, constant luminance, hue property and chroma subsampling, and it also has good compression efficiency. Therefore it is desirable to adopt ITP colour space as a new signal format for HDR/WCG video compression.},
author = {Lu, Taoran and Pu, Fangjun and Yin, Peng and Chen, Tao and Husak, Walt and Pytlarz, Jaclyn and Atkins, Robin and Froehlich, Jan and Su, Guan-Ming},
doi = {10.3969/j.},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Lu et al. - 2016 - ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution.pdf:pdf},
+file = {::},
journal = {ZTE Communications},
keywords = {HDR,ICT CP,ITP,WCG,Y′CbCr},
number = {1},
@@ -1040,52 +1138,62 @@ @article{Lu2016a
volume = {14},
year = {2016}
}
-@inproceedings{Smith1978,
-address = {New York, NY, USA},
-author = {Smith, Alvy Ray},
-booktitle = {Proceedings of the 5th Annual Conference on Computer Graphics and Interactive Techniques},
-doi = {10.1145/800248.807361},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Smith - 1978 - Color Gamut Transform Pairs.pdf:pdf},
-keywords = {Brightness,Color,Color transform,Gamut,HSL,HSV,Hue,Luminance,NTSC,RGB,Saturation,Value,color transforms},
-pages = {12--19},
-publisher = {ACM},
-series = {SIGGRAPH '78},
-title = {{Color Gamut Transform Pairs}},
-url = {http://doi.acm.org/10.1145/800248.807361 http://alvyray.com/Papers/CG/color78.pdf},
-year = {1978}
+@incollection{Luo2013,
+abstract = {This volume does much more than survey modern advanced color processing.$\backslash$nStarting with a historical perspective on ways we have classified$\backslash$ncolor, it sets out the latest numerical techniques for analyzing$\backslash$nand processing colors, the leading edge in our search to accurately$\backslash$nrecord and print what we see. The human eye perceives only a fraction$\backslash$nof available light wavelengths, yet we live in a multicolor world$\backslash$nof myriad shining hues. Colors rich in metaphorical associations$\backslash$nmake us "purple with rage" or "green with envy" and cause us to "see$\backslash$nred." Defining colors has been the work of centuries, culminating$\backslash$nin today's complex mathematical coding that nonetheless remains a$\backslash$nwork in progress: only recently have we possessed the computing capacity$\backslash$nto process the algebraic matrices that reproduce color more accurately.$\backslash$nWith chapters on dihedral color and image spectrometers, this book$\backslash$nprovides technicians and researchers with the knowledge they need$\backslash$nto grasp the intricacies of today's color imaging.},
+author = {Luo, Ming Ronnier and Li, Changjun},
+booktitle = {Advanced Color Image Processing and Analysis},
+doi = {10.1007/978-1-4419-6190-7},
+file = {::},
+isbn = {978-1-4419-6189-1},
+keywords = {cam,cat,chromatic adap-,ciecam02,color appearance model,colour appearance attributes,tation transforms,uniform colour spaces,visual phenomena},
+pages = {19--58},
+title = {{CIECAM02 and Its Recent Developments}},
+url = {http://link.springer.com/10.1007/978-1-4419-6190-7},
+year = {2013}
}
-@misc{Mansencala,
-author = {Mansencal, Thomas},
-title = {{Structure}},
-url = {https://github.com/KelSolaar/Foundations/blob/develop/foundations/data{\_}structures.py}
+@article{Luo1996,
+abstract = {A new colour model, named LLAB(l:c) is derived. It includes two parts: the BFD chromatic adaptation transform derived by Lam and Rigg, and a modified CIELAB uniform colour space. The model's performance was compared with the other spaces and models using the LUTCHI Colour Appearance Data Set. The results show that LLAB(l:c) model is capable of precisely quantifying the change of colour appearance under a wide range of viewing parameters such as light sources, surrounds/media, achromatic backgrounds, sizes of stimuli, and luminance levels. It had a similar performance as that of the Hunt colour appearance model. The LLAB(l:c) model was also tested using various colour difference datasets. The model gave a similar performance as the state-of-the-art colour difference formulae such as CMC, CIE94, and BFD. This performance is considered to be very satisfactory, and the model, therefore, should be considered for field trials in applications such as colour specification, colour difference evaluation, cross-image reproduction, gamut mapping, prediction of metamerism and colour constancy, and quantification of colour-rendering properties. The model does not give predictions for chroma (as distinct from colourfulness), or for brightness, and it does not include any rod response. {\textcopyright} 1996 John Wiley {\&} Sons, Inc.},
+author = {Luo, Ming Ronnier and Lo, Mei-Chun and Kuo, Wen-Guey},
+doi = {10.1002/(SICI)1520-6378(199612)21:6<412::AID-COL4>3.0.CO;2-Z},
+issn = {1520-6378},
+journal = {Color Research {\&} Application},
+keywords = {chromatic adaptation transform,colour appearance,colour appearance model,colour difference,colour difference formula,corresponding colours,uniform colour space},
+number = {6},
+pages = {412--429},
+publisher = {Wiley Subscription Services, Inc., A Wiley Company},
+title = {{The LLAB (l:c) colour model}},
+url = {http://dx.doi.org/10.1002/(SICI)1520-6378(199612)21:6{\%}3C412::AID-COL4{\%}3E3.0.CO;2-Z},
+volume = {21},
+year = {1996}
}
-@incollection{CIETC1-482004d,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-chapter = {3.1},
-isbn = {978-3-901-90633-6},
-pages = {12--13},
-title = {{3.1 Recommendations concerning standard physical data of illuminants}},
-url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
-year = {2004}
+@inproceedings{Luo1996a,
+author = {Luo, Ming Ronnier and Morovic, J{\'{a}}n},
+booktitle = {Conference: 5th International Conference on High Technology: Imaging Science and Technology – Evolution {\&} Promise},
+pages = {136--147},
+title = {{Two Unsolved Issues in Colour Management – Colour Appearance and Gamut Mapping}},
+url = {http://www.researchgate.net/publication/236348295{\_}Two{\_}Unsolved{\_}Issues{\_}in{\_}Colour{\_}Management{\_}{\_}Colour{\_}Appearance{\_}and{\_}Gamut{\_}Mapping},
+year = {1996}
}
-@book{Fairchild2013b,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {13},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {5563--5824},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{The RLAB Model}},
-year = {2013}
+@article{Luo2006,
+abstract = {Can a single colour model be used for all colorimetric applications? This article intends to answer that question. Colour appearance models have been developed to predict colour appearance under different viewing conditions. They are also capable of evaluating colour differences because of their embedded uniform colour spaces. This article first tests the performance of the CIE 2002 colour appearance model, CIECAM02, in predicting three types of colour discrimination data sets: large- and small-magnitude colour differences under daylight illuminants and small-magnitude colour differences under illuminant A. The results showed that CIECAM02 gave reasonable performance compared with the best available formulae and uniform colour spaces. It was further extended to give accurate predictions to all types of colour discrimination data. The results were very encouraging in that the CIECAM02 extensions performed second best among all the colour models tested and only slightly poorer than the models that were developed to fit a particular data set. One extension derived to fit all types of data can predict well for colour differences having a large range of difference magnitudes. 2006 Wiley Periodicals, Inc. Col Res Appl, 31, 320-330, 2006; Published online in Wiley InterScience DOI 10.1002/col.20227},
+author = {Luo, Ronnier M. and Cui, Guihua and Li, Changjun},
+doi = {10.1002/col.20227},
+file = {::},
+isbn = {0361-2317},
+issn = {03612317},
+journal = {Color Research and Application},
+keywords = {Colour appearance data,Colour appearance model,Colour difference data,Colour difference formula,Uniform colour space},
+number = {4},
+pages = {320--330},
+title = {{Uniform Colour Spaces Based on CIECAM02 Colour Appearance Model}},
+volume = {31},
+year = {2006}
}
@article{MacAdam1935,
abstract = {Tristimulus values have been computed for hypothetical spectrophotometric curves of the type found to give the maximum visual reflectance factor (or transmission factor) for specified chromaticities. These computations have been based on the I.C.I. 1931 data for the normal observer for colorimetry, and on the I.C.I. Illuminants ``A'' and ``C.'' By plotting the results on the I.C.I. color mixture diagram, the loci of points characterized by equal maximum efficiencies have been established. Tables have been prepared showing the maximum visual efficiency as a function of excitation purity for twenty-four dominant wave-lengths.},
author = {MacAdam, David L.},
doi = {10.1364/JOSA.25.000361},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/MacAdam - 1935 - Maximum Visual Efficiency of Colored Materials.pdf:pdf},
+file = {::},
journal = {J. Opt. Soc. Am.},
month = {nov},
number = {11},
@@ -1096,50 +1204,124 @@ @article{MacAdam1935
volume = {25},
year = {1935}
}
-@misc{CVRLf,
-author = {CVRL},
-title = {{New CIE XYZ functions transformed from the CIE (2006) LMS functions}},
-url = {http://cvrl.ioo.ucl.ac.uk/ciexyzpr.htm},
-urldate = {2014-02-24}
+@article{Machado2010,
+author = {Machado, Gm},
+file = {::},
+keywords = {Anomalous Trichromacy,Color Perception,Color Vision Deficiency,Color-Contrast Enhancement,Dichromacy,Models of Color Vision,Recoloring Algorithm,Simulation of Color Vision Deficiency},
+title = {{A model for simulation of color vision deficiency and a color contrast enhancement technique for dichromats}},
+url = {http://www.lume.ufrgs.br/handle/10183/26950},
+year = {2010}
}
-@misc{EasyRGB,
-author = {EasyRGB},
-title = {{HSV —{\textgreater} RGB}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=21{\#}text21},
-urldate = {2014-05-18}
+@misc{Mansencal2015,
+author = {Mansencal, Thomas},
+title = {{RED Colourspaces Derivation}},
+url = {http://colour-science.org/posts/red-colourspaces-derivation},
+urldate = {2015-05-20},
+year = {2015}
}
-@article{,
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Lu et al. - 2016 - ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution.pdf:pdf},
-title = {{ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution}}
+@inproceedings{Mansencal,
+author = {Mansencal, Thomas},
+title = {{Lookup}},
+url = {https://github.com/KelSolaar/Foundations/blob/develop/foundations/data{\_}structures.py}
}
-@article{Wyszecki1963,
-author = {Wyszecki, G{\"{u}}nther},
-doi = {10.1364/JOSA.53.001318},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Wyszecki - 1963 - Proposal for a New Color-Difference Formula.pdf:pdf},
-issn = {0030-3941},
-journal = {J. Opt. Soc. Am.},
-month = {nov},
-number = {11},
-pages = {1318--1319},
-publisher = {OSA},
-title = {{Proposal for a New Color-Difference Formula}},
-url = {http://www.opticsinfobase.org/abstract.cfm?URI=josa-53-11-1318},
-volume = {53},
-year = {1963}
+@inproceedings{Mansencala,
+author = {Mansencal, Thomas},
+title = {{Structure}},
+url = {https://github.com/KelSolaar/Foundations/blob/develop/foundations/data{\_}structures.py}
}
-@inproceedings{Luo1996a,
-author = {Luo, Ming Ronnier and Morovic, J{\'{a}}n},
-booktitle = {Conference: 5th International Conference on High Technology: Imaging Science and Technology – Evolution {\&} Promise},
-pages = {136--147},
-title = {{Two Unsolved Issues in Colour Management – Colour Appearance and Gamut Mapping}},
-url = {http://www.researchgate.net/publication/236348295{\_}Two{\_}Unsolved{\_}Issues{\_}in{\_}Colour{\_}Management{\_}{\_}Colour{\_}Appearance{\_}and{\_}Gamut{\_}Mapping},
-year = {1996}
+@misc{mansencal_2015_17370,
+author = {Mansencal, Thomas and Mauderer, Michael and Parsons, Michael},
+doi = {10.5281/zenodo.17370},
+month = {may},
+title = {{Colour 0.3.5}},
+url = {http://dx.doi.org/10.5281/zenodo.17370},
+year = {2015}
+}
+@article{Melgosa2013,
+author = {Melgosa, Manuel},
+file = {::},
+number = {July},
+title = {{CIE / ISO new standard: CIEDE2000}},
+url = {http://www.color.org/events/colorimetry/Melgosa{\_}CIEDE2000{\_}Workshop-July4.pdf},
+volume = {2013},
+year = {2013}
+}
+@article{Meng2015,
+author = {Meng, Johannes and Simon, Florian and Hanika, Johannes},
+file = {::},
+number = {4},
+title = {{Physically Meaningful Rendering using Tristimulus Colours}},
+url = {http://jo.dreggn.org/home/2015{\_}spectrum.pdf},
+volume = {34},
+year = {2015}
+}
+@misc{Miller2014,
+author = {Miller, Scott and {Dolby Laboratories}},
+file = {::},
+pages = {1--17},
+title = {{A Perceptual EOTF for Extended Dynamic Range Imagery}},
+url = {https://www.smpte.org/sites/default/files/2014-05-06-EOTF-Miller-1-2-handout.pdf},
+year = {2014}
+}
+@article{Moroney,
+abstract = {The CIE Technical Committee 8-01, color appearance models for color management applications, has recently proposed a single set of revisions to the CIECAM97s color appearance model. This new model, called CIECAM02, is based on CIECAM97s but includes many revisions and some simplifications. A partial list of revisions includes a linear chromatic adaptation transform, a new non-linear response compression function and modifications to the calculations for the perceptual attribute correlates. The format of this paper is an annotated description of the forward equations for the model.},
+author = {Moroney, Nathan and Fairchild, Mark D. and Hunt, Robert W. G. and Li, Changjun and Luo, Ming Ronnier and Newman, Todd},
+file = {::},
+journal = {Color and Imaging Conference},
+number = {1},
+pages = {23--27},
+title = {{The CIECAM02 Color Appearance Model}},
+url = {http://www.ingentaconnect.com/content/ist/cic/2002/00002002/00000001/art00006},
+volume = {2002}
+}
+@misc{MunsellColorSciencea,
+author = {{Munsell Color Science}},
+title = {{Macbeth Colorchecker}},
+url = {http://www.rit-mcsl.org/UsefulData/MacbethColorChecker.xls http://www.cis.rit.edu/research/mcsl2/online/cie.php}
+}
+@misc{MunsellColorScience,
+author = {{Munsell Color Science}},
+title = {{Munsell Colours Data}},
+url = {http://www.cis.rit.edu/research/mcsl2/online/munsell.php},
+urldate = {2014-08-20}
+}
+@article{NationalElectricalManufacturersAssociation2004,
+abstract = {Two sensitive procedures to quantitate human exposure to endogenous N-nitroso compounds (NOC) and/or methylating agents have been developed. One, the NPRO test, is based on the excretion of N-nitrosoproline (NPRO) and other N-nitrosoamino acids in the urine, that are measured as an index of endogenous nitrosation, following ingestion of precursors. The NPRO test has been applied to human subjects in clinical and epidemiological studies, and the kinetics and dietary modifiers of endogenous nitrosation have been investigated. Results obtained after application of the NPRO test to subjects at high risk for cancers of the stomach, esophagus, oral cavity and urinary bladder are summarized. In most instances, higher exposures to endogenous NOC were found in high-risk subjects, but individual exposure was greatly affected by dietary modifiers or disease state. Vitamin C efficiently lowered the body burden of intragastrically formed NOC. In experimental animals 3-methyladenine (3-MeAde) is excreted in urine following exposure to methylating NOC. Humans normally excrete 3-MeAde, the origin of which remains unknown. Recently developed analytical methodology permits large numbers of human urine samples to be analyzed and a wide variation is observed. Preliminary results suggest a weak correlation between basal NPRO excretion and background 3-MeAde excretion. Taken together, the results point to an etiological role of endogenously formed NOC in certain human cancers, and provide an interpretation of epidemiological findings that have shown protective effects of fruits and vegetables against several malignancies.},
+author = {{National Electrical Manufacturers Association}},
+doi = {10.1007/BF03168637},
+file = {::},
+journal = {Medicine},
+number = {S1},
+pages = {3--4},
+title = {{Digital Imaging and Communications in Medicine ( DICOM ) Part 14 : Grayscale Standard Display Function}},
+url = {http://www.ncbi.nlm.nih.gov/pubmed/2188123},
+volume = {10},
+year = {2004}
+}
+@misc{Nattress2016,
+author = {Nattress, Graeme},
+title = {{Private Discussion with Shaw, N.}},
+year = {2016}
+}
+@article{Nayatani1995,
+author = {Nayatani, Yoshinobu and Sobagaki, Hiroaki and Yano, Kenjiro Hashimoto Tadashi},
+doi = {10.1002/col.5080200305},
+issn = {1520-6378},
+journal = {Color Research {\&} Application},
+keywords = {color-vision model,lightness dependency of chroma,nonlinear color-appearance model},
+number = {3},
+pages = {156--167},
+publisher = {Wiley Subscription Services, Inc., A Wiley Company},
+title = {{Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation}},
+url = {http://dx.doi.org/10.1002/col.5080200305},
+volume = {20},
+year = {1995}
}
@article{Newhall1943,
abstract = {This report presents the characteristics of a modified and enlarged Munsell solid which has been evolved from the 1940 visual estimates of the Munsell Book of Color samples. All three dimensions have been carefully reviewed and extensively revised. The newly defined loci of constant hue have been extended closer to the extremes of value while the loci of constant chroma have been extrapolated to the pigment maximum. The dimension of value has been redefined without substantial departure from the Munsell-Sloan-Godlove scale. By the above changes a solid is achieved which approaches more closely to A. H. Munsell's dual ideal of psychological equispacing and precise applicability. The new solid is defined in terms of the I.C.I. standard coordinate system and Illuminant C.},
author = {Newhall, Sidney M. and Nickerson, Dorothy and Judd, Deane B.},
doi = {10.1364/JOSA.33.000385},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Newhall, Nickerson, Judd - 1943 - Final report of the OSA subcommittee on the spacing of the munsell colors.pdf:pdf},
+file = {::},
issn = {0030-3941},
journal = {JOSA},
month = {jul},
@@ -1150,6 +1332,90 @@ @article{Newhall1943
volume = {33},
year = {1943}
}
+@article{Ohno2014,
+author = {Ohno, Yoshi},
+doi = {10.1080/15502724.2014.839020},
+file = {::},
+issn = {1550-2724},
+journal = {LEUKOS},
+keywords = {Duv,Planckian locus,chromaticity,correlated color temperature,duv,light source,planckian locus},
+month = {jan},
+number = {1},
+pages = {47--55},
+title = {{Practical Use and Calculation of CCT and Duv}},
+url = {http://www.tandfonline.com/doi/abs/10.1080/15502724.2014.839020 http://dx.doi.org/10.1080/15502724.2014.839020},
+volume = {10},
+year = {2014}
+}
+@misc{Ohno2008,
+author = {Ohno, Yoshi and Davis, Wendy},
+file = {::},
+title = {{NIST CQS simulation 7.4}},
+url = {http://cie2.nist.gov/TC1-69/NIST CQS simulation 7.4.xls},
+year = {2008}
+}
+@misc{Ohta1997,
+author = {Ohta, N.},
+title = {{The basis of color reproduction engineering}},
+year = {1997}
+}
+@misc{Panasonic2014,
+author = {Panasonic},
+file = {::},
+pages = {1--7},
+title = {{VARICAM V-Log/V-Gamut}},
+url = {http://pro-av.panasonic.net/en/varicam/common/pdf/VARICAM{\_}V-Log{\_}V-Gamut.pdf},
+year = {2014}
+}
+@misc{Pointer1980,
+author = {Pointer, Michael R.},
+file = {::},
+title = {{Pointer's Gamut Data}},
+url = {http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls http://www.cis.rit.edu/research/mcsl2/online/cie.php},
+year = {1980}
+}
+@misc{Reitz,
+author = {Reitz, Kenneth},
+title = {{CaseInsensitiveDict}},
+url = {https://github.com/kennethreitz/requests/blob/v1.2.3/requests/structures.py{\#}L37}
+}
+@misc{RenewableResourceDataCenter2003,
+author = {{Renewable Resource Data Center}},
+title = {{Reference Solar Spectral Irradiance: ASTM G-173}},
+url = {http://rredc.nrel.gov/solar/spectra/am1.5/ASTMG173/ASTMG173.html},
+urldate = {2014-08-23},
+year = {2003}
+}
+@misc{Ruana,
+author = {Ruana, Rob},
+title = {pockets.iterators},
+url = {https://github.com/RobRuana/pockets/blob/master/pockets/iterators.py},
+urldate = {2016-08-14}
+}
+@misc{Ruana,
+author = {Ruana, Rob},
+title = {pockets.tests.test{\_}iterators},
+url = {https://github.com/RobRuana/pockets/blob/master/tests/test{\_}iterators.py},
+urldate = {2016-08-14}
+}
+@misc{Ruana,
+author = {Ruana, Rob},
+title = {sphinxcontrib.napoleon},
+url = {https://bitbucket.org/birkenfeld/sphinx-contrib/src/21e3b2dc70a43d3f7e8942c4aaf078f66e1c575b/napoleon/sphinxcontrib/napoleon/docstring.py},
+urldate = {2016-08-14}
+}
+@misc{Saeedn,
+author = {Saeedn},
+title = {{Extend a line segment a specific distance}},
+url = {http://stackoverflow.com/questions/7740507/extend-a-line-segment-a-specific-distance},
+urldate = {2016-01-16}
+}
+@misc{Sastanin,
+author = {Sastanin},
+title = {{How to make scipy.interpolate give an extrapolated result beyond the input range?}},
+url = {http://stackoverflow.com/a/2745496/931625},
+urldate = {2014-08-08}
+}
@article{Sharma2005,
abstract = {This article and the associated data and programs$\backslash$nprovided with it are intended to assist color engineers and$\backslash$nscientists in correctly implementing the recently developed$\backslash$nCIEDE2000 color-difference formula. We indicate several$\backslash$npotential implementation errors that are not uncovered in$\backslash$ntests performed using the original sample data published$\backslash$nwith the standard. A supplemental set of data is provided for$\backslash$ncomprehensive testing of implementations. The test data,$\backslash$nMicrosoft Excel spreadsheets, and MATLAB scripts for$\backslash$nevaluating the CIEDE2000 color difference are made avail-$\backslash$nable at the first author's website. Finally, we also point out$\backslash$nsmall mathematical discontinuities in the formula.},
author = {Sharma, Gaurav and Wu, Wencheng and Dalal, Edul N.},
@@ -1166,206 +1432,221 @@ @article{Sharma2005
volume = {30},
year = {2005}
}
-@misc{HutchColorc,
-author = {HutchColor},
-title = {{MaxRGB (4 K)}},
-url = {http://www.hutchcolor.com/profiles/MaxRGB.zip http://www.hutchcolor.com/profiles.html}
+@article{Shirley2015,
+abstract = {In the spirit of the HSV color space, we introduce a simple transform of the RGB color cube into a light/dark dimension and a 2D hue. The hue is a normalized (barycentric) triangle with pure red, green, and blue at the vertices, often called the Maxwell Color Tri- angle. Each cross section of the space is the same barycentric triangle, and the light/dark dimension runs zero to one for each hue so the whole color volume takes the form of a prism. This prismatic space has advantages computationally and intuitively for some common color operations used in computer graphics and image processing.},
+author = {Shirley, Peter and Hart, David},
+file = {::},
+pages = {2--7},
+title = {{The prismatic color space for rgb computations}},
+year = {2015}
+}
+@inproceedings{Smith1978,
+address = {New York, NY, USA},
+author = {Smith, Alvy Ray},
+booktitle = {Proceedings of the 5th Annual Conference on Computer Graphics and Interactive Techniques},
+doi = {10.1145/800248.807361},
+file = {::},
+keywords = {Brightness,Color,Color transform,Gamut,HSL,HSV,Hue,Luminance,NTSC,RGB,Saturation,Value,color transforms},
+pages = {12--19},
+publisher = {ACM},
+series = {SIGGRAPH '78},
+title = {{Color Gamut Transform Pairs}},
+url = {http://doi.acm.org/10.1145/800248.807361 http://alvyray.com/Papers/CG/color78.pdf},
+year = {1978}
}
-@misc{,
-title = {{Protanopia – Red-Green Color Blindness}},
-url = {http://www.color-blindness.com/protanopia-red-green-color-blindness/},
-urldate = {2015-07-04}
+@article{Smits1999,
+abstract = {The desire for accuracy and realism in images requires a physically-based rendering system. Often this can mean using a full spectral representation, as RGB represen- tations have limitations in some situations4. The spectral representation does come at some cost, not ...},
+author = {Smits, Brian},
+doi = {10.1080/10867651.1999.10487511},
+file = {::},
+issn = {1086-7651},
+journal = {Journal of Graphics Tools},
+month = {jan},
+number = {4},
+pages = {11--22},
+publisher = {AK Peters, Ltd.},
+title = {{An RGB-to-Spectrum Conversion for Reflectances}},
+url = {http://www.cs.utah.edu/{~}bes/papers/color/ http://www.tandfonline.com/doi/abs/10.1080/10867651.1999.10487511},
+volume = {4},
+year = {1999}
}
-@misc{Cottrell,
-author = {Cottrell, Russell},
-title = {{The Russell RGB working color space}},
-url = {http://www.russellcottrell.com/photo/downloads/RussellRGB.icc http://www.russellcottrell.com/photo/RussellRGB.htm}
+@article{SocietyofMotionPictureandTelevisionEngineers1999,
+author = {{Society of Motion Picture and Television Engineers}},
+file = {::},
+pages = {1--7},
+title = {{ANSI/SMPTE 240M-1995 - Signal Parameters - 1125-Line High-Definition Production Systems}},
+url = {http://car.france3.mars.free.fr/HD/INA- 26 jan 06/SMPTE normes et confs/s240m.pdf},
+year = {1999}
}
-@misc{Wikipediah,
-author = {Wikipedia},
-title = {{CIE 1960 color space}},
-url = {http://en.wikipedia.org/wiki/CIE{\_}1960{\_}color{\_}space},
-urldate = {2014-02-24}
+@misc{SocietyofMotionPictureandTelevisionEngineers2014,
+abstract = {This standard specifies an EOTF characterizing high-dynamic-range reference displays used primarily for mastering non-broadcast content. This standard also specifies an Inverse-EOTF derived from the EOTF.},
+author = {{Society of Motion Picture and Television Engineers}},
+doi = {10.5594/SMPTE.ST2084.2014},
+file = {::},
+pages = {1--14},
+title = {{SMPTE ST 2084:2014 - Dynamic Range Electro-Optical Transfer Function of Mastering Reference Displays}},
+url = {http://www.techstreet.com/products/1883436},
+year = {2014}
}
-@article{Dolby2016,
-author = {Dolby},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Dolby - 2016 - WHAT IS ICTCP - INTRODUCTION.pdf:pdf},
-title = {{WHAT IS ICTCP? - INTRODUCTION}},
-url = {https://www.dolby.com/us/en/technologies/dolby-vision/ICtCp-white-paper.pdf},
-year = {2016}
+@incollection{SMPTE1993,
+abstract = {color white whitepoint matrix Scope This practice is intended to define the numerical procedures for deriving basic color equations for color television and other systems using additive display devices. These equations are first, the normalized reference primary matrix which defines the relationship between RGB signals and CIE tristimulus values XYZ; then, the system luminance equation; and finally, the color primary transformation matrix for transforming signals from one set of reference primaries to another set of reference primaries or to a set of display primaries.},
+author = {{Society of Motion Picture and Television Engineers}},
+booktitle = {RP 177:1993},
+doi = {10.5594/S9781614821915},
+file = {:Users/kelsolaar/Library/Application Support/Mendeley Desktop/Downloaded/SMPTE - 1993 - RP 177-1993 Derivation of Basic Television Color Equations.pdf:pdf},
+isbn = {978-1-61482-191-5},
+month = {jan},
+pages = {1--4},
+title = {{Derivation of Basic Television Color Equations}},
+url = {http://standards.smpte.org/content/978-1-61482-191-5/rp-177-1993/SEC1.abstract http://car.france3.mars.free.fr/HD/INA- 26 jan 06/SMPTE normes et confs/rp177.pdf},
+volume = {RP 177:199},
+year = {1993}
}
-@book{Fairchild2013c,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {12},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {5094--5556},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{The Hunt Model}},
-year = {2013}
+@incollection{SMPTE2004,
+abstract = {cie Scope This practice specifies the chromaticity values of the red, green, and blue visible radiation emitted by the primaries and the chromaticity of the white point for professional monitors used in systems based on SMPTE C colorimetry.},
+author = {{Society of Motion Picture and Television Engineers}},
+booktitle = {RP 145:2004},
+doi = {10.5594/S9781614821649},
+file = {::},
+isbn = {978-1-61482-164-9},
+month = {jan},
+title = {{SMPTE C Color Monitor Colorimetry}},
+url = {http://standards.smpte.org/content/978-1-61482-164-9/rp-145-2004/SEC1.abstract},
+volume = {RP 145:200},
+year = {2004}
}
-@misc{Wikipediaa,
-author = {Wikipedia},
-title = {{List of common coordinate transformations}},
-url = {http://en.wikipedia.org/wiki/List{\_}of{\_}common{\_}coordinate{\_}transformations}
+@misc{SonyCorporationb,
+author = {{Sony Corporation}},
+title = {{S-Gamut3{\_}S-Gamut3Cine{\_}Matrix.xlsx}},
+url = {https://community.sony.com/sony/attachments/sony/large-sensor-camera-F5-F55/12359/3/S-Gamut3{\_}S-Gamut3Cine{\_}Matrix.xlsx}
}
-@article{Fairchild1998,
-abstract = {The colorimetric characterization of a flat-panel LCD monitor, the Apple Studio Display, using traditional CRT characterization techniques was evaluated. The results showed that the display performed up to the manufacturer's specifications in terms of luminance and contrast. However, the traditional CRT gain-offset-gamma (GOG) model for characterization was inadequate and a model with one-dimensional lookup tables followed by a 3x3 matrix was developed. The LUT model performed excellently with average CIE94 color differences between measured and predicted colors of approximately 1.0.},
-author = {Fairchild, M. and Wyble, D.},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild, Wyble - 1998 - Colorimetric Characterization of The Apple Studio Display (flat panel LCD).pdf:pdf},
-pages = {22},
-title = {{Colorimetric Characterization of The Apple Studio Display (flat panel LCD)}},
-url = {https://ritdml.rit.edu/handle/1850/4368},
-year = {1998}
+@misc{SonyCorporationa,
+author = {{Sony Corporation}},
+file = {::},
+pages = {1--7},
+title = {{Technical Summary for S-Gamut3.Cine/S-Log3 and S-Gamut3/S-Log3}},
+url = {http://community.sony.com/sony/attachments/sony/large-sensor-camera-F5-F55/12359/2/TechnicalSummary{\_}for{\_}S-Gamut3Cine{\_}S-Gamut3{\_}S-Log3{\_}V1{\_}00.pdf}
}
-@misc{Wikipediad,
-author = {Wikipedia},
-title = {{Color temperature}},
-url = {http://en.wikipedia.org/wiki/Color{\_}temperature},
-urldate = {2014-06-28}
+@misc{SonyCorporation,
+author = {{Sony Corporation}},
+file = {::},
+pages = {1--17},
+title = {{S-Log Whitepaper}},
+url = {http://www.theodoropoulos.info/attachments/076{\_}on S-Log.pdf}
}
-@book{Westland2012b,
-author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
-edition = {2},
-isbn = {978-0-470-66569-5},
-pages = {1--240},
-title = {{Computational Colour Science Using MATLAB}},
+@misc{SonyImageworks2012,
+author = {{Sony Imageworks}},
+pages = {1},
+title = {make.py},
+url = {https://github.com/imageworks/OpenColorIO-Configs/blob/master/nuke-default/make.py},
+urldate = {2014-11-27},
year = {2012}
}
-@misc{CVRLc,
-author = {CVRL},
-title = {{Older CIE Standards}},
-url = {http://cvrl.ioo.ucl.ac.uk/cie.htm},
-urldate = {2014-02-24}
-}
-@misc{CVRLg,
-author = {CVRL},
-title = {{Stiles {\&} Burch individual 10-deg colour matching data}},
-url = {http://www.cvrl.org/stilesburch10{\_}ind.htm},
-urldate = {2014-02-24}
+@article{Spaulding2000,
+abstract = {A new color encoding specification known as Reference Output Medium Metric RGB (ROMM RGB) is defined. This color encoding is intended to be used for storing, interchanging and manipulating images that exist in a rendered image state without imposing the gamut limitations normally associated with device-specific color spaces. ROMM RGB was designed to provide a large enough color gamut to encompass most common output devices, while simultaneously satisfying a number of other important criteria. It is defined in a way that is tightly linked to the ICC profile connection space (PCS) and is suitable for use as an Adobe PhotoshopTM working color space. A companion color encoding specification, known as Reference Input Medium Metric RGB (RIMM RGB), is also defined. This encoding can be used to represent images in an unrendered scene image state.},
+author = {Spaulding, K E and Woolfe, G J and Giorgianni, E J},
+file = {::},
+pages = {1--8},
+title = {{Reference Input/Output Medium Metric RGB Color Encodings (RIMM/ROMM RGB)}},
+url = {http://www.photo-lovers.org/pdf/color/romm.pdf},
+year = {2000}
}
-@article{Kang2002,
-author = {Kang, Bongsoon and Moon, Ohak and Hong, Changhee and Lee, Honam and Cho, Bonghwan and Kim, Youngsun},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Kang et al. - 2002 - Design of advanced color Temperature control system for HDTV applications.pdf:pdf},
-journal = {Journal of the Korean {\ldots}},
-keywords = {chromaticity,cie-xyz,color temperature,hdtv},
-number = {6},
-pages = {865--871},
-title = {{Design of advanced color: Temperature control system for HDTV applications}},
-url = {http://cat.inist.fr/?aModele=afficheN{\&}cpsidt=14448733 http://icpr.snu.ac.kr/resource/wop.pdf/J01/2002/041/R06/J012002041R060865.pdf},
-volume = {41},
-year = {2002}
+@misc{Spiker2015,
+author = {Spiker, Nick},
+title = {{Private Discussion with Mansencal, T.}},
+url = {http://www.repairfaq.org/sam/repspec/ http://www.invisiblelightimages.com/},
+year = {2015}
}
-@misc{CVRLa,
-author = {CVRL},
-title = {{Stiles {\&} Burch individual 2-deg colour matching data}},
-url = {http://www.cvrl.org/stilesburch2{\_}ind.htm},
-urldate = {2014-02-24}
+@article{Stearns1988,
+author = {Stearns, E. I. and Stearns, R. E.},
+doi = {10.1002/col.5080130410},
+issn = {1520-6378},
+journal = {Color Research {\&} Application},
+number = {4},
+pages = {257--259},
+publisher = {Wiley Subscription Services, Inc., A Wiley Company},
+title = {{An example of a method for correcting radiance data for Bandpass error}},
+url = {http://dx.doi.org/10.1002/col.5080130410},
+volume = {13},
+year = {1988}
}
-@misc{Wikipediab,
-author = {Wikipedia},
-title = {{Lagrange polynomial - Definition}},
-url = {https://en.wikipedia.org/wiki/Lagrange{\_}polynomial{\#}Definition},
-urldate = {2016-01-20}
+@article{Susstrunk1999,
+abstract = {This paper describes the specifications and usage of standard RGB color spaces promoted today by standard bodies and/or the imaging industry. As in the past, most of the new standard RGB color spaces were developed for specific imaging workflow and applications. They are used as interchange spaces to communicate color and/or as working spaces in imaging applications. Standard color spaces can facilitate color communication: if an image is in ‘knownRGB,' the user, application, and/or device can unambiguously understand the color of the image, and further color manage from there if necessary. When applied correctly, a standard RGB space can minimize color space conversions in an imaging workflow, improve image reproducibility, and facilitate accountability.$\backslash$nThe digital image color workflow is examined with emphasis on when an RGB color space is appropriate, and when to apply color management by profile. An RGB space is “standard” because either it is defined in an official standards document (a de jure standard) or it is supported by commonly used tools (a de facto standard). Examples of standard RGB color spaces are ISO RGB, sRGB, ROMM RGB, Adobe RGB 98, Apple RGB, and video RGB spaces (NTSC, EBU, ITU-R BT.709). As there is no one RGB color space that is suitable for all imaging needs, factors to consider when choosing an RGB color space are discussed.},
+author = {Susstrunk, Sabine and Buckley, Robert and Swen, Steve},
+file = {::},
+isbn = {2166-9635},
+journal = {New York},
+keywords = {are becoming a thing,color communication,color image workflow,color management,color spaces,color standards,it is quite common,of the,past,skilled operators manage color,to be scanned by,today for an image},
+pages = {127--134},
+title = {{Standard RGB Color Spaces}},
+year = {1999}
}
-@misc{Broadbent2009,
-author = {Broadbent, A. D.},
-title = {{Calculation from the original experimental data of the CIE 1931 RGB standard observer spectral chromaticity co-ordinates and color matching functions}},
-url = {http://www.cis.rit.edu/mcsl/research/1931.php},
-urldate = {2014-06-12},
-year = {2009}
+@misc{TheAcademyofMotionPictureArtsandSciences2016,
+author = {{The Academy of Motion Picture Arts and Sciences}},
+title = {{Specification S-2016-001 - ACEScct, A Quasi-Logarithmic Encoding of ACES Data for use within Color Grading Systems}},
+url = {https://github.com/ampas/aces-dev/tree/v1.0.3/documents},
+urldate = {2016-10-10},
+year = {2016}
}
-@misc{Ruana,
-author = {Ruana, Rob},
-title = {pockets.tests.test{\_}iterators},
-url = {https://github.com/RobRuana/pockets/blob/master/tests/test{\_}iterators.py},
-urldate = {2016-08-14}
+@article{TheAcademyofMotionPictureArtsandSciences2015,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+file = {::},
+pages = {1--9},
+title = {{Specification S-2014-004 - ACEScg – A Working Space for CGI Render and Compositing}},
+url = {https://github.com/ampas/aces-dev/tree/master/documents},
+year = {2015}
}
-@misc{Centore2014e,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/xyYtoMunsell.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+@misc{TheAcademyofMotionPictureArtsandSciences2014,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+file = {::},
+pages = {1--8},
+title = {{Technical Bulletin TB-2014-012 - Academy Color Encoding System Version 1.0 Component Names}},
+url = {https://github.com/ampas/aces-dev/tree/master/documents},
year = {2014}
}
-@misc{Wikipedia,
-author = {Wikipedia},
-title = {{Color difference}},
-url = {http://en.wikipedia.org/wiki/Color{\_}difference},
-urldate = {2014-08-29}
-}
-@misc{Centore2014j,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToASTMHue.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
+@misc{TheAcademyofMotionPictureArtsandSciences2014a,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+file = {::},
+pages = {1--40},
+title = {{Technical Bulletin TB-2014-004 - Informative Notes on SMPTE ST 2065-1 – Academy Color Encoding Specification (ACES)}},
+url = {https://github.com/ampas/aces-dev/tree/master/documents},
year = {2014}
}
-@misc{Lindbloom2009a,
-author = {Lindbloom, Bruce},
-title = {{Delta E (CMC)}},
-url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CMC.html},
-urldate = {2014-02-24},
-year = {2009}
-}
-@misc{Wikipediai,
-author = {Wikipedia},
-title = {{Luminosity function}},
-url = {https://en.wikipedia.org/wiki/Luminosity{\_}function{\#}Details},
-urldate = {2014-10-20}
-}
-@book{Wyszecki2000g,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {224--229},
-publisher = {Wiley},
-title = {{DISTRIBUTION TEMPERATURE, COLOR TEMPERATURE, AND CORRELATED COLOR TEMPERATURE}},
-year = {2000}
-}
-@misc{Mansencal,
-author = {Mansencal, Thomas},
-title = {{Lookup}},
-url = {https://github.com/KelSolaar/Foundations/blob/develop/foundations/data{\_}structures.py}
+@misc{TheAcademyofMotionPictureArtsandSciences2014b,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+file = {::},
+pages = {1--12},
+title = {{Specification S-2014-003 - ACEScc , A Logarithmic Encoding of ACES Data for use within Color Grading Systems}},
+url = {https://github.com/ampas/aces-dev/tree/master/documents},
+year = {2014}
}
-@misc{EasyRGBd,
-author = {EasyRGB},
-title = {{RGB —{\textgreater} HSV}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=20{\#}text20},
-urldate = {2014-05-18}
+@misc{TheAcademyofMotionPictureArtsandSciences2014c,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+file = {::},
+pages = {1--16},
+title = {{Specification S-2013-001 - ACESproxy , an Integer Log Encoding of ACES Image Data}},
+url = {https://github.com/ampas/aces-dev/tree/master/documents},
+year = {2014}
}
-@article{Bodhaine1999,
-abstract = {Many different techniques are used for the calculation of Rayleigh optical depth in the atmosphere. In some cases differences among these techniques can be important, especially in the UV region of the spectrum and under clean atmospheric conditions. The authors recommend that the calculation of Rayleigh optical depth be approached by going back to the first principles of Rayleigh scattering theory rather than the variety of curve- fitting techniques currently in use. A survey of the literature was conducted in order to determine the latest values of the physical constants necessary and to review the methods available for the calculation of Rayleigh optical depth. The recommended approach requires the accurate calculation of the refractive index of air based on the latest published measurements. Calculations estimating Rayleigh optical depth should be done as accurately as possible because the inaccuracies that arise can equal or even exceed other quantities being estimated, such as aerosol optical depth, particularly in the UV region of the spectrum. All of the calculations are simple enough to be done easily in a spreadsheet.},
-author = {Bodhaine, Barry A. and Wood, Norman B. and Dutton, Ellsworth G. and Slusser, James R.},
-doi = {10.1175/1520-0426(1999)016%3C1854:ORODC%3E2.0.CO;2},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Bodhaine et al. - 1999 - On Rayleigh optical depth calculations.pdf:pdf},
-journal = {Journal of Atmospheric {\ldots}},
-number = {11 PART 2},
-pages = {1854--1861},
-title = {{On Rayleigh optical depth calculations}},
-url = {http://journals.ametsoc.org/doi/abs/10.1175/1520-0426(1999)016{\%}253C1854:ORODC{\%}253E2.0.CO;2},
-volume = {16},
-year = {1999}
+@misc{TheAcademyofMotionPictureArtsandSciences,
+author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
+title = {{Academy Color Encoding System}},
+url = {http://www.oscars.org/science-technology/council/projects/aces.html},
+urldate = {2014-02-24}
}
-@misc{Centore2014,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@misc{Thorpe2012,
+author = {Thorpe, Larry},
+file = {::},
+title = {{CANON-LOG TRANSFER CHARACTERISTIC}},
+url = {http://downloads.canon.com/CDLC/Canon-Log{\_}Transfer{\_}Characteristic{\_}6-20-2012.pdf http://scholar.google.com/scholar?hl=en{\&}btnG=Search{\&}q=intitle:CANON-LOG+TRANSFER+CHARACTERISTIC{\#}0},
+year = {2012}
}
-@book{Fairchild2013,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {14.3},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {6025--6178},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{LLAB Model}},
-year = {2013}
+@misc{Trieu2015,
+author = {Trieu, Tashi},
+title = {{Private Discussion with Mansencal, T.}},
+year = {2015}
}
-@book{Westland2012a,
+@incollection{Westland2012a,
author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
booktitle = {Computational Colour Science Using MATLAB},
chapter = {6.2.3},
@@ -1375,66 +1656,77 @@ @book{Westland2012a
title = {{CMCCAT2000}},
year = {2012}
}
-@misc{Holmes,
-author = {Holmes, Joseph},
-title = {{Ekta Space PS 5}},
-url = {http://www.josephholmes.com/Ekta{\_}Space.zip http://www.josephholmes.com/profiles.html}
+@incollection{Westland2012e,
+author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
+booktitle = {Computational Colour Science Using MATLAB},
+chapter = {6.2.2},
+edition = {2},
+isbn = {978-0-470-66569-5},
+pages = {80},
+title = {{CMCCAT97}},
+year = {2012}
}
-@article{Susstrunk1999,
-abstract = {This paper describes the specifications and usage of standard RGB color spaces promoted today by standard bodies and/or the imaging industry. As in the past, most of the new standard RGB color spaces were developed for specific imaging workflow and applications. They are used as interchange spaces to communicate color and/or as working spaces in imaging applications. Standard color spaces can facilitate color communication: if an image is in ‘knownRGB,' the user, application, and/or device can unambiguously understand the color of the image, and further color manage from there if necessary. When applied correctly, a standard RGB space can minimize color space conversions in an imaging workflow, improve image reproducibility, and facilitate accountability.$\backslash$nThe digital image color workflow is examined with emphasis on when an RGB color space is appropriate, and when to apply color management by profile. An RGB space is “standard” because either it is defined in an official standards document (a de jure standard) or it is supported by commonly used tools (a de facto standard). Examples of standard RGB color spaces are ISO RGB, sRGB, ROMM RGB, Adobe RGB 98, Apple RGB, and video RGB spaces (NTSC, EBU, ITU-R BT.709). As there is no one RGB color space that is suitable for all imaging needs, factors to consider when choosing an RGB color space are discussed.},
-author = {Susstrunk, Sabine and Buckley, Robert and Swen, Steve},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Susstrunk, Buckley, Swen - 1999 - Standard RGB Color Spaces.pdf:pdf},
-isbn = {2166-9635},
-journal = {New York},
-keywords = {are becoming a thing,color communication,color image workflow,color management,color spaces,color standards,it is quite common,of the,past,skilled operators manage color,to be scanned by,today for an image},
-pages = {127--134},
-title = {{Standard RGB Color Spaces}},
-year = {1999}
+@incollection{Westland2012c,
+author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
+booktitle = {Computational Colour Science Using MATLAB},
+chapter = {4.4},
+edition = {2},
+isbn = {978-0-470-66569-5},
+pages = {38},
+title = {{Correction for Spectral Bandpass}},
+year = {2012}
}
-@article{Centore2012,
-author = {Centore, Paul},
-doi = {10.1002/col.20715},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Centore - 2012 - An open-source inversion algorithm for the Munsell renotation.pdf:pdf},
-issn = {03612317},
-journal = {Color Research {\&} Application},
-keywords = {algorithm,inverse renotation,munsell,open source,renotation},
-month = {dec},
-number = {6},
-pages = {455--464},
-title = {{An open-source inversion algorithm for the Munsell renotation}},
-url = {http://onlinelibrary.wiley.com/doi/10.1002/col.20715/full http://www.99main.com/{~}centore/ColourSciencePapers/OpenSourceInverseRenotationArticle.pdf http://doi.wiley.com/10.1002/col.20715},
-volume = {37},
+@incollection{Westland2012,
+author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
+booktitle = {Computational Colour Science Using MATLAB},
+chapter = {4.4},
+edition = {2},
+isbn = {978-0-470-66569-5},
+pages = {38},
+title = {{Extrapolation Methods}},
year = {2012}
}
-@misc{Wikipediax,
+@incollection{Westland2012d,
+author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
+booktitle = {Computational Colour Science Using MATLAB},
+chapter = {4.3},
+edition = {2},
+isbn = {978-0-470-66569-5},
+pages = {29--37},
+title = {{Interpolation Methods}},
+year = {2012}
+}
+@book{Westland2012b,
+author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
+edition = {2},
+isbn = {978-0-470-66569-5},
+pages = {1--240},
+title = {{Computational Colour Science Using MATLAB}},
+year = {2012}
+}
+@misc{Wikipediat,
author = {Wikipedia},
-title = {{CIE 1964 color space}},
-url = {http://en.wikipedia.org/wiki/CIE{\_}1964{\_}color{\_}space},
-urldate = {2014-06-10}
+title = {{Michaelis–Menten kinetics}},
+url = {https://en.wikipedia.org/wiki/Michaelis–Menten{\_}kinetics},
+urldate = {2017-04-29}
}
-@article{Fairchild1991,
-abstract = {A mathematical model of chromatic adaptation for calculating corresponding colors across changes of illumination based on the Hunt color appearance model is formulated and tested. This model consists of a modified von Kries transform that accounts for incomplete levels of adaptation. The model predicts that adaptation will be less complete as the saturation of the adapting stimulus increases and more complete as the luminance of the adapting stimulus increases. An experiment is described in which achromatic appearance is measured for various adapting conditions. The model is tested with these experimental results as well as results from another study and found to be significantly better at predicting corresponding colors than other proposed models.},
-author = {Fairchild, Mark D.},
-doi = {10.1002/col.5080160406},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild - 1991 - Formulation and testing of an incomplete-chromatic-adaptation model.pdf:pdf},
-issn = {03612317},
-journal = {Color Research {\&} Application},
-month = {aug},
-number = {4},
-pages = {243--250},
-title = {{Formulation and testing of an incomplete-chromatic-adaptation model}},
-url = {http://doi.wiley.com/10.1002/col.5080160406},
-volume = {16},
-year = {1991}
+@misc{Wikipediae,
+author = {Wikipedia},
+title = {{The reverse transformation}},
+url = {http://en.wikipedia.org/wiki/CIELUV{\#}The{\_}reverse{\_}transformation},
+urldate = {2014-02-24}
}
-@misc{ARRI2012,
-author = {ARRI},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/ARRI - 2012 - ALEXA - Log C Curve - Usage in VFX.pdf:pdf},
-number = {June},
-pages = {1--12},
-title = {{ALEXA - Log C Curve - Usage in VFX}},
-url = {http://www.arri.com/?eID=registration{\&}file{\_}uid=8026},
-year = {2012}
+@misc{Wikipediaj,
+author = {Wikipedia},
+title = {{ISO 31-11}},
+url = {https://en.wikipedia.org/wiki/ISO{\_}31-11},
+urldate = {2016-07-31}
+}
+@misc{Wikipedia,
+author = {Wikipedia},
+title = {{YCbCr}},
+url = {https://en.wikipedia.org/wiki/YCbCr},
+urldate = {2016-02-29}
}
@misc{Wikipedia,
author = {Wikipedia},
@@ -1442,288 +1734,219 @@ @misc{Wikipedia
url = {https://en.wikipedia.org/wiki/Luminous{\_}efficacy},
urldate = {2016-04-03}
}
-@book{Wyszecki2000f,
-author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
-booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
-isbn = {978-0471399186},
-pages = {167},
-publisher = {Wiley},
-title = {{CIE 1976 (L*u*v*)-Space and Color-Difference Formula}},
-year = {2000}
-}
-@article{Moroney,
-abstract = {The CIE Technical Committee 8-01, color appearance models for color management applications, has recently proposed a single set of revisions to the CIECAM97s color appearance model. This new model, called CIECAM02, is based on CIECAM97s but includes many revisions and some simplifications. A partial list of revisions includes a linear chromatic adaptation transform, a new non-linear response compression function and modifications to the calculations for the perceptual attribute correlates. The format of this paper is an annotated description of the forward equations for the model.},
-author = {Moroney, Nathan and Fairchild, Mark D. and Hunt, Robert W. G. and Li, Changjun and Luo, Ming Ronnier and Newman, Todd},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop//Moroney, Fairchild - 2002 - The CIECAM02 color appearance model.pdf:pdf},
-journal = {Color and Imaging Conference},
-number = {1},
-pages = {23--27},
-title = {{The CIECAM02 Color Appearance Model}},
-url = {http://www.ingentaconnect.com/content/ist/cic/2002/00002002/00000001/art00006},
-volume = {2002}
-}
-@techreport{InternationalTelecommunicationUnion2015,
-abstract = {The role of the Radiocommunication Sector is to ensure the rational, equitable, efficient and economical use of the radio-frequency spectrum by all radiocommunication services, including satellite services, and carry out studies without limit of frequency range on the basis of which Recommendations are adopted. The regulatory and policy functions of the Radiocommunication Sector are performed by World and Regional Radiocommunication Conferences and Radiocommunication Assemblies supported by Study Groups},
-author = {{International Telecommunication Union}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/International Telecommunication Union - 2015 - Recommendation ITU-R BT.2020 - Parameter values for ultra-high definition television syst.pdf:pdf},
-pages = {1--8},
-title = {{Recommendation ITU-R BT.2020 - Parameter values for ultra-high definition television systems for production and international programme exchange}},
-url = {https://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.2020-2-201510-I!!PDF-E.pdf},
-volume = {1},
-year = {2015}
-}
-@misc{EuropeanColorInitiative2002,
-author = {{European Color Initiative}},
-title = {{ECI RGB v2}},
-url = {http://www.eci.org/{\_}media/downloads/icc{\_}profiles{\_}from{\_}eci/ecirgbv20.zip http://www.eci.org/en/colourstandards/workingcolorspaces},
-year = {2002}
-}
-@misc{Fairchild,
-author = {Fairchild, Mark D.},
-title = {{Fairchild YSh}},
-url = {http://rit-mcsl.org/fairchild//files/FairchildYSh.zip}
-}
-@misc{Reitz,
-author = {Reitz, Kenneth},
-title = {{CaseInsensitiveDict}},
-url = {https://github.com/kennethreitz/requests/blob/v1.2.3/requests/structures.py{\#}L37}
+@misc{Wikipediab,
+author = {Wikipedia},
+title = {{Lagrange polynomial - Definition}},
+url = {https://en.wikipedia.org/wiki/Lagrange{\_}polynomial{\#}Definition},
+urldate = {2016-01-20}
}
-@article{ASTMInternational2015,
-author = {{ASTM International}},
-doi = {10.1520/E0308-15},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/ASTM International - 2015 - ASTM E308–15 - Standard Practice for Computing the Colors of Objects by Using the CIE System.pdf:pdf},
-pages = {1--47},
-title = {{ASTM E308–15 - Standard Practice for Computing the Colors of Objects by Using the CIE System}},
-year = {2015}
+@misc{Wikipediai,
+author = {Wikipedia},
+title = {{Luminosity function}},
+url = {https://en.wikipedia.org/wiki/Luminosity{\_}function{\#}Details},
+urldate = {2014-10-20}
}
-@misc{Hewlett-PackardDevelopmentCompany2009,
-author = {{Hewlett-Packard Development Company}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Hewlett-Packard Development Company - 2009 - Understanding the HP DreamColor LP2480zx DCI-P3 Emulation Color Space.pdf:pdf},
-pages = {1--3},
-title = {{Understanding the HP DreamColor LP2480zx DCI-P3 Emulation Color Space}},
-url = {http://www.hp.com/united-states/campaigns/workstations/pdfs/lp2480zx-dci--p3-emulation.pdf},
-year = {2009}
+@misc{Wikipedias,
+author = {Wikipedia},
+title = {{Approximation}},
+url = {http://en.wikipedia.org/wiki/Color{\_}temperature{\#}Approximation},
+urldate = {2014-06-28}
}
-@misc{RenewableResourceDataCenter2003,
-author = {{Renewable Resource Data Center}},
-title = {{Reference Solar Spectral Irradiance: ASTM G-173}},
-url = {http://rredc.nrel.gov/solar/spectra/am1.5/ASTMG173/ASTMG173.html},
-urldate = {2014-08-23},
-year = {2003}
+@misc{Wikipediaq,
+author = {Wikipedia},
+title = {{Whiteness}},
+url = {http://en.wikipedia.org/wiki/Whiteness},
+urldate = {2014-09-17}
}
-@misc{Lindbloom2011,
-author = {Lindbloom, Bruce},
-title = {{Delta E (CIE 1994)}},
-url = {http://brucelindbloom.com/Eqn{\_}DeltaE{\_}CIE94.html},
-urldate = {2014-02-24},
-year = {2011}
+@misc{Wikipediao,
+author = {Wikipedia},
+title = {{Wide-gamut RGB color space}},
+url = {http://en.wikipedia.org/wiki/Wide-gamut{\_}RGB{\_}color{\_}space},
+urldate = {2014-04-13}
}
-@article{Luo2006,
-abstract = {Can a single colour model be used for all colorimetric applications? This article intends to answer that question. Colour appearance models have been developed to predict colour appearance under different viewing conditions. They are also capable of evaluating colour differences because of their embedded uniform colour spaces. This article first tests the performance of the CIE 2002 colour appearance model, CIECAM02, in predicting three types of colour discrimination data sets: large- and small-magnitude colour differences under daylight illuminants and small-magnitude colour differences under illuminant A. The results showed that CIECAM02 gave reasonable performance compared with the best available formulae and uniform colour spaces. It was further extended to give accurate predictions to all types of colour discrimination data. The results were very encouraging in that the CIECAM02 extensions performed second best among all the colour models tested and only slightly poorer than the models that were developed to fit a particular data set. One extension derived to fit all types of data can predict well for colour differences having a large range of difference magnitudes. 2006 Wiley Periodicals, Inc. Col Res Appl, 31, 320-330, 2006; Published online in Wiley InterScience DOI 10.1002/col.20227},
-author = {Luo, Ronnier M. and Cui, Guihua and Li, Changjun},
-doi = {10.1002/col.20227},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Luo, Cui, Li - 2006 - Uniform Colour Spaces Based on CIECAM02 Colour Appearance Model.pdf:pdf},
-isbn = {0361-2317},
-issn = {03612317},
-journal = {Color Research and Application},
-keywords = {Colour appearance data,Colour appearance model,Colour difference data,Colour difference formula,Uniform colour space},
-number = {4},
-pages = {320--330},
-title = {{Uniform Colour Spaces Based on CIECAM02 Colour Appearance Model}},
-volume = {31},
-year = {2006}
+@misc{Wikipediak,
+author = {Wikipedia},
+title = {{White points of standard illuminants}},
+url = {http://en.wikipedia.org/wiki/Standard{\_}illuminant{\#}White{\_}points{\_}of{\_}standard{\_}illuminants},
+urldate = {2014-02-24}
}
-@article{Breneman1987,
-abstract = {While each of his or her two eyes was independently adapted to a different illuminant in viewing a complex visual field, each of a number of observers matched a series of test colors seen by one eye with a juxtaposed variable stimulus seen by the other eye. The 2 degrees test and matching stimuli were located centrally in the complex adapting field, which subtended an angle of 31 degrees X 24 degrees. In making the matches, the observer viewed the test and matching stimuli for a series of brief intervals (approximately 1 sec) while viewing the complex adapting field with normal eye movements. Nine experiments were performed with different pairs of illuminants and different illuminances ranging from that of an average living room to that of a scene illuminated with hazy sunlight. In three other experiments each of the observer's two eyes was adapted to a different illuminance of D55. The amount of adaptation was more nearly complete at high levels of illuminance than at low levels, and the proportional amount of adaptation was less for the "blue" receptors. When adaptation coefficients were determined from the actual adaptation differences (e.g., from corresponding tristimulus values for matching neutrals) rather than from the adapting illuminants, a linear von Kries transformation based on experimentally determined visual primaries gave corresponding chromaticities that were in good agreement with the results obtained in each of the chromatic-adaptation experiments, except at the lowest illuminances. The results of the experiments in which each eye was adapted to different levels of the same illuminant indicated again that adaptation to the different levels was incomplete, the proportional amount of adaptation being less at low illuminances and for the "blue" receptors. This caused a change in chromatic adaptation with the level of illuminance even when the chromaticities of the adapting lights were equal. The results of these experiments also indicated that higher purities are needed in order to produce the same absolute color appearances at low levels of illuminance.},
-author = {Breneman, E J},
-doi = {10.1364/JOSAA.4.001115},
-issn = {1084-7529},
-journal = {Journal of the Optical Society of America. A, Optics and image science},
-pages = {1115--1129},
-pmid = {3598755},
-title = {{Corresponding chromaticities for different states of adaptation to complex visual fields.}},
-volume = {4},
-year = {1987}
+@misc{Wikipediam,
+author = {Wikipedia},
+title = {{Rayleigh scattering}},
+url = {http://en.wikipedia.org/wiki/Rayleigh{\_}scattering},
+urldate = {2014-09-23}
}
-@misc{MunsellColorSciencea,
-author = {{Munsell Color Science}},
-title = {{Macbeth Colorchecker}},
-url = {http://www.rit-mcsl.org/UsefulData/MacbethColorChecker.xls http://www.cis.rit.edu/research/mcsl2/online/cie.php}
+@unpublished{Wikipediaa,
+author = {Wikipedia},
+title = {{List of common coordinate transformations}},
+url = {http://en.wikipedia.org/wiki/List{\_}of{\_}common{\_}coordinate{\_}transformations}
}
-@misc{Ohno2008,
-author = {Ohno, Yoshi and Davis, Wendy},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Ohno, Davis - 2008 - NIST CQS simulation 7.4.xls:xls},
-title = {{NIST CQS simulation 7.4}},
-url = {http://cie2.nist.gov/TC1-69/NIST CQS simulation 7.4.xls},
-year = {2008}
+@misc{Wikipediaf,
+author = {Wikipedia},
+title = {{Lightness}},
+url = {http://en.wikipedia.org/wiki/Lightness},
+urldate = {2014-04-13}
}
-@inproceedings{Guth1995,
-abstract = {Previous and recent revisions of the ATD model for color perception$\backslash$nand visual adaption are incorporated into the version that is fully$\backslash$ndescribed in this paper.},
-author = {Guth, S. Lee},
-booktitle = {IS{\&}T/SPIE's Symposium on Electronic {\ldots}},
-doi = {10.1117/12.206546},
-editor = {Walowit, Eric},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Guth - 1995 - Further applications of the ATD model for color vision.pdf:pdf},
-keywords = {chromatic adaptation,color appearances,color discriminations,color models},
-month = {apr},
-pages = {12--26},
-title = {{Further applications of the ATD model for color vision}},
-url = {http://proceedings.spiedigitallibrary.org/data/Conferences/SPIEP/53372/12{\_}1.pdf http://proceedings.spiedigitallibrary.org/proceeding.aspx?articleid=991324},
-volume = {2414},
-year = {1995}
+@misc{Wikipedian,
+author = {Wikipedia},
+title = {{Surfaces}},
+url = {http://en.wikipedia.org/wiki/Gamut{\#}Surfaces},
+urldate = {2014-09-10}
}
-@book{Fairchild2013g,
-author = {Fairchild, Mark D.},
-booktitle = {Color Appearance Models},
-chapter = {14.2},
-edition = {3},
-isbn = {B00DAYO8E2},
-pages = {5852--5991},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{ATD Model}},
-year = {2013}
+@misc{Wikipediac,
+author = {Wikipedia},
+title = {{HSL and HSV}},
+url = {http://en.wikipedia.org/wiki/HSL{\_}and{\_}HSV},
+urldate = {2014-09-10}
}
-@misc{SonyImageworks2012,
-author = {{Sony Imageworks}},
-pages = {1},
-title = {make.py},
-url = {https://github.com/imageworks/OpenColorIO-Configs/blob/master/nuke-default/make.py},
-urldate = {2014-11-27},
-year = {2012}
+@misc{Wikipediad,
+author = {Wikipedia},
+title = {{Color temperature}},
+url = {http://en.wikipedia.org/wiki/Color{\_}temperature},
+urldate = {2014-06-28}
}
-@misc{HunterLab2012,
-author = {HunterLab},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/HunterLab - 2012 - Hunter Rd,a,b Color Scale – History and Application.pdf:pdf},
-keywords = {a rd,b rd,hunter rd,opponent color scale,rd a b,rdab},
-title = {{Hunter Rd,a,b Color Scale – History and Application}},
-url = {https://hunterlabdotcom.files.wordpress.com/2012/07/an-1016-hunter-rd-a-b-color-scale-update-12-07-03.pdf},
-year = {2012}
+@misc{Wikipedia,
+author = {Wikipedia},
+title = {{Color difference}},
+url = {http://en.wikipedia.org/wiki/Color{\_}difference},
+urldate = {2014-08-29}
}
-@book{Westland2012c,
-author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
-booktitle = {Computational Colour Science Using MATLAB},
-chapter = {4.4},
-edition = {2},
-isbn = {978-0-470-66569-5},
-pages = {38},
-title = {{Correction for Spectral Bandpass}},
-year = {2012}
+@misc{Wikipediax,
+author = {Wikipedia},
+title = {{CIE 1964 color space}},
+url = {http://en.wikipedia.org/wiki/CIE{\_}1964{\_}color{\_}space},
+urldate = {2014-06-10}
}
-@misc{Miller2014,
-author = {Miller, Scott and {Dolby Laboratories}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Miller, Dolby Laboratories - 2014 - A Perceptual EOTF for Extended Dynamic Range Imagery.pdf:pdf},
-pages = {1--17},
-title = {{A Perceptual EOTF for Extended Dynamic Range Imagery}},
-url = {https://www.smpte.org/sites/default/files/2014-05-06-EOTF-Miller-1-2-handout.pdf},
-year = {2014}
+@misc{Wikipediap,
+author = {Wikipedia},
+title = {{CIELUV}},
+url = {http://en.wikipedia.org/wiki/CIELUV},
+urldate = {2014-02-24}
}
-@misc{Erdem,
-author = {Erdem, U. Murat},
-title = {{Fast Line Segment Intersection}},
-url = {http://www.mathworks.com/matlabcentral/fileexchange/27205-fast-line-segment-intersection},
-urldate = {2016-01-15}
+@misc{Wikipedial,
+author = {Wikipedia},
+title = {{CAT02}},
+url = {http://en.wikipedia.org/wiki/CIECAM02{\#}CAT02},
+urldate = {2014-02-24}
}
-@misc{Laurent2012,
-author = {Laurent},
-title = {{Reproducibility of python pseudo-random numbers across systems and versions?}},
-url = {http://stackoverflow.com/questions/8786084/reproducibility-of-python-pseudo-random-numbers-across-systems-and-versions},
-urldate = {2015-01-20},
-year = {2012}
+@misc{Wikipediag,
+author = {Wikipedia},
+title = {{CIECAM02}},
+url = {http://en.wikipedia.org/wiki/CIECAM02},
+urldate = {2014-08-14}
}
-@article{Melgosa2013,
-author = {Melgosa, Manuel},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Melgosa - 2013 - CIE ISO new standard CIEDE2000.pdf:pdf},
-number = {July},
-title = {{CIE / ISO new standard: CIEDE2000}},
-url = {http://www.color.org/events/colorimetry/Melgosa{\_}CIEDE2000{\_}Workshop-July4.pdf},
-volume = {2013},
-year = {2013}
+@misc{Wikipediar,
+author = {Wikipedia},
+title = {{Relation to CIE XYZ}},
+url = {http://en.wikipedia.org/wiki/CIE{\_}1960{\_}color{\_}space{\#}Relation{\_}to{\_}CIE{\_}XYZ},
+urldate = {2014-02-24}
}
-@misc{Thorpe2012,
-author = {Thorpe, Larry},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Thorpe - 2012 - CANON-LOG TRANSFER CHARACTERISTIC.pdf:pdf},
-title = {{CANON-LOG TRANSFER CHARACTERISTIC}},
-url = {http://downloads.canon.com/CDLC/Canon-Log{\_}Transfer{\_}Characteristic{\_}6-20-2012.pdf http://scholar.google.com/scholar?hl=en{\&}btnG=Search{\&}q=intitle:CANON-LOG+TRANSFER+CHARACTERISTIC{\#}0},
-year = {2012}
+@misc{Wikipediah,
+author = {Wikipedia},
+title = {{CIE 1960 color space}},
+url = {http://en.wikipedia.org/wiki/CIE{\_}1960{\_}color{\_}space},
+urldate = {2014-02-24}
}
-@misc{SonyCorporationb,
-author = {{Sony Corporation}},
-title = {{S-Gamut3{\_}S-Gamut3Cine{\_}Matrix.xlsx}},
-url = {https://community.sony.com/sony/attachments/sony/large-sensor-camera-F5-F55/12359/3/S-Gamut3{\_}S-Gamut3Cine{\_}Matrix.xlsx}
+@misc{Wikipediaw,
+author = {Wikipedia},
+title = {{CIE 1931 color space}},
+url = {http://en.wikipedia.org/wiki/CIE{\_}1931{\_}color{\_}space},
+urldate = {2014-02-24}
}
-@misc{Centore2014f,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/FindHueOnRenotationOvoid.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
+@misc{Wikipediay,
+author = {Wikipedia},
+title = {{Mesopic weighting function}},
+url = {http://en.wikipedia.org/wiki/Mesopic{\_}vision{\#}Mesopic{\_}weighting{\_}function},
+urldate = {2014-06-20}
}
-@techreport{InternationalTelecommunicationUnion2015,
-author = {{International Telecommunication Union}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/International Telecommunication Union - 2015 - Recommendation ITU-R BT.709-6 - Parameter values for the HDTV standards for production an.pdf:pdf},
-pages = {1--32},
-title = {{Recommendation ITU-R BT.709-6 - Parameter values for the HDTV standards for production and international programme exchange BT Series Broadcasting service}},
-url = {https://www.itu.int/dms{\_}pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf},
-volume = {5},
-year = {2015}
+@article{Wyszecki1963,
+author = {Wyszecki, G{\"{u}}nther},
+doi = {10.1364/JOSA.53.001318},
+file = {::},
+issn = {0030-3941},
+journal = {J. Opt. Soc. Am.},
+month = {nov},
+number = {11},
+pages = {1318--1319},
+publisher = {OSA},
+title = {{Proposal for a New Color-Difference Formula}},
+url = {http://www.opticsinfobase.org/abstract.cfm?URI=josa-53-11-1318},
+volume = {53},
+year = {1963}
}
-@misc{AdobeSystems2013a,
-author = {{Adobe Systems}},
-title = {{Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng{\_}sdk{\_}1{\_}3/dng{\_}sdk/source/dng{\_}temperature.cpp::dng{\_}temperature::xy{\_}coord}},
-url = {https://www.adobe.com/support/downloads/dng/dng{\_}sdk.html},
-year = {2013}
+@incollection{Wyszecki2000h,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {837--839},
+publisher = {Wiley},
+title = {{Table I(6.5.3) Whiteness Formulae (Whiteness Measure Denoted by W)}},
+year = {2000}
}
-@misc{TheAcademyofMotionPictureArtsandSciences2014a,
-author = {{The Academy of Motion Picture Arts and Sciences} and {Science and Technology Council} and {Academy Color Encoding System (ACES) Project Subcommittee}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/The Academy of Motion Picture Arts and Sciences, Science and Technology Council, Academy Color Encoding System (ACES) Project Subcommi.pdf:pdf},
-pages = {1--40},
-title = {{Technical Bulletin TB-2014-004 - Informative Notes on SMPTE ST 2065-1 – Academy Color Encoding Specification (ACES)}},
-url = {https://github.com/ampas/aces-dev/tree/master/documents},
-year = {2014}
+@incollection{Wyszecki2000d,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {778--779},
+publisher = {Wiley},
+title = {{Table II(3.7)}},
+year = {2000}
}
-@misc{CIEa,
-author = {CIE},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE - Unknown - CIE Spectral Data.xls:xls},
-title = {{CIE Spectral Data}},
-url = {http://files.cie.co.at/204.xls}
+@incollection{Wyszecki2000b,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {776--777},
+publisher = {Wiley},
+title = {{Table I(3.7)}},
+year = {2000}
+}
+@incollection{Wyszecki2000,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {138--139},
+publisher = {Wiley},
+title = {{Table 1(3.3.3)}},
+year = {2000}
}
-@book{Wyszecki2000d,
+@incollection{Wyszecki2000i,
author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
isbn = {978-0471399186},
-pages = {778--779},
+pages = {228},
publisher = {Wiley},
-title = {{Table II(3.7)}},
+title = {{Table 1(3.11) Isotemperature Lines}},
year = {2000}
}
-@misc{Panasonic2014,
-author = {Panasonic},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Panasonic - 2014 - VARICAM V-LogV-Gamut.pdf:pdf},
-pages = {1--7},
-title = {{VARICAM V-Log/V-Gamut}},
-url = {http://pro-av.panasonic.net/en/varicam/common/pdf/VARICAM{\_}V-Log{\_}V-Gamut.pdf},
-year = {2014}
+@incollection{Wyszecki2000g,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {224--229},
+publisher = {Wiley},
+title = {{DISTRIBUTION TEMPERATURE, COLOR TEMPERATURE, AND CORRELATED COLOR TEMPERATURE}},
+year = {2000}
}
-@article{Darrodi2015,
-author = {Darrodi, Maryam Mohammadzadeh and Finlayson, Graham and Goodman, Teresa and Mackiewicz, Michal},
-doi = {10.1364/JOSAA.32.000381},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Darrodi et al. - 2015 - Reference data set for camera spectral sensitivity estimation.pdf:pdf},
-issn = {1084-7529},
-journal = {Journal of the Optical Society of America A},
-number = {3},
-pages = {381},
-title = {{Reference data set for camera spectral sensitivity estimation}},
-url = {http://www.opticsinfobase.org/abstract.cfm?URI=josaa-32-3-381},
-volume = {32},
-year = {2015}
+@incollection{Wyszecki2000f,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {167},
+publisher = {Wiley},
+title = {{CIE 1976 (L*u*v*)-Space and Color-Difference Formula}},
+year = {2000}
}
-@misc{EasyRGBg,
-author = {EasyRGB},
-title = {{HSL —{\textgreater} RGB}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=19{\#}text19},
-urldate = {2014-05-18}
+@incollection{Wyszecki2000e,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
+isbn = {978-0471399186},
+pages = {158--163},
+publisher = {Wiley},
+title = {{Integration Replace by Summation}},
+year = {2000}
}
-@book{Wyszecki2000c,
+@incollection{Wyszecki2000c,
author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
isbn = {978-0471399186},
@@ -1732,129 +1955,7 @@ @book{Wyszecki2000c
title = {{CIE Method of Calculating D-Illuminants}},
year = {2000}
}
-@misc{Gaggioni,
-author = {Gaggioni, Hugo and Dhanendra, Patel and Yamashita, Jin and Kawada, N. and Endo, K. and Clark, Curtis},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Gaggioni et al. - Unknown - S-Log A new LUT for digital production mastering and interchange applications.pdf:pdf},
-pages = {1--13},
-title = {{S-Log: A new LUT for digital production mastering and interchange applications}},
-url = {http://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog{\_}manual.pdf},
-volume = {709}
-}
-@misc{CVRLd,
-author = {CVRL},
-title = {{CIE (2012) 2-deg XYZ “physiologically-relevant” colour matching functions}},
-url = {http://www.cvrl.org/database/text/cienewxyz/cie2012xyz2.htm},
-urldate = {2014-06-25}
-}
-@incollection{CIETC1-482004b,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-chapter = {8.2},
-isbn = {978-3-901-90633-6},
-pages = {24},
-title = {{CIE 1976 uniform colour spaces}},
-url = {http://div1.cie.co.at/?i{\%}7B{\_}{\%}7Dca{\%}7B{\_}{\%}7Did=551{\%}7B{\&}{\%}7Dpubid=23},
-year = {2004}
-}
-@misc{EasyRGBf,
-author = {EasyRGB},
-title = {{RGB —{\textgreater} HSL}},
-url = {http://www.easyrgb.com/index.php?X=MATH{\&}H=18{\#}text18},
-urldate = {2014-05-18}
-}
-@book{Westland2012e,
-author = {Westland, Stephen and Ripamonti, Caterina and Cheung, Vien},
-booktitle = {Computational Colour Science Using MATLAB},
-chapter = {6.2.2},
-edition = {2},
-isbn = {978-0-470-66569-5},
-pages = {80},
-title = {{CMCCAT97}},
-year = {2012}
-}
-@misc{Castro2014,
-author = {Castro, Saullo},
-title = {{Numpy: Fastest way of computing diagonal for each row of a 2d array}},
-url = {http://stackoverflow.com/questions/26511401/numpy-fastest-way-of-computing-diagonal-for-each-row-of-a-2d-array/26517247{\#}26517247},
-urldate = {2014-08-22},
-year = {2014}
-}
-@incollection{CIETC1-482004b,
-author = {{CIE TC 1-48}},
-booktitle = {CIE 015:2004 Colorimetry, 3rd Edition},
-chapter = {7.2.2.1},
-isbn = {978-3-901-90633-6},
-pages = {24},
-title = {{Extrapolation}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=23},
-year = {2004}
-}
-@book{Fairchild2004,
-author = {Fairchild, Mark D.},
-edition = {2},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Fairchild - 2004 - Color Appearance Models.pdf:pdf},
-isbn = {978-0470012161},
-pages = {1--409},
-publisher = {Wiley},
-series = {The Wiley-IS{\&}T Series in Imaging Science and Technology},
-title = {{Color Appearance Models}},
-year = {2004}
-}
-@misc{SonyCorporation,
-author = {{Sony Corporation}},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Sony Corporation - Unknown - S-Log Whitepaper.pdf:pdf},
-pages = {1--17},
-title = {{S-Log Whitepaper}},
-url = {http://www.theodoropoulos.info/attachments/076{\_}on S-Log.pdf}
-}
-@article{Luo1996,
-abstract = {A new colour model, named LLAB(l:c) is derived. It includes two parts: the BFD chromatic adaptation transform derived by Lam and Rigg, and a modified CIELAB uniform colour space. The model's performance was compared with the other spaces and models using the LUTCHI Colour Appearance Data Set. The results show that LLAB(l:c) model is capable of precisely quantifying the change of colour appearance under a wide range of viewing parameters such as light sources, surrounds/media, achromatic backgrounds, sizes of stimuli, and luminance levels. It had a similar performance as that of the Hunt colour appearance model. The LLAB(l:c) model was also tested using various colour difference datasets. The model gave a similar performance as the state-of-the-art colour difference formulae such as CMC, CIE94, and BFD. This performance is considered to be very satisfactory, and the model, therefore, should be considered for field trials in applications such as colour specification, colour difference evaluation, cross-image reproduction, gamut mapping, prediction of metamerism and colour constancy, and quantification of colour-rendering properties. The model does not give predictions for chroma (as distinct from colourfulness), or for brightness, and it does not include any rod response. {\textcopyright} 1996 John Wiley {\&} Sons, Inc.},
-author = {Luo, Ming Ronnier and Lo, Mei-Chun and Kuo, Wen-Guey},
-doi = {10.1002/(SICI)1520-6378(199612)21:6<412::AID-COL4>3.0.CO;2-Z},
-issn = {1520-6378},
-journal = {Color Research {\&} Application},
-keywords = {chromatic adaptation transform,colour appearance,colour appearance model,colour difference,colour difference formula,corresponding colours,uniform colour space},
-number = {6},
-pages = {412--429},
-publisher = {Wiley Subscription Services, Inc., A Wiley Company},
-title = {{The LLAB (l:c) colour model}},
-url = {http://dx.doi.org/10.1002/(SICI)1520-6378(199612)21:6{\%}3C412::AID-COL4{\%}3E3.0.CO;2-Z},
-volume = {21},
-year = {1996}
-}
-@article{COL:COL5080100109,
-author = {Krystek, M},
-doi = {10.1002/col.5080100109},
-issn = {1520-6378},
-journal = {Color Research {\&} Application},
-number = {1},
-pages = {38--40},
-publisher = {Wiley Subscription Services, Inc., A Wiley Company},
-title = {{An algorithm to calculate correlated colour temperature}},
-url = {http://dx.doi.org/10.1002/col.5080100109},
-volume = {10},
-year = {1985}
-}
-@misc{Lindbloom2009b,
-author = {Lindbloom, Bruce},
-title = {{xyY to XYZ}},
-url = {http://www.brucelindbloom.com/Eqn{\_}xyY{\_}to{\_}XYZ.html},
-urldate = {2014-02-24},
-year = {2009}
-}
-@misc{Centore2014c,
-author = {Centore, Paul},
-title = {{MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyY.m}},
-url = {https://github.com/colour-science/MunsellAndKubelkaMunkToolbox http://www.99main.com/{~}centore/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html},
-year = {2014}
-}
-@misc{Bourke,
-author = {Bourke, Paul},
-title = {{Intersection point of two line segments in 2 dimensions}},
-url = {http://paulbourke.net/geometry/pointlineplane/},
-urldate = {2016-01-15}
-}
-@book{Wyszecki2000a,
+@incollection{Wyszecki2000a,
author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
booktitle = {Color Science: Concepts and Methods, Quantitative Data and Formulae},
isbn = {978-0471399186},
@@ -1863,52 +1964,22 @@ @book{Wyszecki2000a
title = {{The CIE 1964 Standard Observer}},
year = {2000}
}
-@misc{HunterLab2008,
-author = {HunterLab},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/HunterLab - 2008 - Illuminant Factors in Universal Software and EasyMatch Coatings.pdf:pdf},
-keywords = {ASTM illuminant},
-number = {2},
-pages = {1--6},
-title = {{Illuminant Factors in Universal Software and EasyMatch Coatings}},
-url = {https://support.hunterlab.com/hc/en-us/article{\_}attachments/201437785/an02{\_}02.pdf},
-volume = {14},
-year = {2008}
-}
-@article{Ohta1997,
-author = {Ohta, N.},
-title = {{The basis of color reproduction engineering}},
-year = {1997}
-}
-@misc{,
-title = {{Deuteranopia – Red-Green Color Blindness}},
-url = {http://www.color-blindness.com/deuteranopia-red-green-color-blindness/},
-urldate = {2015-07-04}
-}
-@article{Davis2010,
-abstract = {The color rendering index (CRI) has been shown to have deficiencies when applied to white light-emitting-diode–based sources. Furthermore, evidence suggests that the restricted scope of the CRI unnecessarily penalizes some light sources with desirable color qualities. To solve the problems of the CRI and include other dimensions of color quality, the color quality scale (CQS) has been developed. Although the CQS uses many of elements of the CRI, there are a number of fundamental differences. Like the CRI, the CQS is a test-samples method that compares the appearance of a set of reflective samples when illuminated by the test lamp to their appearance under a reference illuminant. The CQS uses a larger set of reflective samples, all of high chroma, and combines the color differences of the samples with a root mean square. Additionally, the CQS does not penalize light sources for causing increases in the chroma of object colors but does penalize sources with smaller rendered color gamut areas. The scale of the CQS is converted to span 0–100, and the uniform object color space and chromatic adaptation transform used in the calculations are updated. Supplementary scales have also been developed for expert users.},
-author = {Davis, Wendy and Ohno, Yoshi},
-doi = {10.1117/1.3360335},
-isbn = {0091-3286},
-journal = {Optical Engineering},
-number = {3},
-pages = {33602--33616},
-title = {{Color quality scale}},
-url = {http://dx.doi.org/10.1117/1.3360335},
-volume = {49},
-year = {2010}
-}
-@article{InternationalElectrotechnicalCommission1999,
-author = {{International Electrotechnical Commission}},
-pages = {51},
-title = {{IEC 61966-2-1:1999 - Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB}},
-url = {https://webstore.iec.ch/publication/6169},
-year = {1999}
+@book{Wyszecki2000j,
+author = {Wyszecki, G{\"{u}}nther and Stiles, W. S.},
+isbn = {978-0471399186},
+pages = {1--968},
+publisher = {Wiley},
+title = {{Color Science: Concepts and Methods, Quantitative Data and Formulae}},
+year = {2000}
}
-@misc{Wikipediaf,
-author = {Wikipedia},
-title = {{Lightness}},
-url = {http://en.wikipedia.org/wiki/Lightness},
-urldate = {2014-04-13}
+@misc{X-Rite2012,
+author = {X-Rite and Pantone},
+file = {:Users/kelsolaar/Documents/Mendeley Desktop/X-Rite, Pantone - 2012 - Color iQC and Color iMatch Color Calculations Guide.pdf:pdf},
+number = {July},
+pages = {1--31},
+title = {{Color iQC and Color iMatch Color Calculations Guide}},
+url = {http://www.xrite.com/documents/literature/en/09{\_}Color{\_}Calculations{\_}en.pdf},
+year = {2012}
}
@misc{Yorke2014,
author = {Yorke, Rory},
@@ -1917,22 +1988,22 @@ @misc{Yorke2014
urldate = {2015-03-27},
year = {2014}
}
-@article{Erdogan,
-abstract = {There are many different systems for analyzing and representing the color of an object perceived by a human observer. For the purposes of unambiguously specifying the color an observer sees when looking through an optical filter at a well-defined light source, we have found the CIE Color Specification System to be the most accurate (for a simple and clear description, see [1]). In this article we briefly describe the method to calculate the three main parameters that fully specify color in this system: luminosity, dominant wavelength, and excitation purity. These terms specifically refer to the definitions in the CIE system given below, but they have analogies in many other systems. A set of more general terms often used to qualitatively describe color are: brightness, hue, and saturation (analogous to luminosity, dominant wavelength, and excitation purity, respectively). These terms (and others) are often used interchangeably. Here we will adhere to the official terms assigned to the CIE system to avoid any ambiguity.},
-author = {Erdogan, Turan},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/Erdogan - Unknown - How to Calculate Luminosity, Dominant Wavelength, and Excitation Purity.pdf:pdf},
-pages = {7},
-title = {{How to Calculate Luminosity, Dominant Wavelength, and Excitation Purity}},
-url = {http://www.semrock.com/Data/Sites/1/semrockpdfs/whitepaper{\_}howtocalculateluminositywavelengthandpurity.pdf}
+@article{,
+file = {::},
+title = {{ITP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution}}
}
-@book{CIETC1-382005d,
-author = {{CIE TC 1-38}},
-booktitle = {CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations},
-chapter = {9},
-file = {:Users/kelsolaar/Documents/Mendeley Desktop/CIE TC 1-38 - 2005 - Table V. Values of the c-coefficients of Equ.s 6 and 7.pdf:pdf},
-isbn = {978-3-901-90641-1},
-pages = {14--19},
-title = {{9. INTERPOLATION}},
-url = {http://div1.cie.co.at/?i{\_}ca{\_}id=551{\&}pubid=47},
-year = {2005}
+@misc{,
+title = {{Tritanopia – Blue-Yellow Color Blindness}},
+url = {http://www.color-blindness.com/tritanopia-blue-yellow-color-blindness/},
+urldate = {2015-07-04}
+}
+@misc{,
+title = {{Deuteranopia – Red-Green Color Blindness}},
+url = {http://www.color-blindness.com/deuteranopia-red-green-color-blindness/},
+urldate = {2015-07-04}
+}
+@misc{,
+title = {{Protanopia – Red-Green Color Blindness}},
+url = {http://www.color-blindness.com/protanopia-red-green-color-blindness/},
+urldate = {2015-07-04}
}
diff --git a/BIBLIOGRAPHY.rst b/BIBLIOGRAPHY.rst
index 11c5888aa4..cf4b953a1d 100644
--- a/BIBLIOGRAPHY.rst
+++ b/BIBLIOGRAPHY.rst
@@ -4,15 +4,16 @@ Colour - Bibliography
Bibliography
------------
-- Adobe Systems. (2005). Adobe RGB (1998) Color Image Encoding. Retrieved from http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
-- Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::Set_xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html
-- Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html
- ANSI. (2003). Specification of ROMM RGB. Retrieved from http://www.color.org/ROMMRGB.pdf
- ARRI. (2012). ALEXA - Log C Curve - Usage in VFX. Retrieved from http://www.arri.com/?eID=registration&file_uid=8026
- ASTM International. (1989). ASTM D1535-89 Standard Test Method for Specifying Color by the Munsell System. Retrieved from http://www.astm.org/DATABASE.CART/HISTORICAL/D1535-89.htm
- ASTM International. (2011). ASTM E2022–11 - Standard Practice for Calculation of Weighting Factors for Tristimulus Integration, i, 1–10. doi:10.1520/E2022-11
- ASTM International. (2015). ASTM E308–15 - Standard Practice for Computing the Colors of Objects by Using the CIE System, 1–47. doi:10.1520/E0308-15
- ASTM International. (n.d.). ASTM D1535-08e1 Standard Practice for Specifying Color by the Munsell System. doi:10.1520/D1535-08E01
+- Adobe Systems. (2005). Adobe RGB (1998) Color Image Encoding. Retrieved from http://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
+- Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::Set_xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html
+- Adobe Systems. (2013). Adobe DNG Software Development Kit (SDK) - 1.3.0.0 - dng_sdk_1_3/dng_sdk/source/dng_temperature.cpp:: dng_temperature::xy_coord. Retrieved from https://www.adobe.com/support/downloads/dng/dng_sdk.html
+- Association of Radio Industries and Businesses. (2015). Essential Parameter Values for the Extended Image Dynamic Range Television (EIDRTV) System for Programme Production. Arib Std-B67. Retrieved from http://www.arib.or.jp/english/html/overview/std-b67.html
- BabelColor. (2012). ColorChecker RGB and spectra. Retrieved from http://www.babelcolor.com/download/ColorChecker_RGB_and_spectra.xls
- BabelColor. (2012). The ColorChecker (since 1976!). Retrieved September 26, 2014, from http://www.babelcolor.com/main_level/ColorChecker.htm
- Bianco, S., & Schettini, R. (2010). Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization. Color Research & Application, 35(3), 184–192. doi:10.1002/col.20573
@@ -21,22 +22,6 @@ Bibliography
- Breneman, E. J. (1987). Corresponding chromaticities for different states of adaptation to complex visual fields. JOSA A, 4(6). Retrieved from http://www.opticsinfobase.org/josaa/fulltext.cfm?uri=josaa-4-6-1115&id=2783
- Brill, M. H., & Süsstrunk, S. (2008). Repairing gamut problems in CIECAM02: A progress report. Color Research & Application, 33(5), 424–426. doi:10.1002/col.20432
- Broadbent, A. D. (2009). Calculation from the original experimental data of the CIE 1931 RGB standard observer spectral chromaticity co-ordinates and color matching functions. Retrieved June 12, 2014, from http://www.cis.rit.edu/mcsl/research/1931.php
-- Canon. (2014). EOS C500 Firmware Update. Retrieved August 27, 2016, from https://www.usa.canon.com/internet/portal/us/home/explore/product-showcases/cameras-and-lenses/cinema-eos-firmware/c500
-- Canon. (n.d.). EOS C300 Mark II - EOS C300 Mark II Input Transform Version 2.0 (for Cinema Gamut / BT.2020). Retrieved August 23, 2016, from https://www.usa.canon.com/internet/portal/us/home/support/details/cameras/cinema-eos/eos-c300-mark-ii
-- Castro, S. (2014). Numpy: Fastest way of computing diagonal for each row of a 2d array. Retrieved August 22, 2014, from http://stackoverflow.com/questions/26511401/numpy-fastest-way-of-computing-diagonal-for-each-row-of-a-2d-array/26517247#26517247
-- Centore, P. (2012). An open-source inversion algorithm for the Munsell renotation. Color Research & Application, 37(6), 455–464. doi:10.1002/col.20715
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - GeneralRoutines/CIELABtoApproxMunsellSpec.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/FindHueOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToASTMHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyY.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/xyYtoMunsell.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/BoundingRenotationHues.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
-- Centore, P. (n.d.). Munsell Resources. Retrieved July 26, 2014, from http://www.99main.com/~centore/MunsellResources/MunsellResources.html
- CIE TC 1-32. (1994). CIE 109-1994 A Method of Predicting Corresponding Colours under Different Chromatic and Illuminance Adaptations (pp. 1–18). ISBN:978-3-900734-51-0
- CIE TC 1-36. (2006). CIE 170-1:2006 Fundamental Chromaticity Diagram with Physiological Axes - Part 1 (pp. 1–56). ISBN:978-3-901-90646-6
- CIE TC 1-38. (2005). 9. INTERPOLATION. In CIE 167:2005 Recommended Practice for Tabulating Spectral Data for Use in Colour Computations (pp. 14–19). ISBN:978-3-901-90641-1
@@ -52,7 +37,6 @@ Bibliography
- CIE TC 1-48. (2004). The evaluation of whiteness. In CIE 015:2004 Colorimetry, 3rd Edition (p. 24). ISBN:978-3-901-90633-6
- CIE. (n.d.). CIE 15:2004 Tables Data. Retrieved from https://law.resource.org/pub/us/cfr/ibr/003/cie.15.2004.tables.xls
- CIE. (n.d.). CIE Spectral Data. Retrieved from http://files.cie.co.at/204.xls
-- Cottrell, R. (n.d.). The Russell RGB working color space. Retrieved from http://www.russellcottrell.com/photo/downloads/RussellRGB.icc
- CVRL. (n.d.). CIE (2012) 10-deg XYZ “physiologically-relevant” colour matching functions. Retrieved June 25, 2014, from http://www.cvrl.org/database/text/cienewxyz/cie2012xyz10.htm
- CVRL. (n.d.). CIE (2012) 2-deg XYZ “physiologically-relevant” colour matching functions. Retrieved June 25, 2014, from http://www.cvrl.org/database/text/cienewxyz/cie2012xyz2.htm
- CVRL. (n.d.). Cone Fundamentals. Retrieved June 23, 2014, from http://www.cvrl.org/cones.htm
@@ -61,10 +45,27 @@ Bibliography
- CVRL. (n.d.). Older CIE Standards. Retrieved February 24, 2014, from http://cvrl.ioo.ucl.ac.uk/cie.htm
- CVRL. (n.d.). Stiles & Burch individual 10-deg colour matching data. Retrieved February 24, 2014, from http://www.cvrl.org/stilesburch10_ind.htm
- CVRL. (n.d.). Stiles & Burch individual 2-deg colour matching data. Retrieved February 24, 2014, from http://www.cvrl.org/stilesburch2_ind.htm
+- Canon. (2014). EOS C500 Firmware Update. Retrieved August 27, 2016, from https://www.usa.canon.com/internet/portal/us/home/explore/product-showcases/cameras-and-lenses/cinema-eos-firmware/c500
+- Canon. (n.d.). EOS C300 Mark II - EOS C300 Mark II Input Transform Version 2.0 (for Cinema Gamut / BT.2020). Retrieved August 23, 2016, from https://www.usa.canon.com/internet/portal/us/home/support/details/cameras/cinema-eos/eos-c300-mark-ii
+- Castro, S. (2014). Numpy: Fastest way of computing diagonal for each row of a 2d array. Retrieved August 22, 2014, from http://stackoverflow.com/questions/26511401/numpy-fastest-way-of-computing-diagonal-for-each-row-of-a-2d-array/26517247#26517247
+- Centore, P. (2012). An open-source inversion algorithm for the Munsell renotation. Color Research & Application, 37(6), 455–464. doi:10.1002/col.20715
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - GeneralRoutines/CIELABtoApproxMunsellSpec.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/ChromDiagHueAngleToMunsellHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/FindHueOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MaxChromaForExtrapolatedRenotation.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToASTMHue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellHueToChromDiagHueAngle.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyForIntegerMunsellValue.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/MunsellToxyY.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellRenotationRoutines/xyYtoMunsell.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/BoundingRenotationHues.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (2014). MunsellAndKubelkaMunkToolboxApr2014 - MunsellSystemRoutines/LinearVsRadialInterpOnRenotationOvoid.m. Retrieved from https://github.com/colour-science/MunsellAndKubelkaMunkToolbox
+- Centore, P. (n.d.). Munsell Resources. Retrieved July 26, 2014, from http://www.99main.com/~centore/MunsellResources/MunsellResources.html
+- Cottrell, R. (n.d.). The Russell RGB working color space. Retrieved from http://www.russellcottrell.com/photo/downloads/RussellRGB.icc
- Darrodi, M. M., Finlayson, G., Goodman, T., & Mackiewicz, M. (2015). Reference data set for camera spectral sensitivity estimation. Journal of the Optical Society of America A, 32(3), 381. doi:10.1364/JOSAA.32.000381
- Davis, W., & Ohno, Y. (2010). Color quality scale. Optical Engineering, 49(3), 33602–33616. doi:10.1117/1.3360335
- Digital Cinema Initiatives. (2007). Digital Cinema System Specification - Version 1.1. Retrieved from http://www.dcimovies.com/archives/spec_v1_1/DCI_DCinema_System_Spec_v1_1.pdf
-- Dolby. (2016). WHAT IS ICTCP? - INTRODUCTION. Retrieved from https://www.dolby.com/us/en/technologies/dolby-vision/ ICtCp-white-paper.pdf
+- Dolby. (2016). WHAT IS ICTCP? - INTRODUCTION. Retrieved from https://www.dolby.com/us/en/technologies/dolby-vision/ICtCp-white-paper.pdf
- EasyRGB. (n.d.). CMY —> CMYK. Retrieved May 18, 2014, from http://www.easyrgb.com/index.php?X=MATH&H=13#text13
- EasyRGB. (n.d.). CMY —> RGB. Retrieved May 18, 2014, from http://www.easyrgb.com/index.php?X=MATH&H=12#text12
- EasyRGB. (n.d.). CMYK —> CMY. Retrieved May 18, 2014, from http://www.easyrgb.com/index.php?X=MATH&H=14#text14
@@ -88,11 +89,13 @@ Bibliography
- Fairchild, M. D. (2013). The Nayatani et al. Model. In Color Appearance Models (3rd ed., pp. 4810–5085). Wiley. ASIN:B00DAYO8E2
- Fairchild, M. D. (2013). The RLAB Model. In Color Appearance Models (3rd ed., pp. 5563–5824). Wiley. ASIN:B00DAYO8E2
- Fairchild, M. D. (n.d.). Fairchild YSh. Retrieved from http://rit-mcsl.org/fairchild//files/FairchildYSh.zip
+- Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT: Simple Models for Describing the Color of High-Dynamic-Range and Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference (pp. 322–326). ISBN:9781629932156
- Fairchild, M., & Wyble, D. (1998). Colorimetric Characterization of The Apple Studio Display (flat panel LCD), 22. Retrieved from https://ritdml.rit.edu/handle/1850/4368
- Fairman, H. S. (1985). The calculation of weight factors for tristimulus integration. Color Research & Application, 10(4), 199–203. doi:10.1002/col.5080100407
- Fairman, H. S., Brill, M. H., & Hemmendinger, H. (1997). How the CIE 1931 color-matching functions were derived from Wright-Guild data. Color Research & …, 22(1), 11–23. Retrieved from http://doi.wiley.com/10.1002/%28SICI%291520-6378%28199702%2922%3A1%3C11%3A%3AAID-COL4%3E3.0.CO%3B2-7
- Gaggioni, H., Dhanendra, P., Yamashita, J., Kawada, N., Endo, K., & Clark, C. (n.d.). S-Log: A new LUT for digital production mastering and interchange applications. Retrieved from http://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog_manual.pdf
- Glasser, L. G., McKinney, A. H., Reilly, C. D., & Schnelle, P. D. (1958). Cube-Root Color Coordinate System. J. Opt. Soc. Am., 48(10), 736–740. doi:10.1364/JOSA.48.000736
+- GoPro, Duiker, H.-P., & Mansencal, T. (2016). gopro.py. Retrieved April 12, 2017, from https://github.com/hpd/OpenColorIO-Configs/blob/master/aces_1.0.3/python/aces_ocio/colorspaces/gopro.py
- Guth, S. L. (1995). Further applications of the ATD model for color vision. In E. Walowit (Ed.), IS&T/SPIE’s Symposium on Electronic … (Vol. 2414, pp. 12–26). doi:10.1117/12.206546
- Hernández-Andrés, J., Lee, R. L., & Romero, J. (1999). Calculating correlated color temperatures across the entire gamut of daylight and skylight chromaticities. Applied Optics, 38(27), 5703–5709. doi:10.1364/AO.38.005703
- Hettinger, R. (n.d.). Python hashable dicts. Retrieved August 08, 2014, from http://stackoverflow.com/a/16162138/931625
@@ -131,19 +134,22 @@ Bibliography
- Lindbloom, B. (2011). Delta E (CIE 1994). Retrieved February 24, 2014, from http://brucelindbloom.com/Eqn_DeltaE_CIE94.html
- Lindbloom, B. (2014). RGB Working Space Information. Retrieved April 11, 2014, from http://www.brucelindbloom.com/WorkingSpaceInfo.html
- Lu, T., Pu, F., Yin, P., Chen, T., Husak, W., Pytlarz, J., … Su, G.-M. (2016). ICTCP Colour Space and Its Compression Performance for High Dynamic Range and Wide Colour Gamut Video Distribution. ZTE Communications, 14(1), 32–38. doi:10.3969/j.
+- Luo, M. R., & Li, C. (2013). CIECAM02 and Its Recent Developments. In Advanced Color Image Processing and Analysis (pp. 19–58). doi:10.1007/978-1-4419-6190-7
- Luo, M. R., & Morovic, J. (1996). Two Unsolved Issues in Colour Management – Colour Appearance and Gamut Mapping. In Conference: 5th International Conference on High Technology: Imaging Science and Technology – Evolution & Promise (pp. 136–147). Retrieved from http://www.researchgate.net/publication/236348295_Two_Unsolved_Issues_in_Colour_Management_Colour_Appearance_and_Gamut_Mapping
- Luo, M. R., Lo, M.-C., & Kuo, W.-G. (1996). The LLAB (l:c) colour model. Color Research & Application, 21(6), 412–429. doi:10.1002/(SICI)1520-6378(199612)21:6<412::AID-COL4>3.0.CO;2-Z
- Luo, R. M., Cui, G., & Li, C. (2006). Uniform Colour Spaces Based on CIECAM02 Colour Appearance Model. Color Research and Application, 31(4), 320–330. doi:10.1002/col.20227
-- MacAdam, D. L. (1935). Maximum Visual Efficiency of Colored Materials. - . Soc. Am., 25(11], 361–367. doi:10.1364/JOSA.25.000361
+- MacAdam, D. L. (1935). Maximum Visual Efficiency of Colored Materials. [. Opt. Soc. Am., 25(11], 361–367. doi:10.1364/JOSA.25.000361
- Machado, G. (2010). A model for simulation of color vision deficiency and a color contrast enhancement technique for dichromats. Retrieved from http://www.lume.ufrgs.br/handle/10183/26950
- Mansencal, T. (2015). RED Colourspaces Derivation. Retrieved May 20, 2015, from http://colour-science.org/posts/red-colourspaces-derivation
- Mansencal, T. (n.d.). Lookup. Retrieved from https://github.com/KelSolaar/Foundations/blob/develop/foundations/data_structures.py
- Mansencal, T. (n.d.). Structure. Retrieved from https://github.com/KelSolaar/Foundations/blob/develop/foundations/data_structures.py
- Melgosa, M. (2013). CIE / ISO new standard: CIEDE2000, 2013(July). Retrieved from http://www.color.org/events/colorimetry/Melgosa_CIEDE2000_Workshop-July4.pdf
+- Meng, J., Simon, F., & Hanika, J. (2015). Physically Meaningful Rendering using Tristimulus Colours, 34(4). Retrieved from http://jo.dreggn.org/home/2015_spectrum.pdf
- Miller, S., & Dolby Laboratories. (2014). A Perceptual EOTF for Extended Dynamic Range Imagery, 1–17. Retrieved from https://www.smpte.org/sites/default/files/2014-05-06-EOTF-Miller-1-2-handout.pdf
- Moroney, N., Fairchild, M. D., Hunt, R. W. G., Li, C., Luo, M. R., & Newman, T. (n.d.). The CIECAM02 Color Appearance Model. Color and Imaging Conference, 2002(1), 23–27. Retrieved from http://www.ingentaconnect.com/content/ist/cic/2002/00002002/00000001/art00006
- Munsell Color Science. (n.d.). Macbeth Colorchecker. Retrieved from http://www.rit-mcsl.org/UsefulData/MacbethColorChecker.xls
- Munsell Color Science. (n.d.). Munsell Colours Data. Retrieved August 20, 2014, from http://www.cis.rit.edu/research/mcsl2/online/munsell.php
+- National Electrical Manufacturers Association. (2004). Digital Imaging and Communications in Medicine ( DICOM ) Part 14 : Grayscale Standard Display Function. Medicine, 10(S1), 3–4. doi:10.1007/BF03168637
- Nattress, G. (2016). Private Discussion with Shaw, N.
- Nayatani, Y., Sobagaki, H., & Yano, K. H. T. (1995). Lightness dependency of chroma scales of a nonlinear color-appearance model and its latest formulation. Color Research & Application, 20(3), 156–167. doi:10.1002/col.5080200305
- Newhall, S. M., Nickerson, D., & Judd, D. B. (1943). Final report of the OSA subcommittee on the spacing of the munsell colors. JOSA, 33(7), 385. doi:10.1364/JOSA.33.000385
@@ -151,12 +157,12 @@ Bibliography
- Ohno, Y., & Davis, W. (2008). NIST CQS simulation 7.4. Retrieved from http://cie2.nist.gov/TC1-69/NIST CQS simulation 7.4.xls
- Ohta, N. (1997). The basis of color reproduction engineering.
- Panasonic. (2014). VARICAM V-Log/V-Gamut. Retrieved from http://pro-av.panasonic.net/en/varicam/common/pdf/VARICAM_V-Log_V-Gamut.pdf
-- Pointer, M. R. (1980). Pointer’s Gamut Data. Retrieved from http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls
+- Pointer, M. R. (1980). Pointer's Gamut Data. Retrieved from http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls
- Reitz, K. (n.d.). CaseInsensitiveDict. Retrieved from https://github.com/kennethreitz/requests/blob/v1.2.3/requests/structures.py#L37
- Renewable Resource Data Center. (2003). Reference Solar Spectral Irradiance: ASTM G-173. Retrieved August 23, 2014, from http://rredc.nrel.gov/solar/spectra/am1.5/ASTMG173/ASTMG173.html
- Saeedn. (n.d.). Extend a line segment a specific distance. Retrieved January 16, 2016, from http://stackoverflow.com/questions/7740507/extend-a-line-segment-a-specific-distance
-- sastanin. (n.d.). How to make scipy.interpolate give an extrapolated result beyond the input range? Retrieved August 08, 2014, from http://stackoverflow.com/a/2745496/931625
- Sharma, G., Wu, W., & Dalal, E. N. (2005). The CIEDE2000 color‐difference formula: Implementation notes, supplementary test data, and mathematical observations. Color Research & Application, 30(1), 21–30. doi:10.1002/col.20070
+- Shirley, P., & Hart, D. (2015). The prismatic color space for rgb computations, 2–7.
- Smith, A. R. (1978). Color Gamut Transform Pairs. In Proceedings of the 5th Annual Conference on Computer Graphics and Interactive Techniques (pp. 12–19). New York, NY, USA: ACM. doi:10.1145/800248.807361
- Smits, B. (1999). An RGB-to-Spectrum Conversion for Reflectances. Journal of Graphics Tools, 4(4), 11–22. doi:10.1080/10867651.1999.10487511
- Society of Motion Picture and Television Engineers. (1993). Derivation of Basic Television Color Equations. In RP 177:1993 (Vol. RP 177:199). doi:10.5594/S9781614821915
@@ -201,7 +207,7 @@ Bibliography
- Wikipedia. (n.d.). Luminosity function. Retrieved October 20, 2014, from https://en.wikipedia.org/wiki/Luminosity_function#Details
- Wikipedia. (n.d.). Luminous Efficacy. Retrieved April 3, 2016, from https://en.wikipedia.org/wiki/Luminous_efficacy
- Wikipedia. (n.d.). Mesopic weighting function. Retrieved June 20, 2014, from http://en.wikipedia.org/wiki/Mesopic_vision#Mesopic_weighting_function
-- Wikipedia. (n.d.). Mesopic weighting function. Retrieved June 20, 2014, from http://en.wikipedia.org/wiki/Mesopic_vision#Mesopic_weighting_function
+- Wikipedia. (n.d.). Michaelis–Menten kinetics. Retrieved April 29, 2017, from https://en.wikipedia.org/wiki/Michaelis–Menten_kinetics
- Wikipedia. (n.d.). Rayleigh scattering. Retrieved September 23, 2014, from http://en.wikipedia.org/wiki/Rayleigh_scattering
- Wikipedia. (n.d.). Relation to CIE XYZ. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIE_1960_color_space#Relation_to_CIE_XYZ
- Wikipedia. (n.d.). Surfaces. Retrieved September 10, 2014, from http://en.wikipedia.org/wiki/Gamut#Surfaces
@@ -224,6 +230,7 @@ Bibliography
- Wyszecki, G., & Stiles, W. S. (2000). The CIE 1964 Standard Observer. In Color Science: Concepts and Methods, Quantitative Data and Formulae (p. 141). Wiley. ISBN:978-0471399186
- X-Rite, & Pantone. (2012). Color iQC and Color iMatch Color Calculations Guide. Retrieved from http://www.xrite.com/documents/literature/en/09_Color_Calculations_en.pdf
- Yorke, R. (2014). Python: Change format of np.array or allow tolerance in in1d function. Retrieved March 27, 2015, from http://stackoverflow.com/a/23521245/931625
+- sastanin. (n.d.). How to make scipy.interpolate give an extrapolated result beyond the input range? Retrieved August 08, 2014, from http://stackoverflow.com/a/2745496/931625
About
-----
diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst
index 92511c5701..11aa46ded8 100644
--- a/CONTRIBUTORS.rst
+++ b/CONTRIBUTORS.rst
@@ -8,7 +8,7 @@ Development & Technical Support
Project coordination, overall development.
-- **Michael Mauderer**, *HCI Researcher @ University of St Andrews*
+- **Michael Mauderer**, *HCI Researcher @ University of Dundee*
Colour appearance models, overall development.
@@ -28,6 +28,14 @@ Development & Technical Support
Technical support.
+- **Kevin Wheatley**, *Head of Imaging at Framestore @ Framestore*
+
+ Technical support.
+
+- **Katherine Crowson**
+
+ CIECAM02 improvements, technical support.
+
Acknowledgements
----------------
- **Steve Agland**, *Supervising Lighting Technical Director @ Animal Logic*
@@ -58,17 +66,13 @@ Acknowledgements
*Ohno (2013)* correlated colour temperature calculation technical support.
-- **Kevin Wheatley**, *Head of Imaging at Framestore @ Framestore*
-
- Technical support.
-
Special Mentions
----------------
- **Aurélia Sellier**, *Line Producer @ Cube Creative*
-Others
-------
+Contributors
+------------
- Nick Spiker
- fangjy88
diff --git a/README.rst b/README.rst
index 92e60b8fdf..41a2392653 100644
--- a/README.rst
+++ b/README.rst
@@ -13,7 +13,7 @@ Colour Science for Python
* - Status
- |waffle| |travis| |coveralls| |scrutinizer| |landscape| |gemnasium|
* - Package
- - |version| |downloads|
+ - |version|
* - Citation
- |zenodo|
@@ -41,8 +41,8 @@ Colour Science for Python
.. |version| image:: https://badge.fury.io/py/colour-science.svg
:target: https://pypi.python.org/pypi/colour-science
:alt: Package Version
-.. |zenodo| image:: https://zenodo.org/badge/doi/10.5281/zenodo.376790.png
- :target: http://dx.doi.org/10.5281/zenodo.376790
+.. |zenodo| image:: https://zenodo.org/badge/doi/10.5281/zenodo.821825.png
+ :target: http://dx.doi.org/10.5281/zenodo.821825
:alt: DOI
.. end-badges
@@ -64,12 +64,27 @@ and collection of objects, please see the
Installation
------------
-The installation procedure is described in the
+The detailed installation procedure is described in the
`Installation Guide `_.
+`Anaconda `_ from *Continuum Analytics*
+is the Python distribution we use to develop **Colour**:
+it ships all the scientific dependencies we require and is easily deployed
+cross-platform.
+
+This *asciicast* demonstrates how to generate a pristine Python *conda*
+environment for Colour:
+
+.. image:: https://raw.githubusercontent.com/colour-science/colour-branding/master/screencasts/Colour_Conda_Installation.gif
+
Usage
-----
+At its most basic, `Colour `_ only requires
+to be imported:
+
+.. image:: https://raw.githubusercontent.com/colour-science/colour-branding/master/screencasts/Colour_Science_for_Python.gif
+
The two main references for `Colour `_
usage are the complete Sphinx `API Reference `_
and the `Jupyter Notebooks `_
diff --git a/TODO.rst b/TODO.rst
index bddca8598d..242885d080 100644
--- a/TODO.rst
+++ b/TODO.rst
@@ -4,61 +4,67 @@ Colour - TODO
TODO
----
-- colour (20 items in 13 files)
+- colour (22 items in 15 files)
- - appearance (8 items in 5 files)
+ - appearance (7 items in 5 files)
- ciecam02.py
- - (260, 7) # TODO: Compute hue composition.
- - (702, 7) # TODO: Check for negative values and their handling.
+ - (257, 7) # TODO: Compute hue composition.
- hunt.py
- - (418, 7) # TODO: Implement hue quadrature & composition computation.
- - (449, 7) # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.
+ - (384, 7) # TODO: Implement hue quadrature & composition computation.
+ - (415, 7) # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.
- llab.py
- - (309, 7) # TODO: Implement hue composition computation.
+ - (297, 7) # TODO: Implement hue composition computation.
- nayatani95.py
- - (271, 7) # TODO: Implement hue quadrature & composition computation.
- - (289, 7) # TODO: Investigate components usage.
+ - (244, 7) # TODO: Implement hue quadrature & composition computation.
+ - (256, 7) # TODO: Investigate components usage.
- rlab.py
- - (246, 7) # TODO: Implement hue composition computation.
+ - (235, 7) # TODO: Implement hue composition computation.
- - colorimetry (2 item in 2 files)
+ - colorimetry (4 items in 3 files)
+
+ - tests (2 items in 1 file)
+
+ - tests_spectrum.py
+
+ - (2352, 11) # TODO: Remove statement whenever we make "Scipy" 0.19.0 the minimum version.
+ - (2834, 11) # TODO: Remove statement whenever we make "Scipy" 0.19.0 the minimum version.
- spectrum.py
- - (1943, 11) # TODO: Provide support for fractional interval like 0.1, etc...
+ - (1920, 11) # TODO: Provide support for fractional interval like 0.1, etc...
- tristimulus.py
- - (686, 11) # TODO: Investigate code vectorisation.
+ - (672, 11) # TODO: Investigate code vectorisation.
- - models (4 item in 3 file)
+ - models (4 items in 3 files)
- - rgb
+ - rgb (4 items in 3 files)
- tests (1 item in 1 file)
- tests_derivation.py
- - (302, 15) # TODO: Simplify that monster.
+ - (275, 11) # TODO: Simplify that monster.
- derivation.py
- - (220, 7) # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together.
+ - (215, 7) # TODO: Investigate if we return an ndarray here with primaries and
- rgb_colourspace.py
- - (518, 11) # TODO: Revisit for potential behaviour / type checking.
- - (545, 11) # TODO: Revisit for potential behaviour / type checking.
+ - (515, 11) # TODO: Revisit for potential behaviour / type checking.
+ - (542, 11) # TODO: Revisit for potential behaviour / type checking.
- notation (5 items in 2 files)
@@ -66,20 +72,26 @@ TODO
- tests_munsell.py
- - (94, 3) # TODO: Investigate if tests can be simplified by using a common valid set of specifications.
- - (4528, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
- - (4574, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
+ - (67, 3) # TODO: Investigate if tests can be simplified by using a common valid set of specifications.
+ - (4399, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
+ - (4441, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
- munsell.py
- - (837, 11) # TODO: Consider refactoring implementation.
- - (1176, 11) # TODO: Should raise KeyError, need to check the tests.
+ - (802, 11) # TODO: Consider refactoring implementation.
+ - (1129, 11) # TODO: Should raise KeyError, need to check the tests.
+
+ - plotting (1 item in 1 file)
+
+ - colorimetry.py
+
+ - (599, 11) # TODO: Handle condition statement with metadata capabilities.
- volume (1 item in 1 file)
-
- - rgb.py
-
- - (319, 7) # TODO: Investigate for generator yielding directly a ndarray.
+
+ - rgb.py
+
+ - (308, 7) # TODO: Investigate for generator yielding directly a ndarray.
About
-----
diff --git a/colour/__init__.py b/colour/__init__.py
index 9a861e2858..e483782fad 100644
--- a/colour/__init__.py
+++ b/colour/__init__.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour
======
@@ -13,6 +12,7 @@
- adaptation: Chromatic adaptation models and transformations.
- algebra: Algebra utilities.
- appearance: Colour appearance models.
+- biochemistry: Biochemistry computations.
- characterisation: Colour fitting and camera characterisation.
- colorimetry: Core objects for colour computations.
- constants: *CIE* and *CODATA* constants.
@@ -40,6 +40,8 @@
from . import adaptation # noqa
from .algebra import * # noqa
from . import algebra # noqa
+from .biochemistry import * # noqa
+from . import biochemistry # noqa
from .colorimetry import * # noqa
from . import colorimetry # noqa
from .appearance import * # noqa
@@ -80,6 +82,7 @@
__all__ += utilities.__all__
__all__ += adaptation.__all__
__all__ += algebra.__all__
+__all__ += biochemistry.__all__
__all__ += colorimetry.__all__
__all__ += appearance.__all__
__all__ += constants.__all__
@@ -99,7 +102,8 @@
__major_version__ = '0'
__minor_version__ = '3'
-__change_version__ = '9'
-__version__ = '.'.join((__major_version__,
- __minor_version__,
- __change_version__))
+__change_version__ = '10'
+__version__ = '.'.join(
+ (__major_version__,
+ __minor_version__,
+ __change_version__)) # yapf: disable
diff --git a/colour/adaptation/__init__.py b/colour/adaptation/__init__.py
index fb6d20775f..dd5ee99f81 100644
--- a/colour/adaptation/__init__.py
+++ b/colour/adaptation/__init__.py
@@ -5,26 +5,25 @@
from .dataset import * # noqa
from . import dataset
-from .vonkries import (
- chromatic_adaptation_matrix_VonKries,
- chromatic_adaptation_VonKries)
+from .vonkries import (chromatic_adaptation_matrix_VonKries,
+ chromatic_adaptation_VonKries)
from .fairchild1990 import chromatic_adaptation_Fairchild1990
from .cmccat2000 import (
- CMCCAT2000_InductionFactors,
- CMCCAT2000_VIEWING_CONDITIONS,
+ CMCCAT2000_InductionFactors, CMCCAT2000_VIEWING_CONDITIONS,
chromatic_adaptation_forward_CMCCAT2000,
- chromatic_adaptation_reverse_CMCCAT2000,
- chromatic_adaptation_CMCCAT2000)
+ chromatic_adaptation_reverse_CMCCAT2000, chromatic_adaptation_CMCCAT2000)
from .cie1994 import chromatic_adaptation_CIE1994
__all__ = []
__all__ += dataset.__all__
-__all__ += ['chromatic_adaptation_matrix_VonKries',
- 'chromatic_adaptation_VonKries']
+__all__ += [
+ 'chromatic_adaptation_matrix_VonKries', 'chromatic_adaptation_VonKries'
+]
__all__ += ['chromatic_adaptation_Fairchild1990']
-__all__ += ['CMCCAT2000_InductionFactors',
- 'CMCCAT2000_VIEWING_CONDITIONS',
- 'chromatic_adaptation_forward_CMCCAT2000',
- 'chromatic_adaptation_reverse_CMCCAT2000',
- 'chromatic_adaptation_CMCCAT2000']
+__all__ += [
+ 'CMCCAT2000_InductionFactors', 'CMCCAT2000_VIEWING_CONDITIONS',
+ 'chromatic_adaptation_forward_CMCCAT2000',
+ 'chromatic_adaptation_reverse_CMCCAT2000',
+ 'chromatic_adaptation_CMCCAT2000'
+]
__all__ += ['chromatic_adaptation_CIE1994']
diff --git a/colour/adaptation/cie1994.py b/colour/adaptation/cie1994.py
index f97221a9ca..9720e471f7 100644
--- a/colour/adaptation/cie1994.py
+++ b/colour/adaptation/cie1994.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE 1994 Chromatic Adaptation Model
===================================
@@ -36,18 +35,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CIE1994_XYZ_TO_RGB_MATRIX',
- 'CIE1994_RGB_TO_XYZ_MATRIX',
- 'chromatic_adaptation_CIE1994',
- 'XYZ_to_RGB_CIE1994',
- 'RGB_to_XYZ_CIE1994',
- 'intermediate_values',
- 'effective_adapting_responses',
- 'beta_1',
- 'beta_2',
- 'exponential_factors',
- 'K_coefficient',
- 'corresponding_colour']
+__all__ = [
+ 'CIE1994_XYZ_TO_RGB_MATRIX', 'CIE1994_RGB_TO_XYZ_MATRIX',
+ 'chromatic_adaptation_CIE1994', 'XYZ_to_RGB_CIE1994', 'RGB_to_XYZ_CIE1994',
+ 'intermediate_values', 'effective_adapting_responses', 'beta_1', 'beta_2',
+ 'exponential_factors', 'K_coefficient', 'corresponding_colour'
+]
CIE1994_XYZ_TO_RGB_MATRIX = VON_KRIES_CAT
"""
@@ -66,13 +59,7 @@
"""
-def chromatic_adaptation_CIE1994(XYZ_1,
- xy_o1,
- xy_o2,
- Y_o,
- E_o1,
- E_o2,
- n=1):
+def chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2, n=1):
"""
Adapts given stimulus *CIE XYZ_1* tristimulus values from test viewing
conditions to reference viewing conditions using *CIE 1994* chromatic
@@ -147,8 +134,8 @@ def chromatic_adaptation_CIE1994(XYZ_1,
K = K_coefficient(xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, n)
- RGB_2 = corresponding_colour(
- RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K, n)
+ RGB_2 = corresponding_colour(RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K,
+ n)
XYZ_2 = RGB_to_XYZ_CIE1994(RGB_2)
return XYZ_2
diff --git a/colour/adaptation/cmccat2000.py b/colour/adaptation/cmccat2000.py
index 6e2273e890..25219b1b52 100644
--- a/colour/adaptation/cmccat2000.py
+++ b/colour/adaptation/cmccat2000.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CMCCAT2000 Chromatic Adaptation Model
=====================================
@@ -44,12 +43,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CMCCAT2000_INVERSE_CAT',
- 'CMCCAT2000_InductionFactors',
- 'CMCCAT2000_VIEWING_CONDITIONS',
- 'chromatic_adaptation_forward_CMCCAT2000',
- 'chromatic_adaptation_reverse_CMCCAT2000',
- 'chromatic_adaptation_CMCCAT2000']
+__all__ = [
+ 'CMCCAT2000_INVERSE_CAT', 'CMCCAT2000_InductionFactors',
+ 'CMCCAT2000_VIEWING_CONDITIONS', 'chromatic_adaptation_forward_CMCCAT2000',
+ 'chromatic_adaptation_reverse_CMCCAT2000',
+ 'chromatic_adaptation_CMCCAT2000'
+]
CMCCAT2000_INVERSE_CAT = np.linalg.inv(CMCCAT2000_CAT)
"""
@@ -60,8 +59,7 @@
class CMCCAT2000_InductionFactors(
- namedtuple('CMCCAT2000_InductionFactors',
- ('F',))):
+ namedtuple('CMCCAT2000_InductionFactors', ('F', ))):
"""
*CMCCAT2000* chromatic adaptation model induction factors.
@@ -72,10 +70,11 @@ class CMCCAT2000_InductionFactors(
"""
-CMCCAT2000_VIEWING_CONDITIONS = CaseInsensitiveMapping(
- {'Average': CMCCAT2000_InductionFactors(1.),
- 'Dim': CMCCAT2000_InductionFactors(0.8),
- 'Dark': CMCCAT2000_InductionFactors(0.8)})
+CMCCAT2000_VIEWING_CONDITIONS = CaseInsensitiveMapping({
+ 'Average': CMCCAT2000_InductionFactors(1),
+ 'Dim': CMCCAT2000_InductionFactors(0.8),
+ 'Dark': CMCCAT2000_InductionFactors(0.8)
+})
"""
Reference *CMCCAT2000* chromatic adaptation model viewing conditions.
@@ -149,15 +148,14 @@ def chromatic_adaptation_forward_CMCCAT2000(
RGB_w = dot_vector(CMCCAT2000_CAT, XYZ_w)
RGB_wr = dot_vector(CMCCAT2000_CAT, XYZ_wr)
- D = (surround.F *
- (0.08 * np.log10(0.5 * (L_A1 + L_A2)) +
- 0.76 - 0.45 * (L_A1 - L_A2) / (L_A1 + L_A2)))
+ D = (surround.F * (0.08 * np.log10(0.5 * (L_A1 + L_A2)) + 0.76 - 0.45 *
+ (L_A1 - L_A2) / (L_A1 + L_A2)))
D = np.clip(D, 0, 1)
a = D * XYZ_w[..., 1] / XYZ_wr[..., 1]
- RGB_c = (RGB *
- (a[..., np.newaxis] * (RGB_wr / RGB_w) + 1 - D[..., np.newaxis]))
+ RGB_c = (RGB * (a[..., np.newaxis] *
+ (RGB_wr / RGB_w) + 1 - D[..., np.newaxis]))
XYZ_c = dot_vector(CMCCAT2000_INVERSE_CAT, RGB_c)
return XYZ_c
@@ -228,15 +226,14 @@ def chromatic_adaptation_reverse_CMCCAT2000(
RGB_w = dot_vector(CMCCAT2000_CAT, XYZ_w)
RGB_wr = dot_vector(CMCCAT2000_CAT, XYZ_wr)
- D = (surround.F *
- (0.08 * np.log10(0.5 * (L_A1 + L_A2)) +
- 0.76 - 0.45 * (L_A1 - L_A2) / (L_A1 + L_A2)))
+ D = (surround.F * (0.08 * np.log10(0.5 * (L_A1 + L_A2)) + 0.76 - 0.45 *
+ (L_A1 - L_A2) / (L_A1 + L_A2)))
D = np.clip(D, 0, 1)
a = D * XYZ_w[..., 1] / XYZ_wr[..., 1]
- RGB = (RGB_c /
- (a[..., np.newaxis] * (RGB_wr / RGB_w) + 1 - D[..., np.newaxis]))
+ RGB = (RGB_c / (a[..., np.newaxis] *
+ (RGB_wr / RGB_w) + 1 - D[..., np.newaxis]))
XYZ = dot_vector(CMCCAT2000_INVERSE_CAT, RGB)
return XYZ
@@ -317,8 +314,8 @@ def chromatic_adaptation_CMCCAT2000(
"""
if method.lower() == 'forward':
- return chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, surround)
+ return chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr,
+ L_A1, L_A2, surround)
else:
- return chromatic_adaptation_reverse_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, surround)
+ return chromatic_adaptation_reverse_CMCCAT2000(XYZ, XYZ_w, XYZ_wr,
+ L_A1, L_A2, surround)
diff --git a/colour/adaptation/dataset/__init__.py b/colour/adaptation/dataset/__init__.py
index f06123aeff..60bcfed8af 100644
--- a/colour/adaptation/dataset/__init__.py
+++ b/colour/adaptation/dataset/__init__.py
@@ -4,27 +4,13 @@
from __future__ import absolute_import
from .cat import CHROMATIC_ADAPTATION_TRANSFORMS
-from .cat import (XYZ_SCALING_CAT,
- VON_KRIES_CAT,
- BRADFORD_CAT,
- SHARP_CAT,
- FAIRCHILD_CAT,
- CMCCAT97_CAT,
- CMCCAT2000_CAT,
- CAT02_CAT,
- CAT02_BRILL_CAT,
- BS_CAT,
- BS_PC_CAT)
+from .cat import (XYZ_SCALING_CAT, VON_KRIES_CAT, BRADFORD_CAT, SHARP_CAT,
+ FAIRCHILD_CAT, CMCCAT97_CAT, CMCCAT2000_CAT, CAT02_CAT,
+ CAT02_BRILL_CAT, BS_CAT, BS_PC_CAT)
__all__ = ['CHROMATIC_ADAPTATION_TRANSFORMS']
-__all__ += ['XYZ_SCALING_CAT',
- 'VON_KRIES_CAT',
- 'BRADFORD_CAT',
- 'SHARP_CAT',
- 'FAIRCHILD_CAT',
- 'CMCCAT97_CAT',
- 'CMCCAT2000_CAT',
- 'CAT02_CAT',
- 'CAT02_BRILL_CAT',
- 'BS_CAT',
- 'BS_PC_CAT']
+__all__ += [
+ 'XYZ_SCALING_CAT', 'VON_KRIES_CAT', 'BRADFORD_CAT', 'SHARP_CAT',
+ 'FAIRCHILD_CAT', 'CMCCAT97_CAT', 'CMCCAT2000_CAT', 'CAT02_CAT',
+ 'CAT02_BRILL_CAT', 'BS_CAT', 'BS_PC_CAT'
+]
diff --git a/colour/adaptation/dataset/cat.py b/colour/adaptation/dataset/cat.py
index 4e5bc82942..a4ba916401 100644
--- a/colour/adaptation/dataset/cat.py
+++ b/colour/adaptation/dataset/cat.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Chromatic Adaptation Transforms
===============================
@@ -62,18 +61,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_SCALING_CAT',
- 'VON_KRIES_CAT',
- 'BRADFORD_CAT',
- 'SHARP_CAT',
- 'FAIRCHILD_CAT',
- 'CMCCAT97_CAT',
- 'CMCCAT2000_CAT',
- 'CAT02_CAT',
- 'CAT02_BRILL_CAT',
- 'BS_CAT',
- 'BS_PC_CAT',
- 'CHROMATIC_ADAPTATION_TRANSFORMS']
+__all__ = [
+ 'XYZ_SCALING_CAT', 'VON_KRIES_CAT', 'BRADFORD_CAT', 'SHARP_CAT',
+ 'FAIRCHILD_CAT', 'CMCCAT97_CAT', 'CMCCAT2000_CAT', 'CAT02_CAT',
+ 'CAT02_BRILL_CAT', 'BS_CAT', 'BS_PC_CAT', 'CHROMATIC_ADAPTATION_TRANSFORMS'
+]
XYZ_SCALING_CAT = np.array(np.identity(3)).reshape((3, 3))
"""
@@ -85,7 +77,7 @@
VON_KRIES_CAT = np.array(
[[0.4002400, 0.7076000, -0.0808100],
[-0.2263000, 1.1653200, 0.0457000],
- [0.0000000, 0.0000000, 0.9182200]])
+ [0.0000000, 0.0000000, 0.9182200]]) # yapf: disable
"""
*Von Kries* chromatic adaptation transform. [1]_
@@ -95,7 +87,7 @@
BRADFORD_CAT = np.array(
[[0.8951000, 0.2664000, -0.1614000],
[-0.7502000, 1.7135000, 0.0367000],
- [0.0389000, -0.0685000, 1.0296000]])
+ [0.0389000, -0.0685000, 1.0296000]]) # yapf: disable
"""
*Bradford* chromatic adaptation transform. [1]_
@@ -105,7 +97,7 @@
SHARP_CAT = np.array(
[[1.2694, -0.0988, -0.1706],
[-0.8364, 1.8006, 0.0357],
- [0.0297, -0.0315, 1.0018]])
+ [0.0297, -0.0315, 1.0018]]) # yapf: disable
"""
*Sharp* chromatic adaptation transform. [4]_
@@ -115,7 +107,7 @@
FAIRCHILD_CAT = np.array(
[[0.8562, 0.3372, -0.1934],
[-0.8360, 1.8327, 0.0033],
- [0.0357, -0.0469, 1.0112]])
+ [0.0357, -0.0469, 1.0112]]) # yapf: disable
"""
*Fairchild* chromatic adaptation transform. [2]_
@@ -125,7 +117,7 @@
CMCCAT97_CAT = np.array(
[[0.8951, -0.7502, 0.0389],
[0.2664, 1.7135, 0.0685],
- [-0.1614, 0.0367, 1.0296]])
+ [-0.1614, 0.0367, 1.0296]]) # yapf: disable
"""
*CMCCAT97* chromatic adaptation transform. [5]_
@@ -135,7 +127,7 @@
CMCCAT2000_CAT = np.array(
[[0.7982, 0.3389, -0.1371],
[-0.5918, 1.5512, 0.0406],
- [0.0008, 0.0239, 0.9753]])
+ [0.0008, 0.0239, 0.9753]]) # yapf: disable
"""
*CMCCAT2000* chromatic adaptation transform. [5]_
@@ -145,7 +137,7 @@
CAT02_CAT = np.array(
[[0.7328, 0.4296, -0.1624],
[-0.7036, 1.6975, 0.0061],
- [0.0030, 0.0136, 0.9834]])
+ [0.0030, 0.0136, 0.9834]]) # yapf: disable
"""
*CAT02* chromatic adaptation transform. [3]_
@@ -155,7 +147,7 @@
CAT02_BRILL_CAT = np.array(
[[0.7328, 0.4296, -0.1624],
[-0.7036, 1.6975, 0.0061],
- [0.0000, 0.0000, 1.0000]])
+ [0.0000, 0.0000, 1.0000]]) # yapf: disable
"""
*Brill and Süsstrunk (2008)* corrected CAT02 chromatic adaptation
transform. [6]_ [7]
@@ -166,7 +158,7 @@
BS_CAT = np.array(
[[0.8752, 0.2787, -0.1539],
[-0.8904, 1.8709, 0.0195],
- [-0.0061, 0.0162, 0.9899]])
+ [-0.0061, 0.0162, 0.9899]]) # yapf: disable
"""
*Bianco and Schettini (2010)* chromatic adaptation transform. [4]_
@@ -176,7 +168,7 @@
BS_PC_CAT = np.array(
[[0.6489, 0.3915, -0.0404],
[-0.3775, 1.3055, 0.0720],
- [-0.0271, 0.0888, 0.9383]])
+ [-0.0271, 0.0888, 0.9383]]) # yapf: disable
"""
*Bianco and Schettini PC (2010)* chromatic adaptation transform. [4]_
@@ -187,18 +179,19 @@
- This chromatic adaptation transform has no negative lobes.
"""
-CHROMATIC_ADAPTATION_TRANSFORMS = CaseInsensitiveMapping(
- {'XYZ Scaling': XYZ_SCALING_CAT,
- 'Von Kries': VON_KRIES_CAT,
- 'Bradford': BRADFORD_CAT,
- 'Sharp': SHARP_CAT,
- 'Fairchild': FAIRCHILD_CAT,
- 'CMCCAT97': CMCCAT97_CAT,
- 'CMCCAT2000': CMCCAT2000_CAT,
- 'CAT02': CAT02_CAT,
- 'CAT02_BRILL_CAT': CAT02_BRILL_CAT,
- 'Bianco': BS_CAT,
- 'Bianco PC': BS_PC_CAT})
+CHROMATIC_ADAPTATION_TRANSFORMS = CaseInsensitiveMapping({
+ 'XYZ Scaling': XYZ_SCALING_CAT,
+ 'Von Kries': VON_KRIES_CAT,
+ 'Bradford': BRADFORD_CAT,
+ 'Sharp': SHARP_CAT,
+ 'Fairchild': FAIRCHILD_CAT,
+ 'CMCCAT97': CMCCAT97_CAT,
+ 'CMCCAT2000': CMCCAT2000_CAT,
+ 'CAT02': CAT02_CAT,
+ 'CAT02_BRILL_CAT': CAT02_BRILL_CAT,
+ 'Bianco': BS_CAT,
+ 'Bianco PC': BS_PC_CAT
+})
"""
Supported chromatic adaptation transforms.
diff --git a/colour/adaptation/fairchild1990.py b/colour/adaptation/fairchild1990.py
index 0846660487..887a93e91e 100644
--- a/colour/adaptation/fairchild1990.py
+++ b/colour/adaptation/fairchild1990.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Fairchild (1990) Chromatic Adaptation Model
===========================================
@@ -38,12 +37,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['FAIRCHILD1990_XYZ_TO_RGB_MATRIX',
- 'FAIRCHILD1990_RGB_TO_XYZ_MATRIX',
- 'chromatic_adaptation_Fairchild1990',
- 'XYZ_to_RGB_Fairchild1990',
- 'RGB_to_XYZ_Fairchild1990',
- 'degrees_of_adaptation']
+__all__ = [
+ 'FAIRCHILD1990_XYZ_TO_RGB_MATRIX', 'FAIRCHILD1990_RGB_TO_XYZ_MATRIX',
+ 'chromatic_adaptation_Fairchild1990', 'XYZ_to_RGB_Fairchild1990',
+ 'RGB_to_XYZ_Fairchild1990', 'degrees_of_adaptation'
+]
FAIRCHILD1990_XYZ_TO_RGB_MATRIX = VON_KRIES_CAT
"""
@@ -122,9 +120,8 @@ def chromatic_adaptation_Fairchild1990(XYZ_1,
LMS_n = dot_vector(FAIRCHILD1990_XYZ_TO_RGB_MATRIX, XYZ_n)
LMS_r = dot_vector(FAIRCHILD1990_XYZ_TO_RGB_MATRIX, XYZ_r)
- p_LMS = degrees_of_adaptation(LMS_1,
- Y_n,
- discount_illuminant=discount_illuminant)
+ p_LMS = degrees_of_adaptation(
+ LMS_1, Y_n, discount_illuminant=discount_illuminant)
a_LMS_1 = p_LMS / LMS_n
a_LMS_2 = p_LMS / LMS_r
diff --git a/colour/adaptation/tests/tests_cie1994.py b/colour/adaptation/tests/tests_cie1994.py
index 20c7f90426..f8905aa2ef 100644
--- a/colour/adaptation/tests/tests_cie1994.py
+++ b/colour/adaptation/tests/tests_cie1994.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.adaptation.cie1994` module.
"""
diff --git a/colour/adaptation/tests/tests_cmccat2000.py b/colour/adaptation/tests/tests_cmccat2000.py
index 7db0679978..4204471723 100644
--- a/colour/adaptation/tests/tests_cmccat2000.py
+++ b/colour/adaptation/tests/tests_cmccat2000.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.adaptation.cmccat2000.
"""
@@ -24,8 +23,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestChromaticAdaptationForwardCMCCAT2000',
- 'TestChromaticAdaptationReverseCMCCAT2000']
+__all__ = [
+ 'TestChromaticAdaptationForwardCMCCAT2000',
+ 'TestChromaticAdaptationReverseCMCCAT2000'
+]
class TestChromaticAdaptationForwardCMCCAT2000(unittest.TestCase):
@@ -44,8 +45,7 @@ def test_chromatic_adaptation_forward_CMCCAT2000(self):
chromatic_adaptation_forward_CMCCAT2000(
np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
np.array([1.09846607, 1.00000000, 0.35582280]) * 100,
- np.array([0.95042855, 1.00000000, 1.08890037]) * 100,
- 100,
+ np.array([0.95042855, 1.00000000, 1.08890037]) * 100, 100,
100),
np.array([8.01087299, 10.89423054, 26.89150177]),
decimal=7)
@@ -54,8 +54,7 @@ def test_chromatic_adaptation_forward_CMCCAT2000(self):
chromatic_adaptation_forward_CMCCAT2000(
np.array([0.47097710, 0.34950000, 0.11301649]) * 100,
np.array([0.99092745, 1.00000000, 0.85313273]) * 100,
- np.array([1.01679082, 1.00000000, 0.67610122]) * 100,
- 100,
+ np.array([1.01679082, 1.00000000, 0.67610122]) * 100, 100,
100),
np.array([48.97710455, 35.36874611, 9.02878274]),
decimal=7)
@@ -64,8 +63,7 @@ def test_chromatic_adaptation_forward_CMCCAT2000(self):
chromatic_adaptation_forward_CMCCAT2000(
np.array([0.25506814, 0.19150000, 0.08849752]) * 100,
np.array([0.98070597, 1.00000000, 1.18224949]) * 100,
- np.array([0.92833635, 1.00000000, 1.03664720]) * 100,
- 100,
+ np.array([0.92833635, 1.00000000, 1.03664720]) * 100, 100,
100),
np.array([24.68548451, 19.08228483, 7.81570209]),
decimal=7)
@@ -84,16 +82,16 @@ def test_n_dimensional_chromatic_adaptation_forward_CMCCAT2000(self):
L_A2 = 200
XYZ_c = np.array([19.52698326, 23.06833960, 24.97175229])
np.testing.assert_almost_equal(
- chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ_c,
decimal=7)
XYZ = np.tile(XYZ, (6, 1))
XYZ_c = np.tile(XYZ_c, (6, 1))
np.testing.assert_almost_equal(
- chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ_c,
decimal=7)
@@ -102,8 +100,8 @@ def test_n_dimensional_chromatic_adaptation_forward_CMCCAT2000(self):
L_A1 = np.tile(L_A1, 6)
L_A2 = np.tile(L_A2, 6)
np.testing.assert_almost_equal(
- chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ_c,
decimal=7)
@@ -114,8 +112,8 @@ def test_n_dimensional_chromatic_adaptation_forward_CMCCAT2000(self):
L_A2 = np.reshape(L_A2, (2, 3))
XYZ_c = np.reshape(XYZ_c, (2, 3, 3))
np.testing.assert_almost_equal(
- chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ_c,
decimal=7)
@@ -134,8 +132,8 @@ def test_nan_chromatic_adaptation_forward_CMCCAT2000(self):
XYZ_wr = np.array(case)
L_A1 = case[0]
L_A2 = case[0]
- chromatic_adaptation_forward_CMCCAT2000(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2)
+ chromatic_adaptation_forward_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1,
+ L_A2)
class TestChromaticAdaptationReverseCMCCAT2000(unittest.TestCase):
@@ -154,8 +152,7 @@ def test_chromatic_adaptation_reverse_CMCCAT2000(self):
chromatic_adaptation_reverse_CMCCAT2000(
np.array([8.01087299, 10.89423054, 26.89150177]),
np.array([1.09846607, 1.00000000, 0.35582280]) * 100,
- np.array([0.95042855, 1.00000000, 1.08890037]) * 100,
- 100,
+ np.array([0.95042855, 1.00000000, 1.08890037]) * 100, 100,
100),
np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
decimal=7)
@@ -164,8 +161,7 @@ def test_chromatic_adaptation_reverse_CMCCAT2000(self):
chromatic_adaptation_reverse_CMCCAT2000(
np.array([48.97710455, 35.36874611, 9.02878274]),
np.array([0.99092745, 1.00000000, 0.85313273]) * 100,
- np.array([1.01679082, 1.00000000, 0.67610122]) * 100,
- 100,
+ np.array([1.01679082, 1.00000000, 0.67610122]) * 100, 100,
100),
np.array([0.47097710, 0.34950000, 0.11301649]) * 100,
decimal=7)
@@ -174,8 +170,7 @@ def test_chromatic_adaptation_reverse_CMCCAT2000(self):
chromatic_adaptation_reverse_CMCCAT2000(
np.array([24.68548451, 19.08228483, 7.81570209]),
np.array([0.98070597, 1.00000000, 1.18224949]) * 100,
- np.array([0.92833635, 1.00000000, 1.03664720]) * 100,
- 100,
+ np.array([0.92833635, 1.00000000, 1.03664720]) * 100, 100,
100),
np.array([0.25506814, 0.19150000, 0.08849752]) * 100,
decimal=7)
@@ -194,16 +189,16 @@ def test_n_dimensional_chromatic_adaptation_reverse_CMCCAT2000(self):
L_A2 = 200
XYZ = np.array([22.48, 22.74, 8.54])
np.testing.assert_almost_equal(
- chromatic_adaptation_reverse_CMCCAT2000(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_reverse_CMCCAT2000(XYZ_c, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ,
decimal=7)
XYZ_c = np.tile(XYZ_c, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- chromatic_adaptation_reverse_CMCCAT2000(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_reverse_CMCCAT2000(XYZ_c, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ,
decimal=7)
@@ -212,8 +207,8 @@ def test_n_dimensional_chromatic_adaptation_reverse_CMCCAT2000(self):
L_A1 = np.tile(L_A1, 6)
L_A2 = np.tile(L_A2, 6)
np.testing.assert_almost_equal(
- chromatic_adaptation_reverse_CMCCAT2000(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_reverse_CMCCAT2000(XYZ_c, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ,
decimal=7)
@@ -224,8 +219,8 @@ def test_n_dimensional_chromatic_adaptation_reverse_CMCCAT2000(self):
L_A2 = np.reshape(L_A2, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- chromatic_adaptation_reverse_CMCCAT2000(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2),
+ chromatic_adaptation_reverse_CMCCAT2000(XYZ_c, XYZ_w, XYZ_wr, L_A1,
+ L_A2),
XYZ,
decimal=7)
@@ -244,8 +239,8 @@ def test_nan_chromatic_adaptation_reverse_CMCCAT2000(self):
XYZ_wr = np.array(case)
L_A1 = case[0]
L_A2 = case[0]
- chromatic_adaptation_reverse_CMCCAT2000(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2)
+ chromatic_adaptation_reverse_CMCCAT2000(XYZ_c, XYZ_w, XYZ_wr, L_A1,
+ L_A2)
if __name__ == '__main__':
diff --git a/colour/adaptation/tests/tests_fairchild1990.py b/colour/adaptation/tests/tests_fairchild1990.py
index 456aefa5f4..d268b98304 100644
--- a/colour/adaptation/tests/tests_fairchild1990.py
+++ b/colour/adaptation/tests/tests_fairchild1990.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.adaptation.fairchild1990` module.
"""
@@ -40,8 +39,7 @@ def test_chromatic_adaptation_Fairchild1990(self):
chromatic_adaptation_Fairchild1990(
np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
np.array([1.09846607, 1.00000000, 0.35582280]) * 100,
- np.array([0.95042855, 1.00000000, 1.08890037]) * 100,
- 200),
+ np.array([0.95042855, 1.00000000, 1.08890037]) * 100, 200),
np.array([8.35782287, 10.21428897, 29.25065668]),
decimal=7)
@@ -49,8 +47,7 @@ def test_chromatic_adaptation_Fairchild1990(self):
chromatic_adaptation_Fairchild1990(
np.array([0.47097710, 0.34950000, 0.11301649]) * 100,
np.array([0.99092745, 1.00000000, 0.85313273]) * 100,
- np.array([1.01679082, 1.00000000, 0.67610122]) * 100,
- 200),
+ np.array([1.01679082, 1.00000000, 0.67610122]) * 100, 200),
np.array([49.00577034, 35.03909328, 8.95647114]),
decimal=7)
@@ -58,8 +55,7 @@ def test_chromatic_adaptation_Fairchild1990(self):
chromatic_adaptation_Fairchild1990(
np.array([0.25506814, 0.19150000, 0.08849752]) * 100,
np.array([0.98070597, 1.00000000, 1.18224949]) * 100,
- np.array([0.92833635, 1.00000000, 1.03664720]) * 100,
- 200),
+ np.array([0.92833635, 1.00000000, 1.03664720]) * 100, 200),
np.array([24.79473034, 19.13024207, 7.75984317]),
decimal=7)
diff --git a/colour/adaptation/tests/tests_vonkries.py b/colour/adaptation/tests/tests_vonkries.py
index 1e07650d6b..f0c72e1272 100644
--- a/colour/adaptation/tests/tests_vonkries.py
+++ b/colour/adaptation/tests/tests_vonkries.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.adaptation.vonkries` module.
"""
@@ -11,9 +10,8 @@
import unittest
from itertools import permutations
-from colour.adaptation import (
- chromatic_adaptation_matrix_VonKries,
- chromatic_adaptation_VonKries)
+from colour.adaptation import (chromatic_adaptation_matrix_VonKries,
+ chromatic_adaptation_VonKries)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestChromaticAdaptationMatrixVonKries',
- 'TestChromaticAdaptationVonKries']
+__all__ = [
+ 'TestChromaticAdaptationMatrixVonKries', 'TestChromaticAdaptationVonKries'
+]
class TestChromaticAdaptationMatrixVonKries(unittest.TestCase):
@@ -46,7 +45,7 @@ def test_chromatic_adaptation_matrix_VonKries(self):
np.array([[0.86876537, -0.14165393, 0.38719611],
[-0.10300724, 1.05840142, 0.15386462],
[0.00781674, 0.02678750, 2.96081771]]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatic_adaptation_matrix_VonKries(
@@ -55,15 +54,16 @@ def test_chromatic_adaptation_matrix_VonKries(self):
np.array([[1.03379528, 0.03065322, -0.04486819],
[0.02195826, 0.99354348, -0.01793687],
[-0.00102726, -0.00281712, 0.79698769]]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatic_adaptation_matrix_VonKries(
np.array([0.98070597, 1.00000000, 1.18224949]),
np.array([0.92833635, 1.00000000, 1.03664720])),
- np.linalg.inv(chromatic_adaptation_matrix_VonKries(
- np.array([0.92833635, 1.00000000, 1.03664720]),
- np.array([0.98070597, 1.00000000, 1.18224949]))))
+ np.linalg.inv(
+ chromatic_adaptation_matrix_VonKries(
+ np.array([0.92833635, 1.00000000, 1.03664720]),
+ np.array([0.98070597, 1.00000000, 1.18224949]))))
np.testing.assert_almost_equal(
chromatic_adaptation_matrix_VonKries(
@@ -73,7 +73,7 @@ def test_chromatic_adaptation_matrix_VonKries(self):
np.array([[0.86523251, 0.00000000, 0.00000000],
[0.00000000, 1.00000000, 0.00000000],
[0.00000000, 0.00000000, 3.06023214]]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatic_adaptation_matrix_VonKries(
@@ -83,7 +83,7 @@ def test_chromatic_adaptation_matrix_VonKries(self):
np.array([[0.84467949, -0.11793553, 0.39489408],
[-0.13664085, 1.10412369, 0.12919812],
[0.07986716, -0.13493155, 3.19288296]]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatic_adaptation_matrix_VonKries(
@@ -93,7 +93,7 @@ def test_chromatic_adaptation_matrix_VonKries(self):
np.array([[0.93949221, -0.23393727, 0.42820614],
[-0.02569635, 1.02638463, 0.00517656],
[0.00000000, 0.00000000, 3.06023214]]),
- decimal=7)
+ decimal=7) # yapf: disable
def test_n_dimensional_chromatic_adaptation_matrix_VonKries(self):
"""
@@ -105,27 +105,21 @@ def test_n_dimensional_chromatic_adaptation_matrix_VonKries(self):
XYZ_wr = np.array([0.95042855, 1.00000000, 1.08890037])
M = np.array([[0.86876537, -0.14165393, 0.38719611],
[-0.10300724, 1.05840142, 0.15386462],
- [0.00781674, 0.02678750, 2.96081771]])
+ [0.00781674, 0.02678750, 2.96081771]]) # yapf: disable
np.testing.assert_almost_equal(
- chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr),
- M,
- decimal=7)
+ chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr), M, decimal=7)
XYZ_w = np.tile(XYZ_w, (6, 1))
XYZ_wr = np.tile(XYZ_wr, (6, 1))
M = np.reshape(np.tile(M, (6, 1)), (6, 3, 3))
np.testing.assert_almost_equal(
- chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr),
- M,
- decimal=7)
+ chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr), M, decimal=7)
XYZ_w = np.reshape(XYZ_w, (2, 3, 3))
XYZ_wr = np.reshape(XYZ_wr, (2, 3, 3))
M = np.reshape(M, (2, 3, 3, 3))
np.testing.assert_almost_equal(
- chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr),
- M,
- decimal=7)
+ chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr), M, decimal=7)
@ignore_numpy_errors
def test_nan_chromatic_adaptation_matrix_VonKries(self):
diff --git a/colour/adaptation/vonkries.py b/colour/adaptation/vonkries.py
index e804c6e462..25be0e8f01 100644
--- a/colour/adaptation/vonkries.py
+++ b/colour/adaptation/vonkries.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Von Kries Chromatic Adaptation Model
====================================
@@ -36,8 +35,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['chromatic_adaptation_matrix_VonKries',
- 'chromatic_adaptation_VonKries']
+__all__ = [
+ 'chromatic_adaptation_matrix_VonKries', 'chromatic_adaptation_VonKries'
+]
def chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr, transform='CAT02'):
diff --git a/colour/algebra/__init__.py b/colour/algebra/__init__.py
index 61e879069b..fd14450499 100644
--- a/colour/algebra/__init__.py
+++ b/colour/algebra/__init__.py
@@ -7,32 +7,24 @@
from . import coordinates
from .extrapolation import Extrapolator
from .geometry import (
- normalise_vector,
- euclidean_distance,
- extend_line_segment,
- LineSegmentsIntersections_Specification,
- intersect_line_segments)
-from .interpolation import (
- LinearInterpolator,
- SpragueInterpolator,
- CubicSplineInterpolator,
- PchipInterpolator,
- lagrange_coefficients)
+ normalise_vector, euclidean_distance, extend_line_segment,
+ LineSegmentsIntersections_Specification, intersect_line_segments)
+from .interpolation import (LinearInterpolator, SpragueInterpolator,
+ CubicSplineInterpolator, PchipInterpolator,
+ lagrange_coefficients)
from .matrix import is_identity
from .random import random_triplet_generator
__all__ = []
__all__ += coordinates.__all__
__all__ += ['Extrapolator']
-__all__ += ['normalise_vector',
- 'euclidean_distance',
- 'extend_line_segment',
- 'LineSegmentsIntersections_Specification',
- 'intersect_line_segments']
-__all__ += ['LinearInterpolator',
- 'SpragueInterpolator',
- 'CubicSplineInterpolator',
- 'PchipInterpolator',
- 'lagrange_coefficients']
+__all__ += [
+ 'normalise_vector', 'euclidean_distance', 'extend_line_segment',
+ 'LineSegmentsIntersections_Specification', 'intersect_line_segments'
+]
+__all__ += [
+ 'LinearInterpolator', 'SpragueInterpolator', 'CubicSplineInterpolator',
+ 'PchipInterpolator', 'lagrange_coefficients'
+]
__all__ += ['is_identity']
__all__ += ['random_triplet_generator']
diff --git a/colour/algebra/coordinates/__init__.py b/colour/algebra/coordinates/__init__.py
index 9d85dee7dd..2eab52578c 100644
--- a/colour/algebra/coordinates/__init__.py
+++ b/colour/algebra/coordinates/__init__.py
@@ -4,16 +4,11 @@
from __future__ import absolute_import
from .transformations import (
- cartesian_to_spherical,
- spherical_to_cartesian,
- cartesian_to_polar,
- polar_to_cartesian,
- cartesian_to_cylindrical,
- cylindrical_to_cartesian)
+ cartesian_to_spherical, spherical_to_cartesian, cartesian_to_polar,
+ polar_to_cartesian, cartesian_to_cylindrical, cylindrical_to_cartesian)
-__all__ = ['cartesian_to_spherical',
- 'spherical_to_cartesian',
- 'cartesian_to_polar',
- 'polar_to_cartesian',
- 'cartesian_to_cylindrical',
- 'cylindrical_to_cartesian']
+__all__ = [
+ 'cartesian_to_spherical', 'spherical_to_cartesian', 'cartesian_to_polar',
+ 'polar_to_cartesian', 'cartesian_to_cylindrical',
+ 'cylindrical_to_cartesian'
+]
diff --git a/colour/algebra/coordinates/transformations.py b/colour/algebra/coordinates/transformations.py
index ff72d0f01f..7de1412caf 100644
--- a/colour/algebra/coordinates/transformations.py
+++ b/colour/algebra/coordinates/transformations.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Coordinates System Transformations
==================================
@@ -38,12 +37,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['cartesian_to_spherical',
- 'spherical_to_cartesian',
- 'cartesian_to_polar',
- 'polar_to_cartesian',
- 'cartesian_to_cylindrical',
- 'cylindrical_to_cartesian']
+__all__ = [
+ 'cartesian_to_spherical', 'spherical_to_cartesian', 'cartesian_to_polar',
+ 'polar_to_cartesian', 'cartesian_to_cylindrical',
+ 'cylindrical_to_cartesian'
+]
def cartesian_to_spherical(a):
diff --git a/colour/algebra/extrapolation.py b/colour/algebra/extrapolation.py
index ed9462d907..a27a81182e 100644
--- a/colour/algebra/extrapolation.py
+++ b/colour/algebra/extrapolation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Extrapolation
=============
@@ -178,9 +177,9 @@ def method(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('method', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'method', value))
value = value.lower()
self._method = value
@@ -212,7 +211,7 @@ def left(self, value):
if value is not None:
assert is_numeric(value), (
'"{0}" attribute: "{1}" is not a "numeric"!').format(
- 'left', value)
+ 'left', value)
self._left = value
@property
@@ -242,7 +241,7 @@ def right(self, value):
if value is not None:
assert is_numeric(value), (
'"{0}" attribute: "{1}" is not a "numeric"!').format(
- 'right', value)
+ 'right', value)
self._right = value
def __call__(self, x):
@@ -287,8 +286,8 @@ def _evaluate(self, x):
y = np.empty_like(x)
if self._method == 'linear':
- y[x < xi[0]] = (yi[0] + (x[x < xi[0]] - xi[0]) *
- (yi[1] - yi[0]) / (xi[1] - xi[0]))
+ y[x < xi[0]] = (yi[0] + (x[x < xi[0]] - xi[0]) * (yi[1] - yi[0]) /
+ (xi[1] - xi[0]))
y[x > xi[-1]] = (yi[-1] + (x[x > xi[-1]] - xi[-1]) *
(yi[-1] - yi[-2]) / (xi[-1] - xi[-2]))
elif self._method == 'constant':
diff --git a/colour/algebra/geometry.py b/colour/algebra/geometry.py
index 2d2bcc8bc3..e5cc6a81f4 100644
--- a/colour/algebra/geometry.py
+++ b/colour/algebra/geometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Geometry
========
@@ -27,11 +26,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['normalise_vector',
- 'euclidean_distance',
- 'extend_line_segment',
- 'LineSegmentsIntersections_Specification',
- 'intersect_line_segments']
+__all__ = [
+ 'normalise_vector', 'euclidean_distance', 'extend_line_segment',
+ 'LineSegmentsIntersections_Specification', 'intersect_line_segments'
+]
def normalise_vector(a):
@@ -137,8 +135,8 @@ def extend_line_segment(a, b, distance=1):
class LineSegmentsIntersections_Specification(
- namedtuple('LineSegmentsIntersections_Specification',
- ('xy', 'intersect', 'parallel', 'coincident'))):
+ namedtuple('LineSegmentsIntersections_Specification',
+ ('xy', 'intersect', 'parallel', 'coincident'))):
"""
Defines the specification for intersection of line segments :math:`l_1` and
:math:`l_2` returned by :func:`intersect_line_segments` definition.
@@ -237,12 +235,11 @@ def intersect_line_segments(l_1, l_2):
r_2, c_2 = l_2.shape[0], l_2.shape[1]
x_1, y_1, x_2, y_2 = [np.tile(l_1[:, i, np.newaxis], (1, r_2))
- for i in range(c_1)]
+ for i in range(c_1)] # yapf: disable
l_2 = np.transpose(l_2)
- x_3, y_3, x_4, y_4 = [np.tile(l_2[i, :], (r_1, 1))
- for i in range(c_2)]
+ x_3, y_3, x_4, y_4 = [np.tile(l_2[i, :], (r_1, 1)) for i in range(c_2)]
x_4_x_3 = x_4 - x_3
y_1_y_3 = y_1 - y_3
@@ -258,13 +255,12 @@ def intersect_line_segments(l_1, l_2):
u_a = numerator_a / denominator
u_b = numerator_b / denominator
- intersect = np.logical_and.reduce(
- (u_a >= 0, u_a <= 1, u_b >= 0, u_b <= 1))
+ intersect = np.logical_and.reduce((u_a >= 0, u_a <= 1, u_b >= 0, u_b <= 1))
xy = tstack((x_1 + x_2_x_1 * u_a, y_1 + y_2_y_1 * u_a))
xy[~intersect] = np.nan
parallel = denominator == 0
- coincident = np.logical_and.reduce(
- (numerator_a == 0, numerator_b == 0, parallel))
+ coincident = np.logical_and.reduce((numerator_a == 0, numerator_b == 0,
+ parallel))
- return LineSegmentsIntersections_Specification(
- xy, intersect, parallel, coincident)
+ return LineSegmentsIntersections_Specification(xy, intersect, parallel,
+ coincident)
diff --git a/colour/algebra/interpolation.py b/colour/algebra/interpolation.py
index 9ae2a60e2f..53cf8a7883 100644
--- a/colour/algebra/interpolation.py
+++ b/colour/algebra/interpolation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Interpolation
=============
@@ -31,11 +30,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LinearInterpolator',
- 'SpragueInterpolator',
- 'CubicSplineInterpolator',
- 'PchipInterpolator',
- 'lagrange_coefficients']
+__all__ = [
+ 'LinearInterpolator', 'SpragueInterpolator', 'CubicSplineInterpolator',
+ 'PchipInterpolator', 'lagrange_coefficients'
+]
class LinearInterpolator(object):
@@ -208,8 +206,8 @@ def _validate_dimensions(self):
if len(self.__x) != len(self.__y):
raise ValueError(
('"x" independent and "y" dependent variables have different '
- 'dimensions: "{0}", "{1}"').format(len(self.__x),
- len(self.__y)))
+ 'dimensions: "{0}", "{1}"').format(
+ len(self.__x), len(self.__y)))
def _validate_interpolation_range(self, x):
"""
@@ -290,9 +288,9 @@ class SpragueInterpolator(object):
SPRAGUE_C_COEFFICIENTS = np.array(
[[884, -1960, 3033, -2648, 1080, -180],
- [508, -540, 488, -367, 144, -24],
- [-24, 144, -367, 488, -540, 508],
- [-180, 1080, -2648, 3033, -1960, 884]])
+ [508, -540, 488, -367, 144,
+ -24], [-24, 144, -367, 488, -540, 508],
+ [-180, 1080, -2648, 3033, -1960, 884]]) # yapf: disable
"""
Defines the coefficients used to generate extra points for boundaries
interpolation.
@@ -392,18 +390,18 @@ def y(self, value):
assert len(value) >= 6, (
'"y" dependent variable values count must be in domain [6:]!')
- yp1 = np.ravel((np.dot(
- self.SPRAGUE_C_COEFFICIENTS[0],
- np.array(value[0:6]).reshape((6, 1)))) / 209)[0]
- yp2 = np.ravel((np.dot(
- self.SPRAGUE_C_COEFFICIENTS[1],
- np.array(value[0:6]).reshape((6, 1)))) / 209)[0]
- yp3 = np.ravel((np.dot(
- self.SPRAGUE_C_COEFFICIENTS[2],
- np.array(value[-6:]).reshape((6, 1)))) / 209)[0]
- yp4 = np.ravel((np.dot(
- self.SPRAGUE_C_COEFFICIENTS[3],
- np.array(value[-6:]).reshape((6, 1)))) / 209)[0]
+ yp1 = np.ravel((np.dot(self.SPRAGUE_C_COEFFICIENTS[0],
+ np.array(value[0:6]).reshape(
+ (6, 1)))) / 209)[0]
+ yp2 = np.ravel((np.dot(self.SPRAGUE_C_COEFFICIENTS[1],
+ np.array(value[0:6]).reshape(
+ (6, 1)))) / 209)[0]
+ yp3 = np.ravel((np.dot(self.SPRAGUE_C_COEFFICIENTS[2],
+ np.array(value[-6:]).reshape(
+ (6, 1)))) / 209)[0]
+ yp4 = np.ravel((np.dot(self.SPRAGUE_C_COEFFICIENTS[3],
+ np.array(value[-6:]).reshape(
+ (6, 1)))) / 209)[0]
self._yp = np.concatenate(((yp1, yp2), value, (yp3, yp4)))
@@ -452,16 +450,16 @@ def _evaluate(self, x):
r = self._yp
a0p = r[i]
- a1p = ((2 * r[i - 2] - 16 * r[i - 1] + 16 * r[i + 1] - 2 *
- r[i + 2]) / 24)
+ a1p = ((2 * r[i - 2] - 16 * r[i - 1] + 16 * r[i + 1] -
+ 2 * r[i + 2]) / 24) # yapf: disable
a2p = ((-r[i - 2] + 16 * r[i - 1] - 30 * r[i] + 16 * r[i + 1] -
- r[i + 2]) / 24)
- a3p = ((-9 * r[i - 2] + 39 * r[i - 1] - 70 * r[i] + 66 *
- r[i + 1] - 33 * r[i + 2] + 7 * r[i + 3]) / 24)
- a4p = ((13 * r[i - 2] - 64 * r[i - 1] + 126 * r[i] - 124 *
- r[i + 1] + 61 * r[i + 2] - 12 * r[i + 3]) / 24)
- a5p = ((-5 * r[i - 2] + 25 * r[i - 1] - 50 * r[i] + 50 *
- r[i + 1] - 25 * r[i + 2] + 5 * r[i + 3]) / 24)
+ r[i + 2]) / 24) # yapf: disable
+ a3p = ((-9 * r[i - 2] + 39 * r[i - 1] - 70 * r[i] + 66 * r[i + 1] -
+ 33 * r[i + 2] + 7 * r[i + 3]) / 24)
+ a4p = ((13 * r[i - 2] - 64 * r[i - 1] + 126 * r[i] - 124 * r[i + 1] +
+ 61 * r[i + 2] - 12 * r[i + 3]) / 24)
+ a5p = ((-5 * r[i - 2] + 25 * r[i - 1] - 50 * r[i] + 50 * r[i + 1] -
+ 25 * r[i + 2] + 5 * r[i + 3]) / 24)
y = (a0p + a1p * X + a2p * X ** 2 + a3p * X ** 3 + a4p * X ** 4 +
a5p * X ** 5)
@@ -476,8 +474,8 @@ def _validate_dimensions(self):
if len(self.__x) != len(self.__y):
raise ValueError(
('"x" independent and "y" dependent variables have different '
- 'dimensions: "{0}", "{1}"').format(len(self.__x),
- len(self.__y)))
+ 'dimensions: "{0}", "{1}"').format(
+ len(self.__x), len(self.__y)))
def _validate_interpolation_range(self, x):
"""
@@ -585,8 +583,8 @@ def lagrange_coefficients(r, n=4):
r_i = np.arange(n)
L_n = []
for j in range(len(r_i)):
- basis = [(r - r_i[i]) / (r_i[j] - r_i[i])
- for i in range(len(r_i)) if i != j]
+ basis = [(r - r_i[i]) / (r_i[j] - r_i[i]) for i in range(len(r_i))
+ if i != j]
L_n.append(reduce(lambda x, y: x * y, basis)) # noqa
return np.array(L_n)
diff --git a/colour/algebra/matrix.py b/colour/algebra/matrix.py
index 31954f242a..aa0748a48a 100644
--- a/colour/algebra/matrix.py
+++ b/colour/algebra/matrix.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Matrix Helpers
==============
diff --git a/colour/algebra/random.py b/colour/algebra/random.py
index 355c4f6633..0cd3c48f90 100644
--- a/colour/algebra/random.py
+++ b/colour/algebra/random.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Random Numbers Utilities
========================
@@ -23,8 +22,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RANDOM_STATE',
- 'random_triplet_generator']
+__all__ = ['RANDOM_STATE', 'random_triplet_generator']
RANDOM_STATE = np.random.RandomState()
@@ -80,10 +78,11 @@ def random_triplet_generator(size,
integer_size = int(size)
if integer_size != size:
- warning(('"size" has been cast to integer: {0}'.format(
- integer_size)))
+ warning(('"size" has been cast to integer: {0}'.format(integer_size)))
for _ in range(integer_size):
- yield np.array([random_state.uniform(*limits[0]),
- random_state.uniform(*limits[1]),
- random_state.uniform(*limits[2])])
+ yield np.array([
+ random_state.uniform(*limits[0]),
+ random_state.uniform(*limits[1]),
+ random_state.uniform(*limits[2])
+ ])
diff --git a/colour/algebra/tests/tests_coordinates/tests_transformations.py b/colour/algebra/tests/tests_coordinates/tests_transformations.py
index 2191fd16d6..c8983f7ad9 100644
--- a/colour/algebra/tests/tests_coordinates/tests_transformations.py
+++ b/colour/algebra/tests/tests_coordinates/tests_transformations.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.coordinates.transformations`
module.
@@ -12,13 +11,9 @@
import unittest
from itertools import permutations
-from colour.algebra import (
- cartesian_to_spherical,
- spherical_to_cartesian,
- cartesian_to_polar,
- polar_to_cartesian,
- cartesian_to_cylindrical,
- cylindrical_to_cartesian)
+from colour.algebra import (cartesian_to_spherical, spherical_to_cartesian,
+ cartesian_to_polar, polar_to_cartesian,
+ cartesian_to_cylindrical, cylindrical_to_cartesian)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -28,12 +23,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestCartesianToSpherical',
- 'TestSphericalToCartesian',
- 'TestCartesianToPolar',
- 'TestPolarToCartesian',
- 'TestCartesianToCylindrical',
- 'TestCylindricalToCartesian']
+__all__ = [
+ 'TestCartesianToSpherical', 'TestSphericalToCartesian',
+ 'TestCartesianToPolar', 'TestPolarToCartesian',
+ 'TestCartesianToCylindrical', 'TestCylindricalToCartesian'
+]
class TestCartesianToSpherical(unittest.TestCase):
@@ -72,23 +66,17 @@ def test_n_dimensional_cartesian_to_spherical(self):
a_i = np.array([3, 1, 6])
a_o = np.array([6.78232998, 1.08574654, 0.32175055])
np.testing.assert_almost_equal(
- cartesian_to_spherical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_spherical(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
np.testing.assert_almost_equal(
- cartesian_to_spherical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_spherical(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 3))
a_o = np.reshape(a_o, (2, 3, 3))
np.testing.assert_almost_equal(
- cartesian_to_spherical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_spherical(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_cartesian_to_spherical(self):
@@ -143,23 +131,17 @@ def test_n_dimensional_spherical_to_cartesian(self):
a_i = np.array([6.78232998, 1.08574654, 0.32175055])
a_o = np.array([3, 1, 6])
np.testing.assert_almost_equal(
- spherical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ spherical_to_cartesian(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
np.testing.assert_almost_equal(
- spherical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ spherical_to_cartesian(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 3))
a_o = np.reshape(a_o, (2, 3, 3))
np.testing.assert_almost_equal(
- spherical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ spherical_to_cartesian(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_spherical_to_cartesian(self):
@@ -210,24 +192,15 @@ def test_n_dimensional_cartesian_to_polar(self):
a_i = np.array([3, 1])
a_o = np.array([3.16227766, 0.32175055])
- np.testing.assert_almost_equal(
- cartesian_to_polar(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(cartesian_to_polar(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
- np.testing.assert_almost_equal(
- cartesian_to_polar(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(cartesian_to_polar(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 2))
a_o = np.reshape(a_o, (2, 3, 2))
- np.testing.assert_almost_equal(
- cartesian_to_polar(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(cartesian_to_polar(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_cartesian_to_polar(self):
@@ -256,20 +229,17 @@ def test_polar_to_cartesian(self):
"""
np.testing.assert_almost_equal(
- polar_to_cartesian(
- np.array([0.32175055, 1.08574654])),
+ polar_to_cartesian(np.array([0.32175055, 1.08574654])),
np.array([0.15001697, 0.28463718]),
decimal=7)
np.testing.assert_almost_equal(
- polar_to_cartesian(
- np.array([1.68145355, 1.05578119])),
+ polar_to_cartesian(np.array([1.68145355, 1.05578119])),
np.array([0.82819662, 1.46334425]),
decimal=7)
np.testing.assert_almost_equal(
- polar_to_cartesian(
- np.array([-0.14626640, 1.23829030])),
+ polar_to_cartesian(np.array([-0.14626640, 1.23829030])),
np.array([-0.04774323, -0.13825500]),
decimal=7)
@@ -281,24 +251,15 @@ def test_n_dimensional_polar_to_cartesian(self):
a_i = np.array([3.16227766, 0.32175055])
a_o = np.array([3, 1])
- np.testing.assert_almost_equal(
- polar_to_cartesian(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(polar_to_cartesian(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
- np.testing.assert_almost_equal(
- polar_to_cartesian(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(polar_to_cartesian(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 2))
a_o = np.reshape(a_o, (2, 3, 2))
- np.testing.assert_almost_equal(
- polar_to_cartesian(a_i),
- a_o,
- decimal=7)
+ np.testing.assert_almost_equal(polar_to_cartesian(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_polar_to_cartesian(self):
@@ -350,23 +311,17 @@ def test_n_dimensional_cartesian_to_cylindrical(self):
a_i = np.array([3, 1, 6])
a_o = np.array([3.16227766, 0.32175055, 6.00000000])
np.testing.assert_almost_equal(
- cartesian_to_cylindrical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_cylindrical(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
np.testing.assert_almost_equal(
- cartesian_to_cylindrical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_cylindrical(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 3))
a_o = np.reshape(a_o, (2, 3, 3))
np.testing.assert_almost_equal(
- cartesian_to_cylindrical(a_i),
- a_o,
- decimal=7)
+ cartesian_to_cylindrical(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_cartesian_to_cylindrical(self):
@@ -421,23 +376,17 @@ def test_n_dimensional_cylindrical_to_cartesian(self):
a_i = np.array([3.16227766, 0.32175055, 6.00000000])
a_o = np.array([3, 1, 6])
np.testing.assert_almost_equal(
- cylindrical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ cylindrical_to_cartesian(a_i), a_o, decimal=7)
a_i = np.tile(a_i, (6, 1))
a_o = np.tile(a_o, (6, 1))
np.testing.assert_almost_equal(
- cylindrical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ cylindrical_to_cartesian(a_i), a_o, decimal=7)
a_i = np.reshape(a_i, (2, 3, 3))
a_o = np.reshape(a_o, (2, 3, 3))
np.testing.assert_almost_equal(
- cylindrical_to_cartesian(a_i),
- a_o,
- decimal=7)
+ cylindrical_to_cartesian(a_i), a_o, decimal=7)
@ignore_numpy_errors
def test_nan_cylindrical_to_cartesian(self):
diff --git a/colour/algebra/tests/tests_extrapolation.py b/colour/algebra/tests/tests_extrapolation.py
index 41975faefe..2dffba56ea 100644
--- a/colour/algebra/tests/tests_extrapolation.py
+++ b/colour/algebra/tests/tests_extrapolation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.extrapolation` module.
"""
@@ -11,11 +10,8 @@
import unittest
from itertools import permutations
-from colour.algebra import (
- Extrapolator,
- LinearInterpolator,
- CubicSplineInterpolator,
- PchipInterpolator)
+from colour.algebra import (Extrapolator, LinearInterpolator,
+ CubicSplineInterpolator, PchipInterpolator)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -39,7 +35,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('interpolator',)
+ required_attributes = ('interpolator', )
for attribute in required_attributes:
self.assertIn(attribute, dir(Extrapolator))
@@ -61,55 +57,44 @@ def test___call__(self):
"""
extrapolator = Extrapolator(
- LinearInterpolator(
- np.array([5, 6, 7]),
- np.array([5, 6, 7])))
+ LinearInterpolator(np.array([5, 6, 7]), np.array([5, 6, 7])))
np.testing.assert_almost_equal(extrapolator((4, 8)), (4, 8))
self.assertEqual(extrapolator(4), 4)
extrapolator = Extrapolator(
- LinearInterpolator(
- np.array([3, 4, 5]),
- np.array([1, 2, 3])),
+ LinearInterpolator(np.array([3, 4, 5]), np.array([1, 2, 3])),
method='Constant')
- np.testing.assert_almost_equal(extrapolator((0.1, 0.2, 8, 9)),
- (1, 1, 3, 3))
+ np.testing.assert_almost_equal(
+ extrapolator((0.1, 0.2, 8, 9)), (1, 1, 3, 3))
self.assertEqual(extrapolator(0.1), 1.)
extrapolator = Extrapolator(
- LinearInterpolator(
- np.array([3, 4, 5]),
- np.array([1, 2, 3])),
+ LinearInterpolator(np.array([3, 4, 5]), np.array([1, 2, 3])),
method='Constant',
left=0)
- np.testing.assert_almost_equal(extrapolator((0.1, 0.2, 8, 9)),
- (0, 0, 3, 3))
+ np.testing.assert_almost_equal(
+ extrapolator((0.1, 0.2, 8, 9)), (0, 0, 3, 3))
self.assertEqual(extrapolator(0.1), 0)
extrapolator = Extrapolator(
- LinearInterpolator(
- np.array([3, 4, 5]),
- np.array([1, 2, 3])),
+ LinearInterpolator(np.array([3, 4, 5]), np.array([1, 2, 3])),
method='Constant',
right=0)
- np.testing.assert_almost_equal(extrapolator((0.1, 0.2, 8, 9)),
- (1, 1, 0, 0))
+ np.testing.assert_almost_equal(
+ extrapolator((0.1, 0.2, 8, 9)), (1, 1, 0, 0))
self.assertEqual(extrapolator(9), 0)
extrapolator = Extrapolator(
CubicSplineInterpolator(
- np.array([3, 4, 5, 6]),
- np.array([1, 2, 3, 4])))
- np.testing.assert_almost_equal(extrapolator((0.1, 0.2, 8.0, 9.0)),
- (-1.9, -1.8, 6.0, 7.0))
+ np.array([3, 4, 5, 6]), np.array([1, 2, 3, 4])))
+ np.testing.assert_almost_equal(
+ extrapolator((0.1, 0.2, 8.0, 9.0)), (-1.9, -1.8, 6.0, 7.0))
self.assertEqual(extrapolator(9), 7)
extrapolator = Extrapolator(
- PchipInterpolator(
- np.array([3, 4, 5]),
- np.array([1, 2, 3])))
- np.testing.assert_almost_equal(extrapolator((0.1, 0.2, 8.0, 9.0)),
- (-1.9, -1.8, 6.0, 7.0))
+ PchipInterpolator(np.array([3, 4, 5]), np.array([1, 2, 3])))
+ np.testing.assert_almost_equal(
+ extrapolator((0.1, 0.2, 8.0, 9.0)), (-1.9, -1.8, 6.0, 7.0))
self.assertEqual(extrapolator(9), 7.)
@ignore_numpy_errors
diff --git a/colour/algebra/tests/tests_geometry.py b/colour/algebra/tests/tests_geometry.py
index ec7c4196b1..0b114741f6 100644
--- a/colour/algebra/tests/tests_geometry.py
+++ b/colour/algebra/tests/tests_geometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.geometry` module.
"""
@@ -11,11 +10,8 @@
import unittest
from itertools import permutations
-from colour.algebra import (
- normalise_vector,
- euclidean_distance,
- extend_line_segment,
- intersect_line_segments)
+from colour.algebra import (normalise_vector, euclidean_distance,
+ extend_line_segment, intersect_line_segments)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -25,10 +21,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestNormaliseVector',
- 'TestEuclideanDistance',
- 'TestExtendLineSegment',
- 'TestIntersectLineSegments']
+__all__ = [
+ 'TestNormaliseVector', 'TestEuclideanDistance', 'TestExtendLineSegment',
+ 'TestIntersectLineSegments'
+]
class TestNormaliseVector(unittest.TestCase):
@@ -100,25 +96,19 @@ def test_n_dimensional_euclidean_distance(self):
b = np.array([100.00000000, 426.67945353, 72.39590835])
distance = 451.71330197
np.testing.assert_almost_equal(
- euclidean_distance(a, b),
- distance,
- decimal=7)
+ euclidean_distance(a, b), distance, decimal=7)
a = np.tile(a, (6, 1))
b = np.tile(b, (6, 1))
distance = np.tile(distance, 6)
np.testing.assert_almost_equal(
- euclidean_distance(a, b),
- distance,
- decimal=7)
+ euclidean_distance(a, b), distance, decimal=7)
a = np.reshape(a, (2, 3, 3))
b = np.reshape(b, (2, 3, 3))
distance = np.reshape(distance, (2, 3))
np.testing.assert_almost_equal(
- euclidean_distance(a, b),
- distance,
- decimal=7)
+ euclidean_distance(a, b), distance, decimal=7)
@ignore_numpy_errors
def test_nan_euclidean_distance(self):
@@ -156,16 +146,14 @@ def test_extend_line_segment(self):
np.testing.assert_almost_equal(
extend_line_segment(
np.array([0.95694934, 0.13720932]),
- np.array([0.28382835, 0.60608318]),
- 5),
+ np.array([0.28382835, 0.60608318]), 5),
np.array([-3.81893739, 3.46393435]),
decimal=7)
np.testing.assert_almost_equal(
extend_line_segment(
np.array([0.95694934, 0.13720932]),
- np.array([0.28382835, 0.60608318]),
- -1),
+ np.array([0.28382835, 0.60608318]), -1),
np.array([1.1043815, 0.03451295]),
decimal=7)
@@ -182,48 +170,47 @@ def test_intersect_line_segments(self):
definition.
"""
- l_1 = np.array([[[0.15416284, 0.7400497],
- [0.26331502, 0.53373939]],
- [[0.01457496, 0.91874701],
- [0.90071485, 0.03342143]]])
- l_2 = np.array([[[0.95694934, 0.13720932],
- [0.28382835, 0.60608318]],
- [[0.94422514, 0.85273554],
- [0.00225923, 0.52122603]],
- [[0.55203763, 0.48537741],
- [0.76813415, 0.16071675]],
- [[0.01457496, 0.91874701],
- [0.90071485, 0.03342143]]])
+ l_1 = np.array([
+ [[0.15416284, 0.7400497],
+ [0.26331502, 0.53373939]],
+ [[0.01457496, 0.91874701],
+ [0.90071485, 0.03342143]]]) # yapf: disable
+ l_2 = np.array([
+ [[0.95694934, 0.13720932],
+ [0.28382835, 0.60608318]],
+ [[0.94422514, 0.85273554],
+ [0.00225923, 0.52122603]],
+ [[0.55203763, 0.48537741],
+ [0.76813415, 0.16071675]],
+ [[0.01457496, 0.91874701],
+ [0.90071485, 0.03342143]]]) # yapf: disable
s = intersect_line_segments(l_1, l_2)
np.testing.assert_almost_equal(
s.xy,
- np.array([[[np.nan, np.nan],
- [0.22791841, 0.60064309],
- [np.nan, np.nan],
- [np.nan, np.nan]],
-
- [[0.42814517, 0.50555685],
- [0.30560559, 0.62798382],
- [0.7578749, 0.17613012],
- [np.nan, np.nan]]]),
- decimal=7)
-
- np.testing.assert_array_equal(
- s.intersect,
- np.array([[False, True, False, False],
- [True, True, True, False]], dtype=bool))
-
- np.testing.assert_array_equal(
- s.parallel,
- np.array([[False, False, False, False],
- [False, False, False, True]], dtype=bool))
-
- np.testing.assert_array_equal(
- s.coincident,
- np.array([[False, False, False, False],
- [False, False, False, True]], dtype=bool))
+ np.array(
+ [[[np.nan, np.nan],
+ [0.22791841, 0.60064309],
+ [np.nan, np.nan],
+ [np.nan, np.nan]],
+ [[0.42814517, 0.50555685],
+ [0.30560559, 0.62798382],
+ [0.7578749, 0.17613012],
+ [np.nan, np.nan]]]),
+ decimal=7) # yapf: disable
+
+ np.testing.assert_array_equal(s.intersect,
+ np.array([[False, True, False, False],
+ [True, True, True, False]]))
+
+ np.testing.assert_array_equal(s.parallel,
+ np.array([[False, False, False, False],
+ [False, False, False, True]]))
+
+ np.testing.assert_array_equal(s.coincident,
+ np.array([[False, False, False, False],
+ [False, False, False, True]]))
if __name__ == '__main__':
diff --git a/colour/algebra/tests/tests_interpolation.py b/colour/algebra/tests/tests_interpolation.py
index c52ed247c5..210789121b 100644
--- a/colour/algebra/tests/tests_interpolation.py
+++ b/colour/algebra/tests/tests_interpolation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.interpolation` module.
"""
@@ -11,11 +10,8 @@
import unittest
from itertools import permutations
-from colour.algebra import (
- LinearInterpolator,
- SpragueInterpolator,
- PchipInterpolator,
- lagrange_coefficients)
+from colour.algebra import (LinearInterpolator, SpragueInterpolator,
+ PchipInterpolator, lagrange_coefficients)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -25,15 +21,13 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['POINTS_DATA_A',
- 'LINEAR_INTERPOLATED_POINTS_DATA_A_10_SAMPLES',
- 'SPRAGUE_INTERPOLATED_POINTS_DATA_A_10_SAMPLES',
- 'LAGRANGE_COEFFICIENTS_A',
- 'LAGRANGE_COEFFICIENTS_B',
- 'TestLinearInterpolator',
- 'TestSpragueInterpolator',
- 'TestPchipInterpolator',
- 'TestLagrangeCoefficients']
+__all__ = [
+ 'POINTS_DATA_A', 'LINEAR_INTERPOLATED_POINTS_DATA_A_10_SAMPLES',
+ 'SPRAGUE_INTERPOLATED_POINTS_DATA_A_10_SAMPLES', 'LAGRANGE_COEFFICIENTS_A',
+ 'LAGRANGE_COEFFICIENTS_B', 'TestLinearInterpolator',
+ 'TestSpragueInterpolator', 'TestPchipInterpolator',
+ 'TestLagrangeCoefficients'
+]
POINTS_DATA_A = (
9.3700,
@@ -51,7 +45,7 @@
69.5900,
81.7300,
88.1900,
- 86.0500)
+ 86.0500) # yapf: disable
LINEAR_INTERPOLATED_POINTS_DATA_A_10_SAMPLES = (
9.370,
@@ -204,7 +198,7 @@
86.692,
86.478,
86.264,
- 86.050)
+ 86.050) # yapf: disable
SPRAGUE_INTERPOLATED_POINTS_DATA_A_10_SAMPLES = (
9.37000000,
@@ -357,7 +351,7 @@
87.22734720,
86.85002373,
86.45733945,
- 86.05000000)
+ 86.05000000) # yapf: disable
LAGRANGE_COEFFICIENTS_A = np.array(
[[0.92625, 0.09750, -0.02375],
@@ -378,7 +372,7 @@
[0.12000, 0.96000, -0.08000],
[0.08625, 0.97750, -0.06375],
[0.05500, 0.99000, -0.04500],
- [0.02625, 0.99750, -0.02375]])
+ [0.02625, 0.99750, -0.02375]]) # yapf: disable
LAGRANGE_COEFFICIENTS_B = np.array(
[[-0.0154375, 0.9725625, 0.0511875, -0.0083125],
@@ -399,7 +393,7 @@
[-0.0320000, 0.2160000, 0.8640000, -0.0480000],
[-0.0244375, 0.1595625, 0.9041875, -0.0393125],
[-0.0165000, 0.1045000, 0.9405000, -0.0285000],
- [-0.0083125, 0.0511875, 0.9725625, -0.0154375]])
+ [-0.0083125, 0.0511875, 0.9725625, -0.0154375]]) # yapf: disable
class TestLinearInterpolator(unittest.TestCase):
@@ -413,8 +407,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('x',
- 'y')
+ required_attributes = ('x', 'y')
for attribute in required_attributes:
self.assertIn(attribute, dir(LinearInterpolator))
@@ -483,8 +476,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('x',
- 'y')
+ required_attributes = ('x', 'y')
for attribute in required_attributes:
self.assertIn(attribute, dir(SpragueInterpolator))
@@ -553,8 +545,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('x',
- 'y')
+ required_attributes = ('x', 'y')
for attribute in required_attributes:
self.assertIn(attribute, dir(PchipInterpolator))
@@ -593,12 +584,10 @@ def test_lagrange_coefficients(self):
199–203. doi:10.1002/col.5080100407
"""
- lc = [lagrange_coefficients(i, 3)
- for i in np.linspace(0.05, 0.95, 19)]
+ lc = [lagrange_coefficients(i, 3) for i in np.linspace(0.05, 0.95, 19)]
np.testing.assert_almost_equal(lc, LAGRANGE_COEFFICIENTS_A, decimal=7)
- lc = [lagrange_coefficients(i, 4)
- for i in np.linspace(1.05, 1.95, 19)]
+ lc = [lagrange_coefficients(i, 4) for i in np.linspace(1.05, 1.95, 19)]
np.testing.assert_almost_equal(lc, LAGRANGE_COEFFICIENTS_B, decimal=7)
diff --git a/colour/algebra/tests/tests_matrix.py b/colour/algebra/tests/tests_matrix.py
index 83c464f9fb..98df6ad867 100644
--- a/colour/algebra/tests/tests_matrix.py
+++ b/colour/algebra/tests/tests_matrix.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.matrix` module.
"""
diff --git a/colour/algebra/tests/tests_random.py b/colour/algebra/tests/tests_random.py
index d9b6225d66..fbafbfca29 100644
--- a/colour/algebra/tests/tests_random.py
+++ b/colour/algebra/tests/tests_random.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.algebra.random` module.
"""
@@ -19,20 +18,19 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RANDOM_TRIPLETS',
- 'TestRandomTripletGenerator']
+__all__ = ['RANDOM_TRIPLETS', 'TestRandomTripletGenerator']
-RANDOM_TRIPLETS = np.array([
- [0.96702984, 0.54723225, 0.97268436],
- [0.71481599, 0.69772882, 0.21608950],
- [0.97627445, 0.00623026, 0.25298236],
- [0.43479153, 0.77938292, 0.19768507],
- [0.86299324, 0.98340068, 0.16384224],
- [0.59733394, 0.00898610, 0.38657128],
- [0.04416006, 0.95665297, 0.43614665],
- [0.94897731, 0.78630599, 0.86628930],
- [0.17316542, 0.07494859, 0.60074272],
- [0.16797218, 0.73338017, 0.40844386]])
+RANDOM_TRIPLETS = np.array(
+ [[0.96702984, 0.54723225, 0.97268436],
+ [0.71481599, 0.69772882, 0.21608950],
+ [0.97627445, 0.00623026, 0.25298236],
+ [0.43479153, 0.77938292, 0.19768507],
+ [0.86299324, 0.98340068, 0.16384224],
+ [0.59733394, 0.00898610, 0.38657128],
+ [0.04416006, 0.95665297, 0.43614665],
+ [0.94897731, 0.78630599, 0.86628930],
+ [0.17316542, 0.07494859, 0.60074272],
+ [0.16797218, 0.73338017, 0.40844386]]) # yapf: disable
class TestRandomTripletGenerator(unittest.TestCase):
diff --git a/colour/appearance/__init__.py b/colour/appearance/__init__.py
index 8dd0925af3..93d57ef865 100644
--- a/colour/appearance/__init__.py
+++ b/colour/appearance/__init__.py
@@ -3,43 +3,31 @@
from __future__ import absolute_import
-from .hunt import (
- Hunt_InductionFactors,
- HUNT_VIEWING_CONDITIONS,
- Hunt_Specification,
- XYZ_to_Hunt)
+from .hunt import (Hunt_InductionFactors, HUNT_VIEWING_CONDITIONS,
+ Hunt_Specification, XYZ_to_Hunt)
from .atd95 import ATD95_Specification, XYZ_to_ATD95
-from .ciecam02 import (
- CIECAM02_InductionFactors,
- CIECAM02_VIEWING_CONDITIONS,
- CIECAM02_Specification,
- XYZ_to_CIECAM02,
- CIECAM02_to_XYZ)
+from .ciecam02 import (CIECAM02_InductionFactors, CIECAM02_VIEWING_CONDITIONS,
+ CIECAM02_Specification, XYZ_to_CIECAM02,
+ CIECAM02_to_XYZ)
from .llab import ( # noqa
- LLAB_InductionFactors,
- LLAB_VIEWING_CONDITIONS,
- LLAB_Specification,
+ LLAB_InductionFactors, LLAB_VIEWING_CONDITIONS, LLAB_Specification,
XYZ_to_LLAB)
from .nayatani95 import Nayatani95_Specification, XYZ_to_Nayatani95
-from .rlab import (
- RLAB_VIEWING_CONDITIONS,
- RLAB_D_FACTOR,
- RLAB_Specification,
- XYZ_to_RLAB)
+from .rlab import (RLAB_VIEWING_CONDITIONS, RLAB_D_FACTOR, RLAB_Specification,
+ XYZ_to_RLAB)
-__all__ = ['Hunt_InductionFactors',
- 'HUNT_VIEWING_CONDITIONS',
- 'Hunt_Specification',
- 'XYZ_to_Hunt']
+__all__ = [
+ 'Hunt_InductionFactors', 'HUNT_VIEWING_CONDITIONS', 'Hunt_Specification',
+ 'XYZ_to_Hunt'
+]
__all__ += ['ATD95_Specification', 'XYZ_to_ATD95']
-__all__ += ['CIECAM02_InductionFactors',
- 'CIECAM02_VIEWING_CONDITIONS',
- 'CIECAM02_Specification',
- 'XYZ_to_CIECAM02',
- 'CIECAM02_to_XYZ']
+__all__ += [
+ 'CIECAM02_InductionFactors', 'CIECAM02_VIEWING_CONDITIONS',
+ 'CIECAM02_Specification', 'XYZ_to_CIECAM02', 'CIECAM02_to_XYZ'
+]
__all__ += ['LLAB_VIEWING_CONDITIONS', 'LLAB_Specification', 'XYZ_to_LLAB']
__all__ += ['Nayatani95_Specification', 'XYZ_to_Nayatani95']
-__all__ += ['RLAB_VIEWING_CONDITIONS',
- 'RLAB_D_FACTOR',
- 'RLAB_Specification',
- 'XYZ_to_RLAB']
+__all__ += [
+ 'RLAB_VIEWING_CONDITIONS', 'RLAB_D_FACTOR', 'RLAB_Specification',
+ 'XYZ_to_RLAB'
+]
diff --git a/colour/appearance/atd95.py b/colour/appearance/atd95.py
index ff7e072374..03013288f1 100644
--- a/colour/appearance/atd95.py
+++ b/colour/appearance/atd95.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ATD (1995) Colour Vision Model
==============================
@@ -46,18 +45,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ATD95_ReferenceSpecification',
- 'ATD95_Specification',
- 'XYZ_to_ATD95',
- 'luminance_to_retinal_illuminance',
- 'XYZ_to_LMS_ATD95',
- 'opponent_colour_dimensions',
- 'final_response']
+__all__ = [
+ 'ATD95_ReferenceSpecification', 'ATD95_Specification', 'XYZ_to_ATD95',
+ 'luminance_to_retinal_illuminance', 'XYZ_to_LMS_ATD95',
+ 'opponent_colour_dimensions', 'final_response'
+]
class ATD95_ReferenceSpecification(
- namedtuple('ATD95_ReferenceSpecification',
- ('H', 'C', 'Br', 'A_1', 'T_1', 'D_1', 'A_2', 'T_2', 'D_2'))):
+ namedtuple('ATD95_ReferenceSpecification',
+ ('H', 'C', 'Br', 'A_1', 'T_1', 'D_1', 'A_2', 'T_2',
+ 'D_2'))):
"""
Defines the *ATD (1995)* colour vision model reference specification.
@@ -92,8 +90,8 @@ class ATD95_ReferenceSpecification(
class ATD95_Specification(
- namedtuple('ATD95_Specification',
- ('h', 'C', 'Q', 'A_1', 'T_1', 'D_1', 'A_2', 'T_2', 'D_2'))):
+ namedtuple('ATD95_Specification', ('h', 'C', 'Q', 'A_1', 'T_1', 'D_1',
+ 'A_2', 'T_2', 'D_2'))):
"""
Defines the *ATD (1995)* colour vision model specification.
@@ -199,22 +197,15 @@ def XYZ_to_ATD95(XYZ, XYZ_0, Y_0, k_1, k_2, sigma=300):
LMS_g = LMS * (sigma[..., np.newaxis] / (sigma[..., np.newaxis] + LMS_a))
# Computing opponent colour dimensions.
- A_1, T_1, D_1, A_2, T_2, D_2 = tsplit(
- opponent_colour_dimensions(LMS_g))
+ A_1, T_1, D_1, A_2, T_2, D_2 = tsplit(opponent_colour_dimensions(LMS_g))
- # -------------------------------------------------------------------------
# Computing the correlate of *brightness* :math:`Br`.
- # -------------------------------------------------------------------------
Br = (A_1 ** 2 + T_1 ** 2 + D_1 ** 2) ** 0.5
- # -------------------------------------------------------------------------
# Computing the correlate of *saturation* :math:`C`.
- # -------------------------------------------------------------------------
C = (T_2 ** 2 + D_2 ** 2) ** 0.5 / A_2
- # -------------------------------------------------------------------------
# Computing the *hue* :math:`H`.
- # -------------------------------------------------------------------------
H = T_2 / D_2
return ATD95_Specification(H, C, Br, A_1, T_1, D_1, A_2, T_2, D_2)
diff --git a/colour/appearance/ciecam02.py b/colour/appearance/ciecam02.py
index 7db42b8445..7fe26dd598 100644
--- a/colour/appearance/ciecam02.py
+++ b/colour/appearance/ciecam02.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIECAM02 Colour Appearance Model
================================
@@ -33,6 +32,9 @@
Imaging Conference, 2002(1), 23–27. Retrieved from
http://www.ingentaconnect.com/content/ist/cic\
/2002/00002002/00000001/art00006
+.. [5] Luo, M. R., & Li, C. (2013). CIECAM02 and Its Recent Developments.
+ In Advanced Color Image Processing and Analysis (pp. 19–58).
+ doi:10.1007/978-1-4419-6190-7
"""
from __future__ import division, unicode_literals
@@ -41,17 +43,12 @@
from collections import namedtuple
from colour.adaptation import CAT02_CAT
-from colour.appearance.hunt import (
- HPE_TO_XYZ_MATRIX,
- XYZ_TO_HPE_MATRIX,
- luminance_level_adaptation_factor)
-from colour.utilities import (
- CaseInsensitiveMapping,
- as_numeric,
- dot_matrix,
- dot_vector,
- tsplit,
- tstack)
+from colour.appearance.hunt import (HPE_TO_XYZ_MATRIX, XYZ_TO_HPE_MATRIX,
+ luminance_level_adaptation_factor)
+from colour.constants import EPSILON
+from colour.utilities import (CaseInsensitiveMapping, as_namedtuple,
+ as_numeric, dot_matrix, dot_vector, tsplit,
+ tstack)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -60,39 +57,25 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CAT02_INVERSE_CAT',
- 'CIECAM02_InductionFactors',
- 'CIECAM02_VIEWING_CONDITIONS',
- 'HUE_DATA_FOR_HUE_QUADRATURE',
- 'CIECAM02_Specification',
- 'XYZ_to_CIECAM02',
- 'CIECAM02_to_XYZ',
- 'chromatic_induction_factors',
- 'base_exponential_non_linearity',
- 'viewing_condition_dependent_parameters',
- 'degree_of_adaptation',
- 'full_chromatic_adaptation_forward',
- 'full_chromatic_adaptation_reverse',
- 'RGB_to_rgb',
- 'rgb_to_RGB',
- 'post_adaptation_non_linear_response_compression_forward',
- 'post_adaptation_non_linear_response_compression_reverse',
- 'opponent_colour_dimensions_forward',
- 'opponent_colour_dimensions_reverse',
- 'hue_angle',
- 'hue_quadrature',
- 'eccentricity_factor',
- 'achromatic_response_forward',
- 'achromatic_response_reverse',
- 'lightness_correlate',
- 'brightness_correlate',
- 'temporary_magnitude_quantity_forward',
- 'temporary_magnitude_quantity_reverse',
- 'chroma_correlate',
- 'colourfulness_correlate',
- 'saturation_correlate',
- 'P',
- 'post_adaptation_non_linear_response_compression_matrix']
+__all__ = [
+ 'CAT02_INVERSE_CAT', 'CIECAM02_InductionFactors',
+ 'CIECAM02_VIEWING_CONDITIONS', 'HUE_DATA_FOR_HUE_QUADRATURE',
+ 'CIECAM02_Specification', 'XYZ_to_CIECAM02', 'CIECAM02_to_XYZ',
+ 'chromatic_induction_factors', 'base_exponential_non_linearity',
+ 'viewing_condition_dependent_parameters', 'degree_of_adaptation',
+ 'full_chromatic_adaptation_forward', 'full_chromatic_adaptation_reverse',
+ 'RGB_to_rgb', 'rgb_to_RGB',
+ 'post_adaptation_non_linear_response_compression_forward',
+ 'post_adaptation_non_linear_response_compression_reverse',
+ 'opponent_colour_dimensions_forward', 'opponent_colour_dimensions_reverse',
+ 'hue_angle', 'hue_quadrature', 'eccentricity_factor',
+ 'achromatic_response_forward', 'achromatic_response_reverse',
+ 'lightness_correlate', 'brightness_correlate',
+ 'temporary_magnitude_quantity_forward',
+ 'temporary_magnitude_quantity_reverse', 'chroma_correlate',
+ 'colourfulness_correlate', 'saturation_correlate', 'P',
+ 'post_adaptation_non_linear_response_compression_matrix'
+]
CAT02_INVERSE_CAT = np.linalg.inv(CAT02_CAT)
"""
@@ -103,8 +86,7 @@
class CIECAM02_InductionFactors(
- namedtuple('CIECAM02_InductionFactors',
- ('F', 'c', 'N_c'))):
+ namedtuple('CIECAM02_InductionFactors', ('F', 'c', 'N_c'))):
"""
*CIECAM02* colour appearance model induction factors.
@@ -119,10 +101,11 @@ class CIECAM02_InductionFactors(
"""
-CIECAM02_VIEWING_CONDITIONS = CaseInsensitiveMapping(
- {'Average': CIECAM02_InductionFactors(1, 0.69, 1),
- 'Dim': CIECAM02_InductionFactors(0.9, 0.59, 0.95),
- 'Dark': CIECAM02_InductionFactors(0.8, 0.525, 0.8)})
+CIECAM02_VIEWING_CONDITIONS = CaseInsensitiveMapping({
+ 'Average': CIECAM02_InductionFactors(1, 0.69, 1),
+ 'Dim': CIECAM02_InductionFactors(0.9, 0.59, 0.95),
+ 'Dark': CIECAM02_InductionFactors(0.8, 0.525, 0.8)
+})
"""
Reference *CIECAM02* colour appearance model viewing conditions.
@@ -133,12 +116,13 @@ class CIECAM02_InductionFactors(
HUE_DATA_FOR_HUE_QUADRATURE = {
'h_i': np.array([20.14, 90.00, 164.25, 237.53, 380.14]),
'e_i': np.array([0.8, 0.7, 1.0, 1.2, 0.8]),
- 'H_i': np.array([0.0, 100.0, 200.0, 300.0, 400.0])}
+ 'H_i': np.array([0.0, 100.0, 200.0, 300.0, 400.0])
+}
class CIECAM02_Specification(
- namedtuple('CIECAM02_Specification',
- ('J', 'C', 'h', 's', 'Q', 'M', 'H', 'HC'))):
+ namedtuple('CIECAM02_Specification', ('J', 'C', 'h', 's', 'Q', 'M',
+ 'H', 'HC'))):
"""
Defines the *CIECAM02* colour appearance model specification.
@@ -162,6 +146,22 @@ class CIECAM02_Specification(
*Hue* :math:`h` composition :math:`H^C`.
"""
+ def __new__(cls,
+ J=None,
+ C=None,
+ h=None,
+ s=None,
+ Q=None,
+ M=None,
+ H=None,
+ HC=None):
+ """
+ Returns a new instance of the :class:`CIECAM02_Specification` class.
+ """
+
+ return super(CIECAM02_Specification, cls).__new__(
+ cls, J, C, h, s, Q, M, H, HC)
+
def XYZ_to_CIECAM02(XYZ,
XYZ_w,
@@ -222,8 +222,8 @@ def XYZ_to_CIECAM02(XYZ,
L_A = np.asarray(L_A)
Y_b = np.asarray(Y_b)
- n, F_L, N_bb, N_cb, z = tsplit(viewing_condition_dependent_parameters(
- Y_b, Y_w, L_A))
+ n, F_L, N_bb, N_cb, z = tsplit(
+ viewing_condition_dependent_parameters(Y_b, Y_w, L_A))
# Converting *CIE XYZ* tristimulus values to *CMCCAT2000* transform
# sharpened *RGB* values.
@@ -234,18 +234,15 @@ def XYZ_to_CIECAM02(XYZ,
D = degree_of_adaptation(surround.F, L_A) if not discount_illuminant else 1
# Computing full chromatic adaptation.
- RGB_c = full_chromatic_adaptation_forward(
- RGB, RGB_w, Y_w, D)
- RGB_wc = full_chromatic_adaptation_forward(
- RGB_w, RGB_w, Y_w, D)
+ RGB_c = full_chromatic_adaptation_forward(RGB, RGB_w, Y_w, D)
+ RGB_wc = full_chromatic_adaptation_forward(RGB_w, RGB_w, Y_w, D)
# Converting to *Hunt-Pointer-Estevez* colourspace.
RGB_p = RGB_to_rgb(RGB_c)
RGB_pw = RGB_to_rgb(RGB_wc)
# Applying forward post-adaptation non linear response compression.
- RGB_a = post_adaptation_non_linear_response_compression_forward(
- RGB_p, F_L)
+ RGB_a = post_adaptation_non_linear_response_compression_forward(RGB_p, F_L)
RGB_aw = post_adaptation_non_linear_response_compression_forward(
RGB_pw, F_L)
@@ -284,9 +281,7 @@ def XYZ_to_CIECAM02(XYZ,
return CIECAM02_Specification(J, C, h, s, Q, M, H, None)
-def CIECAM02_to_XYZ(J,
- C,
- h,
+def CIECAM02_to_XYZ(CIECAM02_specification,
XYZ_w,
L_A,
Y_b,
@@ -299,12 +294,11 @@ def CIECAM02_to_XYZ(J,
Parameters
----------
- J : numeric or array_like
- Correlate of *Lightness* :math:`J`.
- C : numeric or array_like
- Correlate of *chroma* :math:`C`.
- h : numeric or array_like
- *Hue* angle :math:`h` in degrees.
+ CIECAM02_specification : CIECAM02_Specification
+ *CIECAM02* colour appearance model specification. Correlate of
+ *Lightness* :math:`J`, correlate of *chroma* :math:`C` or correlate of
+ *colourfulness* :math:`M` and *hue* angle :math:`h` in degrees must be
+ specified, e.g. :math:`JCh` or :math:`JMh`.
XYZ_w : array_like
*CIE XYZ* tristimulus values of reference white.
L_A : numeric or array_like
@@ -322,31 +316,49 @@ def CIECAM02_to_XYZ(J,
XYZ : ndarray
*CIE XYZ* tristimulus values.
+ Raises
+ ------
+ ValueError
+ If neither *C* or *M* correlates have been defined in the
+ `CIECAM02_specification` argument.
+
Warning
-------
The output range of that definition is non standard!
Notes
-----
+ - `CIECAM02_specification` can also be passed as a compatible argument
+ :func:`colour.as_namedtuple` definition.
- Input *CIE XYZ_w* tristimulus values are in domain [0, 100].
- Output *CIE XYZ* tristimulus values are in range [0, 100].
Examples
--------
- >>> J = 41.731091132513917
- >>> C = 0.104707757171105
- >>> h = 219.04843265827190
+ >>> specification = CIECAM02_Specification(
+ ... J=41.731091132513917,
+ ... C=0.104707757171031,
+ ... h=219.048432658311780)
>>> XYZ_w = np.array([95.05, 100.00, 108.88])
>>> L_A = 318.31
>>> Y_b = 20.0
- >>> CIECAM02_to_XYZ(J, C, h, XYZ_w, L_A, Y_b) # doctest: +ELLIPSIS
+ >>> CIECAM02_to_XYZ(specification, XYZ_w, L_A, Y_b) # doctest: +ELLIPSIS
array([ 19.01..., 20... , 21.78...])
"""
+ J, C, h, s, Q, M, H, HC = as_namedtuple(CIECAM02_specification,
+ CIECAM02_Specification)
+
_X_w, Y_w, _Zw = tsplit(XYZ_w)
- n, F_L, N_bb, N_cb, z = tsplit(viewing_condition_dependent_parameters(
- Y_b, Y_w, L_A))
+ n, F_L, N_bb, N_cb, z = tsplit(
+ viewing_condition_dependent_parameters(Y_b, Y_w, L_A))
+
+ if C is None and M is not None:
+ C = M / F_L ** 0.25
+ elif C is None:
+ raise ValueError('Either "C" or "M" correlate must be defined in '
+ 'the "CIECAM02_specification" argument!')
# Converting *CIE XYZ* tristimulus values to *CMCCAT2000* transform
# sharpened *RGB* values.
@@ -385,12 +397,10 @@ def CIECAM02_to_XYZ(J,
a, b = tsplit(opponent_colour_dimensions_reverse(P_n, h))
# Computing post-adaptation non linear response compression matrix.
- RGB_a = post_adaptation_non_linear_response_compression_matrix(
- P_2, a, b)
+ RGB_a = post_adaptation_non_linear_response_compression_matrix(P_2, a, b)
# Applying reverse post-adaptation non linear response compression.
- RGB_p = post_adaptation_non_linear_response_compression_reverse(
- RGB_a, F_L)
+ RGB_p = post_adaptation_non_linear_response_compression_reverse(RGB_a, F_L)
# Converting to *Hunt-Pointer-Estevez* colourspace.
RGB_c = rgb_to_RGB(RGB_p)
@@ -567,8 +577,8 @@ def full_chromatic_adaptation_forward(RGB, RGB_w, Y_w, D):
Y_w = np.asarray(Y_w)
D = np.asarray(D)
- RGB_c = (((Y_w[..., np.newaxis] * D[..., np.newaxis] / RGB_w) +
- 1 - D[..., np.newaxis]) * RGB)
+ RGB_c = (((Y_w[..., np.newaxis] * D[..., np.newaxis] / RGB_w) + 1 -
+ D[..., np.newaxis]) * RGB)
return RGB_c
@@ -610,8 +620,8 @@ def full_chromatic_adaptation_reverse(RGB, RGB_w, Y_w, D):
Y_w = np.asarray(Y_w)
D = np.asarray(D)
- RGB_c = (RGB / (Y_w[..., np.newaxis] * (D[..., np.newaxis] / RGB_w) +
- 1 - D[..., np.newaxis]))
+ RGB_c = (RGB / (Y_w[..., np.newaxis] *
+ (D[..., np.newaxis] / RGB_w) + 1 - D[..., np.newaxis]))
return RGB_c
@@ -687,6 +697,10 @@ def post_adaptation_non_linear_response_compression_forward(RGB, F_L):
ndarray
Compressed *CMCCAT2000* transform sharpened *RGB* array.
+ Notes
+ -----
+ - This definition implements negative values handling as per [5]_.
+
Examples
--------
>>> RGB = np.array([19.99693975, 20.00186123, 20.01350530])
@@ -699,9 +713,8 @@ def post_adaptation_non_linear_response_compression_forward(RGB, F_L):
RGB = np.asarray(RGB)
F_L = np.asarray(F_L)
- # TODO: Check for negative values and their handling.
- RGB_c = ((((400 * (F_L[..., np.newaxis] * RGB / 100) ** 0.42) /
- (27.13 + (F_L[..., np.newaxis] * RGB / 100) ** 0.42))) + 0.1)
+ F_L_RGB = (F_L[..., np.newaxis] * np.absolute(RGB) / 100) ** 0.42
+ RGB_c = ((400 * np.sign(RGB) * F_L_RGB) / (27.13 + F_L_RGB)) + 0.1
return RGB_c
@@ -735,10 +748,9 @@ def post_adaptation_non_linear_response_compression_reverse(RGB, F_L):
RGB = np.asarray(RGB)
F_L = np.asarray(F_L)
- RGB_p = ((np.sign(RGB - 0.1) *
- (100 / F_L[..., np.newaxis]) * ((27.13 * np.abs(RGB - 0.1)) /
- (400 - np.abs(RGB - 0.1))) ** (
- 1 / 0.42)))
+ RGB_p = ((np.sign(RGB - 0.1) * (100 / F_L[..., np.newaxis]) *
+ ((27.13 * np.abs(RGB - 0.1)) /
+ (400 - np.abs(RGB - 0.1))) ** (1 / 0.42)))
return RGB_p
@@ -792,6 +804,10 @@ def opponent_colour_dimensions_reverse(P_n, h):
ndarray
Opponent colour dimensions.
+ Notes
+ -----
+ - This definition implements negative values handling as per [5]_.
+
Examples
--------
>>> P_n = np.array([30162.89081534, 24.23720547, 1.05000000])
@@ -813,20 +829,23 @@ def opponent_colour_dimensions_reverse(P_n, h):
a = np.zeros(hr.shape)
b = np.zeros(hr.shape)
- b = np.where(np.abs(sin_hr) >= np.abs(cos_hr),
- (n / (P_4 + (2 + P_3) * (220 / 1403) * (cos_hr / sin_hr) -
- (27 / 1403) + P_3 * (6300 / 1403))),
- b)
+ b = np.where(
+ np.isfinite(P_1) * np.abs(sin_hr) >= np.abs(cos_hr),
+ (n / (P_4 + (2 + P_3) * (220 / 1403) * (cos_hr / sin_hr) -
+ (27 / 1403) + P_3 * (6300 / 1403))), b)
- a = np.where(np.abs(sin_hr) >= np.abs(cos_hr), b * (cos_hr / sin_hr), a)
+ a = np.where(
+ np.isfinite(P_1) * np.abs(sin_hr) >= np.abs(cos_hr),
+ b * (cos_hr / sin_hr), a)
- a = np.where(np.abs(sin_hr) < np.abs(cos_hr),
- (n / (P_5 + (2 + P_3) * (220 / 1403) -
- ((27 / 1403) - P_3 * (6300 / 1403)) *
- (sin_hr / cos_hr))),
- a)
+ a = np.where(
+ np.isfinite(P_1) * np.abs(sin_hr) < np.abs(cos_hr),
+ (n / (P_5 + (2 + P_3) * (220 / 1403) -
+ ((27 / 1403) - P_3 * (6300 / 1403)) * (sin_hr / cos_hr))), a)
- b = np.where(np.abs(sin_hr) < np.abs(cos_hr), a * (sin_hr / cos_hr), b)
+ b = np.where(
+ np.isfinite(P_1) * np.abs(sin_hr) < np.abs(cos_hr),
+ a * (sin_hr / cos_hr), b)
ab = tstack((a, b))
@@ -901,14 +920,12 @@ def hue_quadrature(h):
h_ii1 = h_i[i + 1]
e_ii1 = e_i[i + 1]
- H = H_ii + ((100 * (h - h_ii) / e_ii) /
- ((h - h_ii) / e_ii + (h_ii1 - h) / e_ii1))
- H = np.where(h < 20.14,
- 385.9 + (14.1 * h / 0.856) / (h / 0.856 + (20.14 - h) / 0.8),
- H)
- H = np.where(h >= 237.53,
- H_ii + ((85.9 * (h - h_ii) / e_ii) /
- ((h - h_ii) / e_ii + (360 - h) / 0.856)),
+ H = H_ii + ((100 * (h - h_ii) / e_ii) / ((h - h_ii) / e_ii +
+ (h_ii1 - h) / e_ii1))
+ H = np.where(h < 20.14, 385.9 + (14.1 * h / 0.856) /
+ (h / 0.856 + (20.14 - h) / 0.8), H)
+ H = np.where(h >= 237.53, H_ii + ((85.9 * (h - h_ii) / e_ii) /
+ ((h - h_ii) / e_ii + (360 - h) / 0.856)),
H)
return as_numeric(H)
@@ -1167,6 +1184,10 @@ def temporary_magnitude_quantity_reverse(C, J, n):
numeric or ndarray
Temporary magnitude quantity :math:`t`.
+ Notes
+ -----
+ - This definition implements negative values handling as per [5]_.
+
Examples
--------
>>> C = 68.8364136888275
@@ -1177,7 +1198,7 @@ def temporary_magnitude_quantity_reverse(C, J, n):
"""
C = np.asarray(C)
- J = np.asarray(J)
+ J = np.maximum(J, EPSILON)
n = np.asarray(n)
t = (C / (np.sqrt(J / 100) * (1.64 - 0.29 ** n) ** 0.73)) ** (1 / 0.9)
diff --git a/colour/appearance/hunt.py b/colour/appearance/hunt.py
index 4c1a28b1f8..62cd3bc5b5 100644
--- a/colour/appearance/hunt.py
+++ b/colour/appearance/hunt.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Hunt Colour Appearance Model
============================
@@ -31,12 +30,8 @@
import numpy as np
from collections import namedtuple
-from colour.utilities import (
- CaseInsensitiveMapping,
- dot_vector,
- tsplit,
- tstack,
- warning)
+from colour.utilities import (CaseInsensitiveMapping, dot_vector, tsplit,
+ tstack, warning)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -45,39 +40,23 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['Hunt_InductionFactors',
- 'HUNT_VIEWING_CONDITIONS',
- 'HUE_DATA_FOR_HUE_QUADRATURE',
- 'XYZ_TO_HPE_MATRIX',
- 'HPE_TO_XYZ_MATRIX',
- 'Hunt_ReferenceSpecification',
- 'Hunt_Specification',
- 'XYZ_to_Hunt',
- 'luminance_level_adaptation_factor',
- 'illuminant_scotopic_luminance',
- 'XYZ_to_rgb',
- 'f_n',
- 'chromatic_adaptation',
- 'adjusted_reference_white_signals',
- 'achromatic_post_adaptation_signal',
- 'colour_difference_signals',
- 'hue_angle',
- 'eccentricity_factor',
- 'low_luminance_tritanopia_factor',
- 'yellowness_blueness_response',
- 'redness_greenness_response',
- 'overall_chromatic_response',
- 'saturation_correlate',
- 'achromatic_signal',
- 'brightness_correlate',
- 'lightness_correlate',
- 'chroma_correlate',
- 'colourfulness_correlate']
+__all__ = [
+ 'Hunt_InductionFactors', 'HUNT_VIEWING_CONDITIONS',
+ 'HUE_DATA_FOR_HUE_QUADRATURE', 'XYZ_TO_HPE_MATRIX', 'HPE_TO_XYZ_MATRIX',
+ 'Hunt_ReferenceSpecification', 'Hunt_Specification', 'XYZ_to_Hunt',
+ 'luminance_level_adaptation_factor', 'illuminant_scotopic_luminance',
+ 'XYZ_to_rgb', 'f_n', 'chromatic_adaptation',
+ 'adjusted_reference_white_signals', 'achromatic_post_adaptation_signal',
+ 'colour_difference_signals', 'hue_angle', 'eccentricity_factor',
+ 'low_luminance_tritanopia_factor', 'yellowness_blueness_response',
+ 'redness_greenness_response', 'overall_chromatic_response',
+ 'saturation_correlate', 'achromatic_signal', 'brightness_correlate',
+ 'lightness_correlate', 'chroma_correlate', 'colourfulness_correlate'
+]
class Hunt_InductionFactors(
- namedtuple('Hunt_InductionFactors',
- ('N_c', 'N_b', 'N_cb', 'N_bb'))):
+ namedtuple('Hunt_InductionFactors', ('N_c', 'N_b', 'N_cb', 'N_bb'))):
"""
*Hunt* colour appearance model induction factors.
@@ -106,17 +85,18 @@ def __new__(cls, N_c, N_b, N_cb=None, N_bb=None):
cls, N_c, N_b, N_cb, N_bb)
-HUNT_VIEWING_CONDITIONS = CaseInsensitiveMapping(
- {'Small Areas, Uniform Background & Surrounds': (
- Hunt_InductionFactors(1, 300)),
- 'Normal Scenes': (
- Hunt_InductionFactors(1, 75)),
- 'Television & CRT, Dim Surrounds': (
- Hunt_InductionFactors(1, 25)),
- 'Large Transparencies On Light Boxes': (
- Hunt_InductionFactors(0.7, 25)),
- 'Projected Transparencies, Dark Surrounds': (
- Hunt_InductionFactors(0.7, 10))})
+HUNT_VIEWING_CONDITIONS = CaseInsensitiveMapping({
+ 'Small Areas, Uniform Background & Surrounds':
+ Hunt_InductionFactors(1, 300),
+ 'Normal Scenes':
+ Hunt_InductionFactors(1, 75),
+ 'Television & CRT, Dim Surrounds':
+ Hunt_InductionFactors(1, 25),
+ 'Large Transparencies On Light Boxes':
+ Hunt_InductionFactors(0.7, 25),
+ 'Projected Transparencies, Dark Surrounds':
+ Hunt_InductionFactors(0.7, 10)
+})
"""
Reference *Hunt* colour appearance model viewing conditions.
@@ -138,8 +118,7 @@ def __new__(cls, N_c, N_b, N_cb=None, N_bb=None):
"""
HUNT_VIEWING_CONDITIONS['small_uniform'] = (
HUNT_VIEWING_CONDITIONS['Small Areas, Uniform Background & Surrounds'])
-HUNT_VIEWING_CONDITIONS['normal'] = (
- HUNT_VIEWING_CONDITIONS['Normal Scenes'])
+HUNT_VIEWING_CONDITIONS['normal'] = (HUNT_VIEWING_CONDITIONS['Normal Scenes'])
HUNT_VIEWING_CONDITIONS['tv_dim'] = (
HUNT_VIEWING_CONDITIONS['Television & CRT, Dim Surrounds'])
HUNT_VIEWING_CONDITIONS['light_boxes'] = (
@@ -149,12 +128,13 @@ def __new__(cls, N_c, N_b, N_cb=None, N_bb=None):
HUE_DATA_FOR_HUE_QUADRATURE = {
'h_s': np.array([20.14, 90.00, 164.25, 237.53]),
- 'e_s': np.array([0.8, 0.7, 1.0, 1.2])}
+ 'e_s': np.array([0.8, 0.7, 1.0, 1.2])
+}
XYZ_TO_HPE_MATRIX = np.array(
[[0.38971, 0.68898, -0.07868],
[-0.22981, 1.18340, 0.04641],
- [0.00000, 0.00000, 1.00000]])
+ [0.00000, 0.00000, 1.00000]]) # yapf: disable
"""
*Hunt* colour appearance model *CIE XYZ* tristimulus values to
*Hunt-Pointer-Estevez* :math:`\\rho\gamma\\beta` colourspace matrix.
@@ -172,8 +152,8 @@ def __new__(cls, N_c, N_b, N_cb=None, N_bb=None):
class Hunt_ReferenceSpecification(
- namedtuple('Hunt_ReferenceSpecification',
- ('J', 'C_94', 'h_S', 's', 'Q', 'M_94', 'H', 'H_C'))):
+ namedtuple('Hunt_ReferenceSpecification', ('J', 'C_94', 'h_S', 's',
+ 'Q', 'M_94', 'H', 'H_C'))):
"""
Defines the *Hunt* colour appearance model reference specification.
@@ -202,8 +182,8 @@ class Hunt_ReferenceSpecification(
class Hunt_Specification(
- namedtuple('Hunt_Specification',
- ('J', 'C', 'h', 's', 'Q', 'M', 'H', 'HC'))):
+ namedtuple('Hunt_Specification', ('J', 'C', 'h', 's', 'Q', 'M', 'H',
+ 'HC'))):
"""
Defines the *Hunt* colour appearance model specification.
@@ -380,26 +360,12 @@ def XYZ_to_Hunt(XYZ,
F_L = luminance_level_adaptation_factor(L_A)
# Computing test sample chromatic adaptation.
- rgb_a = chromatic_adaptation(XYZ,
- XYZ_w,
- XYZ_b,
- L_A,
- F_L,
- XYZ_p,
- p,
- helson_judd_effect,
- discount_illuminant)
+ rgb_a = chromatic_adaptation(XYZ, XYZ_w, XYZ_b, L_A, F_L, XYZ_p, p,
+ helson_judd_effect, discount_illuminant)
# Computing reference white chromatic adaptation.
- rgb_aw = chromatic_adaptation(XYZ_w,
- XYZ_w,
- XYZ_b,
- L_A,
- F_L,
- XYZ_p,
- p,
- helson_judd_effect,
- discount_illuminant)
+ rgb_aw = chromatic_adaptation(XYZ_w, XYZ_w, XYZ_b, L_A, F_L, XYZ_p, p,
+ helson_judd_effect, discount_illuminant)
# Computing opponent colour dimensions.
# Computing achromatic post adaptation signals.
@@ -648,15 +614,15 @@ def chromatic_adaptation(XYZ,
# Computing chromatic adaptation factors.
if not discount_illuminant:
- F_rgb = ((1 + (L_A ** (1 / 3)) + h_rgb) /
- (1 + (L_A ** (1 / 3)) + (1 / h_rgb)))
+ F_rgb = ((1 + (L_A ** (1 / 3)) + h_rgb) / (1 + (L_A ** (1 / 3)) +
+ (1 / h_rgb)))
else:
F_rgb = np.ones(h_rgb.shape)
# Computing Helson-Judd effect parameters.
if helson_judd_effect:
- D_rgb = (f_n((Y_b / Y_w) * F_L * F_rgb[..., 1]) -
- f_n((Y_b / Y_w) * F_L * F_rgb))
+ D_rgb = (f_n((Y_b / Y_w) * F_L * F_rgb[..., 1]) - f_n(
+ (Y_b / Y_w) * F_L * F_rgb))
else:
D_rgb = np.zeros(F_rgb.shape)
@@ -666,8 +632,7 @@ def chromatic_adaptation(XYZ,
# Computing adjusted reference white signals.
if XYZ_p is not None and p is not None:
rgb_p = XYZ_to_rgb(XYZ_p)
- rgb_w = adjusted_reference_white_signals(rgb_p, B_rgb, rgb_w,
- p)
+ rgb_w = adjusted_reference_white_signals(rgb_p, B_rgb, rgb_w, p)
# Computing adapted cone responses.
rgb_a = 1
@@ -815,8 +780,8 @@ def hue_angle(C):
C_1, C_2, C_3 = tsplit(C)
- hue = (180 * np.arctan2(0.5 * (C_2 - C_3) / 4.5,
- C_1 - (C_2 / 11)) / np.pi) % 360
+ hue = (180 * np.arctan2(0.5 * (C_2 - C_3) / 4.5, C_1 -
+ (C_2 / 11)) / np.pi) % 360
return hue
@@ -924,8 +889,8 @@ def yellowness_blueness_response(C, e_s, N_c, N_cb, F_t):
N_cb = np.asarray(N_cb)
F_t = np.asarray(F_t)
- M_yb = (100 * (0.5 * (C_2 - C_3) / 4.5) *
- (e_s * (10 / 13) * N_c * N_cb * F_t))
+ M_yb = (100 * (0.5 * (C_2 - C_3) / 4.5) * (e_s *
+ (10 / 13) * N_c * N_cb * F_t))
return M_yb
@@ -1218,9 +1183,8 @@ def chroma_correlate(s, Y_b, Y_w, Q, Q_w):
Q = np.asarray(Q)
Q_w = np.asarray(Q_w)
- C_94 = (2.44 * (s ** 0.69) *
- ((Q / Q_w) ** (Y_b / Y_w)) *
- (1.64 - 0.29 ** (Y_b / Y_w)))
+ C_94 = (2.44 * (s ** 0.69) * ((Q / Q_w) ** (Y_b / Y_w)) * (1.64 - 0.29 **
+ (Y_b / Y_w)))
return C_94
diff --git a/colour/appearance/llab.py b/colour/appearance/llab.py
index f2582e1d4f..29b675d54b 100644
--- a/colour/appearance/llab.py
+++ b/colour/appearance/llab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
LLAB(l:c) Colour Appearance Model
=================================
@@ -49,27 +48,18 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LLAB_InductionFactors',
- 'LLAB_VIEWING_CONDITIONS',
- 'LLAB_XYZ_TO_RGB_MATRIX',
- 'LLAB_RGB_TO_XYZ_MATRIX',
- 'LLAB_ReferenceSpecification',
- 'LLAB_Specification',
- 'XYZ_to_LLAB',
- 'XYZ_to_RGB_LLAB',
- 'chromatic_adaptation',
- 'f',
- 'opponent_colour_dimensions',
- 'hue_angle',
- 'chroma_correlate',
- 'colourfulness_correlate',
- 'saturation_correlate',
- 'final_opponent_signals']
+__all__ = [
+ 'LLAB_InductionFactors', 'LLAB_VIEWING_CONDITIONS',
+ 'LLAB_XYZ_TO_RGB_MATRIX', 'LLAB_RGB_TO_XYZ_MATRIX',
+ 'LLAB_ReferenceSpecification', 'LLAB_Specification', 'XYZ_to_LLAB',
+ 'XYZ_to_RGB_LLAB', 'chromatic_adaptation', 'f',
+ 'opponent_colour_dimensions', 'hue_angle', 'chroma_correlate',
+ 'colourfulness_correlate', 'saturation_correlate', 'final_opponent_signals'
+]
class LLAB_InductionFactors(
- namedtuple('LLAB_InductionFactors',
- ('D', 'F_S', 'F_L', 'F_C'))):
+ namedtuple('LLAB_InductionFactors', ('D', 'F_S', 'F_L', 'F_C'))):
"""
*LLAB(l:c)* colour appearance model induction factors.
@@ -86,17 +76,18 @@ class LLAB_InductionFactors(
"""
-LLAB_VIEWING_CONDITIONS = CaseInsensitiveMapping(
- {'Reference Samples & Images, Average Surround, Subtending > 4': (
+LLAB_VIEWING_CONDITIONS = CaseInsensitiveMapping({
+ 'Reference Samples & Images, Average Surround, Subtending > 4': (
LLAB_InductionFactors(1, 3, 0, 1)),
- 'Reference Samples & Images, Average Surround, Subtending < 4': (
- LLAB_InductionFactors(1, 3, 1, 1)),
- 'Television & VDU Displays, Dim Surround': (
- LLAB_InductionFactors(0.7, 3.5, 1, 1)),
- 'Cut Sheet Transparency, Dim Surround': (
- LLAB_InductionFactors(1, 5, 1, 1.1)),
- '35mm Projection Transparency, Dark Surround': (
- LLAB_InductionFactors(0.7, 4, 1, 1))})
+ 'Reference Samples & Images, Average Surround, Subtending < 4': (
+ LLAB_InductionFactors(1, 3, 1, 1)),
+ 'Television & VDU Displays, Dim Surround': (LLAB_InductionFactors(
+ 0.7, 3.5, 1, 1)),
+ 'Cut Sheet Transparency, Dim Surround': (LLAB_InductionFactors(
+ 1, 5, 1, 1.1)),
+ '35mm Projection Transparency, Dark Surround': (LLAB_InductionFactors(
+ 0.7, 4, 1, 1))
+})
"""
Reference *LLAB(l:c)* colour appearance model viewing conditions.
@@ -117,26 +108,23 @@ class LLAB_InductionFactors(
- 'sheet_dim': 'Cut Sheet Transparency, Dim Surround'
- 'projected_dark': '35mm Projection Transparency, Dark Surround'
"""
-LLAB_VIEWING_CONDITIONS['ref_average_4_plus'] = (
- LLAB_VIEWING_CONDITIONS[
- 'Reference Samples & Images, Average Surround, Subtending > 4'])
-LLAB_VIEWING_CONDITIONS['ref_average_4_minus'] = (
- LLAB_VIEWING_CONDITIONS[
- 'Reference Samples & Images, Average Surround, Subtending < 4'])
+LLAB_VIEWING_CONDITIONS['ref_average_4_plus'] = ( # yapf: disable
+ LLAB_VIEWING_CONDITIONS['Reference Samples & Images, '
+ 'Average Surround, Subtending > 4'])
+LLAB_VIEWING_CONDITIONS['ref_average_4_minus'] = ( # yapf: disable
+ LLAB_VIEWING_CONDITIONS['Reference Samples & Images, '
+ 'Average Surround, Subtending < 4'])
LLAB_VIEWING_CONDITIONS['tv_dim'] = (
- LLAB_VIEWING_CONDITIONS[
- 'Television & VDU Displays, Dim Surround'])
+ LLAB_VIEWING_CONDITIONS['Television & VDU Displays, Dim Surround'])
LLAB_VIEWING_CONDITIONS['sheet_dim'] = (
- LLAB_VIEWING_CONDITIONS[
- 'Cut Sheet Transparency, Dim Surround'])
+ LLAB_VIEWING_CONDITIONS['Cut Sheet Transparency, Dim Surround'])
LLAB_VIEWING_CONDITIONS['projected_dark'] = (
- LLAB_VIEWING_CONDITIONS[
- '35mm Projection Transparency, Dark Surround'])
+ LLAB_VIEWING_CONDITIONS['35mm Projection Transparency, Dark Surround'])
LLAB_XYZ_TO_RGB_MATRIX = np.array(
[[0.8951, 0.2664, -0.1614],
[-0.7502, 1.7135, 0.0367],
- [0.0389, -0.0685, 1.0296]])
+ [0.0389, -0.0685, 1.0296]]) # yapf: disable
"""
LLAB(l:c) colour appearance model *CIE XYZ* tristimulus values to normalised
cone responses matrix.
@@ -154,8 +142,8 @@ class LLAB_InductionFactors(
class LLAB_ReferenceSpecification(
- namedtuple('LLAB_ReferenceSpecification',
- ('L_L', 'Ch_L', 'h_L', 's_L', 'C_L', 'HC', 'A_L', 'B_L'))):
+ namedtuple('LLAB_ReferenceSpecification',
+ ('L_L', 'Ch_L', 'h_L', 's_L', 'C_L', 'HC', 'A_L', 'B_L'))):
"""
Defines the *LLAB(l:c)* colour appearance model reference specification.
@@ -184,8 +172,8 @@ class LLAB_ReferenceSpecification(
class LLAB_Specification(
- namedtuple('LLAB_Specification',
- ('J', 'C', 'h', 's', 'M', 'HC', 'a', 'b'))):
+ namedtuple('LLAB_Specification', ('J', 'C', 'h', 's', 'M', 'HC', 'a',
+ 'b'))):
"""
Defines the *LLAB(l:c)* colour appearance model specification.
@@ -283,8 +271,8 @@ def XYZ_to_LLAB(
# Computing the correlate of *Lightness* :math:`L_L`.
# -------------------------------------------------------------------------
# Computing opponent colour dimensions.
- L_L, a, b = tsplit(opponent_colour_dimensions(
- XYZ_r, Y_b, surround.F_S, surround.F_L))
+ L_L, a, b = tsplit(
+ opponent_colour_dimensions(XYZ_r, Y_b, surround.F_S, surround.F_L))
# Computing perceptual correlates.
# -------------------------------------------------------------------------
@@ -429,8 +417,8 @@ def f(x, F_S):
x_m = np.where(x > 0.008856,
x ** (1 / F_S),
- ((((0.008856 ** (1 / F_S)) -
- (16 / 116)) / 0.008856) * x + (16 / 116)))
+ ((((0.008856 ** (1 / F_S)) - (16 / 116)) / 0.008856) * x +
+ (16 / 116)))
return x_m
diff --git a/colour/appearance/nayatani95.py b/colour/appearance/nayatani95.py
index 591150cddd..5b0fa40607 100644
--- a/colour/appearance/nayatani95.py
+++ b/colour/appearance/nayatani95.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Nayatani (1995) Colour Appearance Model
=======================================
@@ -31,11 +30,9 @@
import numpy as np
from collections import namedtuple
-from colour.adaptation.cie1994 import (
- CIE1994_XYZ_TO_RGB_MATRIX,
- beta_1,
- exponential_factors,
- intermediate_values)
+from colour.adaptation.cie1994 import (CIE1994_XYZ_TO_RGB_MATRIX, beta_1,
+ exponential_factors,
+ intermediate_values)
from colour.models import XYZ_to_xy
from colour.utilities import dot_vector, tsplit, tstack
@@ -46,28 +43,18 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['NAYATANI95_XYZ_TO_RGB_MATRIX',
- 'Nayatani95_ReferenceSpecification',
- 'Nayatani95_Specification',
- 'XYZ_to_Nayatani95',
- 'illuminance_to_luminance',
- 'XYZ_to_RGB_Nayatani95',
- 'scaling_coefficient',
- 'achromatic_response',
- 'tritanopic_response',
- 'protanopic_response',
- 'brightness_correlate',
- 'ideal_white_brightness_correlate',
- 'achromatic_lightness_correlate',
- 'normalised_achromatic_lightness_correlate',
- 'hue_angle',
- 'saturation_components',
- 'saturation_correlate',
- 'chroma_components',
- 'chroma_correlate',
- 'colourfulness_components',
- 'colourfulness_correlate',
- 'chromatic_strength_function']
+__all__ = [
+ 'NAYATANI95_XYZ_TO_RGB_MATRIX', 'Nayatani95_ReferenceSpecification',
+ 'Nayatani95_Specification', 'XYZ_to_Nayatani95',
+ 'illuminance_to_luminance', 'XYZ_to_RGB_Nayatani95', 'scaling_coefficient',
+ 'achromatic_response', 'tritanopic_response', 'protanopic_response',
+ 'brightness_correlate', 'ideal_white_brightness_correlate',
+ 'achromatic_lightness_correlate',
+ 'normalised_achromatic_lightness_correlate', 'hue_angle',
+ 'saturation_components', 'saturation_correlate', 'chroma_components',
+ 'chroma_correlate', 'colourfulness_components', 'colourfulness_correlate',
+ 'chromatic_strength_function'
+]
NAYATANI95_XYZ_TO_RGB_MATRIX = CIE1994_XYZ_TO_RGB_MATRIX
"""
@@ -79,9 +66,9 @@
class Nayatani95_ReferenceSpecification(
- namedtuple(
- 'Nayatani95_ReferenceSpecification',
- ('Lstar_P', 'C', 'theta', 'S', 'B_r', 'M', 'H', 'H_C', 'Lstar_N'))):
+ namedtuple('Nayatani95_ReferenceSpecification',
+ ('Lstar_P', 'C', 'theta', 'S', 'B_r', 'M', 'H', 'H_C',
+ 'Lstar_N'))):
"""
Defines the *Nayatani (1995)* colour appearance model reference
specification.
@@ -113,8 +100,8 @@ class Nayatani95_ReferenceSpecification(
class Nayatani95_Specification(
- namedtuple('Nayatani95_Specification',
- ('Lstar_P', 'C', 'h', 's', 'Q', 'M', 'H', 'HC', 'Lstar_N'))):
+ namedtuple('Nayatani95_Specification', ('Lstar_P', 'C', 'h', 's', 'Q',
+ 'M', 'H', 'HC', 'Lstar_N'))):
"""
Defines the *Nayatani (1995)* colour appearance model specification.
@@ -149,12 +136,7 @@ class Nayatani95_Specification(
"""
-def XYZ_to_Nayatani95(XYZ,
- XYZ_n,
- Y_o,
- E_o,
- E_or,
- n=1):
+def XYZ_to_Nayatani95(XYZ, XYZ_n, Y_o, E_o, E_or, n=1):
"""
Computes the *Nayatani (1995)* colour appearance model correlates.
@@ -242,63 +224,41 @@ def XYZ_to_Nayatani95(XYZ,
# Computing protanopic response :math:`p`:
p_response = protanopic_response(RGB, bRGB_o, xez, n)
- # -------------------------------------------------------------------------
# Computing the correlate of *brightness* :math:`B_r`.
- # -------------------------------------------------------------------------
B_r = brightness_correlate(bRGB_o, bL_or, Q_response)
# Computing *brightness* :math:`B_{rw}` of ideal white.
brightness_ideal_white = ideal_white_brightness_correlate(
bRGB_o, xez, bL_or, n)
- # -------------------------------------------------------------------------
# Computing the correlate of achromatic *Lightness* :math:`L_p^\star`.
- # -------------------------------------------------------------------------
- Lstar_P = (
- achromatic_lightness_correlate(Q_response))
+ Lstar_P = (achromatic_lightness_correlate(Q_response))
- # -------------------------------------------------------------------------
# Computing the correlate of normalised achromatic *Lightness*
# :math:`L_n^\star`.
- # -------------------------------------------------------------------------
- Lstar_N = (
- normalised_achromatic_lightness_correlate(B_r, brightness_ideal_white))
+ Lstar_N = (normalised_achromatic_lightness_correlate(
+ B_r, brightness_ideal_white))
- # -------------------------------------------------------------------------
# Computing the *hue* angle :math:`\\theta`.
- # -------------------------------------------------------------------------
theta = hue_angle(p_response, t_response)
# TODO: Implement hue quadrature & composition computation.
- # -------------------------------------------------------------------------
# Computing the correlate of *saturation* :math:`S`.
- # -------------------------------------------------------------------------
- S_RG, S_YB = tsplit(saturation_components(
- theta, bL_or, t_response, p_response))
+ S_RG, S_YB = tsplit(
+ saturation_components(theta, bL_or, t_response, p_response))
S = saturation_correlate(S_RG, S_YB)
- # -------------------------------------------------------------------------
# Computing the correlate of *chroma* :math:`C`.
- # -------------------------------------------------------------------------
# C_RG, C_YB = tsplit(chroma_components(Lstar_P, S_RG, S_YB))
C = chroma_correlate(Lstar_P, S)
- # -------------------------------------------------------------------------
# Computing the correlate of *colourfulness* :math:`M`.
- # -------------------------------------------------------------------------
# TODO: Investigate components usage.
# M_RG, M_YB = tsplit(colourfulness_components(C_RG, C_YB,
# brightness_ideal_white))
M = colourfulness_correlate(C, brightness_ideal_white)
- return Nayatani95_Specification(Lstar_P,
- C,
- theta,
- S,
- B_r,
- M,
- None,
- None,
+ return Nayatani95_Specification(Lstar_P, C, theta, S, B_r, M, None, None,
Lstar_N)
@@ -479,7 +439,7 @@ def tritanopic_response(RGB, bRGB_o, xez, n):
xi, eta, zeta = tsplit(xez)
t = (1 / 1) * bR_o * np.log10((R + n) / (20 * xi + n))
- t += - (12 / 11) * bG_o * np.log10((G + n) / (20 * eta + n))
+ t += -(12 / 11) * bG_o * np.log10((G + n) / (20 * eta + n))
t += (1 / 11) * bB_o * np.log10((B + n) / (20 * zeta + n))
return t
@@ -523,7 +483,7 @@ def protanopic_response(RGB, bRGB_o, xez, n):
p = (1 / 9) * bR_o * np.log10((R + n) / (20 * xi + n))
p += (1 / 9) * bG_o * np.log10((G + n) / (20 * eta + n))
- p += - (2 / 9) * bB_o * np.log10((B + n) / (20 * zeta + n))
+ p += -(2 / 9) * bB_o * np.log10((B + n) / (20 * zeta + n))
return p
diff --git a/colour/appearance/rlab.py b/colour/appearance/rlab.py
index d91c0bf59b..7cb1db0b92 100644
--- a/colour/appearance/rlab.py
+++ b/colour/appearance/rlab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RLAB Colour Appearance Model
============================
@@ -33,12 +32,8 @@
from collections import namedtuple
from colour.appearance.hunt import XYZ_TO_HPE_MATRIX, XYZ_to_rgb
-from colour.utilities import (
- CaseInsensitiveMapping,
- dot_matrix,
- dot_vector,
- tsplit,
- row_as_diagonal)
+from colour.utilities import (CaseInsensitiveMapping, dot_matrix, dot_vector,
+ tsplit, row_as_diagonal)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -47,27 +42,26 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['R_MATRIX',
- 'RLAB_VIEWING_CONDITIONS',
- 'RLAB_D_FACTOR',
- 'RLAB_ReferenceSpecification',
- 'RLAB_Specification',
- 'XYZ_to_RLAB']
+__all__ = [
+ 'R_MATRIX', 'RLAB_VIEWING_CONDITIONS', 'RLAB_D_FACTOR',
+ 'RLAB_ReferenceSpecification', 'RLAB_Specification', 'XYZ_to_RLAB'
+]
R_MATRIX = np.array(
[[1.9569, -1.1882, 0.2313],
[0.3612, 0.6388, 0.0000],
- [0.0000, 0.0000, 1.0000]])
+ [0.0000, 0.0000, 1.0000]]) # yapf: disable
"""
*RLAB* colour appearance model precomputed helper matrix.
R_MATRIX : array_like, (3, 3)
"""
-RLAB_VIEWING_CONDITIONS = CaseInsensitiveMapping(
- {'Average': 1 / 2.3,
- 'Dim': 1 / 2.9,
- 'Dark': 1 / 3.5})
+RLAB_VIEWING_CONDITIONS = CaseInsensitiveMapping({
+ 'Average': 1 / 2.3,
+ 'Dim': 1 / 2.9,
+ 'Dark': 1 / 3.5
+})
"""
Reference *RLAB* colour appearance model viewing conditions.
@@ -75,10 +69,11 @@
**{'Average', 'Dim', 'Dark'}**
"""
-RLAB_D_FACTOR = CaseInsensitiveMapping(
- {'Hard Copy Images': 1,
- 'Soft Copy Images': 0,
- 'Projected Transparencies, Dark Room': 0.5})
+RLAB_D_FACTOR = CaseInsensitiveMapping({
+ 'Hard Copy Images': 1,
+ 'Soft Copy Images': 0,
+ 'Projected Transparencies, Dark Room': 0.5
+})
"""
*RLAB* colour appearance model *Discounting-the-Illuminant* factor values.
@@ -93,17 +88,15 @@
- 'soft_cp_img': 'Soft Copy Images'
- 'projected_dark': 'Projected Transparencies, Dark Room'
"""
-RLAB_D_FACTOR['hard_cp_img'] = (
- RLAB_D_FACTOR['Hard Copy Images'])
-RLAB_D_FACTOR['soft_cp_img'] = (
- RLAB_D_FACTOR['Soft Copy Images'])
+RLAB_D_FACTOR['hard_cp_img'] = RLAB_D_FACTOR['Hard Copy Images']
+RLAB_D_FACTOR['soft_cp_img'] = RLAB_D_FACTOR['Soft Copy Images']
RLAB_D_FACTOR['projected_dark'] = (
RLAB_D_FACTOR['Projected Transparencies, Dark Room'])
class RLAB_ReferenceSpecification(
- namedtuple('RLAB_ReferenceSpecification',
- ('LR', 'CR', 'hR', 'sR', 'HR', 'aR', 'bR'))):
+ namedtuple('RLAB_ReferenceSpecification', ('LR', 'CR', 'hR', 'sR',
+ 'HR', 'aR', 'bR'))):
"""
Defines the *RLAB* colour appearance model reference specification.
@@ -130,8 +123,8 @@ class RLAB_ReferenceSpecification(
class RLAB_Specification(
- namedtuple('RLAB_Specification',
- ('J', 'C', 'h', 's', 'HC', 'a', 'b'))):
+ namedtuple('RLAB_Specification', ('J', 'C', 'h', 's', 'HC', 'a',
+ 'b'))):
"""
Defines the *RLAB* colour appearance model specification.
@@ -230,29 +223,21 @@ def XYZ_to_RLAB(XYZ,
X_ref, Y_ref, Z_ref = tsplit(XYZ_ref)
- # -------------------------------------------------------------------------
# Computing the correlate of *Lightness* :math:`L^R`.
- # -------------------------------------------------------------------------
LR = 100 * (Y_ref ** sigma)
# Computing opponent colour dimensions :math:`a^R` and :math:`b^R`.
aR = 430 * ((X_ref ** sigma) - (Y_ref ** sigma))
bR = 170 * ((Y_ref ** sigma) - (Z_ref ** sigma))
- # -------------------------------------------------------------------------
# Computing the *hue* angle :math:`h^R`.
- # -------------------------------------------------------------------------
hR = np.degrees(np.arctan2(bR, aR)) % 360
# TODO: Implement hue composition computation.
- # -------------------------------------------------------------------------
# Computing the correlate of *chroma* :math:`C^R`.
- # -------------------------------------------------------------------------
CR = np.hypot(aR, bR)
- # -------------------------------------------------------------------------
# Computing the correlate of *saturation* :math:`s^R`.
- # -------------------------------------------------------------------------
sR = CR / LR
return RLAB_Specification(LR, CR, hR, sR, None, aR, bR)
diff --git a/colour/appearance/tests/common.py b/colour/appearance/tests/common.py
index 17bcd7813f..8ef9b592d6 100644
--- a/colour/appearance/tests/common.py
+++ b/colour/appearance/tests/common.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines the common unit tests objects for :mod:`colour.appearance` package.
"""
@@ -10,7 +9,7 @@
import csv
import numpy as np
import os
-from abc import abstractmethod
+from abc import ABCMeta, abstractmethod
from collections import defaultdict
__author__ = 'Colour Developers'
@@ -28,7 +27,7 @@ class ColourAppearanceModelTest(object):
Defines the base class for tests of: mod:`colour.appearance` package.
Each colour appearance model is tested against a respective '.csv' file
- from which content has been generated from data of the following file by
+ whose content has been generated from data of the following file by
*Fairchild (2013)*: http://rit-mcsl.org/fairchild//files/AppModEx.xls
Methods
@@ -40,6 +39,8 @@ class ColourAppearanceModelTest(object):
test_forward_examples
"""
+ __metaclass__ = ABCMeta
+
FIXTURE_BASENAME = None
"""
'.csv' file fixture path for the colour appearance model being tested,
@@ -78,9 +79,8 @@ def load_fixtures(file_name, fixtures_directory='fixtures'):
"""
path = os.path.dirname(__file__)
- with open(os.path.join(path,
- fixtures_directory,
- file_name)) as in_file:
+ with open(
+ os.path.join(path, fixtures_directory, file_name)) as in_file:
result = []
for case_data in csv.DictReader(in_file):
for key in case_data:
@@ -138,17 +138,16 @@ def check_specification_attribute(self, case, data, attribute, expected):
'Expected: "{2}" \n'
'Received "{3}"').format(attribute, case, expected, value)
- np.testing.assert_allclose(value,
- expected,
- err_msg=error_message,
- rtol=0.01,
- atol=0.01,
- verbose=False)
+ np.testing.assert_allclose(
+ value,
+ expected,
+ err_msg=error_message,
+ rtol=0.01,
+ atol=0.01,
+ verbose=False)
- np.testing.assert_almost_equal(value,
- expected,
- decimal=1,
- err_msg=error_message)
+ np.testing.assert_almost_equal(
+ value, expected, decimal=1, err_msg=error_message)
def check_model_consistency(self, data, output_attributes):
"""
@@ -169,11 +168,8 @@ def check_model_consistency(self, data, output_attributes):
"""
for data_attr, specification_attr in sorted(output_attributes.items()):
- yield (self.check_specification_attribute,
- data.get('Case'),
- data,
- specification_attr,
- data[data_attr])
+ yield (self.check_specification_attribute, data.get('Case'), data,
+ specification_attr, data[data_attr])
def fixtures(self):
"""
diff --git a/colour/appearance/tests/tests_atd95.py b/colour/appearance/tests/tests_atd95.py
index 9000319deb..f4776e7891 100644
--- a/colour/appearance/tests/tests_atd95.py
+++ b/colour/appearance/tests/tests_atd95.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.atd95` module.
"""
@@ -41,7 +40,8 @@ class TestATD95ColourAppearanceModel(ColourAppearanceModelTest):
'D_1': 'D_1',
'A_2': 'A_2',
'T_2': 'T_2',
- 'D_2': 'D_2'}
+ 'D_2': 'D_2'
+ }
def output_specification_from_data(self, data):
"""
@@ -62,12 +62,8 @@ def output_specification_from_data(self, data):
XYZ = tstack((data['X'], data['Y'], data['Z']))
XYZ_0 = tstack((data['X_0'], data['Y_0'], data['Z_0']))
- specification = XYZ_to_ATD95(XYZ,
- XYZ_0,
- data['Y_02'],
- data['K_1'],
- data['K_2'],
- data['sigma'])
+ specification = XYZ_to_ATD95(XYZ, XYZ_0, data['Y_02'], data['K_1'],
+ data['K_2'], data['sigma'])
return specification
diff --git a/colour/appearance/tests/tests_ciecam02.py b/colour/appearance/tests/tests_ciecam02.py
index 464c258f68..20430d4d71 100644
--- a/colour/appearance/tests/tests_ciecam02.py
+++ b/colour/appearance/tests/tests_ciecam02.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.ciecam02` module.
"""
@@ -10,12 +9,11 @@
import numpy as np
from itertools import permutations
-from colour.appearance import (
- CIECAM02_InductionFactors,
- XYZ_to_CIECAM02,
- CIECAM02_to_XYZ)
+from colour.appearance import (CIECAM02_InductionFactors,
+ CIECAM02_Specification, XYZ_to_CIECAM02,
+ CIECAM02_to_XYZ)
from colour.appearance.tests.common import ColourAppearanceModelTest
-from colour.utilities import ignore_numpy_errors, tsplit, tstack
+from colour.utilities import as_namedtuple, ignore_numpy_errors, tsplit, tstack
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -24,8 +22,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestCIECAM02ColourAppearanceModelForward',
- 'TestCIECAM02ColourAppearanceModelReverse']
+__all__ = [
+ 'TestCIECAM02ColourAppearanceModelForward',
+ 'TestCIECAM02ColourAppearanceModelReverse'
+]
class TestCIECAM02ColourAppearanceModelForward(ColourAppearanceModelTest):
@@ -36,13 +36,15 @@ class TestCIECAM02ColourAppearanceModelForward(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'ciecam02.csv'
- OUTPUT_ATTRIBUTES = {'J': 'J',
- 'C': 'C',
- 'h': 'h',
- 's': 's',
- 'Q': 'Q',
- 'M': 'M',
- 'H': 'H'}
+ OUTPUT_ATTRIBUTES = {
+ 'J': 'J',
+ 'C': 'C',
+ 'h': 'h',
+ 's': 's',
+ 'Q': 'Q',
+ 'M': 'M',
+ 'H': 'H'
+ }
def output_specification_from_data(self, data):
"""
@@ -63,14 +65,9 @@ def output_specification_from_data(self, data):
XYZ = tstack((data['X'], data['Y'], data['Z']))
XYZ_w = tstack((data['X_w'], data['Y_w'], data['Z_w']))
- specification = XYZ_to_CIECAM02(XYZ,
- XYZ_w,
- data['L_A'],
- data['Y_b'],
+ specification = XYZ_to_CIECAM02(XYZ, XYZ_w, data['L_A'], data['Y_b'],
CIECAM02_InductionFactors(
- data['F'],
- data['c'],
- data['N_c']))
+ data['F'], data['c'], data['N_c']))
return specification
@@ -83,44 +80,64 @@ class TestCIECAM02ColourAppearanceModelReverse(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'ciecam02.csv'
- OUTPUT_ATTRIBUTES = {'X': 0,
- 'Y': 1,
- 'Z': 2}
+ OUTPUT_ATTRIBUTES = {'X': 0, 'Y': 1, 'Z': 2}
def output_specification_from_data(self, data):
"""
- Returns the *CIECAM02* colour appearance model output specification
- from given data.
+ Returns the colour appearance model output specification from given
+ fixture data.
+
+ Parameters
+ ----------
+ data : list
+ Tested colour appearance model fixture data.
+
+ Notes
+ -----
+ - This method is a dummy object.
+ """
+
+ pass
+
+ def _XYZ_from_data(self, data, correlates):
+ """
+ Returns the *CIE XYZ* tristimulus values from given *CIECAM02* colour
+ appearance model input data.
Parameters
----------
data : list
Fixture data.
+ correlates : array_like
+ Correlates used to build the input *CIECAM02* colour appearance
+ model specification.
Returns
-------
- CIECAM02_Specification
- *CIECAM02* colour appearance model specification.
+ array_like
+ *CIE XYZ* tristimulus values
"""
XYZ_w = tstack((data['X_w'], data['Y_w'], data['Z_w']))
- specification = CIECAM02_to_XYZ(data['J'],
- data['C'],
- data['h'],
- XYZ_w,
- data['L_A'],
- data['Y_b'],
- CIECAM02_InductionFactors(
- data['F'],
- data['c'],
- data['N_c']))
+ i, j, k = correlates
+ CIECAM02_specification = as_namedtuple({
+ i: data[i],
+ j: data[j],
+ k: data[k]
+ }, CIECAM02_Specification)
- return specification
+ XYZ = CIECAM02_to_XYZ(CIECAM02_specification, XYZ_w, data['L_A'],
+ data['Y_b'],
+ CIECAM02_InductionFactors(
+ data['F'], data['c'], data['N_c']))
+
+ return XYZ
def check_specification_attribute(self, case, data, attribute, expected):
"""
- Tests given colour appearance model specification attribute value.
+ Tests *CIE XYZ* tristimulus values output from *CIECAM02* colour
+ appearance model input data.
Parameters
----------
@@ -132,27 +149,32 @@ def check_specification_attribute(self, case, data, attribute, expected):
Tested attribute name.
expected : float.
Expected attribute value.
+
+ Warning
+ -------
+ The method name does not reflect the underlying implementation.
"""
- specification = self.output_specification_from_data(data)
- value = tsplit(specification)[attribute]
+ for correlates in (('J', 'C', 'h'), ('J', 'M', 'h')):
+ XYZ = self._XYZ_from_data(data, correlates)
+ value = tsplit(XYZ)[attribute]
- error_message = (
- 'Parameter "{0}" in test case "{1}" does not match target value.\n'
- 'Expected: "{2}" \n'
- 'Received "{3}"').format(attribute, case, expected, value)
+ error_message = ('Parameter "{0}" in test case "{1}" '
+ 'does not match target value.\n'
+ 'Expected: "{2}" \n'
+ 'Received "{3}"').format(attribute, case,
+ expected, value)
- np.testing.assert_allclose(value,
- expected,
- err_msg=error_message,
- rtol=0.01,
- atol=0.01,
- verbose=False)
+ np.testing.assert_allclose(
+ value,
+ expected,
+ err_msg=error_message,
+ rtol=0.01,
+ atol=0.01,
+ verbose=False)
- np.testing.assert_almost_equal(value,
- expected,
- decimal=1,
- err_msg=error_message)
+ np.testing.assert_almost_equal(
+ value, expected, decimal=1, err_msg=error_message)
@ignore_numpy_errors
def test_nan_XYZ_to_CIECAM02(self):
@@ -188,4 +210,5 @@ def test_nan_CIECAM02_to_XYZ(self):
L_A = case[0]
Y_b = case[0]
surround = CIECAM02_InductionFactors(case[0], case[0], case[0])
- CIECAM02_to_XYZ(J, C, h, XYZ_w, L_A, Y_b, surround)
+ CIECAM02_to_XYZ(
+ CIECAM02_Specification(J, C, h), XYZ_w, L_A, Y_b, surround)
diff --git a/colour/appearance/tests/tests_hunt.py b/colour/appearance/tests/tests_hunt.py
index a23ae7fb4b..c51d31e31a 100644
--- a/colour/appearance/tests/tests_hunt.py
+++ b/colour/appearance/tests/tests_hunt.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.hunt` module.
"""
@@ -32,12 +31,14 @@ class TestHuntColourAppearanceModel(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'hunt.csv'
- OUTPUT_ATTRIBUTES = {'J': 'J',
- 'C_94': 'C',
- 'h_S': 'h',
- 's': 's',
- 'Q': 'Q',
- 'M94': 'M'}
+ OUTPUT_ATTRIBUTES = {
+ 'J': 'J',
+ 'C_94': 'C',
+ 'h_S': 'h',
+ 's': 's',
+ 'Q': 'Q',
+ 'M94': 'M'
+ }
def output_specification_from_data(self, data):
"""
@@ -59,14 +60,13 @@ def output_specification_from_data(self, data):
XYZ_w = tstack((data['X_w'], data['Y_w'], data['Z_w']))
XYZ_b = tstack((data['X_w'], 0.2 * data['Y_w'], data['Z_w']))
- specification = XYZ_to_Hunt(XYZ,
- XYZ_w,
- XYZ_b,
- data['L_A'],
- Hunt_InductionFactors(
- data['N_c'],
- data['N_b']),
- CCT_w=data['T'])
+ specification = XYZ_to_Hunt(
+ XYZ,
+ XYZ_w,
+ XYZ_b,
+ data['L_A'],
+ Hunt_InductionFactors(data['N_c'], data['N_b']),
+ CCT_w=data['T'])
return specification
diff --git a/colour/appearance/tests/tests_llab.py b/colour/appearance/tests/tests_llab.py
index b4b1306723..05b587c8d9 100644
--- a/colour/appearance/tests/tests_llab.py
+++ b/colour/appearance/tests/tests_llab.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.llab` module.
"""
@@ -38,13 +37,15 @@ class TestLLABColourAppearanceModel(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'llab.csv'
- OUTPUT_ATTRIBUTES = {'L_L': 'J',
- 'Ch_L': 'C',
- 'h_L': 'h',
- 's_L': 's',
- 'C_L': 'M',
- 'A_L': 'a',
- 'B_L': 'b'}
+ OUTPUT_ATTRIBUTES = {
+ 'L_L': 'J',
+ 'Ch_L': 'C',
+ 'h_L': 'h',
+ 's_L': 's',
+ 'C_L': 'M',
+ 'A_L': 'a',
+ 'B_L': 'b'
+ }
def output_specification_from_data(self, data):
"""
@@ -65,14 +66,10 @@ def output_specification_from_data(self, data):
XYZ = tstack((data['X'], data['Y'], data['Z']))
XYZ_0 = tstack((data['X_0'], data['Y_0'], data['Z_0']))
- specification = XYZ_to_LLAB(XYZ,
- XYZ_0,
- data['Y_b'],
- data['L'],
- LLAB_InductionFactors(1,
- data['F_S'],
- data['F_L'],
- data['F_C']))
+ specification = XYZ_to_LLAB(XYZ, XYZ_0, data['Y_b'], data['L'],
+ LLAB_InductionFactors(
+ 1, data['F_S'], data['F_L'],
+ data['F_C']))
return specification
@@ -92,8 +89,9 @@ def test_examples(self):
"""
with mock.patch('colour.appearance.llab.LLAB_RGB_TO_XYZ_MATRIX',
- np.around(np.linalg.inv(llab.LLAB_XYZ_TO_RGB_MATRIX),
- decimals=4)):
+ np.around(
+ np.linalg.inv(llab.LLAB_XYZ_TO_RGB_MATRIX),
+ decimals=4)):
for test in super(TestLLABColourAppearanceModel,
self).test_examples():
yield test
@@ -115,8 +113,9 @@ def test_n_dimensional_examples(self):
"""
with mock.patch('colour.appearance.llab.LLAB_RGB_TO_XYZ_MATRIX',
- np.around(np.linalg.inv(llab.LLAB_XYZ_TO_RGB_MATRIX),
- decimals=4)):
+ np.around(
+ np.linalg.inv(llab.LLAB_XYZ_TO_RGB_MATRIX),
+ decimals=4)):
for test in super(TestLLABColourAppearanceModel,
self).test_n_dimensional_examples():
yield test
diff --git a/colour/appearance/tests/tests_nayatani95.py b/colour/appearance/tests/tests_nayatani95.py
index d65da90c5b..e8b4a34569 100644
--- a/colour/appearance/tests/tests_nayatani95.py
+++ b/colour/appearance/tests/tests_nayatani95.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.nayatani95` module.
"""
@@ -32,13 +31,15 @@ class TestNayatani95ColourAppearanceModel(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'nayatani95.csv'
- OUTPUT_ATTRIBUTES = {'Lstar_P': 'Lstar_P',
- 'C': 'C',
- 'theta': 'h',
- 'S': 's',
- 'B_r': 'Q',
- 'M': 'M',
- 'Lstar_N': 'Lstar_N'}
+ OUTPUT_ATTRIBUTES = {
+ 'Lstar_P': 'Lstar_P',
+ 'C': 'C',
+ 'theta': 'h',
+ 'S': 's',
+ 'B_r': 'Q',
+ 'M': 'M',
+ 'Lstar_N': 'Lstar_N'
+ }
def output_specification_from_data(self, data):
"""
@@ -59,10 +60,7 @@ def output_specification_from_data(self, data):
XYZ = tstack((data['X'], data['Y'], data['Z']))
XYZ_n = tstack((data['X_n'], data['Y_n'], data['Z_n']))
- specification = XYZ_to_Nayatani95(XYZ,
- XYZ_n,
- data['Y_o'],
- data['E_o'],
+ specification = XYZ_to_Nayatani95(XYZ, XYZ_n, data['Y_o'], data['E_o'],
data['E_or'])
return specification
diff --git a/colour/appearance/tests/tests_rlab.py b/colour/appearance/tests/tests_rlab.py
index 92794d29c1..32abbf9d06 100644
--- a/colour/appearance/tests/tests_rlab.py
+++ b/colour/appearance/tests/tests_rlab.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.appearance.rlab` module.
"""
@@ -32,12 +31,14 @@ class TestRLABColourAppearanceModel(ColourAppearanceModelTest):
FIXTURE_BASENAME = 'rlab.csv'
- OUTPUT_ATTRIBUTES = {'LR': 'J',
- 'CR': 'C',
- 'hR': 'h',
- 'sR': 's',
- 'aR': 'a',
- 'bR': 'b'}
+ OUTPUT_ATTRIBUTES = {
+ 'LR': 'J',
+ 'CR': 'C',
+ 'hR': 'h',
+ 'sR': 's',
+ 'aR': 'a',
+ 'bR': 'b'
+ }
def output_specification_from_data(self, data):
"""
@@ -58,10 +59,7 @@ def output_specification_from_data(self, data):
XYZ = tstack((data['X'], data['Y'], data['Z']))
XYZ_n = tstack((data['X_n'], data['Y_n'], data['Z_n']))
- specification = XYZ_to_RLAB(XYZ,
- XYZ_n,
- data['Y_n2'],
- data['sigma'],
+ specification = XYZ_to_RLAB(XYZ, XYZ_n, data['Y_n2'], data['sigma'],
data['D'])
return specification
diff --git a/colour/biochemistry/__init__.py b/colour/biochemistry/__init__.py
new file mode 100644
index 0000000000..832a877336
--- /dev/null
+++ b/colour/biochemistry/__init__.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from __future__ import absolute_import
+
+from .michaelis_menten import (reaction_rate_MichealisMenten,
+ substrate_concentration_MichealisMenten)
+
+__all__ = []
+__all__ += [
+ 'reaction_rate_MichealisMenten', 'substrate_concentration_MichealisMenten'
+]
diff --git a/colour/biochemistry/michaelis_menten.py b/colour/biochemistry/michaelis_menten.py
new file mode 100644
index 0000000000..a0e7fb5ba7
--- /dev/null
+++ b/colour/biochemistry/michaelis_menten.py
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Michaelis–Menten Kinetics
+=========================
+
+Implements support for *Michaelis–Menten* kinetics, a model of enzyme kinetics:
+
+- :func:`reaction_rate_MichealisMenten`
+- :func:`substrate_concentration_MichealisMenten`
+
+See Also
+--------
+`Michaelis-Menten Kinetics
+`_
+
+References
+----------
+.. [1] Wikipedia. (n.d.). Michaelis–Menten kinetics. Retrieved April 29, 2017,
+ from https://en.wikipedia.org/wiki/Michaelis–Menten_kinetics
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = [
+ 'reaction_rate_MichealisMenten', 'substrate_concentration_MichealisMenten'
+]
+
+
+def reaction_rate_MichealisMenten(S, V_max, K_m):
+ """
+ Describes the rate of enzymatic reactions, by relating reaction rate
+ :math:`v` to concentration of a substrate :math:`S`.
+
+ Parameters
+ ----------
+ S : array_like
+ Concentration of a substrate :math:`S`.
+ V_max : array_like
+ Maximum rate :math:`V_{max}` achieved by the system, at saturating
+ substrate concentration.
+ K_m : array_like
+ Substrate concentration :math:`V_{max}` at which the reaction rate is
+ half of :math:`V_{max}`.
+
+ Returns
+ -------
+ array_like
+ Reaction rate :math:`v`.
+
+ Examples
+ --------
+ >>> reaction_rate_MichealisMenten(0.5, 2.5, 0.8) # doctest: +ELLIPSIS
+ 0.9615384...
+ """
+
+ S = np.asarray(S)
+ V_max = np.asarray(V_max)
+ K_m = np.asarray(K_m)
+
+ v = (V_max * S) / (K_m + S)
+
+ return v
+
+
+def substrate_concentration_MichealisMenten(v, V_max, K_m):
+ """
+ Describes the rate of enzymatic reactions, by relating concentration of a
+ substrate :math:`S` to reaction rate :math:`v`.
+
+ Parameters
+ ----------
+ v : array_like
+ Reaction rate :math:`v`.
+ V_max : array_like
+ Maximum rate :math:`V_{max}` achieved by the system, at saturating
+ substrate concentration.
+ K_m : array_like
+ Substrate concentration :math:`V_{max}` at which the reaction rate is
+ half of :math:`V_{max}`.
+
+ Returns
+ -------
+ array_like
+ Concentration of a substrate :math:`S`.
+
+ Examples
+ --------
+ >>> substrate_concentration_MichealisMenten(
+ ... 0.961538461538461, 2.5, 0.8) # doctest: +ELLIPSIS
+ 0.4999999...
+ """
+
+ v = np.asarray(v)
+ V_max = np.asarray(V_max)
+ K_m = np.asarray(K_m)
+
+ S = (v * K_m) / (V_max - v)
+
+ return S
diff --git a/colour/biochemistry/tests/__init__.py b/colour/biochemistry/tests/__init__.py
new file mode 100644
index 0000000000..faa18be5bb
--- /dev/null
+++ b/colour/biochemistry/tests/__init__.py
@@ -0,0 +1,2 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
diff --git a/colour/biochemistry/tests/tests_michaelis_menten.py b/colour/biochemistry/tests/tests_michaelis_menten.py
new file mode 100644
index 0000000000..5a87407654
--- /dev/null
+++ b/colour/biochemistry/tests/tests_michaelis_menten.py
@@ -0,0 +1,187 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.biochemistry.michaelis_menten` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+from itertools import permutations
+
+from colour.biochemistry import (reaction_rate_MichealisMenten,
+ substrate_concentration_MichealisMenten)
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = [
+ 'TestReactionRateMichealisMenten',
+ 'TestSubstrateConcentrationMichealisMenten'
+]
+
+
+class TestReactionRateMichealisMenten(unittest.TestCase):
+ """
+ Defines :func:`colour.biochemistry.michaelis_menten.\
+reaction_rate_MichealisMenten` definition unit tests methods.
+ """
+
+ def test_reaction_rate_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+reaction_rate_MichealisMenten` definition.
+ """
+
+ self.assertAlmostEqual(
+ reaction_rate_MichealisMenten(0.25, 0.5, 0.25),
+ 0.250000000000000,
+ places=7)
+
+ self.assertAlmostEqual(
+ reaction_rate_MichealisMenten(0.5, 0.5, 0.25),
+ 0.333333333333333,
+ places=7)
+
+ self.assertAlmostEqual(
+ reaction_rate_MichealisMenten(0.65, 0.75, 0.35),
+ 0.487500000000000,
+ places=7)
+
+ def test_n_dimensional_reaction_rate_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+reaction_rate_MichealisMenten` definition n-dimensional arrays
+ support.
+ """
+
+ v = 0.5
+ V_max = 0.5
+ K_m = 0.25
+ S = 0.333333333333333
+ np.testing.assert_almost_equal(
+ reaction_rate_MichealisMenten(v, V_max, K_m), S, decimal=7)
+
+ v = np.tile(v, (6, 1))
+ S = np.tile(S, (6, 1))
+ np.testing.assert_almost_equal(
+ reaction_rate_MichealisMenten(v, V_max, K_m), S, decimal=7)
+
+ V_max = np.tile(V_max, (6, 1))
+ K_m = np.tile(K_m, (6, 1))
+ np.testing.assert_almost_equal(
+ reaction_rate_MichealisMenten(v, V_max, K_m), S, decimal=7)
+
+ v = np.reshape(v, (2, 3, 1))
+ V_max = np.reshape(V_max, (2, 3, 1))
+ K_m = np.reshape(K_m, (2, 3, 1))
+ S = np.reshape(S, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ reaction_rate_MichealisMenten(v, V_max, K_m), S, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_reaction_rate_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+reaction_rate_MichealisMenten` definition nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ v = np.array(case)
+ V_max = np.array(case)
+ K_m = np.array(case)
+ reaction_rate_MichealisMenten(v, V_max, K_m)
+
+
+class TestSubstrateConcentrationMichealisMenten(unittest.TestCase):
+ """
+ Defines :func:`colour.biochemistry.michaelis_menten.\
+reaction_rate_MichealisMenten` definition unit tests methods.
+ """
+
+ def test_substrate_concentration_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+substrate_concentration_MichealisMenten` definition.
+ """
+
+ self.assertAlmostEqual(
+ substrate_concentration_MichealisMenten(0.25, 0.5, 0.25),
+ 0.250000000000000,
+ places=7)
+
+ self.assertAlmostEqual(
+ substrate_concentration_MichealisMenten(1 / 3, 0.5, 0.25),
+ 0.500000000000000,
+ places=7)
+
+ self.assertAlmostEqual(
+ substrate_concentration_MichealisMenten(0.4875, 0.75, 0.35),
+ 0.650000000000000,
+ places=7)
+
+ def test_n_dimensional_substrate_concentration_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+substrate_concentration_MichealisMenten` definition n-dimensional arrays
+ support.
+ """
+
+ S = 1 / 3
+ V_max = 0.5
+ K_m = 0.25
+ v = 0.5
+ np.testing.assert_almost_equal(
+ substrate_concentration_MichealisMenten(S, V_max, K_m),
+ v,
+ decimal=7)
+
+ S = np.tile(S, (6, 1))
+ v = np.tile(v, (6, 1))
+ np.testing.assert_almost_equal(
+ substrate_concentration_MichealisMenten(S, V_max, K_m),
+ v,
+ decimal=7)
+
+ V_max = np.tile(V_max, (6, 1))
+ K_m = np.tile(K_m, (6, 1))
+ np.testing.assert_almost_equal(
+ substrate_concentration_MichealisMenten(S, V_max, K_m),
+ v,
+ decimal=7)
+
+ S = np.reshape(S, (2, 3, 1))
+ V_max = np.reshape(V_max, (2, 3, 1))
+ K_m = np.reshape(K_m, (2, 3, 1))
+ v = np.reshape(v, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ substrate_concentration_MichealisMenten(S, V_max, K_m),
+ v,
+ decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_substrate_concentration_MichealisMenten(self):
+ """
+ Tests :func:`colour.biochemistry.michaelis_menten.\
+substrate_concentration_MichealisMenten` definition nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ s = np.array(case)
+ V_max = np.array(case)
+ K_m = np.array(case)
+ substrate_concentration_MichealisMenten(s, V_max, K_m)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/characterisation/cameras.py b/colour/characterisation/cameras.py
index 2b70623c8f..8c1aa68f2e 100644
--- a/colour/characterisation/cameras.py
+++ b/colour/characterisation/cameras.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Cameras Spectral Sensitivities
==============================
@@ -55,8 +54,12 @@ def __init__(self, name, data):
self,
name,
data,
- mapping={'x': 'red', 'y': 'green', 'z': 'blue'},
- labels={'x': 'R', 'y': 'G', 'z': 'B'},
+ mapping={'x': 'red',
+ 'y': 'green',
+ 'z': 'blue'},
+ labels={'x': 'R',
+ 'y': 'G',
+ 'z': 'B'},
title=name)
@property
diff --git a/colour/characterisation/dataset/__init__.py b/colour/characterisation/dataset/__init__.py
index 4dd00317f9..29adc66100 100644
--- a/colour/characterisation/dataset/__init__.py
+++ b/colour/characterisation/dataset/__init__.py
@@ -4,15 +4,15 @@
from __future__ import absolute_import
from .cameras import CAMERAS_RGB_SPECTRAL_SENSITIVITIES
-from .colour_checkers import (
- COLOURCHECKERS,
- COLOURCHECKER_INDEXES_TO_NAMES_MAPPING,
- COLOURCHECKERS_SPDS)
+from .colour_checkers import (COLOURCHECKERS,
+ COLOURCHECKER_INDEXES_TO_NAMES_MAPPING,
+ COLOURCHECKERS_SPDS)
from .displays import DISPLAYS_RGB_PRIMARIES
__all__ = []
__all__ += ['CAMERAS_RGB_SPECTRAL_SENSITIVITIES']
-__all__ += ['COLOURCHECKERS',
- 'COLOURCHECKER_INDEXES_TO_NAMES_MAPPING',
- 'COLOURCHECKERS_SPDS']
+__all__ += [
+ 'COLOURCHECKERS', 'COLOURCHECKER_INDEXES_TO_NAMES_MAPPING',
+ 'COLOURCHECKERS_SPDS'
+]
__all__ += ['DISPLAYS_RGB_PRIMARIES']
diff --git a/colour/characterisation/dataset/cameras/__init__.py b/colour/characterisation/dataset/cameras/__init__.py
index be853939ae..a67282249c 100644
--- a/colour/characterisation/dataset/cameras/__init__.py
+++ b/colour/characterisation/dataset/cameras/__init__.py
@@ -3,10 +3,10 @@
from __future__ import absolute_import
-from .dslr import DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES
+from .dslr import DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES
from colour.utilities import CaseInsensitiveMapping
CAMERAS_RGB_SPECTRAL_SENSITIVITIES = CaseInsensitiveMapping(
- DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES)
+ DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES)
__all__ = ['CAMERAS_RGB_SPECTRAL_SENSITIVITIES']
diff --git a/colour/characterisation/dataset/cameras/dslr/__init__.py b/colour/characterisation/dataset/cameras/dslr/__init__.py
index 2f8af1a9e3..60ec910b13 100644
--- a/colour/characterisation/dataset/cameras/dslr/__init__.py
+++ b/colour/characterisation/dataset/cameras/dslr/__init__.py
@@ -3,6 +3,6 @@
from __future__ import absolute_import
-from .spectral_sensitivities import DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES
+from .spectral_sensitivities import DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES
-__all__ = ['DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES']
+__all__ = ['DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES']
diff --git a/colour/characterisation/dataset/cameras/dslr/spectral_sensitivities.py b/colour/characterisation/dataset/cameras/dslr/spectral_sensitivities.py
index 146742fa6a..227ccadcb1 100644
--- a/colour/characterisation/dataset/cameras/dslr/spectral_sensitivities.py
+++ b/colour/characterisation/dataset/cameras/dslr/spectral_sensitivities.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
DSLR Cameras Spectral Sensitivities
===================================
@@ -46,10 +45,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA',
- 'DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES']
+__all__ = [
+ 'DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA',
+ 'DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES'
+]
-DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA = {
+DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA = {
'Nikon 5100 (NPL)': {
'red': {
380.0: 0.00156384299336578000,
@@ -132,7 +133,8 @@
765.0: 0.00000000000000000000,
770.0: 8.5599999999999994e-05,
775.0: 0.00013831372865247499,
- 780.0: 3.6199999999999999e-05},
+ 780.0: 3.6199999999999999e-05
+ },
'green': {
380.0: 0.00011500000000000000,
385.0: 0.00152114360178015000,
@@ -214,7 +216,8 @@
765.0: 0.00000000000000000000,
770.0: 0.00013799999999999999,
775.0: 0.0001786501727059410,
- 780.0: 4.2500000000000003e-05},
+ 780.0: 4.2500000000000003e-05
+ },
'blue': {
380.0: 0.00180956039402335990,
385.0: 0.00048982814544150399,
@@ -296,7 +299,9 @@
765.0: 6.1799999999999998e-05,
770.0: 0.00026260703183506501,
775.0: 0.00028050537004191899,
- 780.0: 0.00000000000000000000}},
+ 780.0: 0.00000000000000000000
+ }
+ },
'Sigma SDMerill (NPL)': {
'red': {
400.0: 0.00562107440608700020,
@@ -327,7 +332,8 @@
650.0: 0.92085127736137995000,
660.0: 0.18143311631425299000,
670.0: 0.00630978795372749960,
- 680.0: 0.00528874383171553000},
+ 680.0: 0.00528874383171553000
+ },
'green': {
400.0: 0.00632809751263116970,
410.0: 0.00976180459591275040,
@@ -357,7 +363,8 @@
650.0: 0.76165184741615699000,
660.0: 0.14052437057150499000,
670.0: 0.00414367215817645990,
- 680.0: 0.00183198958165669010},
+ 680.0: 0.00183198958165669010
+ },
'blue': {
400.0: 0.16215942413307899000,
410.0: 0.28549837804628603000,
@@ -387,18 +394,25 @@
650.0: 0.46538831744516401000,
660.0: 0.07961907836720690000,
670.0: 0.00059244446107236802,
- 680.0: 0.00468563680483140980}}}
+ 680.0: 0.00468563680483140980
+ }
+ }
+}
-DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES = CaseInsensitiveMapping({
- 'Nikon 5100 (NPL)': RGB_SpectralSensitivities(
- 'Nikon 5100 (NPL)',
- DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Nikon 5100 (NPL)']),
- 'Sigma SDMerill (NPL)': RGB_SpectralSensitivities(
- 'Sigma SDMerill (NPL)',
- DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Sigma SDMerill (NPL)'])})
+DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES = CaseInsensitiveMapping({
+ 'Nikon 5100 (NPL)':
+ RGB_SpectralSensitivities(
+ 'Nikon 5100 (NPL)',
+ DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Nikon 5100 (NPL)']),
+ 'Sigma SDMerill (NPL)':
+ RGB_SpectralSensitivities(
+ 'Sigma SDMerill (NPL)',
+ DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA[
+ 'Sigma SDMerill (NPL)'])
+}) # yapf: disable
"""
*DSLR* cameras *RGB* spectral sensitivities.
-DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES : CaseInsensitiveMapping
+DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES : CaseInsensitiveMapping
**{Nikon 5100 (NPL), Sigma SDMerill (NPL)}**
"""
diff --git a/colour/characterisation/dataset/colour_checkers/__init__.py b/colour/characterisation/dataset/colour_checkers/__init__.py
index 85d93de896..1175352eab 100644
--- a/colour/characterisation/dataset/colour_checkers/__init__.py
+++ b/colour/characterisation/dataset/colour_checkers/__init__.py
@@ -6,6 +6,7 @@
from .chromaticity_coordinates import COLOURCHECKERS
from .spds import COLOURCHECKER_INDEXES_TO_NAMES_MAPPING, COLOURCHECKERS_SPDS
-__all__ = ['COLOURCHECKERS',
- 'COLOURCHECKER_INDEXES_TO_NAMES_MAPPING',
- 'COLOURCHECKERS_SPDS']
+__all__ = [
+ 'COLOURCHECKERS', 'COLOURCHECKER_INDEXES_TO_NAMES_MAPPING',
+ 'COLOURCHECKERS_SPDS'
+]
diff --git a/colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py b/colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py
index 22422d564a..6976805ae7 100644
--- a/colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py
+++ b/colour/characterisation/dataset/colour_checkers/chromaticity_coordinates.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ColourCheckers Chromaticity Coordinates
=======================================
@@ -51,24 +50,20 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ColourChecker_Specification',
- 'ColourChecker',
- 'BABELCOLOR_AVERAGE_DATA',
- 'BABELCOLOR_AVERAGE_ILLUMINANT',
- 'BABELCOLOR_AVERAGE',
- 'COLORCHECKER_2005_DATA',
- 'COLORCHECKER_2005_ILLUMINANT',
- 'COLORCHECKER_2005',
- 'COLORCHECKER_1976_DATA',
- 'COLORCHECKER_1976_ILLUMINANT',
- 'COLORCHECKER_1976',
- 'COLOURCHECKERS']
-
-ColourChecker_Specification = namedtuple(
- 'ColourChecker_Specification', ('index', 'name', 'xyY'))
+__all__ = [
+ 'ColourChecker_Specification', 'ColourChecker', 'BABELCOLOR_AVERAGE_DATA',
+ 'BABELCOLOR_AVERAGE_ILLUMINANT', 'BABELCOLOR_AVERAGE',
+ 'COLORCHECKER_2005_DATA', 'COLORCHECKER_2005_ILLUMINANT',
+ 'COLORCHECKER_2005', 'COLORCHECKER_1976_DATA',
+ 'COLORCHECKER_1976_ILLUMINANT', 'COLORCHECKER_1976', 'COLOURCHECKERS'
+]
+
+ColourChecker_Specification = namedtuple('ColourChecker_Specification',
+ ('index', 'name', 'xyY'))
ColourChecker = namedtuple('ColourChecker', ('name', 'data', 'illuminant'))
+# yapf: disable
BABELCOLOR_AVERAGE_DATA = (
(1, 'dark skin', np.array([0.4325, 0.3788, 0.1034])),
(2, 'light skin', np.array([0.4191, 0.3748, 0.3525])),
@@ -94,6 +89,7 @@
(22, 'neutral 5 (.70 D)', np.array([0.3438, 0.3589, 0.1912])),
(23, 'neutral 3.5 (1.05 D)', np.array([0.3423, 0.3576, 0.0893])),
(24, 'black 2 (1.5 D)', np.array([0.3439, 0.3565, 0.0320])))
+# yapf: enable
BABELCOLOR_AVERAGE_ILLUMINANT = (
ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'])
@@ -103,14 +99,16 @@
BABELCOLOR_AVERAGE_ILLUMINANT : ndarray
"""
-BABELCOLOR_AVERAGE = [ColourChecker_Specification(*x) for x in
- BABELCOLOR_AVERAGE_DATA]
+BABELCOLOR_AVERAGE = [
+ ColourChecker_Specification(*x) for x in BABELCOLOR_AVERAGE_DATA
+]
"""
Average data derived from measurements of 30 *ColourChecker* charts.
BABELCOLOR_AVERAGE : list
"""
+# yapf: disable
COLORCHECKER_2005_DATA = (
(1, 'dark skin', np.array([0.4316, 0.3777, 0.1008])),
(2, 'light skin', np.array([0.4197, 0.3744, 0.3495])),
@@ -136,6 +134,7 @@
(22, 'neutral 5 (.70 D)', np.array([0.3446, 0.3579, 0.1915])),
(23, 'neutral 3.5 (1.05 D)', np.array([0.3401, 0.3548, 0.0883])),
(24, 'black 2 (1.5 D)', np.array([0.3406, 0.3537, 0.0311])))
+# yapf: enable
COLORCHECKER_2005_ILLUMINANT = (
ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'])
@@ -145,14 +144,16 @@
COLORCHECKER_2005_ILLUMINANT : ndarray
"""
-COLORCHECKER_2005 = [ColourChecker_Specification(*x) for x in
- COLORCHECKER_2005_DATA]
+COLORCHECKER_2005 = [
+ ColourChecker_Specification(*x) for x in COLORCHECKER_2005_DATA
+]
"""
Reference data from *GretagMacbeth (2005)*.
COLORCHECKER_2005 : list
"""
+# yapf: disable
COLORCHECKER_1976_DATA = (
(1, 'dark skin', np.array([0.4002, 0.3504, 0.1005])),
(2, 'light skin', np.array([0.3773, 0.3446, 0.3582])),
@@ -178,6 +179,7 @@
(22, 'neutral 5 (.70 D)', np.array([0.3101, 0.3163, 0.1977])),
(23, 'neutral 3.5 (1.05 D)', np.array([0.3101, 0.3163, 0.0900])),
(24, 'black 2 (1.5 D)', np.array([0.3101, 0.3163, 0.0313])))
+# yapf: enable
COLORCHECKER_1976_ILLUMINANT = (
ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['C'])
@@ -187,8 +189,9 @@
COLORCHECKER_1976_ILLUMINANT : ndarray
"""
-COLORCHECKER_1976 = [ColourChecker_Specification(*x) for x in
- COLORCHECKER_1976_DATA]
+COLORCHECKER_1976 = [
+ ColourChecker_Specification(*x) for x in COLORCHECKER_1976_DATA
+]
"""
*ColourChecker* developed by *McCamy et al.* at Macbeth, a Division of
Kollmorgen.
@@ -197,18 +200,22 @@
"""
COLOURCHECKERS = CaseInsensitiveMapping({
- 'BabelColor Average': ColourChecker(
- 'BabelColor Average',
- BABELCOLOR_AVERAGE,
- BABELCOLOR_AVERAGE_ILLUMINANT),
- 'ColorChecker 2005': ColourChecker(
- 'ColorChecker 2005',
- COLORCHECKER_2005,
- COLORCHECKER_2005_ILLUMINANT),
- 'ColorChecker 1976': ColourChecker(
- 'ColorChecker 1976',
- COLORCHECKER_1976,
- COLORCHECKER_1976_ILLUMINANT)})
+ 'BabelColor Average':
+ ColourChecker(
+ 'BabelColor Average',
+ BABELCOLOR_AVERAGE,
+ BABELCOLOR_AVERAGE_ILLUMINANT),
+ 'ColorChecker 2005':
+ ColourChecker(
+ 'ColorChecker 2005',
+ COLORCHECKER_2005,
+ COLORCHECKER_2005_ILLUMINANT),
+ 'ColorChecker 1976':
+ ColourChecker(
+ 'ColorChecker 1976',
+ COLORCHECKER_1976,
+ COLORCHECKER_1976_ILLUMINANT)
+}) # yapf: disable
"""
Aggregated *ColourCheckers* chromaticity coordinates.
diff --git a/colour/characterisation/dataset/colour_checkers/spds.py b/colour/characterisation/dataset/colour_checkers/spds.py
index a2b951aeea..5f4b332068 100644
--- a/colour/characterisation/dataset/colour_checkers/spds.py
+++ b/colour/characterisation/dataset/colour_checkers/spds.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ColourCheckers Spectral Power Distributions
===========================================
@@ -49,12 +48,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['COLOURCHECKER_INDEXES_TO_NAMES_MAPPING',
- 'COLORCHECKER_N_OHTA_SPDS_DATA',
- 'COLORCHECKER_N_OHTA_SPDS',
- 'BABELCOLOR_AVERAGE_SPDS_DATA',
- 'BABELCOLOR_AVERAGE_SPDS',
- 'COLOURCHECKERS_SPDS']
+__all__ = [
+ 'COLOURCHECKER_INDEXES_TO_NAMES_MAPPING', 'COLORCHECKER_N_OHTA_SPDS_DATA',
+ 'COLORCHECKER_N_OHTA_SPDS', 'BABELCOLOR_AVERAGE_SPDS_DATA',
+ 'BABELCOLOR_AVERAGE_SPDS', 'COLOURCHECKERS_SPDS'
+]
COLOURCHECKER_INDEXES_TO_NAMES_MAPPING = {
1: 'dark skin',
@@ -80,7 +78,8 @@
21: 'neutral 6.5 (.44 D)',
22: 'neutral 5 (.70 D)',
23: 'neutral 3.5 (1.05 D)',
- 24: 'black 2 (1.5 D)'}
+ 24: 'black 2 (1.5 D)'
+}
COLORCHECKER_N_OHTA_SPDS_DATA = {
'dark skin': {
@@ -164,7 +163,8 @@
765: 0.465,
770: 0.448,
775: 0.432,
- 780: 0.421},
+ 780: 0.421
+ },
'light skin': {
380: 0.103,
385: 0.120,
@@ -246,7 +246,8 @@
765: 0.799,
770: 0.771,
775: 0.747,
- 780: 0.734},
+ 780: 0.734
+ },
'blue sky': {
380: 0.113,
385: 0.138,
@@ -328,7 +329,8 @@
765: 0.107,
770: 0.110,
775: 0.115,
- 780: 0.12},
+ 780: 0.12
+ },
'foliage': {
380: 0.048,
385: 0.049,
@@ -410,7 +412,8 @@
765: 0.368,
770: 0.355,
775: 0.346,
- 780: 0.341},
+ 780: 0.341
+ },
'blue flower': {
380: 0.123,
385: 0.152,
@@ -492,7 +495,8 @@
765: 0.515,
770: 0.500,
775: 0.491,
- 780: 0.487},
+ 780: 0.487
+ },
'bluish green': {
380: 0.110,
385: 0.133,
@@ -574,7 +578,8 @@
765: 0.301,
770: 0.297,
775: 0.296,
- 780: 0.296},
+ 780: 0.296
+ },
'orange': {
380: 0.053,
385: 0.054,
@@ -656,7 +661,8 @@
765: 0.639,
770: 0.616,
775: 0.598,
- 780: 0.582},
+ 780: 0.582
+ },
'purplish blue': {
380: 0.099,
385: 0.120,
@@ -738,7 +744,8 @@
765: 0.259,
770: 0.275,
775: 0.294,
- 780: 0.316},
+ 780: 0.316
+ },
'moderate red': {
380: 0.096,
385: 0.108,
@@ -820,7 +827,8 @@
765: 0.584,
770: 0.566,
775: 0.551,
- 780: 0.54},
+ 780: 0.54
+ },
'purple': {
380: 0.101,
385: 0.115,
@@ -902,7 +910,8 @@
765: 0.495,
770: 0.482,
775: 0.471,
- 780: 0.467},
+ 780: 0.467
+ },
'yellow green': {
380: 0.056,
385: 0.058,
@@ -984,7 +993,8 @@
765: 0.436,
770: 0.426,
775: 0.413,
- 780: 0.404},
+ 780: 0.404
+ },
'orange yellow': {
380: 0.060,
385: 0.061,
@@ -1066,7 +1076,8 @@
765: 0.698,
770: 0.673,
775: 0.653,
- 780: 0.639},
+ 780: 0.639
+ },
'blue': {
380: 0.069,
385: 0.081,
@@ -1148,7 +1159,8 @@
765: 0.154,
770: 0.168,
775: 0.186,
- 780: 0.204},
+ 780: 0.204
+ },
'green': {
380: 0.055,
385: 0.056,
@@ -1230,7 +1242,8 @@
765: 0.111,
770: 0.112,
775: 0.112,
- 780: 0.112},
+ 780: 0.112
+ },
'red': {
380: 0.052,
385: 0.052,
@@ -1312,7 +1325,8 @@
765: 0.727,
770: 0.702,
775: 0.680,
- 780: 0.664},
+ 780: 0.664
+ },
'yellow': {
380: 0.054,
385: 0.053,
@@ -1394,7 +1408,8 @@
765: 0.781,
770: 0.752,
775: 0.728,
- 780: 0.71},
+ 780: 0.71
+ },
'magenta': {
380: 0.118,
385: 0.142,
@@ -1476,7 +1491,8 @@
765: 0.813,
770: 0.785,
775: 0.765,
- 780: 0.752},
+ 780: 0.752
+ },
'cyan': {
380: 0.093,
385: 0.110,
@@ -1558,7 +1574,8 @@
765: 0.191,
770: 0.200,
775: 0.208,
- 780: 0.214},
+ 780: 0.214
+ },
'white 9.5 (.05 D)': {
380: 0.153,
385: 0.189,
@@ -1640,7 +1657,8 @@
765: 0.881,
770: 0.880,
775: 0.880,
- 780: 0.879},
+ 780: 0.879
+ },
'neutral 8 (.23 D)': {
380: 0.150,
385: 0.184,
@@ -1722,7 +1740,8 @@
765: 0.554,
770: 0.553,
775: 0.551,
- 780: 0.55},
+ 780: 0.55
+ },
'neutral 6.5 (.44 D)': {
380: 0.138,
385: 0.167,
@@ -1804,7 +1823,8 @@
765: 0.328,
770: 0.327,
775: 0.326,
- 780: 0.325},
+ 780: 0.325
+ },
'neutral 5 (.70 D)': {
380: 0.113,
385: 0.131,
@@ -1886,7 +1906,8 @@
765: 0.185,
770: 0.184,
775: 0.184,
- 780: 0.183},
+ 780: 0.183
+ },
'neutral 3.5 (1.05 D)': {
380: 0.074,
385: 0.079,
@@ -1968,7 +1989,8 @@
765: 0.084,
770: 0.083,
775: 0.083,
- 780: 0.083},
+ 780: 0.083
+ },
'black 2 (1.5 D)': {
380: 0.032,
385: 0.033,
@@ -2050,11 +2072,13 @@
765: 0.032,
770: 0.032,
775: 0.032,
- 780: 0.032}}
+ 780: 0.032
+ }
+}
COLORCHECKER_N_OHTA_SPDS = dict(
- (key, SpectralPowerDistribution(key, value)) for key, value in
- COLORCHECKER_N_OHTA_SPDS_DATA.items())
+ (key, SpectralPowerDistribution(key, value))
+ for key, value in COLORCHECKER_N_OHTA_SPDS_DATA.items())
"""
Measured by *Ohta (1997)*.
@@ -2098,7 +2122,8 @@
700: 0.182,
710: 0.187,
720: 0.196,
- 730: 0.209},
+ 730: 0.209
+ },
'light skin': {
380: 0.117,
390: 0.143,
@@ -2135,7 +2160,8 @@
700: 0.678,
710: 0.700,
720: 0.717,
- 730: 0.734},
+ 730: 0.734
+ },
'blue sky': {
380: 0.130,
390: 0.177,
@@ -2172,7 +2198,8 @@
700: 0.136,
710: 0.132,
720: 0.135,
- 730: 0.147},
+ 730: 0.147
+ },
'foliage': {
380: 0.051,
390: 0.054,
@@ -2209,7 +2236,8 @@
700: 0.115,
710: 0.120,
720: 0.125,
- 730: 0.13},
+ 730: 0.13
+ },
'blue flower': {
380: 0.144,
390: 0.198,
@@ -2246,7 +2274,8 @@
700: 0.358,
710: 0.365,
720: 0.377,
- 730: 0.398},
+ 730: 0.398
+ },
'bluish green': {
380: 0.136,
390: 0.179,
@@ -2283,7 +2312,8 @@
700: 0.232,
710: 0.233,
720: 0.229,
- 730: 0.229},
+ 730: 0.229
+ },
'orange': {
380: 0.054,
390: 0.054,
@@ -2320,7 +2350,8 @@
700: 0.655,
710: 0.663,
720: 0.663,
- 730: 0.667},
+ 730: 0.667
+ },
'purplish blue': {
380: 0.122,
390: 0.164,
@@ -2357,7 +2388,8 @@
700: 0.205,
710: 0.244,
720: 0.287,
- 730: 0.332},
+ 730: 0.332
+ },
'moderate red': {
380: 0.096,
390: 0.115,
@@ -2394,7 +2426,8 @@
700: 0.607,
710: 0.609,
720: 0.609,
- 730: 0.61},
+ 730: 0.61
+ },
'purple': {
380: 0.092,
390: 0.116,
@@ -2431,7 +2464,8 @@
700: 0.355,
710: 0.396,
720: 0.436,
- 730: 0.478},
+ 730: 0.478
+ },
'yellow green': {
380: 0.061,
390: 0.061,
@@ -2468,7 +2502,8 @@
700: 0.376,
710: 0.381,
720: 0.378,
- 730: 0.379},
+ 730: 0.379
+ },
'orange yellow': {
380: 0.063,
390: 0.063,
@@ -2505,7 +2540,8 @@
700: 0.673,
710: 0.680,
720: 0.684,
- 730: 0.688},
+ 730: 0.688
+ },
'blue': {
380: 0.066,
390: 0.079,
@@ -2542,7 +2578,8 @@
700: 0.048,
710: 0.052,
720: 0.057,
- 730: 0.065},
+ 730: 0.065
+ },
'green': {
380: 0.052,
390: 0.053,
@@ -2579,7 +2616,8 @@
700: 0.113,
710: 0.115,
720: 0.114,
- 730: 0.114},
+ 730: 0.114
+ },
'red': {
380: 0.050,
390: 0.049,
@@ -2616,7 +2654,8 @@
700: 0.724,
710: 0.730,
720: 0.734,
- 730: 0.738},
+ 730: 0.738
+ },
'yellow': {
380: 0.058,
390: 0.054,
@@ -2653,7 +2692,8 @@
700: 0.790,
710: 0.796,
720: 0.799,
- 730: 0.804},
+ 730: 0.804
+ },
'magenta': {
380: 0.145,
390: 0.195,
@@ -2690,7 +2730,8 @@
700: 0.803,
710: 0.812,
720: 0.817,
- 730: 0.825},
+ 730: 0.825
+ },
'cyan': {
380: 0.108,
390: 0.141,
@@ -2727,7 +2768,8 @@
700: 0.073,
710: 0.072,
720: 0.074,
- 730: 0.079},
+ 730: 0.079
+ },
'white 9.5 (.05 D)': {
380: 0.189,
390: 0.255,
@@ -2764,7 +2806,8 @@
700: 0.927,
710: 0.930,
720: 0.930,
- 730: 0.933},
+ 730: 0.933
+ },
'neutral 8 (.23 D)': {
380: 0.171,
390: 0.232,
@@ -2801,7 +2844,8 @@
700: 0.568,
710: 0.568,
720: 0.566,
- 730: 0.566},
+ 730: 0.566
+ },
'neutral 6.5 (.44 D)': {
380: 0.144,
390: 0.192,
@@ -2838,7 +2882,8 @@
700: 0.335,
710: 0.334,
720: 0.332,
- 730: 0.331},
+ 730: 0.331
+ },
'neutral 5 (.70 D)': {
380: 0.105,
390: 0.131,
@@ -2875,7 +2920,8 @@
700: 0.174,
710: 0.173,
720: 0.172,
- 730: 0.171},
+ 730: 0.171
+ },
'neutral 3.5 (1.05 D)': {
380: 0.068,
390: 0.077,
@@ -2912,7 +2958,8 @@
700: 0.082,
710: 0.081,
720: 0.081,
- 730: 0.081},
+ 730: 0.081
+ },
'black 2 (1.5 D)': {
380: 0.031,
390: 0.032,
@@ -2949,20 +2996,23 @@
700: 0.032,
710: 0.032,
720: 0.032,
- 730: 0.033}}
+ 730: 0.033
+ }
+}
BABELCOLOR_AVERAGE_SPDS = dict(
- (key, SpectralPowerDistribution(key, value)) for key, value in
- BABELCOLOR_AVERAGE_SPDS_DATA.items())
+ (key, SpectralPowerDistribution(key, value))
+ for key, value in BABELCOLOR_AVERAGE_SPDS_DATA.items())
"""
Average data derived from measurements of 30 *ColourChecker* charts.
BABELCOLOR_AVERAGE_SPDS : dict
"""
-COLOURCHECKERS_SPDS = CaseInsensitiveMapping(
- {'BabelColor Average': BABELCOLOR_AVERAGE_SPDS,
- 'ColorChecker N Ohta': COLORCHECKER_N_OHTA_SPDS})
+COLOURCHECKERS_SPDS = CaseInsensitiveMapping({
+ 'BabelColor Average': BABELCOLOR_AVERAGE_SPDS,
+ 'ColorChecker N Ohta': COLORCHECKER_N_OHTA_SPDS
+})
"""
Aggregated *ColourCheckers* spectral power distributions.
diff --git a/colour/characterisation/dataset/displays/__init__.py b/colour/characterisation/dataset/displays/__init__.py
index 47ad32ddf2..bf8dadf564 100644
--- a/colour/characterisation/dataset/displays/__init__.py
+++ b/colour/characterisation/dataset/displays/__init__.py
@@ -7,7 +7,6 @@
from .lcd import LCD_DISPLAYS_RGB_PRIMARIES
from colour.utilities import CaseInsensitiveMapping
-
DISPLAYS_RGB_PRIMARIES = CaseInsensitiveMapping(CRT_DISPLAYS_RGB_PRIMARIES)
DISPLAYS_RGB_PRIMARIES.update(LCD_DISPLAYS_RGB_PRIMARIES)
diff --git a/colour/characterisation/dataset/displays/crt/rgb_primaries.py b/colour/characterisation/dataset/displays/crt/rgb_primaries.py
index e63490a116..a95254aa26 100644
--- a/colour/characterisation/dataset/displays/crt/rgb_primaries.py
+++ b/colour/characterisation/dataset/displays/crt/rgb_primaries.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CRT Displays RGB Primaries
==========================
@@ -44,8 +43,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CRT_DISPLAYS_RGB_PRIMARIES_DATA',
- 'CRT_DISPLAYS_RGB_PRIMARIES']
+__all__ = ['CRT_DISPLAYS_RGB_PRIMARIES_DATA', 'CRT_DISPLAYS_RGB_PRIMARIES']
CRT_DISPLAYS_RGB_PRIMARIES_DATA = {
'Typical CRT Brainard 1997': {
@@ -130,7 +128,8 @@
765.0: 0.0067,
770.0: 0.0070,
775.0: 0.0073,
- 780.0: 0.0066},
+ 780.0: 0.0066
+ },
'green': {
380.0: 0.0018,
385.0: 0.0016,
@@ -212,7 +211,8 @@
765.0: 0.0018,
770.0: 0.0021,
775.0: 0.0015,
- 780.0: 0.0018},
+ 780.0: 0.0018
+ },
'blue': {
380.0: 0.0219,
385.0: 0.0336,
@@ -294,12 +294,17 @@
765.0: 0.0015,
770.0: 0.0028,
775.0: 0.0046,
- 780.0: 0.0058}}}
+ 780.0: 0.0058
+ }
+ }
+}
-CRT_DISPLAYS_RGB_PRIMARIES = CaseInsensitiveMapping(
- {'Typical CRT Brainard 1997': RGB_DisplayPrimaries(
- 'Typical CRT Brainard 1997',
- CRT_DISPLAYS_RGB_PRIMARIES_DATA['Typical CRT Brainard 1997'])})
+CRT_DISPLAYS_RGB_PRIMARIES = CaseInsensitiveMapping({
+ 'Typical CRT Brainard 1997':
+ RGB_DisplayPrimaries(
+ 'Typical CRT Brainard 1997',
+ CRT_DISPLAYS_RGB_PRIMARIES_DATA['Typical CRT Brainard 1997'])
+})
"""
*CRT* displays *RGB* primaries tri-spectral power distributions.
diff --git a/colour/characterisation/dataset/displays/lcd/rgb_primaries.py b/colour/characterisation/dataset/displays/lcd/rgb_primaries.py
index cae3831628..b87cd5de63 100644
--- a/colour/characterisation/dataset/displays/lcd/rgb_primaries.py
+++ b/colour/characterisation/dataset/displays/lcd/rgb_primaries.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
LCD Displays RGB Primaries
==========================
@@ -47,8 +46,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LCD_DISPLAYS_RGB_PRIMARIES_DATA',
- 'LCD_DISPLAYS_RGB_PRIMARIES']
+__all__ = ['LCD_DISPLAYS_RGB_PRIMARIES_DATA', 'LCD_DISPLAYS_RGB_PRIMARIES']
LCD_DISPLAYS_RGB_PRIMARIES_DATA = {
'Apple Studio Display': {
@@ -133,7 +131,8 @@
765: 0.0000,
770: 0.0000,
775: 0.0000,
- 780: 0.0000},
+ 780: 0.0000
+ },
'green': {
380: 0.0000,
385: 0.0000,
@@ -215,7 +214,8 @@
765: 0.0000,
770: 0.0000,
775: 0.0119,
- 780: 0.0000},
+ 780: 0.0000
+ },
'blue': {
380: 0.0000,
385: 0.0000,
@@ -297,12 +297,17 @@
765: 0.0000,
770: 0.0000,
775: 0.0000,
- 780: 0.0000}}}
+ 780: 0.0000
+ }
+ }
+}
-LCD_DISPLAYS_RGB_PRIMARIES = CaseInsensitiveMapping(
- {'Apple Studio Display': RGB_DisplayPrimaries(
- 'Apple Studio Display',
- LCD_DISPLAYS_RGB_PRIMARIES_DATA['Apple Studio Display'])})
+LCD_DISPLAYS_RGB_PRIMARIES = CaseInsensitiveMapping({
+ 'Apple Studio Display':
+ RGB_DisplayPrimaries(
+ 'Apple Studio Display',
+ LCD_DISPLAYS_RGB_PRIMARIES_DATA['Apple Studio Display'])
+})
"""
*LCD* displays *RGB* primaries tri-spectral power distributions.
diff --git a/colour/characterisation/displays.py b/colour/characterisation/displays.py
index ef264e79d4..e357e1b767 100644
--- a/colour/characterisation/displays.py
+++ b/colour/characterisation/displays.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RGB Displays
============
@@ -56,8 +55,12 @@ def __init__(self, name, data):
self,
name,
data,
- mapping={'x': 'red', 'y': 'green', 'z': 'blue'},
- labels={'x': 'R', 'y': 'G', 'z': 'B'},
+ mapping={'x': 'red',
+ 'y': 'green',
+ 'z': 'blue'},
+ labels={'x': 'R',
+ 'y': 'G',
+ 'z': 'B'},
title=name)
@property
diff --git a/colour/characterisation/fitting.py b/colour/characterisation/fitting.py
index 825d82db50..f389d5d8e4 100644
--- a/colour/characterisation/fitting.py
+++ b/colour/characterisation/fitting.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Fitting
==============
@@ -51,56 +50,56 @@ def first_order_colour_fit(m_1, m_2):
Examples
--------
- >>> m_1 = np.array([
- ... [0.17224810, 0.09170660, 0.06416938],
- ... [0.49189645, 0.27802050, 0.21923399],
- ... [0.10999751, 0.18658946, 0.29938611],
- ... [0.11666120, 0.14327905, 0.05713804],
- ... [0.18988879, 0.18227649, 0.36056247],
- ... [0.12501329, 0.42223442, 0.37027445],
- ... [0.64785606, 0.22396782, 0.03365194],
- ... [0.06761093, 0.11076896, 0.39779139],
- ... [0.49101797, 0.09448929, 0.11623839],
- ... [0.11622386, 0.04425753, 0.14469986],
- ... [0.36867946, 0.44545230, 0.06028681],
- ... [0.61632937, 0.32323906, 0.02437089],
- ... [0.03016472, 0.06153243, 0.29014596],
- ... [0.11103655, 0.30553067, 0.08149137],
- ... [0.41162190, 0.05816656, 0.04845934],
- ... [0.73339206, 0.53075188, 0.02475212],
- ... [0.47347718, 0.08834792, 0.30310315],
- ... [0.00000000, 0.25187016, 0.35062450],
- ... [0.76809639, 0.78486240, 0.77808297],
- ... [0.53822392, 0.54307997, 0.54710883],
- ... [0.35458526, 0.35318419, 0.35524431],
- ... [0.17976704, 0.18000531, 0.17991488],
- ... [0.09351417, 0.09510603, 0.09675027],
- ... [0.03405071, 0.03295077, 0.03702047]])
- >>> m_2 = np.array([
- ... [0.15579559, 0.09715755, 0.07514556],
- ... [0.39113140, 0.25943419, 0.21266708],
- ... [0.12824821, 0.18463570, 0.31508023],
- ... [0.12028974, 0.13455659, 0.07408400],
- ... [0.19368988, 0.21158946, 0.37955964],
- ... [0.19957425, 0.36085439, 0.40678123],
- ... [0.48896605, 0.20691688, 0.05816533],
- ... [0.09775522, 0.16710693, 0.47147724],
- ... [0.39358649, 0.12233400, 0.10526425],
- ... [0.10780332, 0.07258529, 0.16151473],
- ... [0.27502671, 0.34705454, 0.09728099],
- ... [0.43980441, 0.26880559, 0.05430533],
- ... [0.05887212, 0.11126272, 0.38552469],
- ... [0.12705825, 0.25787860, 0.13566464],
- ... [0.35612929, 0.07933258, 0.05118732],
- ... [0.48131976, 0.42082843, 0.07120612],
- ... [0.34665585, 0.15170714, 0.24969804],
- ... [0.08261116, 0.24588716, 0.48707733],
- ... [0.66054904, 0.65941137, 0.66376412],
- ... [0.48051509, 0.47870296, 0.48230082],
- ... [0.33045354, 0.32904184, 0.33228886],
- ... [0.18001305, 0.17978567, 0.18004416],
- ... [0.10283975, 0.10424680, 0.10384975],
- ... [0.04742204, 0.04772203, 0.04914226]])
+ >>> m_1 = np.array(
+ ... [[0.17224810, 0.09170660, 0.06416938],
+ ... [0.49189645, 0.27802050, 0.21923399],
+ ... [0.10999751, 0.18658946, 0.29938611],
+ ... [0.11666120, 0.14327905, 0.05713804],
+ ... [0.18988879, 0.18227649, 0.36056247],
+ ... [0.12501329, 0.42223442, 0.37027445],
+ ... [0.64785606, 0.22396782, 0.03365194],
+ ... [0.06761093, 0.11076896, 0.39779139],
+ ... [0.49101797, 0.09448929, 0.11623839],
+ ... [0.11622386, 0.04425753, 0.14469986],
+ ... [0.36867946, 0.44545230, 0.06028681],
+ ... [0.61632937, 0.32323906, 0.02437089],
+ ... [0.03016472, 0.06153243, 0.29014596],
+ ... [0.11103655, 0.30553067, 0.08149137],
+ ... [0.41162190, 0.05816656, 0.04845934],
+ ... [0.73339206, 0.53075188, 0.02475212],
+ ... [0.47347718, 0.08834792, 0.30310315],
+ ... [0.00000000, 0.25187016, 0.35062450],
+ ... [0.76809639, 0.78486240, 0.77808297],
+ ... [0.53822392, 0.54307997, 0.54710883],
+ ... [0.35458526, 0.35318419, 0.35524431],
+ ... [0.17976704, 0.18000531, 0.17991488],
+ ... [0.09351417, 0.09510603, 0.09675027],
+ ... [0.03405071, 0.03295077, 0.03702047]])
+ >>> m_2 = np.array(
+ ... [[0.15579559, 0.09715755, 0.07514556],
+ ... [0.39113140, 0.25943419, 0.21266708],
+ ... [0.12824821, 0.18463570, 0.31508023],
+ ... [0.12028974, 0.13455659, 0.07408400],
+ ... [0.19368988, 0.21158946, 0.37955964],
+ ... [0.19957425, 0.36085439, 0.40678123],
+ ... [0.48896605, 0.20691688, 0.05816533],
+ ... [0.09775522, 0.16710693, 0.47147724],
+ ... [0.39358649, 0.12233400, 0.10526425],
+ ... [0.10780332, 0.07258529, 0.16151473],
+ ... [0.27502671, 0.34705454, 0.09728099],
+ ... [0.43980441, 0.26880559, 0.05430533],
+ ... [0.05887212, 0.11126272, 0.38552469],
+ ... [0.12705825, 0.25787860, 0.13566464],
+ ... [0.35612929, 0.07933258, 0.05118732],
+ ... [0.48131976, 0.42082843, 0.07120612],
+ ... [0.34665585, 0.15170714, 0.24969804],
+ ... [0.08261116, 0.24588716, 0.48707733],
+ ... [0.66054904, 0.65941137, 0.66376412],
+ ... [0.48051509, 0.47870296, 0.48230082],
+ ... [0.33045354, 0.32904184, 0.33228886],
+ ... [0.18001305, 0.17978567, 0.18004416],
+ ... [0.10283975, 0.10424680, 0.10384975],
+ ... [0.04742204, 0.04772203, 0.04914226]])
>>> first_order_colour_fit(m_1, m_2) # doctest: +ELLIPSIS
array([[ 0.6982266..., 0.0307162..., 0.1621042...],
[ 0.0689349..., 0.6757961..., 0.1643038...],
diff --git a/colour/characterisation/tests/tests_cameras.py b/colour/characterisation/tests/tests_cameras.py
index c7602901b6..d88e827b07 100644
--- a/colour/characterisation/tests/tests_cameras.py
+++ b/colour/characterisation/tests/tests_cameras.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.characterisation.cameras` module.
"""
@@ -32,19 +31,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'mapping',
- 'labels',
- 'data',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape',
- 'red',
- 'green',
- 'blue')
+ required_attributes = ('name', 'mapping', 'labels', 'data', 'x', 'y',
+ 'z', 'wavelengths', 'values', 'shape', 'red',
+ 'green', 'blue')
for attribute in required_attributes:
self.assertIn(attribute, dir(RGB_SpectralSensitivities))
@@ -54,25 +43,11 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__sub__',
- '__mul__',
- '__div__',
- 'get',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__hash__', '__getitem__', '__setitem__',
+ '__iter__', '__contains__', '__len__', '__eq__',
+ '__ne__', '__add__', '__sub__', '__mul__',
+ '__div__', 'get', 'extrapolate', 'interpolate',
+ 'align', 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(RGB_SpectralSensitivities))
diff --git a/colour/characterisation/tests/tests_displays.py b/colour/characterisation/tests/tests_displays.py
index 0fab47af8e..e785126112 100644
--- a/colour/characterisation/tests/tests_displays.py
+++ b/colour/characterisation/tests/tests_displays.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.characterisation.displays` module.
"""
@@ -32,19 +31,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'mapping',
- 'labels',
- 'data',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape',
- 'red',
- 'green',
- 'blue')
+ required_attributes = ('name', 'mapping', 'labels', 'data', 'x', 'y',
+ 'z', 'wavelengths', 'values', 'shape', 'red',
+ 'green', 'blue')
for attribute in required_attributes:
self.assertIn(attribute, dir(RGB_DisplayPrimaries))
@@ -54,25 +43,11 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__sub__',
- '__mul__',
- '__div__',
- 'get',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__hash__', '__getitem__', '__setitem__',
+ '__iter__', '__contains__', '__len__', '__eq__',
+ '__ne__', '__add__', '__sub__', '__mul__',
+ '__div__', 'get', 'extrapolate', 'interpolate',
+ 'align', 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(RGB_DisplayPrimaries))
diff --git a/colour/characterisation/tests/tests_fitting.py b/colour/characterisation/tests/tests_fitting.py
index cfb4f4057b..bb0196cba4 100644
--- a/colour/characterisation/tests/tests_fitting.py
+++ b/colour/characterisation/tests/tests_fitting.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.characterisation.fitting.fitting` package.
"""
@@ -22,61 +21,59 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['M1',
- 'M2',
- 'TestFirstOrderColourFit']
-
-M1 = np.array([
- [0.17224810, 0.09170660, 0.06416938],
- [0.49189645, 0.27802050, 0.21923399],
- [0.10999751, 0.18658946, 0.29938611],
- [0.11666120, 0.14327905, 0.05713804],
- [0.18988879, 0.18227649, 0.36056247],
- [0.12501329, 0.42223442, 0.37027445],
- [0.64785606, 0.22396782, 0.03365194],
- [0.06761093, 0.11076896, 0.39779139],
- [0.49101797, 0.09448929, 0.11623839],
- [0.11622386, 0.04425753, 0.14469986],
- [0.36867946, 0.44545230, 0.06028681],
- [0.61632937, 0.32323906, 0.02437089],
- [0.03016472, 0.06153243, 0.29014596],
- [0.11103655, 0.30553067, 0.08149137],
- [0.41162190, 0.05816656, 0.04845934],
- [0.73339206, 0.53075188, 0.02475212],
- [0.47347718, 0.08834792, 0.30310315],
- [0.00000000, 0.25187016, 0.35062450],
- [0.76809639, 0.78486240, 0.77808297],
- [0.53822392, 0.54307997, 0.54710883],
- [0.35458526, 0.35318419, 0.35524431],
- [0.17976704, 0.18000531, 0.17991488],
- [0.09351417, 0.09510603, 0.09675027],
- [0.03405071, 0.03295077, 0.03702047]])
-
-M2 = np.array([
- [0.15579559, 0.09715755, 0.07514556],
- [0.39113140, 0.25943419, 0.21266708],
- [0.12824821, 0.18463570, 0.31508023],
- [0.12028974, 0.13455659, 0.07408400],
- [0.19368988, 0.21158946, 0.37955964],
- [0.19957424, 0.36085439, 0.40678123],
- [0.48896605, 0.20691688, 0.05816533],
- [0.09775522, 0.16710693, 0.47147724],
- [0.39358649, 0.12233400, 0.10526425],
- [0.10780332, 0.07258529, 0.16151473],
- [0.27502671, 0.34705454, 0.09728099],
- [0.43980441, 0.26880559, 0.05430533],
- [0.05887212, 0.11126272, 0.38552469],
- [0.12705825, 0.25787860, 0.13566464],
- [0.35612929, 0.07933258, 0.05118732],
- [0.48131976, 0.42082843, 0.07120612],
- [0.34665585, 0.15170714, 0.24969804],
- [0.08261116, 0.24588716, 0.48707733],
- [0.66054904, 0.65941137, 0.66376412],
- [0.48051509, 0.47870296, 0.48230082],
- [0.33045354, 0.32904184, 0.33228886],
- [0.18001305, 0.17978567, 0.18004416],
- [0.10283975, 0.10424680, 0.10384975],
- [0.04742204, 0.04772203, 0.04914226]])
+__all__ = ['M1', 'M2', 'TestFirstOrderColourFit']
+
+M1 = np.array(
+ [[0.17224810, 0.09170660, 0.06416938],
+ [0.49189645, 0.27802050, 0.21923399],
+ [0.10999751, 0.18658946, 0.29938611],
+ [0.11666120, 0.14327905, 0.05713804],
+ [0.18988879, 0.18227649, 0.36056247],
+ [0.12501329, 0.42223442, 0.37027445],
+ [0.64785606, 0.22396782, 0.03365194],
+ [0.06761093, 0.11076896, 0.39779139],
+ [0.49101797, 0.09448929, 0.11623839],
+ [0.11622386, 0.04425753, 0.14469986],
+ [0.36867946, 0.44545230, 0.06028681],
+ [0.61632937, 0.32323906, 0.02437089],
+ [0.03016472, 0.06153243, 0.29014596],
+ [0.11103655, 0.30553067, 0.08149137],
+ [0.41162190, 0.05816656, 0.04845934],
+ [0.73339206, 0.53075188, 0.02475212],
+ [0.47347718, 0.08834792, 0.30310315],
+ [0.00000000, 0.25187016, 0.35062450],
+ [0.76809639, 0.78486240, 0.77808297],
+ [0.53822392, 0.54307997, 0.54710883],
+ [0.35458526, 0.35318419, 0.35524431],
+ [0.17976704, 0.18000531, 0.17991488],
+ [0.09351417, 0.09510603, 0.09675027],
+ [0.03405071, 0.03295077, 0.03702047]]) # yapf: disable
+
+M2 = np.array(
+ [[0.15579559, 0.09715755, 0.07514556],
+ [0.39113140, 0.25943419, 0.21266708],
+ [0.12824821, 0.18463570, 0.31508023],
+ [0.12028974, 0.13455659, 0.07408400],
+ [0.19368988, 0.21158946, 0.37955964],
+ [0.19957424, 0.36085439, 0.40678123],
+ [0.48896605, 0.20691688, 0.05816533],
+ [0.09775522, 0.16710693, 0.47147724],
+ [0.39358649, 0.12233400, 0.10526425],
+ [0.10780332, 0.07258529, 0.16151473],
+ [0.27502671, 0.34705454, 0.09728099],
+ [0.43980441, 0.26880559, 0.05430533],
+ [0.05887212, 0.11126272, 0.38552469],
+ [0.12705825, 0.25787860, 0.13566464],
+ [0.35612929, 0.07933258, 0.05118732],
+ [0.48131976, 0.42082843, 0.07120612],
+ [0.34665585, 0.15170714, 0.24969804],
+ [0.08261116, 0.24588716, 0.48707733],
+ [0.66054904, 0.65941137, 0.66376412],
+ [0.48051509, 0.47870296, 0.48230082],
+ [0.33045354, 0.32904184, 0.33228886],
+ [0.18001305, 0.17978567, 0.18004416],
+ [0.10283975, 0.10424680, 0.10384975],
+ [0.04742204, 0.04772203, 0.04914226]]) # yapf: disable
class TestFirstOrderColourFit(unittest.TestCase):
@@ -93,8 +90,8 @@ def test_first_order_colour_fit(self):
np.testing.assert_almost_equal(
first_order_colour_fit(M1, M2),
- np.array([[0.69822661, 0.03071629, 0.16210422],
- [0.06893499, 0.67579611, 0.16430385],
+ np.array([[0.69822661, 0.03071629,
+ 0.16210422], [0.06893499, 0.67579611, 0.16430385],
[-0.06314955, 0.09212470, 0.97134152]]),
decimal=7)
@@ -109,8 +106,8 @@ def test_nan_first_order_colour_fit(self):
cases = set(permutations(cases * 3, r=3))
for case in cases:
try:
- first_order_colour_fit(np.vstack((M1, case)),
- np.vstack((M2, case)))
+ first_order_colour_fit(
+ np.vstack((M1, case)), np.vstack((M2, case)))
except (ValueError, LinAlgError):
import traceback
from colour.utilities import warning
diff --git a/colour/colorimetry/__init__.py b/colour/colorimetry/__init__.py
index 8a673d12a8..d4c27ff0c2 100644
--- a/colour/colorimetry/__init__.py
+++ b/colour/colorimetry/__init__.py
@@ -3,56 +3,33 @@
from __future__ import absolute_import
-from .spectrum import (
- DEFAULT_WAVELENGTH_DECIMALS,
- SpectralMapping,
- SpectralShape,
- SpectralPowerDistribution,
- TriSpectralPowerDistribution,
- DEFAULT_SPECTRAL_SHAPE,
- constant_spd,
- zeros_spd,
- ones_spd)
-from .blackbody import (
- blackbody_spd,
- blackbody_spectral_radiance,
- planck_law)
-from .cmfs import (
- LMS_ConeFundamentals,
- RGB_ColourMatchingFunctions,
- XYZ_ColourMatchingFunctions)
+from .spectrum import (DEFAULT_WAVELENGTH_DECIMALS, SpectralMapping,
+ SpectralShape, SpectralPowerDistribution,
+ TriSpectralPowerDistribution, DEFAULT_SPECTRAL_SHAPE,
+ constant_spd, zeros_spd, ones_spd)
+from .blackbody import (blackbody_spd, blackbody_spectral_radiance, planck_law)
+from .cmfs import (LMS_ConeFundamentals, RGB_ColourMatchingFunctions,
+ XYZ_ColourMatchingFunctions)
from .dataset import * # noqa
from . import dataset
from .correction import BANDPASS_CORRECTION_METHODS
from .correction import bandpass_correction
from .correction import bandpass_correction_Stearns1988
-from .illuminants import (
- D_illuminant_relative_spd,
- CIE_standard_illuminant_A_function)
-from .lefs import (
- mesopic_luminous_efficiency_function,
- mesopic_weighting_function)
+from .illuminants import (D_illuminant_relative_spd,
+ CIE_standard_illuminant_A_function)
+from .lefs import (mesopic_luminous_efficiency_function,
+ mesopic_weighting_function)
from .lightness import LIGHTNESS_METHODS
from .lightness import lightness
-from .lightness import (
- lightness_Glasser1958,
- lightness_Wyszecki1963,
- lightness_CIE1976)
+from .lightness import (lightness_Glasser1958, lightness_Wyszecki1963,
+ lightness_CIE1976, lightness_Fairchild2010)
from .luminance import LUMINANCE_METHODS
from .luminance import luminance
-from .luminance import (
- luminance_Newhall1943,
- luminance_ASTMD153508,
- luminance_CIE1976)
-from .dominant import (
- dominant_wavelength,
- complementary_wavelength,
- excitation_purity,
- colorimetric_purity)
-from .photometry import (
- luminous_flux,
- luminous_efficiency,
- luminous_efficacy)
+from .luminance import (luminance_Newhall1943, luminance_ASTMD153508,
+ luminance_CIE1976, luminance_Fairchild2010)
+from .dominant import (dominant_wavelength, complementary_wavelength,
+ excitation_purity, colorimetric_purity)
+from .photometry import (luminous_flux, luminous_efficiency, luminous_efficacy)
from .transformations import RGB_10_degree_cmfs_to_LMS_10_degree_cmfs
from .transformations import RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs
from .transformations import RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs
@@ -61,64 +38,56 @@
from .tristimulus import SPECTRAL_TO_XYZ_METHODS
from .tristimulus import spectral_to_XYZ
from .tristimulus import (
- ASTME30815_PRACTISE_SHAPE,
- lagrange_coefficients_ASTME202211,
+ ASTME30815_PRACTISE_SHAPE, lagrange_coefficients_ASTME202211,
tristimulus_weighting_factors_ASTME202211,
adjust_tristimulus_weighting_factors_ASTME30815,
spectral_to_XYZ_integration,
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815,
- spectral_to_XYZ_ASTME30815,
- wavelength_to_XYZ)
+ spectral_to_XYZ_ASTME30815, wavelength_to_XYZ)
from .whiteness import WHITENESS_METHODS
from .whiteness import whiteness
-from .whiteness import (
- whiteness_Berger1959,
- whiteness_Taube1960,
- whiteness_Stensby1968,
- whiteness_ASTM313,
- whiteness_Ganz1979,
- whiteness_CIE2004)
+from .whiteness import (whiteness_Berger1959, whiteness_Taube1960,
+ whiteness_Stensby1968, whiteness_ASTME313,
+ whiteness_Ganz1979, whiteness_CIE2004)
+from .yellowness import YELLOWNESS_METHODS
+from .yellowness import yellowness
+from .yellowness import (yellowness_ASTMD1925, yellowness_ASTME313)
-__all__ = ['DEFAULT_WAVELENGTH_DECIMALS',
- 'SpectralMapping',
- 'SpectralShape',
- 'SpectralPowerDistribution',
- 'TriSpectralPowerDistribution',
- 'DEFAULT_SPECTRAL_SHAPE',
- 'constant_spd',
- 'zeros_spd',
- 'ones_spd']
-__all__ += ['blackbody_spd',
- 'blackbody_spectral_radiance',
- 'planck_law']
-__all__ += ['LMS_ConeFundamentals',
- 'RGB_ColourMatchingFunctions',
- 'XYZ_ColourMatchingFunctions']
+__all__ = [
+ 'DEFAULT_WAVELENGTH_DECIMALS', 'SpectralMapping', 'SpectralShape',
+ 'SpectralPowerDistribution', 'TriSpectralPowerDistribution',
+ 'DEFAULT_SPECTRAL_SHAPE', 'constant_spd', 'zeros_spd', 'ones_spd'
+]
+__all__ += ['blackbody_spd', 'blackbody_spectral_radiance', 'planck_law']
+__all__ += [
+ 'LMS_ConeFundamentals', 'RGB_ColourMatchingFunctions',
+ 'XYZ_ColourMatchingFunctions'
+]
__all__ += dataset.__all__
__all__ += ['BANDPASS_CORRECTION_METHODS']
__all__ += ['bandpass_correction']
__all__ += ['bandpass_correction_Stearns1988']
-__all__ += ['D_illuminant_relative_spd',
- 'CIE_standard_illuminant_A_function']
-__all__ += ['mesopic_luminous_efficiency_function',
- 'mesopic_weighting_function']
+__all__ += ['D_illuminant_relative_spd', 'CIE_standard_illuminant_A_function']
+__all__ += [
+ 'mesopic_luminous_efficiency_function', 'mesopic_weighting_function'
+]
__all__ += ['LIGHTNESS_METHODS']
__all__ += ['lightness']
-__all__ += ['lightness_Glasser1958',
- 'lightness_Wyszecki1963',
- 'lightness_CIE1976']
+__all__ += [
+ 'lightness_Glasser1958', 'lightness_Wyszecki1963', 'lightness_CIE1976',
+ 'lightness_Fairchild2010'
+]
__all__ += ['LUMINANCE_METHODS']
__all__ += ['luminance']
-__all__ += ['luminance_Newhall1943',
- 'luminance_ASTMD153508',
- 'luminance_CIE1976']
-__all__ += ['dominant_wavelength',
- 'complementary_wavelength',
- 'excitation_purity',
- 'colorimetric_purity']
-__all__ += ['luminous_flux',
- 'luminous_efficiency',
- 'luminous_efficacy']
+__all__ += [
+ 'luminance_Newhall1943', 'luminance_ASTMD153508', 'luminance_CIE1976',
+ 'luminance_Fairchild2010'
+]
+__all__ += [
+ 'dominant_wavelength', 'complementary_wavelength', 'excitation_purity',
+ 'colorimetric_purity'
+]
+__all__ += ['luminous_flux', 'luminous_efficiency', 'luminous_efficacy']
__all__ += ['RGB_10_degree_cmfs_to_LMS_10_degree_cmfs']
__all__ += ['RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs']
__all__ += ['RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs']
@@ -126,19 +95,20 @@
__all__ += ['LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs']
__all__ += ['SPECTRAL_TO_XYZ_METHODS']
__all__ += ['spectral_to_XYZ']
-__all__ += ['ASTME30815_PRACTISE_SHAPE',
- 'lagrange_coefficients_ASTME202211',
- 'tristimulus_weighting_factors_ASTME202211',
- 'adjust_tristimulus_weighting_factors_ASTME30815',
- 'spectral_to_XYZ_integration',
- 'spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815',
- 'spectral_to_XYZ_ASTME30815',
- 'wavelength_to_XYZ']
+__all__ += [
+ 'ASTME30815_PRACTISE_SHAPE', 'lagrange_coefficients_ASTME202211',
+ 'tristimulus_weighting_factors_ASTME202211',
+ 'adjust_tristimulus_weighting_factors_ASTME30815',
+ 'spectral_to_XYZ_integration',
+ 'spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815',
+ 'spectral_to_XYZ_ASTME30815', 'wavelength_to_XYZ'
+]
__all__ += ['WHITENESS_METHODS']
__all__ += ['whiteness']
-__all__ += ['whiteness_Berger1959',
- 'whiteness_Taube1960',
- 'whiteness_Stensby1968',
- 'whiteness_ASTM313',
- 'whiteness_Ganz1979',
- 'whiteness_CIE2004']
+__all__ += [
+ 'whiteness_Berger1959', 'whiteness_Taube1960', 'whiteness_Stensby1968',
+ 'whiteness_ASTME313', 'whiteness_Ganz1979', 'whiteness_CIE2004'
+]
+__all__ += ['YELLOWNESS_METHODS']
+__all__ += ['yellowness']
+__all__ += ['yellowness_ASTMD1925', 'yellowness_ASTME313']
diff --git a/colour/colorimetry/blackbody.py b/colour/colorimetry/blackbody.py
index 928c904c7b..0edbdcdb91 100644
--- a/colour/colorimetry/blackbody.py
+++ b/colour/colorimetry/blackbody.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Blackbody - Planckian Radiator
==============================
@@ -19,9 +18,8 @@
import numpy as np
-from colour.colorimetry import (
- DEFAULT_SPECTRAL_SHAPE,
- SpectralPowerDistribution)
+from colour.colorimetry import (DEFAULT_SPECTRAL_SHAPE,
+ SpectralPowerDistribution)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -30,12 +28,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['C1',
- 'C2',
- 'N',
- 'planck_law',
- 'blackbody_spectral_radiance',
- 'blackbody_spd']
+__all__ = [
+ 'C1', 'C2', 'N', 'planck_law', 'blackbody_spectral_radiance',
+ 'blackbody_spd'
+]
C1 = 3.741771e-16 # 2 * math.pi * PLANCK_CONSTANT * LIGHT_SPEED ** 2
C2 = 1.4388e-2 # PLANCK_CONSTANT * LIGHT_SPEED / BOLTZMANN_CONSTANT
@@ -95,8 +91,8 @@ def planck_law(wavelength, temperature, c1=C1, c2=C2, n=N):
l = np.asarray(wavelength)
t = np.asarray(temperature)
- p = (((c1 * n ** -2 * l ** -5) / np.pi) *
- (np.exp(c2 / (n * l * t)) - 1) ** -1)
+ p = (((c1 * n ** -2 * l ** -5) / np.pi) * (np.exp(c2 /
+ (n * l * t)) - 1) ** -1)
return p
@@ -104,10 +100,7 @@ def planck_law(wavelength, temperature, c1=C1, c2=C2, n=N):
blackbody_spectral_radiance = planck_law
-def blackbody_spd(temperature,
- shape=DEFAULT_SPECTRAL_SHAPE,
- c1=C1,
- c2=C2,
+def blackbody_spd(temperature, shape=DEFAULT_SPECTRAL_SHAPE, c1=C1, c2=C2,
n=N):
"""
Returns the spectral power distribution of the planckian radiator for given
@@ -154,5 +147,4 @@ def blackbody_spd(temperature,
name='{0}K Blackbody'.format(temperature),
data=dict(
zip(wavelengths,
- planck_law(
- wavelengths * 1e-9, temperature, c1, c2, n))))
+ planck_law(wavelengths * 1e-9, temperature, c1, c2, n))))
diff --git a/colour/colorimetry/cmfs.py b/colour/colorimetry/cmfs.py
index 2304428cab..b38c537149 100644
--- a/colour/colorimetry/cmfs.py
+++ b/colour/colorimetry/cmfs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Matching Functions
=========================
@@ -37,9 +36,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LMS_ConeFundamentals',
- 'RGB_ColourMatchingFunctions',
- 'XYZ_ColourMatchingFunctions']
+__all__ = [
+ 'LMS_ConeFundamentals', 'RGB_ColourMatchingFunctions',
+ 'XYZ_ColourMatchingFunctions'
+]
def _format_cmfs(self):
@@ -59,17 +59,17 @@ def _format_cmfs(self):
"""
mapping = self.mapping
- data = {mapping['x']: dict(self.x.data),
- mapping['y']: dict(self.y.data),
- mapping['z']: dict(self.z.data)}
+ data = {
+ mapping['x']: dict(self.x.data),
+ mapping['y']: dict(self.y.data),
+ mapping['z']: dict(self.z.data)
+ }
return '{0}(\n \'{1}\',\n {2},\n {3})'.format(
- self.__class__.__name__,
- self.name,
+ self.__class__.__name__, self.name,
pprint.pformat(data).replace('\n', '\n '),
('\'{0}\''.format(self.title)
- if self.title is not None else
- self.title))
+ if self.title is not None else self.title))
class LMS_ConeFundamentals(TriSpectralPowerDistribution):
@@ -95,16 +95,17 @@ class LMS_ConeFundamentals(TriSpectralPowerDistribution):
"""
def __init__(self, name, data, title=None):
- TriSpectralPowerDistribution.__init__(self,
- name,
- data,
- mapping={'x': 'l_bar',
- 'y': 'm_bar',
- 'z': 's_bar'},
- labels={'x': '$\\bar{l}$',
- 'y': '$\\bar{m}$',
- 'z': '$\\bar{s}$'},
- title=title)
+ TriSpectralPowerDistribution.__init__(
+ self,
+ name,
+ data,
+ mapping={'x': 'l_bar',
+ 'y': 'm_bar',
+ 'z': 's_bar'},
+ labels={'x': '$\\bar{l}$',
+ 'y': '$\\bar{m}$',
+ 'z': '$\\bar{s}$'},
+ title=title)
@property
def l_bar(self):
@@ -254,16 +255,17 @@ class RGB_ColourMatchingFunctions(TriSpectralPowerDistribution):
"""
def __init__(self, name, data, title=None):
- TriSpectralPowerDistribution.__init__(self,
- name,
- data,
- mapping={'x': 'r_bar',
- 'y': 'g_bar',
- 'z': 'b_bar'},
- labels={'x': '$\\bar{r}$',
- 'y': '$\\bar{g}$',
- 'z': '$\\bar{b}$'},
- title=title)
+ TriSpectralPowerDistribution.__init__(
+ self,
+ name,
+ data,
+ mapping={'x': 'r_bar',
+ 'y': 'g_bar',
+ 'z': 'b_bar'},
+ labels={'x': '$\\bar{r}$',
+ 'y': '$\\bar{g}$',
+ 'z': '$\\bar{b}$'},
+ title=title)
@property
def r_bar(self):
@@ -416,16 +418,17 @@ class XYZ_ColourMatchingFunctions(TriSpectralPowerDistribution):
"""
def __init__(self, name, data, title=None):
- TriSpectralPowerDistribution.__init__(self,
- name,
- data,
- mapping={'x': 'x_bar',
- 'y': 'y_bar',
- 'z': 'z_bar'},
- labels={'x': '$\\bar{x}$',
- 'y': '$\\bar{y}$',
- 'z': '$\\bar{z}$'},
- title=title)
+ TriSpectralPowerDistribution.__init__(
+ self,
+ name,
+ data,
+ mapping={'x': 'x_bar',
+ 'y': 'y_bar',
+ 'z': 'z_bar'},
+ labels={'x': '$\\bar{x}$',
+ 'y': '$\\bar{y}$',
+ 'z': '$\\bar{z}$'},
+ title=title)
@property
def x_bar(self):
diff --git a/colour/colorimetry/correction.py b/colour/colorimetry/correction.py
index 9036aed8ec..a5006fef59 100644
--- a/colour/colorimetry/correction.py
+++ b/colour/colorimetry/correction.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Spectral Bandpass Dependence Correction
=======================================
@@ -30,9 +29,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['bandpass_correction_Stearns1988',
- 'BANDPASS_CORRECTION_METHODS',
- 'bandpass_correction']
+__all__ = [
+ 'bandpass_correction_Stearns1988', 'BANDPASS_CORRECTION_METHODS',
+ 'bandpass_correction'
+]
ALPHA_STEARNS = 0.083
@@ -76,16 +76,17 @@ def bandpass_correction_Stearns1988(spd):
values[-1] = (1 + ALPHA_STEARNS) * values[-1] - ALPHA_STEARNS * values[-2]
for i in range(1, len(values) - 1):
values[i] = (-ALPHA_STEARNS * values[i - 1] +
- (1 + 2 * ALPHA_STEARNS) *
- values[i] - ALPHA_STEARNS * values[i + 1])
+ (1 + 2 * ALPHA_STEARNS) * values[i] -
+ ALPHA_STEARNS * values[i + 1])
for i, (wavelength, _value) in enumerate(spd):
spd[wavelength] = values[i]
return spd
-BANDPASS_CORRECTION_METHODS = CaseInsensitiveMapping(
- {'Stearns 1988': bandpass_correction_Stearns1988})
+BANDPASS_CORRECTION_METHODS = CaseInsensitiveMapping({
+ 'Stearns 1988': bandpass_correction_Stearns1988
+})
"""
Supported spectral bandpass dependence correction methods.
diff --git a/colour/colorimetry/dataset/cmfs.py b/colour/colorimetry/dataset/cmfs.py
index 50e1047ad2..fe875e1643 100644
--- a/colour/colorimetry/dataset/cmfs.py
+++ b/colour/colorimetry/dataset/cmfs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Matching Functions Spectral Power Distributions
======================================================
@@ -71,10 +70,9 @@
from __future__ import division, unicode_literals
-from colour.colorimetry import (
- LMS_ConeFundamentals,
- RGB_ColourMatchingFunctions,
- XYZ_ColourMatchingFunctions)
+from colour.colorimetry import (LMS_ConeFundamentals,
+ RGB_ColourMatchingFunctions,
+ XYZ_ColourMatchingFunctions)
from colour.utilities import CaseInsensitiveMapping
__author__ = 'Colour Developers'
@@ -84,13 +82,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LMS_CMFS_DATA',
- 'LMS_CMFS',
- 'RGB_CMFS_DATA',
- 'RGB_CMFS',
- 'STANDARD_OBSERVERS_CMFS_DATA',
- 'STANDARD_OBSERVERS_CMFS',
- 'CMFS']
+__all__ = [
+ 'LMS_CMFS_DATA', 'LMS_CMFS', 'RGB_CMFS_DATA', 'RGB_CMFS',
+ 'STANDARD_OBSERVERS_CMFS_DATA', 'STANDARD_OBSERVERS_CMFS', 'CMFS'
+]
# *S-cone* spectral sensitivity data wasn't measurable after 615 nm and has
# been set to zero.
@@ -537,7 +532,8 @@
827: 1.15888e-06,
828: 1.09348e-06,
829: 1.03203e-06,
- 830: 9.74306e-07},
+ 830: 9.74306e-07
+ },
'm_bar': {
390: 3.68349e-04,
391: 4.48015e-04,
@@ -979,7 +975,8 @@
827: 1.12416e-07,
828: 1.06398e-07,
829: 1.00711e-07,
- 830: 9.53411e-08},
+ 830: 9.53411e-08
+ },
's_bar': {
390: 9.54729e-03,
391: 1.14794e-02,
@@ -1421,7 +1418,9 @@
827: 0.000000000,
828: 0.000000000,
829: 0.000000000,
- 830: 0.000000000}},
+ 830: 0.000000000
+ }
+ },
'Stockman & Sharpe 10 Degree Cone Fundamentals': {
'l_bar': {
390: 4.07619e-04,
@@ -1864,7 +1863,8 @@
827: 1.03839e-06,
828: 9.79788e-07,
829: 9.24725e-07,
- 830: 8.73008e-07},
+ 830: 8.73008e-07
+ },
'm_bar': {
390: 3.58227e-04,
391: 4.38660e-04,
@@ -2306,7 +2306,8 @@
827: 1.00093e-07,
828: 9.47349e-08,
829: 8.96718e-08,
- 830: 8.48902e-08},
+ 830: 8.48902e-08
+ },
's_bar': {
390: 6.14265e-03,
391: 7.44280e-03,
@@ -2748,7 +2749,9 @@
827: 0.000000000,
828: 0.000000000,
829: 0.000000000,
- 830: 0.000000000}},
+ 830: 0.000000000
+ }
+ },
'Smith & Pokorny 1975 Normal Trichromats': {
'l_bar': {
380: 0.0000,
@@ -2831,7 +2834,8 @@
765: 0.0000,
770: 0.0000,
775: 0.0000,
- 780: 0.0000},
+ 780: 0.0000
+ },
'm_bar': {
380: 0.0000,
385: 0.0000,
@@ -2913,7 +2917,8 @@
765: 0.0000,
770: 0.0000,
775: 0.0000,
- 780: 0.0000},
+ 780: 0.0000
+ },
's_bar': {
380: 0.0000,
385: 0.0000,
@@ -2995,21 +3000,28 @@
765: 0.0000,
770: 0.0000,
775: 0.0000,
- 780: 0.0000}}}
+ 780: 0.0000
+ }
+ }
+}
-LMS_CMFS = CaseInsensitiveMapping(
- {'Stockman & Sharpe 2 Degree Cone Fundamentals': LMS_ConeFundamentals(
- 'Stockman & Sharpe 2 Degree Cone Fundamentals',
- LMS_CMFS_DATA['Stockman & Sharpe 2 Degree Cone Fundamentals'],
- 'Stockman & Sharpe 2$^\\circ$ Cone Fundamentals'),
- 'Stockman & Sharpe 10 Degree Cone Fundamentals': LMS_ConeFundamentals(
- 'Stockman & Sharpe 10 Degree Cone Fundamentals',
- LMS_CMFS_DATA['Stockman & Sharpe 10 Degree Cone Fundamentals'],
- 'Stockman & Sharpe 10$^\\circ$ Cone Fundamentals'),
- 'Smith & Pokorny 1975 Normal Trichromats': LMS_ConeFundamentals(
- 'Smith & Pokorny 1975 Normal Trichromats',
- LMS_CMFS_DATA['Smith & Pokorny 1975 Normal Trichromats'],
- 'Smith & Pokorny 1975 Normal Trichromats')})
+LMS_CMFS = CaseInsensitiveMapping({
+ 'Stockman & Sharpe 2 Degree Cone Fundamentals':
+ LMS_ConeFundamentals(
+ 'Stockman & Sharpe 2 Degree Cone Fundamentals',
+ LMS_CMFS_DATA['Stockman & Sharpe 2 Degree Cone Fundamentals'],
+ 'Stockman & Sharpe 2$^\\circ$ Cone Fundamentals'),
+ 'Stockman & Sharpe 10 Degree Cone Fundamentals':
+ LMS_ConeFundamentals(
+ 'Stockman & Sharpe 10 Degree Cone Fundamentals',
+ LMS_CMFS_DATA['Stockman & Sharpe 10 Degree Cone Fundamentals'],
+ 'Stockman & Sharpe 10$^\\circ$ Cone Fundamentals'),
+ 'Smith & Pokorny 1975 Normal Trichromats':
+ LMS_ConeFundamentals(
+ 'Smith & Pokorny 1975 Normal Trichromats',
+ LMS_CMFS_DATA['Smith & Pokorny 1975 Normal Trichromats'],
+ 'Smith & Pokorny 1975 Normal Trichromats')
+})
"""
*LMS* colour matching functions.
@@ -3102,7 +3114,8 @@
765: 0.00004,
770: 0.00003,
775: 0.00001,
- 780: 0.00000},
+ 780: 0.00000
+ },
'g_bar': {
380: -0.00001,
385: -0.00002,
@@ -3184,7 +3197,8 @@
765: 0.00000,
770: 0.00000,
775: 0.00000,
- 780: 0.00000},
+ 780: 0.00000
+ },
'b_bar': {
380: 0.00117,
385: 0.00189,
@@ -3266,7 +3280,8 @@
765: 0.00000,
770: 0.00000,
775: 0.00000,
- 780: 0.00000},
+ 780: 0.00000
+ },
},
'Stiles & Burch 1955 2 Degree RGB CMFs': {
'r_bar': {
@@ -3338,7 +3353,8 @@
715: 9.40920e-003,
720: 6.51770e-003,
725: 4.53770e-003,
- 730: 3.17420e-003},
+ 730: 3.17420e-003
+ },
'g_bar': {
390: -4.53930e-004,
395: -1.04640e-003,
@@ -3408,7 +3424,8 @@
715: -8.57600e-005,
720: -5.76770e-005,
725: -3.90030e-005,
- 730: -2.65110e-005},
+ 730: -2.65110e-005
+ },
'b_bar': {
390: 1.21520e-002,
395: 3.11100e-002,
@@ -3478,7 +3495,8 @@
715: 7.43510e-006,
720: 6.10570e-006,
725: 5.02770e-006,
- 730: 4.12510e-006}
+ 730: 4.12510e-006
+ }
},
'Stiles & Burch 1959 10 Degree RGB CMFs': {
'r_bar': {
@@ -3570,7 +3588,8 @@
815: 1.1000e-05,
820: 8.1800e-06,
825: 6.0900e-06,
- 830: 4.5500e-06},
+ 830: 4.5500e-06
+ },
'g_bar': {
390: -4.0000e-04,
395: -1.0000e-03,
@@ -3660,7 +3679,8 @@
815: -1.9600e-08,
820: -1.0900e-08,
825: -5.7000e-09,
- 830: -2.7700e-09},
+ 830: -2.7700e-09
+ },
'b_bar': {
390: 6.2000e-03,
395: 1.6100e-02,
@@ -3750,21 +3770,28 @@
815: 2.5300e-10,
820: 1.5200e-10,
825: 8.6400e-11,
- 830: 4.4200e-11}}}
+ 830: 4.4200e-11
+ }
+ }
+}
-RGB_CMFS = CaseInsensitiveMapping(
- {'Wright & Guild 1931 2 Degree RGB CMFs': RGB_ColourMatchingFunctions(
- 'Wright & Guild 1931 2 Degree RGB CMFs',
- RGB_CMFS_DATA['Wright & Guild 1931 2 Degree RGB CMFs'],
- 'Wright & Guild 1931 2$^\\circ$ RGB CMFs', ),
- 'Stiles & Burch 1955 2 Degree RGB CMFs': RGB_ColourMatchingFunctions(
- 'Stiles & Burch 1955 2 Degree RGB CMFs',
- RGB_CMFS_DATA['Stiles & Burch 1955 2 Degree RGB CMFs'],
- 'Stiles & Burch 1955 2$^\\circ$ RGB CMFs'),
- 'Stiles & Burch 1959 10 Degree RGB CMFs': RGB_ColourMatchingFunctions(
- 'Stiles & Burch 1959 10 Degree RGB CMFs',
- RGB_CMFS_DATA['Stiles & Burch 1959 10 Degree RGB CMFs'],
- 'Stiles & Burch 1959 10$^\\circ$ RGB CMFs')})
+RGB_CMFS = CaseInsensitiveMapping({
+ 'Wright & Guild 1931 2 Degree RGB CMFs':
+ RGB_ColourMatchingFunctions(
+ 'Wright & Guild 1931 2 Degree RGB CMFs',
+ RGB_CMFS_DATA['Wright & Guild 1931 2 Degree RGB CMFs'],
+ 'Wright & Guild 1931 2$^\\circ$ RGB CMFs', ),
+ 'Stiles & Burch 1955 2 Degree RGB CMFs':
+ RGB_ColourMatchingFunctions(
+ 'Stiles & Burch 1955 2 Degree RGB CMFs',
+ RGB_CMFS_DATA['Stiles & Burch 1955 2 Degree RGB CMFs'],
+ 'Stiles & Burch 1955 2$^\\circ$ RGB CMFs'),
+ 'Stiles & Burch 1959 10 Degree RGB CMFs':
+ RGB_ColourMatchingFunctions(
+ 'Stiles & Burch 1959 10 Degree RGB CMFs',
+ RGB_CMFS_DATA['Stiles & Burch 1959 10 Degree RGB CMFs'],
+ 'Stiles & Burch 1959 10$^\\circ$ RGB CMFs')
+})
"""
*CIE RGB* colour matching functions.
@@ -4247,7 +4274,8 @@
827: 0.000001544022,
828: 0.000001439440,
829: 0.000001341977,
- 830: 0.000001251141},
+ 830: 0.000001251141
+ },
'y_bar': {
360: 0.000003917000,
361: 0.000004393581,
@@ -4719,7 +4747,8 @@
827: 0.000000557575,
828: 0.000000519808,
829: 0.000000484612,
- 830: 0.000000451810},
+ 830: 0.000000451810
+ },
'z_bar': {
360: 0.000606100000,
361: 0.000680879200,
@@ -5191,7 +5220,8 @@
827: 0.000000000000,
828: 0.000000000000,
829: 0.000000000000,
- 830: 0.000000000000}
+ 830: 0.000000000000
+ }
},
'CIE 1964 10 Degree Standard Observer': {
'x_bar': {
@@ -5665,7 +5695,8 @@
827: 0.000001851900,
828: 0.000001746500,
829: 0.000001647100,
- 830: 0.000001553140},
+ 830: 0.000001553140
+ },
'y_bar': {
360: 0.000000013398,
361: 0.000000020294,
@@ -6137,7 +6168,8 @@
827: 0.000000749780,
828: 0.000000707440,
829: 0.000000667480,
- 830: 0.000000629700},
+ 830: 0.000000629700
+ },
'z_bar': {
360: 0.000000535027,
361: 0.000000810720,
@@ -6609,7 +6641,8 @@
827: 0.000000000000,
828: 0.000000000000,
829: 0.000000000000,
- 830: 0.000000000000}
+ 830: 0.000000000000
+ }
},
'CIE 2012 2 Degree Standard Observer': {
'x_bar': {
@@ -9270,29 +9303,37 @@
827: 0.000000e+00,
828: 0.000000e+00,
829: 0.000000e+00,
- 830: 0.000000e+00, }}}
+ 830: 0.000000e+00,
+ }
+ }
+}
-STANDARD_OBSERVERS_CMFS = CaseInsensitiveMapping(
- {'CIE 1931 2 Degree Standard Observer': XYZ_ColourMatchingFunctions(
- 'CIE 1931 2 Degree Standard Observer',
- STANDARD_OBSERVERS_CMFS_DATA[
- 'CIE 1931 2 Degree Standard Observer'],
- 'CIE 1931 2$^\\circ$ Standard Observer'),
- 'CIE 1964 10 Degree Standard Observer': XYZ_ColourMatchingFunctions(
- 'CIE 1964 10 Degree Standard Observer',
- STANDARD_OBSERVERS_CMFS_DATA[
- 'CIE 1964 10 Degree Standard Observer'],
- 'CIE 1964 10$^\\circ$ Standard Observer'),
- 'CIE 2012 2 Degree Standard Observer': XYZ_ColourMatchingFunctions(
- 'CIE 2012 2 Degree Standard Observer',
- STANDARD_OBSERVERS_CMFS_DATA[
- 'CIE 2012 2 Degree Standard Observer'],
- 'CIE 2012 2$^\\circ$ Standard Observer'),
- 'CIE 2012 10 Degree Standard Observer': XYZ_ColourMatchingFunctions(
- 'CIE 2012 10 Degree Standard Observer',
- STANDARD_OBSERVERS_CMFS_DATA[
- 'CIE 2012 10 Degree Standard Observer'],
- 'CIE 2012 10$^\\circ$ Standard Observer')})
+STANDARD_OBSERVERS_CMFS = CaseInsensitiveMapping({
+ 'CIE 1931 2 Degree Standard Observer':
+ XYZ_ColourMatchingFunctions(
+ 'CIE 1931 2 Degree Standard Observer',
+ STANDARD_OBSERVERS_CMFS_DATA[
+ 'CIE 1931 2 Degree Standard Observer'],
+ 'CIE 1931 2$^\\circ$ Standard Observer'),
+ 'CIE 1964 10 Degree Standard Observer':
+ XYZ_ColourMatchingFunctions(
+ 'CIE 1964 10 Degree Standard Observer',
+ STANDARD_OBSERVERS_CMFS_DATA[
+ 'CIE 1964 10 Degree Standard Observer'],
+ 'CIE 1964 10$^\\circ$ Standard Observer'),
+ 'CIE 2012 2 Degree Standard Observer':
+ XYZ_ColourMatchingFunctions(
+ 'CIE 2012 2 Degree Standard Observer',
+ STANDARD_OBSERVERS_CMFS_DATA[
+ 'CIE 2012 2 Degree Standard Observer'],
+ 'CIE 2012 2$^\\circ$ Standard Observer'),
+ 'CIE 2012 10 Degree Standard Observer':
+ XYZ_ColourMatchingFunctions(
+ 'CIE 2012 10 Degree Standard Observer',
+ STANDARD_OBSERVERS_CMFS_DATA[
+ 'CIE 2012 10 Degree Standard Observer'],
+ 'CIE 2012 10$^\\circ$ Standard Observer')
+}) # yapf: disable
"""
*CIE* Standard Observers *XYZ* colour matching functions.
diff --git a/colour/colorimetry/dataset/illuminants/__init__.py b/colour/colorimetry/dataset/illuminants/__init__.py
index 1752456ab3..68665cfaee 100644
--- a/colour/colorimetry/dataset/illuminants/__init__.py
+++ b/colour/colorimetry/dataset/illuminants/__init__.py
@@ -8,7 +8,7 @@
from .hunterlab import HUNTERLAB_ILLUMINANTS
from .spds import ILLUMINANTS_RELATIVE_SPDS
-__all__ = ['ILLUMINANTS',
- 'D_ILLUMINANTS_S_SPDS',
- 'HUNTERLAB_ILLUMINANTS',
- 'ILLUMINANTS_RELATIVE_SPDS']
+__all__ = [
+ 'ILLUMINANTS', 'D_ILLUMINANTS_S_SPDS', 'HUNTERLAB_ILLUMINANTS',
+ 'ILLUMINANTS_RELATIVE_SPDS'
+]
diff --git a/colour/colorimetry/dataset/illuminants/chromaticity_coordinates.py b/colour/colorimetry/dataset/illuminants/chromaticity_coordinates.py
index b61c7e13c4..d3cea857b1 100644
--- a/colour/colorimetry/dataset/illuminants/chromaticity_coordinates.py
+++ b/colour/colorimetry/dataset/illuminants/chromaticity_coordinates.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Illuminants Chromaticity Coordinates
====================================
@@ -70,32 +69,32 @@
__all__ = [
'ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER',
- 'ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER',
- 'ILLUMINANTS']
-
-ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
- CaseInsensitiveMapping({
- 'A': np.array([0.44757, 0.40745]),
- 'B': np.array([0.34842, 0.35161]),
- 'C': np.array([0.31006, 0.31616]),
- 'D50': np.array([0.34570, 0.35850]),
- 'D55': np.array([0.33242, 0.34743]),
- 'D60': np.array([0.32168, 0.33767]),
- 'D65': np.array([0.31270, 0.32900]),
- 'D75': np.array([0.29902, 0.31485]),
- 'E': np.array([1 / 3, 1 / 3]),
- 'F1': np.array([0.31310, 0.33727]),
- 'F2': np.array([0.37208, 0.37529]),
- 'F3': np.array([0.40910, 0.39430]),
- 'F4': np.array([0.44018, 0.40329]),
- 'F5': np.array([0.31379, 0.34531]),
- 'F6': np.array([0.37790, 0.38835]),
- 'F7': np.array([0.31292, 0.32933]),
- 'F8': np.array([0.34588, 0.35875]),
- 'F9': np.array([0.37417, 0.37281]),
- 'F10': np.array([0.34609, 0.35986]),
- 'F11': np.array([0.38052, 0.37713]),
- 'F12': np.array([0.43695, 0.40441])}))
+ 'ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER', 'ILLUMINANTS'
+]
+
+ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER = CaseInsensitiveMapping({
+ 'A': np.array([0.44757, 0.40745]),
+ 'B': np.array([0.34842, 0.35161]),
+ 'C': np.array([0.31006, 0.31616]),
+ 'D50': np.array([0.34570, 0.35850]),
+ 'D55': np.array([0.33242, 0.34743]),
+ 'D60': np.array([0.32168, 0.33767]),
+ 'D65': np.array([0.31270, 0.32900]),
+ 'D75': np.array([0.29902, 0.31485]),
+ 'E': np.array([1 / 3, 1 / 3]),
+ 'F1': np.array([0.31310, 0.33727]),
+ 'F2': np.array([0.37208, 0.37529]),
+ 'F3': np.array([0.40910, 0.39430]),
+ 'F4': np.array([0.44018, 0.40329]),
+ 'F5': np.array([0.31379, 0.34531]),
+ 'F6': np.array([0.37790, 0.38835]),
+ 'F7': np.array([0.31292, 0.32933]),
+ 'F8': np.array([0.34588, 0.35875]),
+ 'F9': np.array([0.37417, 0.37281]),
+ 'F10': np.array([0.34609, 0.35986]),
+ 'F11': np.array([0.38052, 0.37713]),
+ 'F12': np.array([0.43695, 0.40441])
+})
"""
*CIE* illuminant chromaticity coordinates for
*CIE 1931 2 Degree Standard Observer*.
@@ -103,29 +102,29 @@
ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER : CaseInsensitiveMapping
"""
-ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
- CaseInsensitiveMapping({
- 'A': np.array([0.45117, 0.40594]),
- 'B': np.array([0.34980, 0.35270]),
- 'C': np.array([0.31039, 0.31905]),
- 'D50': np.array([0.34773, 0.35952]),
- 'D55': np.array([0.33411, 0.34877]),
- 'D60': np.array([0.322957407931312, 0.339135835524579]),
- 'D65': np.array([0.31382, 0.33100]),
- 'D75': np.array([0.29968, 0.31740]),
- 'E': np.array([1 / 3, 1 / 3]),
- 'F1': np.array([0.31811, 0.33559]),
- 'F2': np.array([0.37925, 0.36733]),
- 'F3': np.array([0.41761, 0.38324]),
- 'F4': np.array([0.44920, 0.39074]),
- 'F5': np.array([0.31975, 0.34246]),
- 'F6': np.array([0.38660, 0.37847]),
- 'F7': np.array([0.31569, 0.32960]),
- 'F8': np.array([0.34902, 0.35939]),
- 'F9': np.array([0.37829, 0.37045]),
- 'F10': np.array([0.35090, 0.35444]),
- 'F11': np.array([0.38541, 0.37123]),
- 'F12': np.array([0.44256, 0.39717])}))
+ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER = CaseInsensitiveMapping({
+ 'A': np.array([0.45117, 0.40594]),
+ 'B': np.array([0.34980, 0.35270]),
+ 'C': np.array([0.31039, 0.31905]),
+ 'D50': np.array([0.34773, 0.35952]),
+ 'D55': np.array([0.33411, 0.34877]),
+ 'D60': np.array([0.322957407931312, 0.339135835524579]),
+ 'D65': np.array([0.31382, 0.33100]),
+ 'D75': np.array([0.29968, 0.31740]),
+ 'E': np.array([1 / 3, 1 / 3]),
+ 'F1': np.array([0.31811, 0.33559]),
+ 'F2': np.array([0.37925, 0.36733]),
+ 'F3': np.array([0.41761, 0.38324]),
+ 'F4': np.array([0.44920, 0.39074]),
+ 'F5': np.array([0.31975, 0.34246]),
+ 'F6': np.array([0.38660, 0.37847]),
+ 'F7': np.array([0.31569, 0.32960]),
+ 'F8': np.array([0.34902, 0.35939]),
+ 'F9': np.array([0.37829, 0.37045]),
+ 'F10': np.array([0.35090, 0.35444]),
+ 'F11': np.array([0.38541, 0.37123]),
+ 'F12': np.array([0.44256, 0.39717])
+})
"""
*CIE* illuminant chromaticity coordinates for
*CIE 1964 10 Degree Standard Observer*.
@@ -137,7 +136,8 @@
'CIE 1931 2 Degree Standard Observer':
ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER,
'CIE 1964 10 Degree Standard Observer':
- ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER})
+ ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER
+})
"""
Aggregated *CIE* illuminants chromaticity coordinates.
@@ -175,7 +175,8 @@
'HP2': np.array([0.477790101185585, 0.415837783979245]),
'HP3': np.array([0.430229454588196, 0.407513947069155]),
'HP4': np.array([0.381167337458579, 0.379718304902536]),
- 'HP5': np.array([0.377583057157757, 0.371347698500182])})
+ 'HP5': np.array([0.377583057157757, 0.371347698500182])
+})
ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER.update({
'FL3.1': np.array([0.449830684010003, 0.390231404321266]),
@@ -197,7 +198,9 @@
'HP2': np.array([0.482647330648721, 0.410815644179685]),
'HP3': np.array([0.435560034503954, 0.398801084399711]),
'HP4': np.array([0.385193641123543, 0.368275479241015]),
- 'HP5': np.array([0.380316415606638, 0.366617114797851])})
+ 'HP5': np.array([0.380316415606638, 0.366617114797851])
+})
ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER.update({
- 'DCI-P3': np.array([0.31400, 0.35100])})
+ 'DCI-P3': np.array([0.31400, 0.35100])
+})
diff --git a/colour/colorimetry/dataset/illuminants/d_illuminants_s_spds.py b/colour/colorimetry/dataset/illuminants/d_illuminants_s_spds.py
index d6b90d806d..492120401a 100644
--- a/colour/colorimetry/dataset/illuminants/d_illuminants_s_spds.py
+++ b/colour/colorimetry/dataset/illuminants/d_illuminants_s_spds.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE Standard Illuminant D Series :math:`S_n(\lambda)` Distributions
===================================================================
@@ -38,8 +37,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['D_ILLUMINANTS_S_SPDS_DATA',
- 'D_ILLUMINANTS_S_SPDS']
+__all__ = ['D_ILLUMINANTS_S_SPDS_DATA', 'D_ILLUMINANTS_S_SPDS']
D_ILLUMINANTS_S_SPDS_DATA = {
'S0': {
@@ -208,15 +206,15 @@
800: 6.4,
810: 5.5,
820: 6.1,
- 830: 6.5}}
+ 830: 6.5
+ }
+}
-D_ILLUMINANTS_S_SPDS = CaseInsensitiveMapping(
- {'S0': SpectralPowerDistribution(
- 'S0', D_ILLUMINANTS_S_SPDS_DATA['S0']),
- 'S1': SpectralPowerDistribution(
- 'S1', D_ILLUMINANTS_S_SPDS_DATA['S1']),
- 'S2': SpectralPowerDistribution(
- 'S2', D_ILLUMINANTS_S_SPDS_DATA['S2'])})
+D_ILLUMINANTS_S_SPDS = CaseInsensitiveMapping({
+ 'S0': SpectralPowerDistribution('S0', D_ILLUMINANTS_S_SPDS_DATA['S0']),
+ 'S1': SpectralPowerDistribution('S1', D_ILLUMINANTS_S_SPDS_DATA['S1']),
+ 'S2': SpectralPowerDistribution('S2', D_ILLUMINANTS_S_SPDS_DATA['S2'])
+})
"""
*CIE Standard Illuminant D Series* :math:`S_n(\lambda)` spectral power
distributions
diff --git a/colour/colorimetry/dataset/illuminants/hunterlab.py b/colour/colorimetry/dataset/illuminants/hunterlab.py
index 7604eaa0ed..623c6d815d 100644
--- a/colour/colorimetry/dataset/illuminants/hunterlab.py
+++ b/colour/colorimetry/dataset/illuminants/hunterlab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
HunterLab Dataset
=================
@@ -48,12 +47,13 @@
'HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER',
'HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER_DATA',
'HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER',
- 'HUNTERLAB_ILLUMINANTS']
+ 'HUNTERLAB_ILLUMINANTS'
+]
HunterLab_Illuminant_Specification = namedtuple(
- 'HunterLab_Illuminant_Specification',
- ('name', 'XYZ_n', 'K_ab'))
+ 'HunterLab_Illuminant_Specification', ('name', 'XYZ_n', 'K_ab'))
+# yapf: disable
HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER_DATA = (
('A', np.array([109.83, 100.00, 35.55]), np.array([185.20, 38.40])),
('C', np.array([98.04, 100.00, 118.11]), np.array([175.00, 70.00])),
@@ -64,11 +64,13 @@
('F2', np.array([98.09, 100.00, 67.53]), np.array([175.00, 52.90])),
('TL 4', np.array([101.40, 100.00, 65.90]), np.array([178.00, 52.30])),
('UL 3000', np.array([107.99, 100.00, 33.91]), np.array([183.70, 37.50])))
+# yapf: enable
HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
- CaseInsensitiveMapping(dict(
- [(x[0], HunterLab_Illuminant_Specification(*x)) for x in
- HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER_DATA])))
+ CaseInsensitiveMapping({
+ x[0]: HunterLab_Illuminant_Specification(*x)
+ for x in HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER_DATA
+ }))
"""
*Hunter L,a,b* illuminant dataset for *CIE 1931 2 Degree Standard Observer*.
@@ -76,6 +78,7 @@
CaseInsensitiveMapping
"""
+# yapf: disable
HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER_DATA = (
('A', np.array([111.16, 100.00, 35.19]), np.array([186.30, 38.20])),
('C', np.array([97.30, 100.00, 116.14]), np.array([174.30, 69.40])),
@@ -86,11 +89,14 @@
('F2', np.array([102.13, 100.00, 69.37]), np.array([178.60, 53.60])),
('TL 4', np.array([103.82, 100.00, 66.90]), np.array([180.10, 52.70])),
('UL 3000', np.array([111.12, 100.00, 35.21]), np.array([186.30, 38.20])))
+# yapf: enable
HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
- CaseInsensitiveMapping(dict(
- [(x[0], HunterLab_Illuminant_Specification(*x)) for x in
- HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER_DATA])))
+ CaseInsensitiveMapping({
+ x[0]: HunterLab_Illuminant_Specification(*x)
+ for x in
+ HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER_DATA
+ }))
"""
*Hunter L,a,b* illuminant dataset for *CIE 1964 10 Degree Standard Observer*.
@@ -102,7 +108,8 @@
'CIE 1931 2 Degree Standard Observer':
HUNTERLAB_ILLUMINANTS_CIE_1931_2_DEGREE_STANDARD_OBSERVER,
'CIE 1964 10 Degree Standard Observer':
- HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER})
+ HUNTERLAB_ILLUMINANTS_CIE_1964_10_DEGREE_STANDARD_OBSERVER
+})
"""
Aggregated *Hunter L,a,b* illuminant dataset.
diff --git a/colour/colorimetry/dataset/illuminants/spds.py b/colour/colorimetry/dataset/illuminants/spds.py
index bd853fa2da..317da2da7a 100644
--- a/colour/colorimetry/dataset/illuminants/spds.py
+++ b/colour/colorimetry/dataset/illuminants/spds.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Illuminants Relative Spectral Power Distributions
=================================================
@@ -60,8 +59,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ILLUMINANTS_RELATIVE_SPDS_DATA',
- 'ILLUMINANTS_RELATIVE_SPDS']
+__all__ = ['ILLUMINANTS_RELATIVE_SPDS_DATA', 'ILLUMINANTS_RELATIVE_SPDS']
# *CIE Illuminant D Series* *D60* relative spectral power distribution
# has been calculated as follows:
@@ -166,7 +164,8 @@
765: 234.589000,
770: 237.008000,
775: 239.370000,
- 780: 241.675000},
+ 780: 241.675000
+ },
'B': {
320: 0.02,
325: 0.26,
@@ -260,7 +259,8 @@
765: 84.90,
770: 85.40,
775: 86.10,
- 780: 87.00},
+ 780: 87.00
+ },
'C': {
300: 0.00,
305: 0.00,
@@ -358,7 +358,8 @@
765: 58.00,
770: 58.20,
775: 58.50,
- 780: 59.10},
+ 780: 59.10
+ },
'D50': {
300: 0.019,
305: 1.035,
@@ -456,7 +457,8 @@
765: 70.307,
770: 82.923,
775: 80.599,
- 780: 78.274},
+ 780: 78.274
+ },
'D55': {
300: 0.024,
305: 1.048,
@@ -554,7 +556,8 @@
765: 64.360,
770: 75.927,
775: 73.872,
- 780: 71.818},
+ 780: 71.818
+ },
'D60': {
300: 0.029370758174923,
310: 2.619241317964963,
@@ -609,7 +612,8 @@
800: 62.989808616705801,
810: 54.990892361077115,
820: 60.825600670913168,
- 830: 63.893495862261560},
+ 830: 63.893495862261560
+ },
'D65': {
300: 0.034100,
305: 1.664300,
@@ -707,7 +711,8 @@
765: 56.611800,
770: 66.805400,
775: 65.094100,
- 780: 63.382800},
+ 780: 63.382800
+ },
'D75': {
300: 0.043,
305: 2.588,
@@ -805,7 +810,8 @@
765: 51.985,
770: 61.352,
775: 59.838,
- 780: 58.324},
+ 780: 58.324
+ },
'E': {
300: 100.000,
305: 100.000,
@@ -903,7 +909,8 @@
765: 100.000,
770: 100.000,
775: 100.000,
- 780: 100.000},
+ 780: 100.000
+ },
'F1': {
380: 1.87,
385: 2.36,
@@ -985,7 +992,8 @@
765: 0.69,
770: 0.61,
775: 0.52,
- 780: 0.43},
+ 780: 0.43
+ },
'F2': {
380: 1.18,
385: 1.48,
@@ -1067,7 +1075,8 @@
765: 0.47,
770: 0.40,
775: 0.33,
- 780: 0.27},
+ 780: 0.27
+ },
'F3': {
380: 0.82,
385: 1.02,
@@ -1149,7 +1158,8 @@
765: 0.39,
770: 0.33,
775: 0.28,
- 780: 0.21},
+ 780: 0.21
+ },
'F4': {
380: 0.57,
385: 0.70,
@@ -1231,7 +1241,8 @@
765: 0.36,
770: 0.31,
775: 0.26,
- 780: 0.19},
+ 780: 0.19
+ },
'F5': {
380: 1.87,
385: 2.35,
@@ -1313,7 +1324,8 @@
765: 0.64,
770: 0.55,
775: 0.47,
- 780: 0.40},
+ 780: 0.40
+ },
'F6': {
380: 1.05,
385: 1.31,
@@ -1395,7 +1407,8 @@
765: 0.41,
770: 0.33,
775: 0.26,
- 780: 0.21},
+ 780: 0.21
+ },
'F7': {
380: 2.56,
385: 3.18,
@@ -1477,7 +1490,8 @@
765: 1.32,
770: 1.17,
775: 0.99,
- 780: 0.81},
+ 780: 0.81
+ },
'F8': {
380: 1.21,
385: 1.50,
@@ -1559,7 +1573,8 @@
765: 2.15,
770: 1.89,
775: 1.61,
- 780: 1.32},
+ 780: 1.32
+ },
'F9': {
380: 0.90,
385: 1.12,
@@ -1641,7 +1656,8 @@
765: 1.83,
770: 1.61,
775: 1.38,
- 780: 1.12},
+ 780: 1.12
+ },
'F10': {
380: 1.11,
385: 0.80,
@@ -1723,7 +1739,8 @@
765: 0.22,
770: 0.17,
775: 0.12,
- 780: 0.09},
+ 780: 0.09
+ },
'F11': {
380: 0.91,
385: 0.63,
@@ -1805,7 +1822,8 @@
765: 0.26,
770: 0.16,
775: 0.12,
- 780: 0.09},
+ 780: 0.09
+ },
'F12': {
380: 0.96,
385: 0.64,
@@ -1887,7 +1905,8 @@
765: 0.19,
770: 0.15,
775: 0.10,
- 780: 0.05},
+ 780: 0.05
+ },
'FL3.1': {
380: 2.39,
385: 2.93,
@@ -1969,7 +1988,8 @@
765: 0.95,
770: 1.50,
775: 0.89,
- 780: 0.68},
+ 780: 0.68
+ },
'FL3.2': {
380: 5.80,
385: 6.99,
@@ -2051,7 +2071,8 @@
765: 4.01,
770: 4.09,
775: 3.30,
- 780: 2.82},
+ 780: 2.82
+ },
'FL3.3': {
380: 8.94,
385: 11.21,
@@ -2133,7 +2154,8 @@
765: 2.19,
770: 2.71,
775: 2.00,
- 780: 1.80},
+ 780: 1.80
+ },
'FL3.4': {
380: 3.46,
385: 3.86,
@@ -2215,7 +2237,8 @@
765: 13.63,
770: 10.43,
775: 9.67,
- 780: 8.07},
+ 780: 8.07
+ },
'FL3.5': {
380: 4.72,
385: 5.82,
@@ -2297,7 +2320,8 @@
765: 12.42,
770: 9.43,
775: 8.96,
- 780: 7.39},
+ 780: 7.39
+ },
'FL3.6': {
380: 5.53,
385: 6.63,
@@ -2379,7 +2403,8 @@
765: 11.28,
770: 8.51,
775: 8.24,
- 780: 7.02},
+ 780: 7.02
+ },
'FL3.7': {
380: 3.79,
385: 2.56,
@@ -2461,7 +2486,8 @@
765: 0.46,
770: 0.99,
775: 0.43,
- 780: 0.00},
+ 780: 0.00
+ },
'FL3.8': {
380: 4.18,
385: 2.93,
@@ -2543,7 +2569,8 @@
765: 0.61,
770: 1.25,
775: 0.79,
- 780: 0.58},
+ 780: 0.58
+ },
'FL3.9': {
380: 3.77,
385: 2.64,
@@ -2625,7 +2652,8 @@
765: 0.10,
770: 0.68,
775: 0.16,
- 780: 0.00},
+ 780: 0.00
+ },
'FL3.10': {
380: 0.25,
385: 0.00,
@@ -2707,7 +2735,8 @@
765: 0.00,
770: 0.00,
775: 0.00,
- 780: 0.00},
+ 780: 0.00
+ },
'FL3.11': {
380: 3.85,
385: 2.91,
@@ -2789,7 +2818,8 @@
765: 0.45,
770: 1.04,
775: 0.45,
- 780: 0.00},
+ 780: 0.00
+ },
'FL3.12': {
380: 1.62,
385: 2.06,
@@ -2871,7 +2901,8 @@
765: 4.50,
770: 4.81,
775: 3.72,
- 780: 3.28},
+ 780: 3.28
+ },
'FL3.13': {
380: 2.23,
385: 2.92,
@@ -2953,7 +2984,8 @@
765: 3.74,
770: 4.04,
775: 3.14,
- 780: 2.75},
+ 780: 2.75
+ },
'FL3.14': {
380: 2.87,
385: 3.69,
@@ -3035,7 +3067,8 @@
765: 4.08,
770: 4.43,
775: 3.39,
- 780: 3.17},
+ 780: 3.17
+ },
'FL3.15': {
380: 300,
385: 286,
@@ -3117,7 +3150,8 @@
765: 51,
770: 46,
775: 41,
- 780: 37},
+ 780: 37
+ },
'HP1': {
380: 1.90,
385: 2.20,
@@ -3199,7 +3233,8 @@
765: 31.97,
770: 27.87,
775: 5.89,
- 780: 6.69},
+ 780: 6.69
+ },
'HP2': {
380: 2.64,
385: 2.77,
@@ -3281,7 +3316,8 @@
765: 83.04,
770: 86.25,
775: 63.93,
- 780: 64.92},
+ 780: 64.92
+ },
'HP3': {
380: 3.15,
385: 7.49,
@@ -3363,7 +3399,8 @@
765: 17.81,
770: 16.07,
775: 14.83,
- 780: 14.61},
+ 780: 14.61
+ },
'HP4': {
380: 9.80,
385: 13.30,
@@ -3445,7 +3482,8 @@
765: 24.46,
770: 22.05,
775: 16.11,
- 780: 12.91},
+ 780: 12.91
+ },
'HP5': {
380: 0.34,
385: 7.11,
@@ -3527,91 +3565,94 @@
765: 34.58,
770: 30.21,
775: 19.71,
- 780: 15.61}}
+ 780: 15.61
+ }
+}
-ILLUMINANTS_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'A': SpectralPowerDistribution(
+ILLUMINANTS_RELATIVE_SPDS = CaseInsensitiveMapping({
+ 'A': SpectralPowerDistribution(
'A', ILLUMINANTS_RELATIVE_SPDS_DATA['A']),
- 'B': SpectralPowerDistribution(
- 'B', ILLUMINANTS_RELATIVE_SPDS_DATA['B']),
- 'C': SpectralPowerDistribution(
- 'C', ILLUMINANTS_RELATIVE_SPDS_DATA['C']),
- 'D50': SpectralPowerDistribution(
- 'D50', ILLUMINANTS_RELATIVE_SPDS_DATA['D50']),
- 'D55': SpectralPowerDistribution(
- 'D55', ILLUMINANTS_RELATIVE_SPDS_DATA['D55']),
- 'D60': SpectralPowerDistribution(
- 'D60', ILLUMINANTS_RELATIVE_SPDS_DATA['D60']),
- 'D65': SpectralPowerDistribution(
- 'D65', ILLUMINANTS_RELATIVE_SPDS_DATA['D65']),
- 'D75': SpectralPowerDistribution(
- 'D75', ILLUMINANTS_RELATIVE_SPDS_DATA['D75']),
- 'E': SpectralPowerDistribution(
- 'E', ILLUMINANTS_RELATIVE_SPDS_DATA['E']),
- 'F1': SpectralPowerDistribution(
- 'F1', ILLUMINANTS_RELATIVE_SPDS_DATA['F1']),
- 'F2': SpectralPowerDistribution(
- 'F2', ILLUMINANTS_RELATIVE_SPDS_DATA['F2']),
- 'F3': SpectralPowerDistribution(
- 'F3', ILLUMINANTS_RELATIVE_SPDS_DATA['F3']),
- 'F4': SpectralPowerDistribution(
- 'F4', ILLUMINANTS_RELATIVE_SPDS_DATA['F4']),
- 'F5': SpectralPowerDistribution(
- 'F5', ILLUMINANTS_RELATIVE_SPDS_DATA['F5']),
- 'F6': SpectralPowerDistribution(
- 'F6', ILLUMINANTS_RELATIVE_SPDS_DATA['F6']),
- 'F7': SpectralPowerDistribution(
- 'F7', ILLUMINANTS_RELATIVE_SPDS_DATA['F7']),
- 'F8': SpectralPowerDistribution(
- 'F8', ILLUMINANTS_RELATIVE_SPDS_DATA['F8']),
- 'F9': SpectralPowerDistribution(
- 'F9', ILLUMINANTS_RELATIVE_SPDS_DATA['F9']),
- 'F10': SpectralPowerDistribution(
- 'F10', ILLUMINANTS_RELATIVE_SPDS_DATA['F10']),
- 'F11': SpectralPowerDistribution(
- 'F11', ILLUMINANTS_RELATIVE_SPDS_DATA['F11']),
- 'F12': SpectralPowerDistribution(
- 'F12', ILLUMINANTS_RELATIVE_SPDS_DATA['F12']),
- 'FL3.1': SpectralPowerDistribution(
- 'FL3.1', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.1']),
- 'FL3.2': SpectralPowerDistribution(
- 'FL3.2', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.2']),
- 'FL3.3': SpectralPowerDistribution(
- 'FL3.3', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.3']),
- 'FL3.4': SpectralPowerDistribution(
- 'FL3.4', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.4']),
- 'FL3.5': SpectralPowerDistribution(
- 'FL3.5', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.5']),
- 'FL3.6': SpectralPowerDistribution(
- 'FL3.6', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.6']),
- 'FL3.7': SpectralPowerDistribution(
- 'FL3.7', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.7']),
- 'FL3.8': SpectralPowerDistribution(
- 'FL3.8', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.8']),
- 'FL3.9': SpectralPowerDistribution(
- 'FL3.9', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.9']),
- 'FL3.10': SpectralPowerDistribution(
- 'FL3.10', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.10']),
- 'FL3.11': SpectralPowerDistribution(
- 'FL3.11', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.11']),
- 'FL3.12': SpectralPowerDistribution(
- 'FL3.12', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.12']),
- 'FL3.13': SpectralPowerDistribution(
- 'FL3.13', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.13']),
- 'FL3.14': SpectralPowerDistribution(
- 'FL3.14', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.14']),
- 'FL3.15': SpectralPowerDistribution(
- 'FL3.15', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.15']),
- 'HP1': SpectralPowerDistribution(
- 'HP1', ILLUMINANTS_RELATIVE_SPDS_DATA['HP1']),
- 'HP2': SpectralPowerDistribution(
- 'HP2', ILLUMINANTS_RELATIVE_SPDS_DATA['HP2']),
- 'HP3': SpectralPowerDistribution(
- 'HP3', ILLUMINANTS_RELATIVE_SPDS_DATA['HP3']),
- 'HP4': SpectralPowerDistribution(
- 'HP4', ILLUMINANTS_RELATIVE_SPDS_DATA['HP4']),
- 'HP5': SpectralPowerDistribution(
- 'HP5', ILLUMINANTS_RELATIVE_SPDS_DATA['HP5'])})
+ 'B': SpectralPowerDistribution(
+ 'B', ILLUMINANTS_RELATIVE_SPDS_DATA['B']),
+ 'C': SpectralPowerDistribution(
+ 'C', ILLUMINANTS_RELATIVE_SPDS_DATA['C']),
+ 'D50': SpectralPowerDistribution(
+ 'D50', ILLUMINANTS_RELATIVE_SPDS_DATA['D50']),
+ 'D55': SpectralPowerDistribution(
+ 'D55', ILLUMINANTS_RELATIVE_SPDS_DATA['D55']),
+ 'D60': SpectralPowerDistribution(
+ 'D60', ILLUMINANTS_RELATIVE_SPDS_DATA['D60']),
+ 'D65': SpectralPowerDistribution(
+ 'D65', ILLUMINANTS_RELATIVE_SPDS_DATA['D65']),
+ 'D75': SpectralPowerDistribution(
+ 'D75', ILLUMINANTS_RELATIVE_SPDS_DATA['D75']),
+ 'E': SpectralPowerDistribution(
+ 'E', ILLUMINANTS_RELATIVE_SPDS_DATA['E']),
+ 'F1': SpectralPowerDistribution(
+ 'F1', ILLUMINANTS_RELATIVE_SPDS_DATA['F1']),
+ 'F2': SpectralPowerDistribution(
+ 'F2', ILLUMINANTS_RELATIVE_SPDS_DATA['F2']),
+ 'F3': SpectralPowerDistribution(
+ 'F3', ILLUMINANTS_RELATIVE_SPDS_DATA['F3']),
+ 'F4': SpectralPowerDistribution(
+ 'F4', ILLUMINANTS_RELATIVE_SPDS_DATA['F4']),
+ 'F5': SpectralPowerDistribution(
+ 'F5', ILLUMINANTS_RELATIVE_SPDS_DATA['F5']),
+ 'F6': SpectralPowerDistribution(
+ 'F6', ILLUMINANTS_RELATIVE_SPDS_DATA['F6']),
+ 'F7': SpectralPowerDistribution(
+ 'F7', ILLUMINANTS_RELATIVE_SPDS_DATA['F7']),
+ 'F8': SpectralPowerDistribution(
+ 'F8', ILLUMINANTS_RELATIVE_SPDS_DATA['F8']),
+ 'F9': SpectralPowerDistribution(
+ 'F9', ILLUMINANTS_RELATIVE_SPDS_DATA['F9']),
+ 'F10': SpectralPowerDistribution(
+ 'F10', ILLUMINANTS_RELATIVE_SPDS_DATA['F10']),
+ 'F11': SpectralPowerDistribution(
+ 'F11', ILLUMINANTS_RELATIVE_SPDS_DATA['F11']),
+ 'F12': SpectralPowerDistribution(
+ 'F12', ILLUMINANTS_RELATIVE_SPDS_DATA['F12']),
+ 'FL3.1': SpectralPowerDistribution(
+ 'FL3.1', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.1']),
+ 'FL3.2': SpectralPowerDistribution(
+ 'FL3.2', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.2']),
+ 'FL3.3': SpectralPowerDistribution(
+ 'FL3.3', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.3']),
+ 'FL3.4': SpectralPowerDistribution(
+ 'FL3.4', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.4']),
+ 'FL3.5': SpectralPowerDistribution(
+ 'FL3.5', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.5']),
+ 'FL3.6': SpectralPowerDistribution(
+ 'FL3.6', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.6']),
+ 'FL3.7': SpectralPowerDistribution(
+ 'FL3.7', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.7']),
+ 'FL3.8': SpectralPowerDistribution(
+ 'FL3.8', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.8']),
+ 'FL3.9': SpectralPowerDistribution(
+ 'FL3.9', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.9']),
+ 'FL3.10': SpectralPowerDistribution(
+ 'FL3.10', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.10']),
+ 'FL3.11': SpectralPowerDistribution(
+ 'FL3.11', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.11']),
+ 'FL3.12': SpectralPowerDistribution(
+ 'FL3.12', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.12']),
+ 'FL3.13': SpectralPowerDistribution(
+ 'FL3.13', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.13']),
+ 'FL3.14': SpectralPowerDistribution(
+ 'FL3.14', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.14']),
+ 'FL3.15': SpectralPowerDistribution(
+ 'FL3.15', ILLUMINANTS_RELATIVE_SPDS_DATA['FL3.15']),
+ 'HP1': SpectralPowerDistribution(
+ 'HP1', ILLUMINANTS_RELATIVE_SPDS_DATA['HP1']),
+ 'HP2': SpectralPowerDistribution(
+ 'HP2', ILLUMINANTS_RELATIVE_SPDS_DATA['HP2']),
+ 'HP3': SpectralPowerDistribution(
+ 'HP3', ILLUMINANTS_RELATIVE_SPDS_DATA['HP3']),
+ 'HP4': SpectralPowerDistribution(
+ 'HP4', ILLUMINANTS_RELATIVE_SPDS_DATA['HP4']),
+ 'HP5': SpectralPowerDistribution(
+ 'HP5', ILLUMINANTS_RELATIVE_SPDS_DATA['HP5'])
+}) # yapf: disable
"""
*CIE* illuminants relative spectral power distributions.
diff --git a/colour/colorimetry/dataset/lefs.py b/colour/colorimetry/dataset/lefs.py
index 0576039f30..efe0f4bbd2 100644
--- a/colour/colorimetry/dataset/lefs.py
+++ b/colour/colorimetry/dataset/lefs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Luminous Efficiency Functions Spectral Power Distributions
==========================================================
@@ -65,12 +64,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['PHOTOPIC_LEFS_DATA',
- 'PHOTOPIC_LEFS',
- 'SCOTOPIC_LEFS_DATA',
- 'SCOTOPIC_LEFS',
- 'LEFS',
- 'MESOPIC_X_DATA']
+__all__ = [
+ 'PHOTOPIC_LEFS_DATA', 'PHOTOPIC_LEFS', 'SCOTOPIC_LEFS_DATA',
+ 'SCOTOPIC_LEFS', 'LEFS', 'MESOPIC_X_DATA'
+]
PHOTOPIC_LEFS_DATA = {
'CIE 1924 Photopic Standard Observer': {
@@ -544,7 +541,8 @@
827: 0.0000005575746,
828: 0.0000005198080,
829: 0.0000004846123,
- 830: 0.0000004518100},
+ 830: 0.0000004518100
+ },
'Judd Modified CIE 1951 Photopic Standard Observer': {
370: 0.0001,
380: 0.0004,
@@ -586,7 +584,8 @@
740: 0.0002,
750: 0.0001,
760: 0.0001,
- 770: 0.0000},
+ 770: 0.0000
+ },
'Judd-Vos Modified CIE 1978 Photopic Standard Observer': {
380: 0.0002000000,
381: 0.0002282100,
@@ -988,7 +987,8 @@
777: 0.0000184529,
778: 0.0000172169,
779: 0.0000160646,
- 780: 0.0000149900},
+ 780: 0.0000149900
+ },
'CIE 1964 Photopic 10 Degree Standard Observer': {
360: 0.000000013398,
361: 0.000000020294,
@@ -1460,7 +1460,8 @@
827: 0.000000749780,
828: 0.000000707440,
829: 0.000000667480,
- 830: 0.000000629700},
+ 830: 0.000000629700
+ },
'CIE 2008 2 Degree Physiologically Relevant LEF': {
390: 4.14616e-04,
391: 5.02833e-04,
@@ -1902,7 +1903,8 @@
827: 8.38669e-07,
828: 7.91454e-07,
829: 7.47077e-07,
- 830: 7.05386e-07},
+ 830: 7.05386e-07
+ },
'CIE 2008 10 Degree Physiologically Relevant LEF': {
390: 4.07678e-04,
391: 4.97777e-04,
@@ -2344,42 +2346,45 @@
827: 7.54436e-07,
828: 7.11962e-07,
829: 6.72042e-07,
- 830: 6.34538e-07}}
+ 830: 6.34538e-07
+ }
+}
-PHOTOPIC_LEFS = CaseInsensitiveMapping(
- {'CIE 1924 Photopic Standard Observer':
+PHOTOPIC_LEFS = CaseInsensitiveMapping({
+ 'CIE 1924 Photopic Standard Observer':
SpectralPowerDistribution(
'CIE 1924 Photopic Standard Observer',
PHOTOPIC_LEFS_DATA[
'CIE 1924 Photopic Standard Observer']),
- 'Judd Modified CIE 1951 Photopic Standard Observer':
- SpectralPowerDistribution(
- 'Judd Modified CIE 1951 Photopic Standard Observer',
- PHOTOPIC_LEFS_DATA[
- 'Judd Modified CIE 1951 Photopic Standard Observer']),
- 'Judd-Vos Modified CIE 1978 Photopic Standard Observer':
- SpectralPowerDistribution(
- 'Judd-Vos Modified CIE 1978 Photopic Standard Observer',
- PHOTOPIC_LEFS_DATA[
- 'Judd-Vos Modified CIE 1978 Photopic Standard Observer']),
- 'CIE 1964 Photopic 10 Degree Standard Observer':
- SpectralPowerDistribution(
- 'CIE 1964 Photopic 10 Degree Standard Observer',
- PHOTOPIC_LEFS_DATA[
- 'CIE 1964 Photopic 10 Degree Standard Observer'],
- 'CIE 1964 Photopic 10$^\\circ$ Standard Observer'),
- 'CIE 2008 2 Degree Physiologically Relevant LEF':
- SpectralPowerDistribution(
- 'CIE 2008 2 Degree Physiologically Relevant LEF',
- PHOTOPIC_LEFS_DATA[
- 'CIE 2008 2 Degree Physiologically Relevant LEF'],
- 'CIE 2008 2$^\\circ$ Physiologically Relevant LEF'),
- 'CIE 2008 10 Degree Physiologically Relevant LEF':
- SpectralPowerDistribution(
- 'CIE 2008 10 Degree Physiologically Relevant LEF',
- PHOTOPIC_LEFS_DATA[
- 'CIE 2008 10 Degree Physiologically Relevant LEF'],
- 'CIE 2008 10$^\\circ$ Physiologically Relevant LEF')})
+ 'Judd Modified CIE 1951 Photopic Standard Observer':
+ SpectralPowerDistribution(
+ 'Judd Modified CIE 1951 Photopic Standard Observer',
+ PHOTOPIC_LEFS_DATA[
+ 'Judd Modified CIE 1951 Photopic Standard Observer']),
+ 'Judd-Vos Modified CIE 1978 Photopic Standard Observer':
+ SpectralPowerDistribution(
+ 'Judd-Vos Modified CIE 1978 Photopic Standard Observer',
+ PHOTOPIC_LEFS_DATA[
+ 'Judd-Vos Modified CIE 1978 Photopic Standard Observer']),
+ 'CIE 1964 Photopic 10 Degree Standard Observer':
+ SpectralPowerDistribution(
+ 'CIE 1964 Photopic 10 Degree Standard Observer',
+ PHOTOPIC_LEFS_DATA[
+ 'CIE 1964 Photopic 10 Degree Standard Observer'],
+ 'CIE 1964 Photopic 10$^\\circ$ Standard Observer'),
+ 'CIE 2008 2 Degree Physiologically Relevant LEF':
+ SpectralPowerDistribution(
+ 'CIE 2008 2 Degree Physiologically Relevant LEF',
+ PHOTOPIC_LEFS_DATA[
+ 'CIE 2008 2 Degree Physiologically Relevant LEF'],
+ 'CIE 2008 2$^\\circ$ Physiologically Relevant LEF'),
+ 'CIE 2008 10 Degree Physiologically Relevant LEF':
+ SpectralPowerDistribution(
+ 'CIE 2008 10 Degree Physiologically Relevant LEF',
+ PHOTOPIC_LEFS_DATA[
+ 'CIE 2008 10 Degree Physiologically Relevant LEF'],
+ 'CIE 2008 10$^\\circ$ Physiologically Relevant LEF')
+}) # yapf: disable
"""
Photopic luminous efficiency functions.
@@ -2803,12 +2808,16 @@
777: 0.0000001638,
778: 0.0000001551,
779: 0.0000001468,
- 780: 0.0000001390, }}
+ 780: 0.0000001390,
+ }
+}
-SCOTOPIC_LEFS = CaseInsensitiveMapping(
- {'CIE 1951 Scotopic Standard Observer': SpectralPowerDistribution(
- 'CIE 1951 Scotopic Standard Observer',
- SCOTOPIC_LEFS_DATA['CIE 1951 Scotopic Standard Observer'])})
+SCOTOPIC_LEFS = CaseInsensitiveMapping({
+ 'CIE 1951 Scotopic Standard Observer':
+ SpectralPowerDistribution(
+ 'CIE 1951 Scotopic Standard Observer',
+ SCOTOPIC_LEFS_DATA['CIE 1951 Scotopic Standard Observer'])
+})
"""
Scotopic luminous efficiency functions.
@@ -2838,27 +2847,51 @@
LEFS.update(SCOTOPIC_LEFS)
MESOPIC_X_DATA = {
- 0.01: CaseInsensitiveMapping(
- {'Blue Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.13, 'LRC': 0.04}),
- 'Red Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.00, 'LRC': 0.01})}),
- 0.1: CaseInsensitiveMapping({
- 'Blue Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.42, 'LRC': 0.28}),
- 'Red Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.34, 'LRC': 0.11})}),
- 1.0: CaseInsensitiveMapping({
- 'Blue Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.70, 'LRC': 1.00}),
- 'Red Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.68, 'LRC': 1.00})}),
- 10: CaseInsensitiveMapping({
- 'Blue Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.98, 'LRC': 1.00}),
- 'Red Heavy': CaseInsensitiveMapping(
- {'MOVE': 0.98, 'LRC': 1.00})})}
-
+ 0.01:
+ CaseInsensitiveMapping({
+ 'Blue Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.13,
+ 'LRC': 0.04
+ }),
+ 'Red Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.00,
+ 'LRC': 0.01
+ })
+ }),
+ 0.1:
+ CaseInsensitiveMapping({
+ 'Blue Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.42,
+ 'LRC': 0.28
+ }),
+ 'Red Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.34,
+ 'LRC': 0.11
+ })
+ }),
+ 1.0:
+ CaseInsensitiveMapping({
+ 'Blue Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.70,
+ 'LRC': 1.00
+ }),
+ 'Red Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.68,
+ 'LRC': 1.00
+ })
+ }),
+ 10:
+ CaseInsensitiveMapping({
+ 'Blue Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.98,
+ 'LRC': 1.00
+ }),
+ 'Red Heavy': CaseInsensitiveMapping({
+ 'MOVE': 0.98,
+ 'LRC': 1.00
+ })
+ })
+}
"""
Weighting factors for the mesopic luminous efficiency function calculation.
diff --git a/colour/colorimetry/dataset/light_sources/__init__.py b/colour/colorimetry/dataset/light_sources/__init__.py
index a91316cdc7..aa2488375d 100644
--- a/colour/colorimetry/dataset/light_sources/__init__.py
+++ b/colour/colorimetry/dataset/light_sources/__init__.py
@@ -6,5 +6,4 @@
from .chromaticity_coordinates import LIGHT_SOURCES
from .spds import LIGHT_SOURCES_RELATIVE_SPDS
-__all__ = ['LIGHT_SOURCES',
- 'LIGHT_SOURCES_RELATIVE_SPDS']
+__all__ = ['LIGHT_SOURCES', 'LIGHT_SOURCES_RELATIVE_SPDS']
diff --git a/colour/colorimetry/dataset/light_sources/chromaticity_coordinates.py b/colour/colorimetry/dataset/light_sources/chromaticity_coordinates.py
index dad0f465a8..faecb3715e 100644
--- a/colour/colorimetry/dataset/light_sources/chromaticity_coordinates.py
+++ b/colour/colorimetry/dataset/light_sources/chromaticity_coordinates.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Light Sources Chromaticity Coordinates
======================================
@@ -65,26 +64,28 @@
'LIGHT_SOURCES_NIST_PHILIPS_CIE_1964_10_DEGREE_STANDARD_OBSERVER',
'LIGHT_SOURCES_PROJECTORS_CIE_1931_2_DEGREE_STANDARD_OBSERVER',
'LIGHT_SOURCES_PROJECTORS_CIE_1964_10_DEGREE_STANDARD_OBSERVER',
- 'LIGHT_SOURCES']
+ 'LIGHT_SOURCES'
+]
LIGHT_SOURCES_RIT_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Natural': np.array(
- [0.381585730647787, 0.359224138274067]),
- 'Philips TL-84': np.array(
- [0.378413599970988, 0.379290254544090]),
- 'SA': np.array(
- [0.447573030734154, 0.407438137156467]),
- 'SC': np.array(
- [0.310056734303928, 0.316145704789204]),
- 'T8 Luxline Plus White': np.array(
- [0.410492204086250, 0.388932529676840]),
- 'T8 Polylux 3000': np.array(
- [0.431706082207185, 0.413877736072647]),
- 'T8 Polylux 4000': np.array(
- [0.379219473139794, 0.384469085577631]),
- 'Thorn Kolor-rite': np.array(
- [0.381919124282806, 0.374309261641251])}))
+ 'Natural':
+ np.array([0.381585730647787, 0.359224138274067]),
+ 'Philips TL-84':
+ np.array([0.378413599970988, 0.379290254544090]),
+ 'SA':
+ np.array([0.447573030734154, 0.407438137156467]),
+ 'SC':
+ np.array([0.310056734303928, 0.316145704789204]),
+ 'T8 Luxline Plus White':
+ np.array([0.410492204086250, 0.388932529676840]),
+ 'T8 Polylux 3000':
+ np.array([0.431706082207185, 0.413877736072647]),
+ 'T8 Polylux 4000':
+ np.array([0.379219473139794, 0.384469085577631]),
+ 'Thorn Kolor-rite':
+ np.array([0.381919124282806, 0.374309261641251])
+ }))
"""
Light sources chromaticity coordinates from *RIT* *PointerData.xls* spreadsheet
for *CIE 1931 2 Degree Standard Observer*.
@@ -97,7 +98,7 @@
References
----------
-.. [1] Pointer, M. R. (1980). Pointer’s Gamut Data. Retrieved from
+.. [1] Pointer, M. R. (1980). Pointer's Gamut Data. Retrieved from
http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls
LIGHT_SOURCES_RIT_CIE_1931_2_DEGREE_STANDARD_OBSERVER : CaseInsensitiveMapping
@@ -107,22 +108,23 @@
LIGHT_SOURCES_RIT_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Natural': np.array(
- [0.384870991183035, 0.353869223366545]),
- 'Philips TL-84': np.array(
- [0.383592002892950, 0.373922741815762]),
- 'SA': np.array(
- [0.451176803594070, 0.405936046781591]),
- 'SC': np.array(
- [0.310388637415649, 0.319050651220986]),
- 'T8 Luxline Plus White': np.array(
- [0.416946978831203, 0.380991426462756]),
- 'T8 Polylux 3000': np.array(
- [0.439038926288670, 0.404554330124715]),
- 'T8 Polylux 4000': np.array(
- [0.385115161872875, 0.377800928395769]),
- 'Thorn Kolor-rite': np.array(
- [0.385533929282467, 0.370840492090948])}))
+ 'Natural':
+ np.array([0.384870991183035, 0.353869223366545]),
+ 'Philips TL-84':
+ np.array([0.383592002892950, 0.373922741815762]),
+ 'SA':
+ np.array([0.451176803594070, 0.405936046781591]),
+ 'SC':
+ np.array([0.310388637415649, 0.319050651220986]),
+ 'T8 Luxline Plus White':
+ np.array([0.416946978831203, 0.380991426462756]),
+ 'T8 Polylux 3000':
+ np.array([0.439038926288670, 0.404554330124715]),
+ 'T8 Polylux 4000':
+ np.array([0.385115161872875, 0.377800928395769]),
+ 'Thorn Kolor-rite':
+ np.array([0.385533929282467, 0.370840492090948])
+ }))
"""
Light sources chromaticity coordinates from *RIT* *PointerData.xls* spreadsheet
for *CIE 1964 10 Degree Standard Observer*. [1]_
@@ -134,26 +136,27 @@
LIGHT_SOURCES_NIST_TRADITIONAL_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Cool White FL': np.array([
- 0.369256318971281, 0.372549878176631]),
- 'Daylight FL': np.array([
- 0.312662993963651, 0.331985688793009]),
- 'HPS': np.array([
- 0.521677696062816, 0.417971177117239]),
- 'Incandescent': np.array([
- 0.450730217519680, 0.408046128945005]),
- 'LPS': np.array([
- 0.575151311365165, 0.424232234924905]),
- 'Mercury': np.array([
- 0.392018457637112, 0.383777071984453]),
- 'Metal Halide': np.array([
- 0.372544558972793, 0.385603925927588]),
- 'Neodimium Incandescent': np.array([
- 0.447398697052100, 0.395008601248268]),
- 'Super HPS': np.array([
- 0.470061659271846, 0.406116584248741]),
- 'Triphosphor FL': np.array([
- 0.413163268257275, 0.396422053758680])}))
+ 'Cool White FL':
+ np.array([0.369256318971281, 0.372549878176631]),
+ 'Daylight FL':
+ np.array([0.312662993963651, 0.331985688793009]),
+ 'HPS':
+ np.array([0.521677696062816, 0.417971177117239]),
+ 'Incandescent':
+ np.array([0.450730217519680, 0.408046128945005]),
+ 'LPS':
+ np.array([0.575151311365165, 0.424232234924905]),
+ 'Mercury':
+ np.array([0.392018457637112, 0.383777071984453]),
+ 'Metal Halide':
+ np.array([0.372544558972793, 0.385603925927588]),
+ 'Neodimium Incandescent':
+ np.array([0.447398697052100, 0.395008601248268]),
+ 'Super HPS':
+ np.array([0.470061659271846, 0.406116584248741]),
+ 'Triphosphor FL':
+ np.array([0.413163268257275, 0.396422053758680])
+ }))
"""
Traditional light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet.
@@ -171,26 +174,27 @@
LIGHT_SOURCES_NIST_TRADITIONAL_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Cool White FL': np.array([
- 0.376715047518455, 0.364576802118673]),
- 'Daylight FL': np.array([
- 0.317395878738965, 0.330780819136676]),
- 'HPS': np.array([
- 0.531764495177513, 0.408752715284645]),
- 'Incandescent': np.array([
- 0.454365604973572, 0.406573684216774]),
- 'LPS': np.array([
- 0.589960045887891, 0.410039954112109]),
- 'Mercury': np.array([
- 0.401266412873755, 0.364732538221183]),
- 'Metal Halide': np.array([
- 0.378786167751226, 0.377496928504661]),
- 'Neodimium Incandescent': np.array([
- 0.447516717156694, 0.396734151368497]),
- 'Super HPS': np.array([
- 0.473859567146135, 0.401381825309197]),
- 'Triphosphor FL': np.array([
- 0.418591963931736, 0.388947713332192])}))
+ 'Cool White FL':
+ np.array([0.376715047518455, 0.364576802118673]),
+ 'Daylight FL':
+ np.array([0.317395878738965, 0.330780819136676]),
+ 'HPS':
+ np.array([0.531764495177513, 0.408752715284645]),
+ 'Incandescent':
+ np.array([0.454365604973572, 0.406573684216774]),
+ 'LPS':
+ np.array([0.589960045887891, 0.410039954112109]),
+ 'Mercury':
+ np.array([0.401266412873755, 0.364732538221183]),
+ 'Metal Halide':
+ np.array([0.378786167751226, 0.377496928504661]),
+ 'Neodimium Incandescent':
+ np.array([0.447516717156694, 0.396734151368497]),
+ 'Super HPS':
+ np.array([0.473859567146135, 0.401381825309197]),
+ 'Triphosphor FL':
+ np.array([0.418591963931736, 0.388947713332192])
+ }))
"""
Traditional light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -203,36 +207,37 @@
LIGHT_SOURCES_NIST_LED_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- '3-LED-1 (457/540/605)': np.array([
- 0.417057686949170, 0.396262457986602]),
- '3-LED-2 (473/545/616)': np.array([
- 0.417060475566006, 0.396268120523418]),
- '3-LED-2 Yellow': np.array([
- 0.436563079184047, 0.443649619298676]),
- '3-LED-3 (465/546/614)': np.array([
- 0.380460502184482, 0.376772001481922]),
- '3-LED-4 (455/547/623)': np.array([
- 0.417067943691045, 0.396276280071757]),
- '4-LED No Yellow': np.array([
- 0.417060589301332, 0.396268153712350]),
- '4-LED Yellow': np.array([
- 0.417069637940463, 0.396276766014859]),
- '4-LED-1 (461/526/576/624)': np.array([
- 0.417067615440556, 0.396275056779587]),
- '4-LED-2 (447/512/573/627)': np.array([
- 0.417071570560054, 0.396278745130373]),
- 'Luxeon WW 2880': np.array([
- 0.459088527920913, 0.432916480607903]),
- 'PHOS-1': np.array([
- 0.436443167801164, 0.404616033549917]),
- 'PHOS-2': np.array([
- 0.452704462198571, 0.437584543052711]),
- 'PHOS-3': np.array([
- 0.436899870751359, 0.404037372134463]),
- 'PHOS-4': np.array([
- 0.436936023906427, 0.404113558278629]),
- 'Phosphor LED YAG': np.array([
- 0.307761817314310, 0.325268939239941])}))
+ '3-LED-1 (457/540/605)':
+ np.array([0.417057686949170, 0.396262457986602]),
+ '3-LED-2 (473/545/616)':
+ np.array([0.417060475566006, 0.396268120523418]),
+ '3-LED-2 Yellow':
+ np.array([0.436563079184047, 0.443649619298676]),
+ '3-LED-3 (465/546/614)':
+ np.array([0.380460502184482, 0.376772001481922]),
+ '3-LED-4 (455/547/623)':
+ np.array([0.417067943691045, 0.396276280071757]),
+ '4-LED No Yellow':
+ np.array([0.417060589301332, 0.396268153712350]),
+ '4-LED Yellow':
+ np.array([0.417069637940463, 0.396276766014859]),
+ '4-LED-1 (461/526/576/624)':
+ np.array([0.417067615440556, 0.396275056779587]),
+ '4-LED-2 (447/512/573/627)':
+ np.array([0.417071570560054, 0.396278745130373]),
+ 'Luxeon WW 2880':
+ np.array([0.459088527920913, 0.432916480607903]),
+ 'PHOS-1':
+ np.array([0.436443167801164, 0.404616033549917]),
+ 'PHOS-2':
+ np.array([0.452704462198571, 0.437584543052711]),
+ 'PHOS-3':
+ np.array([0.436899870751359, 0.404037372134463]),
+ 'PHOS-4':
+ np.array([0.436936023906427, 0.404113558278629]),
+ 'Phosphor LED YAG':
+ np.array([0.307761817314310, 0.325268939239941])
+ }))
"""
LED light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -247,36 +252,37 @@
LIGHT_SOURCES_NIST_LED_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- '3-LED-1 (457/540/605)': np.array([
- 0.425099988926548, 0.389451349911075]),
- '3-LED-2 (473/545/616)': np.array([
- 0.422222118774217, 0.401298495594226]),
- '3-LED-2 Yellow': np.array([
- 0.446222216139125, 0.441646464276087]),
- '3-LED-3 (465/546/614)': np.array([
- 0.387470465801936, 0.376404716015666]),
- '3-LED-4 (455/547/623)': np.array([
- 0.422865464107041, 0.388772240171637]),
- '4-LED No Yellow': np.array([
- 0.419807532952439, 0.399465294930377]),
- '4-LED Yellow': np.array([
- 0.422720601750053, 0.390284663473479]),
- '4-LED-1 (461/526/576/624)': np.array([
- 0.423899783323037, 0.394170886226971]),
- '4-LED-2 (447/512/573/627)': np.array([
- 0.421571042053867, 0.394089741928601]),
- 'Luxeon WW 2880': np.array([
- 0.466639299623263, 0.430817417218051]),
- 'PHOS-1': np.array([
- 0.440120001281140, 0.403135783393416]),
- 'PHOS-2': np.array([
- 0.461487398870558, 0.436150294667024]),
- 'PHOS-3': np.array([
- 0.440892655302172, 0.408662264402299]),
- 'PHOS-4': np.array([
- 0.441760443951475, 0.407267478268879]),
- 'Phosphor LED YAG': np.array([
- 0.312807834772696, 0.334180937864035])}))
+ '3-LED-1 (457/540/605)':
+ np.array([0.425099988926548, 0.389451349911075]),
+ '3-LED-2 (473/545/616)':
+ np.array([0.422222118774217, 0.401298495594226]),
+ '3-LED-2 Yellow':
+ np.array([0.446222216139125, 0.441646464276087]),
+ '3-LED-3 (465/546/614)':
+ np.array([0.387470465801936, 0.376404716015666]),
+ '3-LED-4 (455/547/623)':
+ np.array([0.422865464107041, 0.388772240171637]),
+ '4-LED No Yellow':
+ np.array([0.419807532952439, 0.399465294930377]),
+ '4-LED Yellow':
+ np.array([0.422720601750053, 0.390284663473479]),
+ '4-LED-1 (461/526/576/624)':
+ np.array([0.423899783323037, 0.394170886226971]),
+ '4-LED-2 (447/512/573/627)':
+ np.array([0.421571042053867, 0.394089741928601]),
+ 'Luxeon WW 2880':
+ np.array([0.466639299623263, 0.430817417218051]),
+ 'PHOS-1':
+ np.array([0.440120001281140, 0.403135783393416]),
+ 'PHOS-2':
+ np.array([0.461487398870558, 0.436150294667024]),
+ 'PHOS-3':
+ np.array([0.440892655302172, 0.408662264402299]),
+ 'PHOS-4':
+ np.array([0.441760443951475, 0.407267478268879]),
+ 'Phosphor LED YAG':
+ np.array([0.312807834772696, 0.334180937864035])
+ }))
"""
LED light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -292,50 +298,51 @@
LIGHT_SOURCES_NIST_PHILIPS_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- '60 A/W (Soft White)': np.array([
- 0.450730217519680, 0.408046128945005]),
- 'C100S54 (HPS)': np.array([
- 0.529231515407657, 0.411370164988427]),
- 'C100S54C (HPS)': np.array([
- 0.502380414374839, 0.415877299905475]),
- 'F32T8/TL830 (Triphosphor)': np.array([
- 0.443250764475753, 0.409523700296928]),
- 'F32T8/TL835 (Triphosphor)': np.array([
- 0.407150274569933, 0.393172743482571]),
- 'F32T8/TL841 (Triphosphor)': np.array([
- 0.385376686681605, 0.390370762102806]),
- 'F32T8/TL850 (Triphosphor)': np.array([
- 0.343768910392287, 0.358447436104108]),
- 'F32T8/TL865 /PLUS (Triphosphor)': np.array([
- 0.316368879615201, 0.345320790143017]),
- 'F34/CW/RS/EW (Cool White FL)': np.array([
- 0.377250931364378, 0.393087658636060]),
- 'F34T12/LW/RS /EW': np.array([
- 0.378863642993776, 0.394960629979820]),
- 'F34T12WW/RS /EW (Warm White FL)': np.array([
- 0.438466967656789, 0.408635441565706]),
- 'F40/C50 (Broadband FL)': np.array([
- 0.345836574973021, 0.361724450389430]),
- 'F40/C75 (Broadband FL)': np.array([
- 0.299966663385220, 0.316582165804824]),
- 'F40/CWX (Broadband FL)': np.array([
- 0.375037045754214, 0.360543952129462]),
- 'F40/DX (Broadband FL)': np.array([
- 0.311922310746537, 0.342802103417329]),
- 'F40/DXTP (Delux FL)': np.array([
- 0.313066543826958, 0.342225714484412]),
- 'F40/N (Natural FL)': np.array([
- 0.376878697365115, 0.354153458302878]),
- 'H38HT-100 (Mercury)': np.array([
- 0.311200590193641, 0.382944245857018]),
- 'H38JA-100/DX (Mercury DX)': np.array([
- 0.389791630360359, 0.373394688931767]),
- 'MHC100/U/MP /3K': np.array([
- 0.428581768670222, 0.388168915678330]),
- 'MHC100/U/MP /4K': np.array([
- 0.373145253482762, 0.371366990216717]),
- 'SDW-T 100W/LV (Super HPS)': np.array([
- 0.472339157938672, 0.407106330880316])}))
+ '60 A/W (Soft White)':
+ np.array([0.450730217519680, 0.408046128945005]),
+ 'C100S54 (HPS)':
+ np.array([0.529231515407657, 0.411370164988427]),
+ 'C100S54C (HPS)':
+ np.array([0.502380414374839, 0.415877299905475]),
+ 'F32T8/TL830 (Triphosphor)':
+ np.array([0.443250764475753, 0.409523700296928]),
+ 'F32T8/TL835 (Triphosphor)':
+ np.array([0.407150274569933, 0.393172743482571]),
+ 'F32T8/TL841 (Triphosphor)':
+ np.array([0.385376686681605, 0.390370762102806]),
+ 'F32T8/TL850 (Triphosphor)':
+ np.array([0.343768910392287, 0.358447436104108]),
+ 'F32T8/TL865 /PLUS (Triphosphor)':
+ np.array([0.316368879615201, 0.345320790143017]),
+ 'F34/CW/RS/EW (Cool White FL)':
+ np.array([0.377250931364378, 0.393087658636060]),
+ 'F34T12/LW/RS /EW':
+ np.array([0.378863642993776, 0.394960629979820]),
+ 'F34T12WW/RS /EW (Warm White FL)':
+ np.array([0.438466967656789, 0.408635441565706]),
+ 'F40/C50 (Broadband FL)':
+ np.array([0.345836574973021, 0.361724450389430]),
+ 'F40/C75 (Broadband FL)':
+ np.array([0.299966663385220, 0.316582165804824]),
+ 'F40/CWX (Broadband FL)':
+ np.array([0.375037045754214, 0.360543952129462]),
+ 'F40/DX (Broadband FL)':
+ np.array([0.311922310746537, 0.342802103417329]),
+ 'F40/DXTP (Delux FL)':
+ np.array([0.313066543826958, 0.342225714484412]),
+ 'F40/N (Natural FL)':
+ np.array([0.376878697365115, 0.354153458302878]),
+ 'H38HT-100 (Mercury)':
+ np.array([0.311200590193641, 0.382944245857018]),
+ 'H38JA-100/DX (Mercury DX)':
+ np.array([0.389791630360359, 0.373394688931767]),
+ 'MHC100/U/MP /3K':
+ np.array([0.428581768670222, 0.388168915678330]),
+ 'MHC100/U/MP /4K':
+ np.array([0.373145253482762, 0.371366990216717]),
+ 'SDW-T 100W/LV (Super HPS)':
+ np.array([0.472339157938672, 0.407106330880316])
+ }))
"""
Philips light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -355,50 +362,51 @@
LIGHT_SOURCES_NIST_PHILIPS_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- '60 A/W (Soft White)': np.array([
- 0.454365604973572, 0.406573684216774]),
- 'C100S54 (HPS)': np.array([
- 0.538554605063010, 0.402575827972962]),
- 'C100S54C (HPS)': np.array([
- 0.509663059970892, 0.409064508209193]),
- 'F32T8/TL830 (Triphosphor)': np.array([
- 0.448795219301811, 0.403574636091678]),
- 'F32T8/TL835 (Triphosphor)': np.array([
- 0.412082534290652, 0.388001071127592]),
- 'F32T8/TL841 (Triphosphor)': np.array([
- 0.390908619219527, 0.385290559992705]),
- 'F32T8/TL850 (Triphosphor)': np.array([
- 0.347882431257452, 0.355845742210551]),
- 'F32T8/TL865 /PLUS (Triphosphor)': np.array([
- 0.320698199593768, 0.343871441043854]),
- 'F34/CW/RS/EW (Cool White FL)': np.array([
- 0.386514853545337, 0.382843326097814]),
- 'F34T12/LW/RS /EW': np.array([
- 0.389628909159399, 0.382074721889904]),
- 'F34T12WW/RS /EW (Warm White FL)': np.array([
- 0.448395377616960, 0.395666643335296]),
- 'F40/C50 (Broadband FL)': np.array([
- 0.349880827196884, 0.360661316491439]),
- 'F40/C75 (Broadband FL)': np.array([
- 0.301988533872761, 0.318479025875818]),
- 'F40/CWX (Broadband FL)': np.array([
- 0.378502309910296, 0.356371890168937]),
- 'F40/DX (Broadband FL)': np.array([
- 0.316783037559153, 0.341749269085077]),
- 'F40/DXTP (Delux FL)': np.array([
- 0.318774745065791, 0.339798825605488]),
- 'F40/N (Natural FL)': np.array([
- 0.378833157741751, 0.350724402658646]),
- 'H38HT-100 (Mercury)': np.array([
- 0.326260627082484, 0.360001095895205]),
- 'H38JA-100/DX (Mercury DX)': np.array([
- 0.397058597517533, 0.356532431806974]),
- 'MHC100/U/MP /3K': np.array([
- 0.431422986591898, 0.380642213887539]),
- 'MHC100/U/MP /4K': np.array([
- 0.375707105948115, 0.366156465779779]),
- 'SDW-T 100W/LV (Super HPS)': np.array([
- 0.476461908192661, 0.402288012403575])}))
+ '60 A/W (Soft White)':
+ np.array([0.454365604973572, 0.406573684216774]),
+ 'C100S54 (HPS)':
+ np.array([0.538554605063010, 0.402575827972962]),
+ 'C100S54C (HPS)':
+ np.array([0.509663059970892, 0.409064508209193]),
+ 'F32T8/TL830 (Triphosphor)':
+ np.array([0.448795219301811, 0.403574636091678]),
+ 'F32T8/TL835 (Triphosphor)':
+ np.array([0.412082534290652, 0.388001071127592]),
+ 'F32T8/TL841 (Triphosphor)':
+ np.array([0.390908619219527, 0.385290559992705]),
+ 'F32T8/TL850 (Triphosphor)':
+ np.array([0.347882431257452, 0.355845742210551]),
+ 'F32T8/TL865 /PLUS (Triphosphor)':
+ np.array([0.320698199593768, 0.343871441043854]),
+ 'F34/CW/RS/EW (Cool White FL)':
+ np.array([0.386514853545337, 0.382843326097814]),
+ 'F34T12/LW/RS /EW':
+ np.array([0.389628909159399, 0.382074721889904]),
+ 'F34T12WW/RS /EW (Warm White FL)':
+ np.array([0.448395377616960, 0.395666643335296]),
+ 'F40/C50 (Broadband FL)':
+ np.array([0.349880827196884, 0.360661316491439]),
+ 'F40/C75 (Broadband FL)':
+ np.array([0.301988533872761, 0.318479025875818]),
+ 'F40/CWX (Broadband FL)':
+ np.array([0.378502309910296, 0.356371890168937]),
+ 'F40/DX (Broadband FL)':
+ np.array([0.316783037559153, 0.341749269085077]),
+ 'F40/DXTP (Delux FL)':
+ np.array([0.318774745065791, 0.339798825605488]),
+ 'F40/N (Natural FL)':
+ np.array([0.378833157741751, 0.350724402658646]),
+ 'H38HT-100 (Mercury)':
+ np.array([0.326260627082484, 0.360001095895205]),
+ 'H38JA-100/DX (Mercury DX)':
+ np.array([0.397058597517533, 0.356532431806974]),
+ 'MHC100/U/MP /3K':
+ np.array([0.431422986591898, 0.380642213887539]),
+ 'MHC100/U/MP /4K':
+ np.array([0.375707105948115, 0.366156465779779]),
+ 'SDW-T 100W/LV (Super HPS)':
+ np.array([0.476461908192661, 0.402288012403575])
+ }))
"""
Philips light sources chromaticity coordinates from *NIST*
*NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -418,8 +426,8 @@
LIGHT_SOURCES_PROJECTORS_CIE_1931_2_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Kinoton 75P': np.array([
- 0.315252413629716, 0.332870794805328])}))
+ 'Kinoton 75P': np.array([0.315252413629716, 0.332870794805328])
+ }))
"""
Projectors and Xenon Arc Lamps.
@@ -434,8 +442,8 @@
LIGHT_SOURCES_PROJECTORS_CIE_1964_10_DEGREE_STANDARD_OBSERVER = (
CaseInsensitiveMapping({
- 'Kinoton 75P': np.array([
- 0.317086642148234, 0.336222428041514])}))
+ 'Kinoton 75P': np.array([0.317086642148234, 0.336222428041514])
+ }))
"""
Projectors and Xenon Arc Lamps. [3_]
@@ -445,10 +453,13 @@
"""
LIGHT_SOURCES = CaseInsensitiveMapping({
- 'CIE 1931 2 Degree Standard Observer': CaseInsensitiveMapping(
- LIGHT_SOURCES_RIT_CIE_1931_2_DEGREE_STANDARD_OBSERVER),
- 'CIE 1964 10 Degree Standard Observer': CaseInsensitiveMapping(
- LIGHT_SOURCES_RIT_CIE_1964_10_DEGREE_STANDARD_OBSERVER)})
+ 'CIE 1931 2 Degree Standard Observer':
+ CaseInsensitiveMapping(
+ LIGHT_SOURCES_RIT_CIE_1931_2_DEGREE_STANDARD_OBSERVER),
+ 'CIE 1964 10 Degree Standard Observer':
+ CaseInsensitiveMapping(
+ LIGHT_SOURCES_RIT_CIE_1964_10_DEGREE_STANDARD_OBSERVER)
+})
"""
Aggregated light sources chromaticity coordinates.
diff --git a/colour/colorimetry/dataset/light_sources/spds.py b/colour/colorimetry/dataset/light_sources/spds.py
index fc962d2c72..f017ecdd13 100644
--- a/colour/colorimetry/dataset/light_sources/spds.py
+++ b/colour/colorimetry/dataset/light_sources/spds.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Light Sources Relative Spectral Power Distributions
===================================================
@@ -59,17 +58,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA',
- 'LIGHT_SOURCES_RIT_RELATIVE_SPDS',
- 'LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA',
- 'LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS',
- 'LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA',
- 'LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS',
- 'LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA',
- 'LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS',
- 'LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS_DATA',
- 'LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS',
- 'LIGHT_SOURCES_RELATIVE_SPDS']
+__all__ = [
+ 'LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA', 'LIGHT_SOURCES_RIT_RELATIVE_SPDS',
+ 'LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA',
+ 'LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS',
+ 'LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA',
+ 'LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS',
+ 'LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA',
+ 'LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS',
+ 'LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS_DATA',
+ 'LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS', 'LIGHT_SOURCES_RELATIVE_SPDS'
+]
LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA = {
'Natural': {
@@ -153,7 +152,8 @@
765: 1.65,
770: 1.47,
775: 1.30,
- 780: 1.20},
+ 780: 1.20
+ },
'Philips TL-84': {
380: 0.784,
385: 0.553,
@@ -235,7 +235,8 @@
765: 0.100,
770: 0.110,
775: 0.110,
- 780: 0.100},
+ 780: 0.100
+ },
'SA': {
380: 9.80,
385: 10.90,
@@ -317,7 +318,8 @@
765: 234.59,
770: 237.01,
775: 239.37,
- 780: 241.68},
+ 780: 241.68
+ },
'SC': {
380: 33.00,
385: 39.92,
@@ -399,7 +401,8 @@
765: 58.00,
770: 58.20,
775: 58.50,
- 780: 59.10},
+ 780: 59.10
+ },
'T8 Luxline Plus White': {
380: 0.833,
385: 1.040,
@@ -481,7 +484,8 @@
765: 0.360,
770: 0.320,
775: 0.300,
- 780: 0.300},
+ 780: 0.300
+ },
'T8 Polylux 3000': {
380: 0.552,
385: 0.381,
@@ -563,7 +567,8 @@
765: 0.064,
770: 0.093,
775: 0.051,
- 780: 0.027},
+ 780: 0.027
+ },
'T8 Polylux 4000': {
380: 0.498,
385: 0.384,
@@ -645,7 +650,8 @@
765: 0.064,
770: 0.093,
775: 0.051,
- 780: 0.055},
+ 780: 0.055
+ },
'Thorn Kolor-rite': {
380: 1.111,
385: 1.316,
@@ -727,41 +733,52 @@
765: 1.710,
770: 1.500,
775: 1.330,
- 780: 1.200}}
+ 780: 1.200
+ }
+}
-LIGHT_SOURCES_RIT_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'Natural': SpectralPowerDistribution(
- 'Natural',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'Natural']),
- 'Philips TL-84': SpectralPowerDistribution(
- 'Philips TL-84',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'Philips TL-84']),
- 'SA': SpectralPowerDistribution(
- 'SA',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'SA']),
- 'SC': SpectralPowerDistribution(
- 'SC',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'SC']),
- 'T8 Luxline Plus White': SpectralPowerDistribution(
- 'T8 Luxline Plus White',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'T8 Luxline Plus White']),
- 'T8 Polylux 3000': SpectralPowerDistribution(
- 'T8 Polylux 3000',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'T8 Polylux 3000']),
- 'T8 Polylux 4000': SpectralPowerDistribution(
- 'T8 Polylux 4000',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'T8 Polylux 4000']),
- 'Thorn Kolor-rite': SpectralPowerDistribution(
- 'Thorn Kolor-rite',
- LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
- 'Thorn Kolor-rite'])})
+LIGHT_SOURCES_RIT_RELATIVE_SPDS = CaseInsensitiveMapping({
+ 'Natural':
+ SpectralPowerDistribution(
+ 'Natural',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'Natural']),
+ 'Philips TL-84':
+ SpectralPowerDistribution(
+ 'Philips TL-84',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'Philips TL-84']),
+ 'SA':
+ SpectralPowerDistribution(
+ 'SA',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'SA']),
+ 'SC':
+ SpectralPowerDistribution(
+ 'SC',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'SC']),
+ 'T8 Luxline Plus White':
+ SpectralPowerDistribution(
+ 'T8 Luxline Plus White',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'T8 Luxline Plus White']),
+ 'T8 Polylux 3000':
+ SpectralPowerDistribution(
+ 'T8 Polylux 3000',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'T8 Polylux 3000']),
+ 'T8 Polylux 4000':
+ SpectralPowerDistribution(
+ 'T8 Polylux 4000',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'T8 Polylux 4000']),
+ 'Thorn Kolor-rite':
+ SpectralPowerDistribution(
+ 'Thorn Kolor-rite',
+ LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA[
+ 'Thorn Kolor-rite'])
+}) # yapf: disable
"""
Light sources from *RIT* *PointerData.xls* spreadsheet.
@@ -773,7 +790,7 @@
References
----------
-.. [1] Pointer, M. R. (1980). Pointer’s Gamut Data. Retrieved from
+.. [1] Pointer, M. R. (1980). Pointer's Gamut Data. Retrieved from
http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls
LIGHT_SOURCES_RIT_RELATIVE_SPDS_DATA : CaseInsensitiveMapping
@@ -863,7 +880,8 @@
765: 0.01817522,
770: 0.01183473,
775: 0.00953278,
- 780: 0.00920353},
+ 780: 0.00920353
+ },
'Daylight FL': {
380: 0.04474924,
385: 0.05659396,
@@ -945,7 +963,8 @@
765: 0.01382840,
770: 0.01316616,
775: 0.01241027,
- 780: 0.01204411},
+ 780: 0.01204411
+ },
'HPS': {
380: 0.0083939426,
385: 0.0091861681,
@@ -1027,7 +1046,8 @@
765: 0.0802690011,
770: 0.0540981011,
775: 0.0326486660,
- 780: 0.0352925378},
+ 780: 0.0352925378
+ },
'Incandescent': {
380: 0.0221129274,
385: 0.0257550191,
@@ -1109,7 +1129,8 @@
765: 0.9669876832,
770: 0.9766525623,
775: 0.9854043089,
- 780: 1.0000000000},
+ 780: 1.0000000000
+ },
'LPS': {
380: 0.0,
385: 0.0,
@@ -1191,7 +1212,8 @@
765: 0.0,
770: 0.0,
775: 0.0,
- 780: 0.0},
+ 780: 0.0
+ },
'Mercury': {
380: 0.0104373669,
385: 0.0078158007,
@@ -1273,7 +1295,8 @@
765: 0.0096855504,
770: 0.0113490129,
775: 0.0099005410,
- 780: 0.0094954250},
+ 780: 0.0094954250
+ },
'Metal Halide': {
380: 0.0601404826,
385: 0.0630286148,
@@ -1355,7 +1378,8 @@
765: 0.0414979164,
770: 0.0344678340,
775: 0.0236333145,
- 780: 0.0254235315},
+ 780: 0.0254235315
+ },
'Neodimium Incandescent': {
380: 0.0334673674,
385: 0.0367106969,
@@ -1437,7 +1461,8 @@
765: 0.8999932814,
770: 0.9622718511,
775: 0.9966525876,
- 780: 1.0000000000},
+ 780: 1.0000000000
+ },
'Super HPS': {
380: 0.0000000000,
385: 0.0035961070,
@@ -1519,7 +1544,8 @@
765: 0.0604807146,
770: 0.0604807146,
775: 0.0604807146,
- 780: 0.0604807146},
+ 780: 0.0604807146
+ },
'Triphosphor FL': {
380: 0.0000000000,
385: 0.0000000000,
@@ -1601,49 +1627,62 @@
765: 0.0079622762,
770: 0.0024428504,
775: 0.0029993177,
- 780: 0.0005290507}}
+ 780: 0.0005290507
+ }
+}
-LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'Cool White FL': SpectralPowerDistribution(
- 'Cool White FL',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Cool White FL']),
- 'Daylight FL': SpectralPowerDistribution(
- 'Daylight FL',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Daylight FL']),
- 'HPS': SpectralPowerDistribution(
- 'HPS',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'HPS']),
- 'Incandescent': SpectralPowerDistribution(
- 'Incandescent',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Incandescent']),
- 'LPS': SpectralPowerDistribution(
- 'LPS',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'LPS']),
- 'Mercury': SpectralPowerDistribution(
- 'Mercury',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Mercury']),
- 'Metal Halide': SpectralPowerDistribution(
- 'Metal Halide',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Metal Halide']),
- 'Neodimium Incandescent': SpectralPowerDistribution(
- 'Neodimium Incandescent',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Neodimium Incandescent']),
- 'Super HPS': SpectralPowerDistribution(
- 'Super HPS',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Super HPS']),
- 'Triphosphor FL': SpectralPowerDistribution(
- 'Triphosphor FL',
- LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
- 'Triphosphor FL'])})
+LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS = CaseInsensitiveMapping({
+ 'Cool White FL':
+ SpectralPowerDistribution(
+ 'Cool White FL',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Cool White FL']),
+ 'Daylight FL':
+ SpectralPowerDistribution(
+ 'Daylight FL',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Daylight FL']),
+ 'HPS':
+ SpectralPowerDistribution(
+ 'HPS',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'HPS']),
+ 'Incandescent':
+ SpectralPowerDistribution(
+ 'Incandescent',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Incandescent']),
+ 'LPS':
+ SpectralPowerDistribution(
+ 'LPS',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'LPS']),
+ 'Mercury':
+ SpectralPowerDistribution(
+ 'Mercury',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Mercury']),
+ 'Metal Halide':
+ SpectralPowerDistribution(
+ 'Metal Halide',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Metal Halide']),
+ 'Neodimium Incandescent':
+ SpectralPowerDistribution(
+ 'Neodimium Incandescent',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Neodimium Incandescent']),
+ 'Super HPS':
+ SpectralPowerDistribution(
+ 'Super HPS',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Super HPS']),
+ 'Triphosphor FL':
+ SpectralPowerDistribution(
+ 'Triphosphor FL',
+ LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS_DATA[
+ 'Triphosphor FL'])
+}) # yapf: disable
"""
Traditional light sources from *NIST* *NIST CQS simulation 7.4.xls*
spreadsheet.
@@ -1740,7 +1779,8 @@
765: 1.24216741363154e-25,
770: 9.91044375901472e-27,
775: 7.48346361630974e-28,
- 780: 5.34607293395408e-29},
+ 780: 5.34607293395408e-29
+ },
'3-LED-2 (473/545/616)': {
380: 8.80700887841404e-11,
385: 8.64191446543499e-10,
@@ -1822,7 +1862,8 @@
765: 1.96520133984630e-24,
770: 1.19562718661274e-25,
775: 8.49126403034339e-27,
- 780: 6.18707499978848e-28},
+ 780: 6.18707499978848e-28
+ },
'3-LED-2 Yellow': {
380: 5.28857670457154e-11,
385: 5.18882652575306e-10,
@@ -1904,7 +1945,8 @@
765: 2.18831363146954e-24,
770: 1.38312763678070e-25,
775: 9.98183844142717e-27,
- 780: 7.30800253280185e-28},
+ 780: 7.30800253280185e-28
+ },
'3-LED-3 (465/546/614)': {
380: 4.24356931933744e-09,
385: 3.35055502496331e-08,
@@ -1986,7 +2028,8 @@
765: 2.09993710079583e-24,
770: 1.70971251548166e-25,
775: 1.35854661437952e-26,
- 780: 1.03007323231651e-27},
+ 780: 1.03007323231651e-27
+ },
'3-LED-4 (455/547/623)': {
380: 1.48554815599882e-07,
385: 9.10000000000000e-07,
@@ -2068,7 +2111,8 @@
765: 7.96184389637815e-23,
770: 2.37929410472859e-24,
775: 7.60786774257376e-26,
- 780: 3.1397886480576e-27},
+ 780: 3.1397886480576e-27
+ },
'4-LED No Yellow': {
380: 5.00830470941566e-06,
385: 2.37160686348979e-05,
@@ -2150,7 +2194,8 @@
765: 1.55965542079349e-24,
770: 3.62239387510338e-26,
775: 7.42464806370353e-28,
- 780: 1.34297913021045e-29},
+ 780: 1.34297913021045e-29
+ },
'4-LED Yellow': {
380: 8.34073345191213e-07,
385: 4.62309206822133e-06,
@@ -2232,7 +2277,8 @@
765: 6.93791409316552e-22,
770: 2.01795866069721e-23,
775: 5.17975154307456e-25,
- 780: 1.17332723412027e-26},
+ 780: 1.17332723412027e-26
+ },
'4-LED-1 (461/526/576/624)': {
380: 2.47034736673368e-08,
385: 1.74863383163897e-07,
@@ -2314,7 +2360,8 @@
765: 2.27129761972571e-22,
770: 6.31463339864241e-24,
775: 1.54930155880890e-25,
- 780: 3.35458329193818e-27},
+ 780: 3.35458329193818e-27
+ },
'4-LED-2 (447/512/573/627)': {
380: 3.47088525590474e-06,
385: 1.73227787723854e-05,
@@ -2396,7 +2443,8 @@
765: 1.61410755281383e-21,
770: 4.81433876182624e-23,
775: 1.26722581811040e-24,
- 780: 2.94363913832964e-26},
+ 780: 2.94363913832964e-26
+ },
'Luxeon WW 2880': {
380: 0.0000000000,
385: 0.0000000000,
@@ -2478,7 +2526,8 @@
765: 1.0039448e-05,
770: 8.9298495e-06,
775: 7.6177480e-06,
- 780: 7.0016420e-06},
+ 780: 7.0016420e-06
+ },
'PHOS-1': {
380: 0.0111298531,
385: 0.0181132825,
@@ -2560,7 +2609,8 @@
765: 7.47174315193493e-05,
770: 2.58870000000000e-05,
775: 8.46950409085507e-06,
- 780: 2.61668300203868e-06},
+ 780: 2.61668300203868e-06
+ },
'PHOS-2': {
380: 6.24336458874078e-06,
385: 1.80201765628625e-05,
@@ -2642,7 +2692,8 @@
765: 1.31785543464018e-10,
770: 2.57451133233467e-11,
775: 4.74939818412281e-12,
- 780: 8.27368713020501e-13},
+ 780: 8.27368713020501e-13
+ },
'PHOS-3': {
380: 2.51463414652205e-05,
385: 6.85384929115295e-05,
@@ -2724,7 +2775,8 @@
765: 2.97187556394679e-11,
770: 5.48247997165375e-12,
775: 9.55081042264917e-13,
- 780: 1.57115898612229e-13},
+ 780: 1.57115898612229e-13
+ },
'PHOS-4': {
380: 2.65174294164563e-05,
385: 7.20892236476949e-05,
@@ -2806,7 +2858,8 @@
765: 3.17087855185187e-11,
770: 5.84959831217044e-12,
775: 1.01903527241427e-12,
- 780: 1.67636709023523e-13},
+ 780: 1.67636709023523e-13
+ },
'Phosphor LED YAG': {
380: 0.0007674402,
385: 0.0007988052,
@@ -2888,69 +2941,87 @@
765: 0.0102635827,
770: 0.0091149715,
775: 0.0079991914,
- 780: 0.0070995878}}
+ 780: 0.0070995878
+ }
+}
-LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'3-LED-1 (457/540/605)': SpectralPowerDistribution(
- '3-LED-1 (457/540/605)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '3-LED-1 (457/540/605)']),
- '3-LED-2 (473/545/616)': SpectralPowerDistribution(
- '3-LED-2 (473/545/616)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '3-LED-2 (473/545/616)']),
- '3-LED-2 Yellow': SpectralPowerDistribution(
- '3-LED-2 Yellow',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '3-LED-2 Yellow']),
- '3-LED-3 (465/546/614)': SpectralPowerDistribution(
- '3-LED-3 (465/546/614)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '3-LED-3 (465/546/614)']),
- '3-LED-4 (455/547/623)': SpectralPowerDistribution(
- '3-LED-4 (455/547/623)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '3-LED-4 (455/547/623)']),
- '4-LED No Yellow': SpectralPowerDistribution(
- '4-LED No Yellow',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '4-LED No Yellow']),
- '4-LED Yellow': SpectralPowerDistribution(
- '4-LED Yellow',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '4-LED Yellow']),
- '4-LED-1 (461/526/576/624)': SpectralPowerDistribution(
- '4-LED-1 (461/526/576/624)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '4-LED-1 (461/526/576/624)']),
- '4-LED-2 (447/512/573/627)': SpectralPowerDistribution(
- '4-LED-2 (447/512/573/627)',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- '4-LED-2 (447/512/573/627)']),
- 'Luxeon WW 2880': SpectralPowerDistribution(
- 'Luxeon WW 2880',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'Luxeon WW 2880']),
- 'PHOS-1': SpectralPowerDistribution(
- 'PHOS-1',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'PHOS-1']),
- 'PHOS-2': SpectralPowerDistribution(
- 'PHOS-2',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'PHOS-2']),
- 'PHOS-3': SpectralPowerDistribution(
- 'PHOS-3',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'PHOS-3']),
- 'PHOS-4': SpectralPowerDistribution(
- 'PHOS-4',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'PHOS-4']),
- 'Phosphor LED YAG': SpectralPowerDistribution(
- 'Phosphor LED YAG',
- LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
- 'Phosphor LED YAG'])})
+LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS = CaseInsensitiveMapping({
+ '3-LED-1 (457/540/605)':
+ SpectralPowerDistribution(
+ '3-LED-1 (457/540/605)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '3-LED-1 (457/540/605)']),
+ '3-LED-2 (473/545/616)':
+ SpectralPowerDistribution(
+ '3-LED-2 (473/545/616)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '3-LED-2 (473/545/616)']),
+ '3-LED-2 Yellow':
+ SpectralPowerDistribution(
+ '3-LED-2 Yellow',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '3-LED-2 Yellow']),
+ '3-LED-3 (465/546/614)':
+ SpectralPowerDistribution(
+ '3-LED-3 (465/546/614)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '3-LED-3 (465/546/614)']),
+ '3-LED-4 (455/547/623)':
+ SpectralPowerDistribution(
+ '3-LED-4 (455/547/623)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '3-LED-4 (455/547/623)']),
+ '4-LED No Yellow':
+ SpectralPowerDistribution(
+ '4-LED No Yellow',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '4-LED No Yellow']),
+ '4-LED Yellow':
+ SpectralPowerDistribution(
+ '4-LED Yellow',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '4-LED Yellow']),
+ '4-LED-1 (461/526/576/624)':
+ SpectralPowerDistribution(
+ '4-LED-1 (461/526/576/624)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '4-LED-1 (461/526/576/624)']),
+ '4-LED-2 (447/512/573/627)':
+ SpectralPowerDistribution(
+ '4-LED-2 (447/512/573/627)',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ '4-LED-2 (447/512/573/627)']),
+ 'Luxeon WW 2880':
+ SpectralPowerDistribution(
+ 'Luxeon WW 2880',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'Luxeon WW 2880']),
+ 'PHOS-1':
+ SpectralPowerDistribution(
+ 'PHOS-1',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'PHOS-1']),
+ 'PHOS-2':
+ SpectralPowerDistribution(
+ 'PHOS-2',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'PHOS-2']),
+ 'PHOS-3':
+ SpectralPowerDistribution(
+ 'PHOS-3',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'PHOS-3']),
+ 'PHOS-4':
+ SpectralPowerDistribution(
+ 'PHOS-4',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'PHOS-4']),
+ 'Phosphor LED YAG':
+ SpectralPowerDistribution(
+ 'Phosphor LED YAG',
+ LIGHT_SOURCES_NIST_LED_RELATIVE_SPDS_DATA[
+ 'Phosphor LED YAG'])
+}) # yapf: disable
"""
LED light sources from *NIST* *NIST CQS simulation 7.4.xls* spreadsheet. [2]_
@@ -3044,7 +3115,8 @@
765: 0.9669876832,
770: 0.9766525623,
775: 0.9854043089,
- 780: 1.0000000000},
+ 780: 1.0000000000
+ },
'C100S54 (HPS)': {
380: 0.0090968865,
385: 0.0099177519,
@@ -3126,7 +3198,8 @@
765: 0.0290665851,
770: 0.0318508294,
775: 0.0300437580,
- 780: 0.0343141879},
+ 780: 0.0343141879
+ },
'C100S54C (HPS)': {
380: 0.0000000000,
385: 0.0091384562,
@@ -3208,7 +3281,8 @@
765: 0.1421969643,
770: 0.1445350862,
775: 0.1425608179,
- 780: 0.1393291025},
+ 780: 0.1393291025
+ },
'F32T8/TL830 (Triphosphor)': {
380: 0.0039380786,
385: 0.0021247895,
@@ -3290,7 +3364,8 @@
765: 0.0021757603,
770: 0.0016340710,
775: 0.0007446283,
- 780: 0.0000000000},
+ 780: 0.0000000000
+ },
'F32T8/TL835 (Triphosphor)': {
380: 0.0044539119,
385: 0.0027246990,
@@ -3372,7 +3447,8 @@
765: 0.0028316149,
770: 0.0020137199,
775: 0.0020856503,
- 780: 0.0015424431},
+ 780: 0.0015424431
+ },
'F32T8/TL841 (Triphosphor)': {
380: 0.0040371862,
385: 0.0024796605,
@@ -3454,7 +3530,8 @@
765: 0.0019168880,
770: 0.0010922856,
775: 0.0004971904,
- 780: 0.0000000000},
+ 780: 0.0000000000
+ },
'F32T8/TL850 (Triphosphor)': {
380: 0.0034742373,
385: 0.0023983574,
@@ -3536,7 +3613,8 @@
765: 0.0029392159,
770: 0.0029753244,
775: 0.0019264764,
- 780: 0.0031394812},
+ 780: 0.0031394812
+ },
'F32T8/TL865 /PLUS (Triphosphor)': {
380: 0.0043823207,
385: 0.0033077391,
@@ -3618,7 +3696,8 @@
765: 0.0072031048,
770: 0.0075045320,
775: 0.0070549007,
- 780: 0.0062780959},
+ 780: 0.0062780959
+ },
'F34/CW/RS/EW (Cool White FL)': {
380: 0.0296401248,
385: 0.0373569560,
@@ -3700,7 +3779,8 @@
765: 0.0114365646,
770: 0.0102565619,
775: 0.0107649726,
- 780: 0.0787313519},
+ 780: 0.0787313519
+ },
'F34T12/LW/RS /EW': {
380: 0.0138848383,
385: 0.0171879452,
@@ -3782,7 +3862,8 @@
765: 0.0048038975,
770: 0.0058633690,
775: 0.0077827634,
- 780: 0.0553820445},
+ 780: 0.0553820445
+ },
'F34T12WW/RS /EW (Warm White FL)': {
380: 0.0183484283,
385: 0.0208397838,
@@ -3864,7 +3945,8 @@
765: 0.0162500215,
770: 0.0154892424,
775: 0.0161230441,
- 780: 0.0941165395},
+ 780: 0.0941165395
+ },
'F40/C50 (Broadband FL)': {
380: 0.0279518444,
385: 0.0297109166,
@@ -3946,7 +4028,8 @@
765: 0.0689298270,
770: 0.0730299188,
775: 0.0751929522,
- 780: 0.0561935817},
+ 780: 0.0561935817
+ },
'F40/C75 (Broadband FL)': {
380: 0.0560479743,
385: 0.0650016588,
@@ -4028,7 +4111,8 @@
765: 0.0765039678,
770: 0.0585353785,
775: 0.0536685951,
- 780: 0.0000000000},
+ 780: 0.0000000000
+ },
'F40/CWX (Broadband FL)': {
380: 0.0273834847,
385: 0.0335910321,
@@ -4110,7 +4194,8 @@
765: 0.0216177183,
770: 0.0225290016,
775: 0.0228098117,
- 780: 0.0234304973},
+ 780: 0.0234304973
+ },
'F40/DX (Broadband FL)': {
380: 0.0377831211,
385: 0.0479805195,
@@ -4192,7 +4277,8 @@
765: 0.0096318955,
770: 0.0121471762,
775: 0.0047304152,
- 780: 0.0000000000},
+ 780: 0.0000000000
+ },
'F40/DXTP (Delux FL)': {
380: 0.0453299851,
385: 0.0565911781,
@@ -4274,7 +4360,8 @@
765: 0.0178226176,
770: 0.0166535773,
775: 0.0162608849,
- 780: 0.0131835384},
+ 780: 0.0131835384
+ },
'F40/N (Natural FL)': {
380: 0.0310803197,
385: 0.0378149459,
@@ -4356,7 +4443,8 @@
765: 0.0816302019,
770: 0.0794656172,
775: 0.0624670576,
- 780: 0.0538005265},
+ 780: 0.0538005265
+ },
'H38HT-100 (Mercury)': {
380: 0.0000000000,
385: 0.0116674647,
@@ -4438,7 +4526,8 @@
765: 0.0850852124,
770: 0.0864842549,
775: 0.0853029284,
- 780: 0.0833691938},
+ 780: 0.0833691938
+ },
'H38JA-100/DX (Mercury DX)': {
380: 0.0000000000,
385: 0.0142531794,
@@ -4520,7 +4609,8 @@
765: 0.1137426110,
770: 0.1156128625,
775: 0.1140336555,
- 780: 0.1114486233},
+ 780: 0.1114486233
+ },
'MHC100/U/MP /3K': {
380: 0.0376147854,
385: 0.0647066508,
@@ -4602,7 +4692,8 @@
765: 0.1081531758,
770: 0.1143784298,
775: 0.1376604646,
- 780: 0.1168708812},
+ 780: 0.1168708812
+ },
'MHC100/U/MP /4K': {
380: 0.0637674013,
385: 0.1123934055,
@@ -4684,7 +4775,8 @@
765: 0.1418151423,
770: 0.1594540493,
775: 0.2387771482,
- 780: 0.1694033761},
+ 780: 0.1694033761
+ },
'SDW-T 100W/LV (Super HPS)': {
380: 0.0000000000,
385: 0.0141961629,
@@ -4766,97 +4858,122 @@
765: 0.2452291219,
770: 0.2492613850,
775: 0.2458566141,
- 780: 0.2402832833}}
+ 780: 0.2402832833
+ }
+}
-LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'60 A/W (Soft White)': SpectralPowerDistribution(
- '60 A/W (Soft White)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- '60 A/W (Soft White)']),
- 'C100S54 (HPS)': SpectralPowerDistribution(
- 'C100S54 (HPS)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'C100S54 (HPS)']),
- 'C100S54C (HPS)': SpectralPowerDistribution(
- 'C100S54C (HPS)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'C100S54C (HPS)']),
- 'F32T8/TL830 (Triphosphor)': SpectralPowerDistribution(
- 'F32T8/TL830 (Triphosphor)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F32T8/TL830 (Triphosphor)']),
- 'F32T8/TL835 (Triphosphor)': SpectralPowerDistribution(
- 'F32T8/TL835 (Triphosphor)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F32T8/TL835 (Triphosphor)']),
- 'F32T8/TL841 (Triphosphor)': SpectralPowerDistribution(
- 'F32T8/TL841 (Triphosphor)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F32T8/TL841 (Triphosphor)']),
- 'F32T8/TL850 (Triphosphor)': SpectralPowerDistribution(
- 'F32T8/TL850 (Triphosphor)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F32T8/TL850 (Triphosphor)']),
- 'F32T8/TL865 /PLUS (Triphosphor)': SpectralPowerDistribution(
- 'F32T8/TL865 /PLUS (Triphosphor)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F32T8/TL865 /PLUS (Triphosphor)']),
- 'F34/CW/RS/EW (Cool White FL)': SpectralPowerDistribution(
- 'F34/CW/RS/EW (Cool White FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F34/CW/RS/EW (Cool White FL)']),
- 'F34T12/LW/RS /EW': SpectralPowerDistribution(
- 'F34T12/LW/RS /EW',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F34T12/LW/RS /EW']),
- 'F34T12WW/RS /EW (Warm White FL)': SpectralPowerDistribution(
- 'F34T12WW/RS /EW (Warm White FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F34T12WW/RS /EW (Warm White FL)']),
- 'F40/C50 (Broadband FL)': SpectralPowerDistribution(
- 'F40/C50 (Broadband FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/C50 (Broadband FL)']),
- 'F40/C75 (Broadband FL)': SpectralPowerDistribution(
- 'F40/C75 (Broadband FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/C75 (Broadband FL)']),
- 'F40/CWX (Broadband FL)': SpectralPowerDistribution(
- 'F40/CWX (Broadband FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/CWX (Broadband FL)']),
- 'F40/DX (Broadband FL)': SpectralPowerDistribution(
- 'F40/DX (Broadband FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/DX (Broadband FL)']),
- 'F40/DXTP (Delux FL)': SpectralPowerDistribution(
- 'F40/DXTP (Delux FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/DXTP (Delux FL)']),
- 'F40/N (Natural FL)': SpectralPowerDistribution(
- 'F40/N (Natural FL)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'F40/N (Natural FL)']),
- 'H38HT-100 (Mercury)': SpectralPowerDistribution(
- 'H38HT-100 (Mercury)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'H38HT-100 (Mercury)']),
- 'H38JA-100/DX (Mercury DX)': SpectralPowerDistribution(
- 'H38JA-100/DX (Mercury DX)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'H38JA-100/DX (Mercury DX)']),
- 'MHC100/U/MP /3K': SpectralPowerDistribution(
- 'MHC100/U/MP /3K',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'MHC100/U/MP /3K']),
- 'MHC100/U/MP /4K': SpectralPowerDistribution(
- 'MHC100/U/MP /4K',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'MHC100/U/MP /4K']),
- 'SDW-T 100W/LV (Super HPS)': SpectralPowerDistribution(
- 'SDW-T 100W/LV (Super HPS)',
- LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
- 'SDW-T 100W/LV (Super HPS)'])})
+LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS = CaseInsensitiveMapping({
+ '60 A/W (Soft White)':
+ SpectralPowerDistribution(
+ '60 A/W (Soft White)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ '60 A/W (Soft White)']),
+ 'C100S54 (HPS)':
+ SpectralPowerDistribution(
+ 'C100S54 (HPS)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'C100S54 (HPS)']),
+ 'C100S54C (HPS)':
+ SpectralPowerDistribution(
+ 'C100S54C (HPS)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'C100S54C (HPS)']),
+ 'F32T8/TL830 (Triphosphor)':
+ SpectralPowerDistribution(
+ 'F32T8/TL830 (Triphosphor)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F32T8/TL830 (Triphosphor)']),
+ 'F32T8/TL835 (Triphosphor)':
+ SpectralPowerDistribution(
+ 'F32T8/TL835 (Triphosphor)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F32T8/TL835 (Triphosphor)']),
+ 'F32T8/TL841 (Triphosphor)':
+ SpectralPowerDistribution(
+ 'F32T8/TL841 (Triphosphor)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F32T8/TL841 (Triphosphor)']),
+ 'F32T8/TL850 (Triphosphor)':
+ SpectralPowerDistribution(
+ 'F32T8/TL850 (Triphosphor)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F32T8/TL850 (Triphosphor)']),
+ 'F32T8/TL865 /PLUS (Triphosphor)':
+ SpectralPowerDistribution(
+ 'F32T8/TL865 /PLUS (Triphosphor)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F32T8/TL865 /PLUS (Triphosphor)']),
+ 'F34/CW/RS/EW (Cool White FL)':
+ SpectralPowerDistribution(
+ 'F34/CW/RS/EW (Cool White FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F34/CW/RS/EW (Cool White FL)']),
+ 'F34T12/LW/RS /EW':
+ SpectralPowerDistribution(
+ 'F34T12/LW/RS /EW',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F34T12/LW/RS /EW']),
+ 'F34T12WW/RS /EW (Warm White FL)':
+ SpectralPowerDistribution(
+ 'F34T12WW/RS /EW (Warm White FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F34T12WW/RS /EW (Warm White FL)']),
+ 'F40/C50 (Broadband FL)':
+ SpectralPowerDistribution(
+ 'F40/C50 (Broadband FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/C50 (Broadband FL)']),
+ 'F40/C75 (Broadband FL)':
+ SpectralPowerDistribution(
+ 'F40/C75 (Broadband FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/C75 (Broadband FL)']),
+ 'F40/CWX (Broadband FL)':
+ SpectralPowerDistribution(
+ 'F40/CWX (Broadband FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/CWX (Broadband FL)']),
+ 'F40/DX (Broadband FL)':
+ SpectralPowerDistribution(
+ 'F40/DX (Broadband FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/DX (Broadband FL)']),
+ 'F40/DXTP (Delux FL)':
+ SpectralPowerDistribution(
+ 'F40/DXTP (Delux FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/DXTP (Delux FL)']),
+ 'F40/N (Natural FL)':
+ SpectralPowerDistribution(
+ 'F40/N (Natural FL)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'F40/N (Natural FL)']),
+ 'H38HT-100 (Mercury)':
+ SpectralPowerDistribution(
+ 'H38HT-100 (Mercury)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'H38HT-100 (Mercury)']),
+ 'H38JA-100/DX (Mercury DX)':
+ SpectralPowerDistribution(
+ 'H38JA-100/DX (Mercury DX)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'H38JA-100/DX (Mercury DX)']),
+ 'MHC100/U/MP /3K':
+ SpectralPowerDistribution(
+ 'MHC100/U/MP /3K',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'MHC100/U/MP /3K']),
+ 'MHC100/U/MP /4K':
+ SpectralPowerDistribution(
+ 'MHC100/U/MP /4K',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'MHC100/U/MP /4K']),
+ 'SDW-T 100W/LV (Super HPS)':
+ SpectralPowerDistribution(
+ 'SDW-T 100W/LV (Super HPS)',
+ LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS_DATA[
+ 'SDW-T 100W/LV (Super HPS)'])
+}) # yapf: disable
"""
Philips light sources from *NIST* *NIST CQS simulation 7.4.xls*
spreadsheet. [2]_
@@ -5075,13 +5192,17 @@
774: 0.0000183800,
776: 0.0000155000,
778: 0.0000097800,
- 780: 0.0000141000}}
+ 780: 0.0000141000
+ }
+}
-LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS = CaseInsensitiveMapping(
- {'Kinoton 75P': SpectralPowerDistribution(
- 'Kinoton 75P',
- LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS_DATA[
- 'Kinoton 75P'])})
+LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS = CaseInsensitiveMapping({
+ 'Kinoton 75P':
+ SpectralPowerDistribution(
+ 'Kinoton 75P',
+ LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS_DATA[
+ 'Kinoton 75P'])
+}) # yapf: disable
"""
Projectors and Xenon Arc Lamps.
@@ -5101,6 +5222,7 @@
LIGHT_SOURCES_RELATIVE_SPDS : CaseInsensitiveMapping
"""
+# yapf: disable
LIGHT_SOURCES_RELATIVE_SPDS.update(
LIGHT_SOURCES_NIST_TRADITIONAL_RELATIVE_SPDS)
LIGHT_SOURCES_RELATIVE_SPDS.update(
@@ -5109,3 +5231,4 @@
LIGHT_SOURCES_NIST_PHILIPS_RELATIVE_SPDS)
LIGHT_SOURCES_RELATIVE_SPDS.update(
LIGHT_SOURCES_PROJECTORS_RELATIVE_SPDS)
+# yapf: enable
diff --git a/colour/colorimetry/dominant.py b/colour/colorimetry/dominant.py
index 974d56b81c..be4f3c2316 100644
--- a/colour/colorimetry/dominant.py
+++ b/colour/colorimetry/dominant.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Dominant Wavelength and Purity
==============================
@@ -33,10 +32,8 @@
import numpy as np
import scipy.spatial.distance
-from colour.algebra import (
- euclidean_distance,
- extend_line_segment,
- intersect_line_segments)
+from colour.algebra import (euclidean_distance, extend_line_segment,
+ intersect_line_segments)
from colour.colorimetry import CMFS
from colour.models import XYZ_to_xy
@@ -47,11 +44,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['closest_spectral_locus_wavelength',
- 'dominant_wavelength',
- 'complementary_wavelength',
- 'excitation_purity',
- 'colorimetric_purity']
+__all__ = [
+ 'closest_spectral_locus_wavelength', 'dominant_wavelength',
+ 'complementary_wavelength', 'excitation_purity', 'colorimetric_purity'
+]
def closest_spectral_locus_wavelength(xy, xy_n, xy_s, reverse=False):
@@ -98,8 +94,7 @@ def closest_spectral_locus_wavelength(xy, xy_n, xy_s, reverse=False):
xy_s = np.asarray(xy_s)
xy_e = (extend_line_segment(xy, xy_n)
- if reverse else
- extend_line_segment(xy_n, xy))
+ if reverse else extend_line_segment(xy_n, xy))
# Closing horse-shoe shape to handle line of purples intersections.
xy_s = np.vstack((xy_s, xy_s[0, :]))
@@ -196,11 +191,10 @@ def dominant_wavelength(xy,
wl = cmfs.wavelengths[i_wl]
xy_e = (extend_line_segment(xy, xy_n)
- if reverse else
- extend_line_segment(xy_n, xy))
+ if reverse else extend_line_segment(xy_n, xy))
intersect = intersect_line_segments(
- np.concatenate((xy_n, xy_e), -1),
- np.hstack((xy_s[0], xy_s[-1]))).intersect
+ np.concatenate((xy_n, xy_e), -1), np.hstack((xy_s[0],
+ xy_s[-1]))).intersect
intersect = np.reshape(intersect, wl.shape)
i_wl_r, xy_cwl_r = closest_spectral_locus_wavelength(
diff --git a/colour/colorimetry/illuminants.py b/colour/colorimetry/illuminants.py
index 61fb7edb31..94695f705a 100644
--- a/colour/colorimetry/illuminants.py
+++ b/colour/colorimetry/illuminants.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Illuminants
===========
@@ -23,9 +22,8 @@
import numpy as np
-from colour.colorimetry import (
- D_ILLUMINANTS_S_SPDS,
- SpectralPowerDistribution)
+from colour.colorimetry import (D_ILLUMINANTS_S_SPDS,
+ SpectralPowerDistribution)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -34,8 +32,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['D_illuminant_relative_spd',
- 'CIE_standard_illuminant_A_function']
+__all__ = ['D_illuminant_relative_spd', 'CIE_standard_illuminant_A_function']
def D_illuminant_relative_spd(xy):
@@ -84,8 +81,8 @@ def D_illuminant_relative_spd(xy):
S2 = D_ILLUMINANTS_S_SPDS['S2'][i]
distribution[i] = S0 + M1 * S1 + M2 * S2
- return SpectralPowerDistribution(
- 'CIE Standard Illuminant D Series', distribution)
+ return SpectralPowerDistribution('CIE Standard Illuminant D Series',
+ distribution)
def CIE_standard_illuminant_A_function(wl):
@@ -122,6 +119,6 @@ def CIE_standard_illuminant_A_function(wl):
wl = np.asarray(wl)
- return (100 * (560 / wl) ** 5 * (
- ((np.exp((1.435 * 10 ** 7) / (2848 * 560)) - 1) /
- (np.exp((1.435 * 10 ** 7) / (2848 * wl)) - 1))))
+ return (100 * (560 / wl) ** 5 * (((np.exp(
+ (1.435 * 10 ** 7) / (2848 * 560)) - 1) / (np.exp(
+ (1.435 * 10 ** 7) / (2848 * wl)) - 1))))
diff --git a/colour/colorimetry/lefs.py b/colour/colorimetry/lefs.py
index e199bacfc0..7110b71828 100644
--- a/colour/colorimetry/lefs.py
+++ b/colour/colorimetry/lefs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Luminous Efficiency Functions Spectral Power Distributions
==========================================================
@@ -24,11 +23,8 @@
from __future__ import division, unicode_literals
-from colour.colorimetry import (
- PHOTOPIC_LEFS,
- SCOTOPIC_LEFS,
- SpectralPowerDistribution,
- SpectralShape)
+from colour.colorimetry import (PHOTOPIC_LEFS, SCOTOPIC_LEFS,
+ SpectralPowerDistribution, SpectralShape)
from colour.colorimetry.dataset.lefs import MESOPIC_X_DATA
from colour.utilities import closest
@@ -39,8 +35,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['mesopic_weighting_function',
- 'mesopic_luminous_efficiency_function']
+__all__ = [
+ 'mesopic_weighting_function', 'mesopic_luminous_efficiency_function'
+]
def mesopic_weighting_function(
@@ -88,8 +85,8 @@ def mesopic_weighting_function(
closest(mesopic_x_luminance_values, Lp))
x = MESOPIC_X_DATA[mesopic_x_luminance_values[index]][source][method]
- Vm = ((1 - x) *
- scotopic_lef.get(wavelength) + x * photopic_lef.get(wavelength))
+ Vm = ((1 - x) * scotopic_lef.get(wavelength) +
+ x * photopic_lef.get(wavelength))
return Vm
@@ -140,17 +137,12 @@ def mesopic_luminous_efficiency_function(
wavelengths = shape.range()
- spd_data = dict(zip(wavelengths,
- mesopic_weighting_function(
- wavelengths,
- Lp,
- source,
- method,
- photopic_lef,
- scotopic_lef)))
+ spd_data = dict(
+ zip(wavelengths,
+ mesopic_weighting_function(wavelengths, Lp, source, method,
+ photopic_lef, scotopic_lef)))
spd = SpectralPowerDistribution(
- '{0} Lp Mesopic Luminous Efficiency Function'.format(Lp),
- spd_data)
+ '{0} Lp Mesopic Luminous Efficiency Function'.format(Lp), spd_data)
return spd.normalise()
diff --git a/colour/colorimetry/lightness.py b/colour/colorimetry/lightness.py
index f4837b5f13..b49a144db5 100644
--- a/colour/colorimetry/lightness.py
+++ b/colour/colorimetry/lightness.py
@@ -1,21 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
-Lightness :math:`L^*`
-=====================
+Lightness :math:`L`
+===================
-Defines *Lightness* :math:`L^*` computation objects.
+Defines *Lightness* :math:`L` computation objects.
The following methods are available:
-- :func:`lightness_Glasser1958`: *Lightness* :math:`L^*` computation of given
- *luminance* :math:`Y` using *Glasser, Mckinney, Reilly and Schnelle (1958)
- method*.
+- :func:`lightness_Glasser1958`: *Lightness* :math:`L` computation of given
+ *luminance* :math:`Y` using *Glasser, Mckinney, Reilly and Schnelle (1958)*
+ method.
- :func:`lightness_Wyszecki1963`: *Lightness* :math:`W` computation of
given *luminance* :math:`Y` using *Wyszecki (1963)* method.
- :func:`lightness_CIE1976`: *Lightness* :math:`L^*` computation of given
*luminance* :math:`Y` as per *CIE 1976* recommendation.
+- :func:`lightness_Fairchild2010`: *Lightness* :math:`L_{hdr}` computation
+ of given *luminance* :math:`Y` using *Fairchild and Wyble (2010)* method.
See Also
--------
@@ -33,6 +34,7 @@
import numpy as np
+from colour.biochemistry import reaction_rate_MichealisMenten
from colour.constants import CIE_E, CIE_K
from colour.utilities import CaseInsensitiveMapping, filter_kwargs, warning
@@ -43,11 +45,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['lightness_Glasser1958',
- 'lightness_Wyszecki1963',
- 'lightness_CIE1976',
- 'LIGHTNESS_METHODS',
- 'lightness']
+__all__ = [
+ 'lightness_Glasser1958', 'lightness_Wyszecki1963', 'lightness_CIE1976',
+ 'lightness_Fairchild2010', 'LIGHTNESS_METHODS', 'lightness'
+]
def lightness_Glasser1958(Y):
@@ -175,22 +176,70 @@ def lightness_CIE1976(Y, Y_n=100):
Lstar = Y / Y_n
- Lstar = np.where(Lstar <= CIE_E,
- CIE_K * Lstar,
+ Lstar = np.where(Lstar <= CIE_E, CIE_K * Lstar,
116 * Lstar ** (1 / 3) - 16)
return Lstar
-LIGHTNESS_METHODS = CaseInsensitiveMapping(
- {'Glasser 1958': lightness_Glasser1958,
- 'Wyszecki 1963': lightness_Wyszecki1963,
- 'CIE 1976': lightness_CIE1976})
+def lightness_Fairchild2010(Y, epsilon=2):
+ """
+ Computes *Lightness* :math:`L_{hdr}` of given *luminance* :math:`Y` using
+ *Fairchild and Wyble (2010)* method accordingly to *Michealis-Menten*
+ kinetics.
+
+ Parameters
+ ----------
+ Y : array_like
+ *luminance* :math:`Y`.
+ epsilon : numeric or array_like, optional
+ :math:`\epsilon` exponent.
+
+ Returns
+ -------
+ array_like
+ *Lightness* :math:`L_{hdr}`.
+
+ Warning
+ -------
+ The input domain of that definition is non standard!
+
+ Notes
+ -----
+ - Input *luminance* :math:`Y` is in domain [0, :math:`\infty`].
+
+ References
+ ----------
+ .. [6] Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT:
+ Simple Models for Describing the Color of High-Dynamic-Range and
+ Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference
+ (pp. 322–326). ISBN:9781629932156
+
+ Examples
+ --------
+ >>> lightness_Fairchild2010(10.08 / 100, 1.836) # doctest: +ELLIPSIS
+ 24.9022902...
+ """
+
+ Y = np.asarray(Y)
+
+ L_hdr = reaction_rate_MichealisMenten(Y ** epsilon, 100, 0.184 **
+ epsilon) + 0.02
+
+ return L_hdr
+
+
+LIGHTNESS_METHODS = CaseInsensitiveMapping({
+ 'Glasser 1958': lightness_Glasser1958,
+ 'Wyszecki 1963': lightness_Wyszecki1963,
+ 'CIE 1976': lightness_CIE1976,
+ 'Fairchild 2010': lightness_Fairchild2010
+})
"""
Supported *Lightness* computations methods.
LIGHTNESS_METHODS : CaseInsensitiveMapping
- **{'Glasser 1958', 'Wyszecki 1963', 'CIE 1976'}**
+ **{'Glasser 1958', 'Wyszecki 1963', 'CIE 1976', 'Fairchild 2010'}**
Aliases:
@@ -201,14 +250,14 @@ def lightness_CIE1976(Y, Y_n=100):
def lightness(Y, method='CIE 1976', **kwargs):
"""
- Returns the *Lightness* :math:`L^*` using given method.
+ Returns the *Lightness* :math:`L` using given method.
Parameters
----------
Y : numeric or array_like
*luminance* :math:`Y`.
method : unicode, optional
- **{'CIE 1976', 'Glasser 1958', 'Wyszecki 1963'}**,
+ **{'CIE 1976', 'Glasser 1958', 'Wyszecki 1963', 'Fairchild 2010'}**,
Computation method.
Other Parameters
@@ -216,17 +265,20 @@ def lightness(Y, method='CIE 1976', **kwargs):
Y_n : numeric or array_like, optional
{:func:`lightness_CIE1976`},
White reference *luminance* :math:`Y_n`.
+ epsilon : numeric or array_like, optional
+ {:func:`lightness_Fairchild2010`},
+ :math:`\epsilon` exponent.
Returns
-------
numeric or array_like
- *Lightness* :math:`L^*`.
+ *Lightness* :math:`L`.
Notes
-----
- Input *luminance* :math:`Y` and optional :math:`Y_n` are in domain
- [0, 100].
- - Output *Lightness* :math:`L^*` is in range [0, 100].
+ [0, 100] or [0, :math:`\infty`].
+ - Output *Lightness* :math:`L` is in range [0, 100].
Examples
--------
@@ -240,6 +292,11 @@ def lightness(Y, method='CIE 1976', **kwargs):
36.2505626...
>>> lightness(10.08, method='Wyszecki 1963') # doctest: +ELLIPSIS
37.0041149...
+ >>> lightness(
+ ... 10.08 / 100,
+ ... epsilon=1.836,
+ ... method='Fairchild 2010') # doctest: +ELLIPSIS
+ 24.9022902...
"""
function = LIGHTNESS_METHODS[method]
diff --git a/colour/colorimetry/luminance.py b/colour/colorimetry/luminance.py
index 323220e8ab..13ad20a871 100644
--- a/colour/colorimetry/luminance.py
+++ b/colour/colorimetry/luminance.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Luminance :math:`Y`
===================
@@ -16,6 +15,8 @@
*Munsell* value :math:`V` using *ASTM D1535-08e1* method.
- :func:`luminance_CIE1976`: *luminance* :math:`Y` computation of given
*Lightness* :math:`L^*` as per *CIE 1976* recommendation.
+- :func:`luminance_Fairchild2010`: *luminance* :math:`Y` computation of given
+ *Lightness* :math:`L_{hdr}` using *Fairchild and Wyble (2010)* method.
See Also
--------
@@ -28,6 +29,7 @@
import numpy as np
+from colour.biochemistry import substrate_concentration_MichealisMenten
from colour.constants import CIE_E, CIE_K
from colour.utilities import CaseInsensitiveMapping, filter_kwargs
@@ -38,11 +40,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['luminance_Newhall1943',
- 'luminance_ASTMD153508',
- 'luminance_CIE1976',
- 'LUMINANCE_METHODS',
- 'luminance']
+__all__ = [
+ 'luminance_Newhall1943', 'luminance_ASTMD153508', 'luminance_CIE1976',
+ 'luminance_Fairchild2010', 'LUMINANCE_METHODS', 'luminance'
+]
def luminance_Newhall1943(V):
@@ -168,31 +169,80 @@ def luminance_CIE1976(Lstar, Y_n=100):
Y_n = np.asarray(Y_n)
Y = np.where(Lstar > CIE_K * CIE_E,
- Y_n * ((Lstar + 16) / 116) ** 3,
- Y_n * (Lstar / CIE_K))
+ Y_n * ((Lstar + 16) / 116) ** 3, Y_n * (Lstar / CIE_K))
+
+ return Y
+
+
+def luminance_Fairchild2010(L_hdr, epsilon=2):
+ """
+ Computes *luminance* :math:`Y` of given *Lightness* :math:`L_{hdr}` using
+ *Fairchild and Wyble (2010)* method accordingly to *Michealis-Menten*
+ kinetics.
+
+ Parameters
+ ----------
+ L_hdr : array_like
+ *Lightness* :math:`L_{hdr}`.
+ epsilon : numeric or array_like, optional
+ :math:`\epsilon` exponent.
+
+ Returns
+ -------
+ array_like
+ *luminance* :math:`Y`.
+
+ Warning
+ -------
+ The output range of that definition is non standard!
+
+ Notes
+ -----
+ - Output *luminance* :math:`Y` is in range [0, math:`\infty`].
+
+ References
+ ----------
+ .. [4] Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT:
+ Simple Models for Describing the Color of High-Dynamic-Range and
+ Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference
+ (pp. 322–326). ISBN:9781629932156
+
+ Examples
+ --------
+ >>> luminance_Fairchild2010(
+ ... 24.902290269546651, 1.836) # doctest: +ELLIPSIS
+ 0.1007999...
+ """
+
+ L_hdr = np.asarray(L_hdr)
+
+ Y = np.exp(
+ np.log(
+ substrate_concentration_MichealisMenten(L_hdr - 0.02, 100, 0.184 **
+ epsilon)) / epsilon)
return Y
-LUMINANCE_METHODS = CaseInsensitiveMapping(
- {'Newhall 1943': luminance_Newhall1943,
- 'ASTM D1535-08': luminance_ASTMD153508,
- 'CIE 1976': luminance_CIE1976})
+LUMINANCE_METHODS = CaseInsensitiveMapping({
+ 'Newhall 1943': luminance_Newhall1943,
+ 'ASTM D1535-08': luminance_ASTMD153508,
+ 'CIE 1976': luminance_CIE1976,
+ 'Fairchild 2010': luminance_Fairchild2010
+})
"""
Supported *luminance* computations methods.
LUMINANCE_METHODS : CaseInsensitiveMapping
- **{'Newhall 1943', 'ASTM D1535-08', 'CIE 1976'}**
+ **{'Newhall 1943', 'ASTM D1535-08', 'CIE 1976', 'Fairchild 2010'}**
Aliases:
- 'astm2008': 'ASTM D1535-08'
- 'cie1976': 'CIE 1976'
"""
-LUMINANCE_METHODS['astm2008'] = (
- LUMINANCE_METHODS['ASTM D1535-08'])
-LUMINANCE_METHODS['cie1976'] = (
- LUMINANCE_METHODS['CIE 1976'])
+LUMINANCE_METHODS['astm2008'] = (LUMINANCE_METHODS['ASTM D1535-08'])
+LUMINANCE_METHODS['cie1976'] = (LUMINANCE_METHODS['CIE 1976'])
def luminance(LV, method='CIE 1976', **kwargs):
@@ -205,7 +255,7 @@ def luminance(LV, method='CIE 1976', **kwargs):
LV : numeric or array_like
*Lightness* :math:`L^*` or *Munsell* value :math:`V`.
method : unicode, optional
- **{'CIE 1976', 'Newhall 1943', 'ASTM D1535-08'}**,
+ **{'CIE 1976', 'Newhall 1943', 'ASTM D1535-08', 'Fairchild 2010'}**,
Computation method.
Other Parameters
@@ -213,6 +263,9 @@ def luminance(LV, method='CIE 1976', **kwargs):
Y_n : numeric or array_like, optional
{:func:`luminance_CIE1976`},
White reference *luminance* :math:`Y_n`.
+ epsilon : numeric or array_like, optional
+ {:func:`lightness_Fairchild2010`},
+ :math:`\epsilon` exponent.
Returns
-------
@@ -221,9 +274,10 @@ def luminance(LV, method='CIE 1976', **kwargs):
Notes
-----
- - Input *LV* is in domain [0, 100] or [0, 10] and optional *luminance*
- :math:`Y_n` is in domain [0, 100].
- - Output *luminance* :math:`Y` is in range [0, 100].
+ - Input *LV* is in domain [0, 100], [0, 10] or [0, 1] and optional
+ *luminance* :math:`Y_n` is in domain [0, 100].
+ - Output *luminance* :math:`Y` is in range [0, 100] or
+ [0, math:`\infty`].
Examples
--------
@@ -237,6 +291,11 @@ def luminance(LV, method='CIE 1976', **kwargs):
10.4089874...
>>> luminance(3.74629715, method='ASTM D1535-08') # doctest: +ELLIPSIS
10.1488096...
+ >>> luminance(
+ ... 24.902290269546651,
+ ... epsilon=1.836,
+ ... method='Fairchild 2010') # doctest: +ELLIPSIS
+ 0.1007999...
"""
function = LUMINANCE_METHODS[method]
diff --git a/colour/colorimetry/photometry.py b/colour/colorimetry/photometry.py
index 5193872e19..539402064b 100644
--- a/colour/colorimetry/photometry.py
+++ b/colour/colorimetry/photometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Photometry
==========
@@ -37,15 +36,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['luminous_flux',
- 'luminous_efficiency',
- 'luminous_efficacy']
+__all__ = ['luminous_flux', 'luminous_efficiency', 'luminous_efficacy']
-def luminous_flux(
- spd,
- lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
- K_m=K_M):
+def luminous_flux(spd,
+ lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
+ K_m=K_M):
"""
Returns the *luminous flux* for given spectral power distribution using
given luminous efficiency function.
@@ -72,9 +68,8 @@ def luminous_flux(
23807.6555273...
"""
- lef = lef.clone().align(spd.shape,
- extrapolation_left=0,
- extrapolation_right=0)
+ lef = lef.clone().align(
+ spd.shape, extrapolation_left=0, extrapolation_right=0)
spd = spd.clone() * lef
flux = K_m * np.trapz(spd.values, spd.wavelengths)
@@ -83,8 +78,7 @@ def luminous_flux(
def luminous_efficiency(
- spd,
- lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer']):
+ spd, lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer']):
"""
Returns the *luminous efficiency* of given spectral power distribution
using given luminous efficiency function.
@@ -109,9 +103,8 @@ def luminous_efficiency(
0.1994393...
"""
- lef = lef.clone().align(spd.shape,
- extrapolation_left=0,
- extrapolation_right=0)
+ lef = lef.clone().align(
+ spd.shape, extrapolation_left=0, extrapolation_right=0)
spd = spd.clone()
efficiency = (np.trapz(lef.values * spd.values, spd.wavelengths) /
@@ -121,8 +114,7 @@ def luminous_efficiency(
def luminous_efficacy(
- spd,
- lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer']):
+ spd, lef=PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer']):
"""
Returns the *luminous efficacy* in :math:`lm\cdot W^{-1}` of given spectral
power distribution using given luminous efficiency function.
diff --git a/colour/colorimetry/spectrum.py b/colour/colorimetry/spectrum.py
index a0754e3829..c649768a06 100644
--- a/colour/colorimetry/spectrum.py
+++ b/colour/colorimetry/spectrum.py
@@ -1,11 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Spectrum
========
-Defines the classes handling spectral data computation:
+Defines the classes handling spectral data computations:
- :class:`SpectralMapping`
- :class:`SpectralShape`
@@ -26,22 +25,12 @@
import pprint
from six.moves import zip
-from colour.algebra import (
- Extrapolator,
- LinearInterpolator,
- SpragueInterpolator,
- CubicSplineInterpolator,
- PchipInterpolator)
-from colour.utilities import (
- ArbitraryPrecisionMapping,
- is_iterable,
- is_numeric,
- is_string,
- is_uniform,
- interval,
- tsplit,
- tstack,
- warning)
+from colour.algebra import (Extrapolator, LinearInterpolator,
+ SpragueInterpolator, CubicSplineInterpolator,
+ PchipInterpolator)
+from colour.utilities import (ArbitraryPrecisionMapping, is_iterable,
+ is_numeric, is_string, is_uniform, interval,
+ tsplit, tstack, warning)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -50,15 +39,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['DEFAULT_WAVELENGTH_DECIMALS',
- 'SpectralMapping',
- 'SpectralShape',
- 'SpectralPowerDistribution',
- 'TriSpectralPowerDistribution',
- 'DEFAULT_SPECTRAL_SHAPE',
- 'constant_spd',
- 'zeros_spd',
- 'ones_spd']
+__all__ = [
+ 'DEFAULT_WAVELENGTH_DECIMALS', 'SpectralMapping', 'SpectralShape',
+ 'SpectralPowerDistribution', 'TriSpectralPowerDistribution',
+ 'DEFAULT_SPECTRAL_SHAPE', 'constant_spd', 'zeros_spd', 'ones_spd'
+]
DEFAULT_WAVELENGTH_DECIMALS = 10
"""
@@ -112,8 +97,8 @@ def __init__(self,
data=None,
wavelength_decimals=DEFAULT_WAVELENGTH_DECIMALS,
**kwargs):
- super(SpectralMapping, self).__init__(
- data, wavelength_decimals, **kwargs)
+ super(SpectralMapping, self).__init__(data, wavelength_decimals,
+ **kwargs)
@property
def wavelength_decimals(self):
@@ -142,7 +127,7 @@ def wavelength_decimals(self, value):
if value is not None:
assert isinstance(value, int), (
'"{0}" attribute: "{1}" is not a "int" instance!').format(
- 'wavelength_decimals', value)
+ 'wavelength_decimals', value)
self.key_decimals = value
@@ -363,8 +348,7 @@ def __str__(self):
Nice formatted string representation.
"""
- return '({0}, {1}, {2})'.format(
- self._start, self._end, self._interval)
+ return '({0}, {1}, {2})'.format(self._start, self._end, self._interval)
def __repr__(self):
"""
@@ -376,8 +360,8 @@ def __repr__(self):
Formatted string representation.
"""
- return 'SpectralShape({0}, {1}, {2})'.format(
- self._start, self._end, self._interval)
+ return 'SpectralShape({0}, {1}, {2})'.format(self._start, self._end,
+ self._interval)
def __iter__(self):
"""
@@ -567,8 +551,8 @@ def range(self):
'"interval" attributes is not defined!'))
if self._range is None:
- samples = round((self._interval + self._end - self._start) /
- self._interval)
+ samples = round(
+ (self._interval + self._end - self._start) / self._interval)
range_, current_interval = np.linspace(
self._start, self._end, samples, retstep=True)
self._range = np.around(range_, DEFAULT_WAVELENGTH_DECIMALS)
@@ -576,8 +560,8 @@ def range(self):
if current_interval != self._interval:
self._interval = current_interval
warning(('"{0}" shape could not be honored, using '
- '"{1}"!').format(
- (self._start, self._end, self._interval), self))
+ '"{1}"!').format((self._start, self._end,
+ self._interval), self))
return self._range
@@ -694,9 +678,9 @@ def name(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('name', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'name', value))
self._name = value
@property
@@ -757,9 +741,9 @@ def title(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('title', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'title', value))
self._title = value
@property
@@ -898,9 +882,8 @@ def shape(self):
wavelengths = self.wavelengths
- return SpectralShape(min(wavelengths),
- max(wavelengths),
- min(interval(wavelengths)))
+ return SpectralShape(
+ min(wavelengths), max(wavelengths), min(interval(wavelengths)))
@shape.setter
def shape(self, value):
@@ -941,8 +924,7 @@ def __str__(self):
SpectralPowerDistribution('Sample', (510..., 540..., 10...))
"""
- return '{0}(\'{1}\', {2})'.format(self.__class__.__name__,
- self._name,
+ return '{0}(\'{1}\', {2})'.format(self.__class__.__name__, self._name,
str(self.shape))
def __repr__(self):
@@ -973,8 +955,7 @@ def __repr__(self):
"""
return '{0}(\n \'{1}\',\n {2})'.format(
- self.__class__.__name__,
- self._name,
+ self.__class__.__name__, self._name,
pprint.pformat(dict(self.data)).replace('\n', '\n '))
def __hash__(self):
@@ -1760,11 +1741,7 @@ def is_uniform(self):
return is_uniform(self.wavelengths)
- def extrapolate(self,
- shape,
- method='Constant',
- left=None,
- right=None):
+ def extrapolate(self, shape, method='Constant', left=None, right=None):
"""
Extrapolates the spectral power distribution following *CIE 15:2004*
recommendation.
@@ -1813,15 +1790,15 @@ def extrapolate(self,
extrapolator = Extrapolator(
LinearInterpolator(self.wavelengths, self.values),
- method=method, left=left, right=right)
+ method=method,
+ left=left,
+ right=right)
spd_shape = self.shape
- for i in np.arange(spd_shape.start,
- shape.start - spd_shape.interval,
+ for i in np.arange(spd_shape.start, shape.start - spd_shape.interval,
-spd_shape.interval):
self[i] = extrapolator(np.float_(i))
- for i in np.arange(spd_shape.end,
- shape.end + spd_shape.interval,
+ for i in np.arange(spd_shape.end, shape.end + spd_shape.interval,
spd_shape.interval):
self[i] = extrapolator(np.float_(i))
@@ -1911,8 +1888,8 @@ def interpolate(self, shape=SpectralShape(), method=None):
>>> spd[511] = 31.41
>>> print(spd.interpolate(SpectralShape(interval=1)))
SpectralPowerDistribution('Sample', (510.0, 560.0, 1.0))
- >>> spd[515] # doctest: +ELLIPSIS
- array(21.4792222...)
+ >>> spd[515] # doctest: +SKIP
+ array(21.4835799...)
Enforcing *Linear* interpolation:
@@ -1969,8 +1946,7 @@ def interpolate(self, shape=SpectralShape(), method=None):
interpolator = SpragueInterpolator
else:
- raise ValueError(
- 'Undefined "{0}" interpolator!'.format(method))
+ raise ValueError('Undefined "{0}" interpolator!'.format(method))
interpolator = interpolator(wavelengths, values)
wavelengths = shape.range()
@@ -2053,9 +2029,7 @@ def align(self,
"""
self.interpolate(shape, interpolation_method)
- self.extrapolate(shape,
- extrapolation_method,
- extrapolation_left,
+ self.extrapolate(shape, extrapolation_method, extrapolation_left,
extrapolation_right)
return self
@@ -2147,14 +2121,15 @@ def zeros(self, shape=SpectralShape()):
boundaries = [x[0] if x[0] is not None else x[1] for x in boundaries]
shape = SpectralShape(*boundaries)
- data = SpectralMapping(
- [(wavelength, self.get(wavelength, 0))
- for wavelength in shape])
+ data = SpectralMapping([(wavelength, self.get(wavelength, 0))
+ for wavelength in shape])
values_s = max(self.shape.start, shape.start)
values_e = min(self.shape.end, shape.end)
- values = [self[wavelength] for wavelength in self.wavelengths
- if values_s <= wavelength <= values_e]
+ values = [
+ self[wavelength] for wavelength in self.wavelengths
+ if values_s <= wavelength <= values_e
+ ]
if not np.all(np.in1d(values, list(data.values()))):
raise RuntimeError(('"{0}" cannot be zeros filled using "{1}" '
'shape!').format(self, shape))
@@ -2217,8 +2192,8 @@ def clone(self):
SpectralPowerDistribution('Sample (...)', (510..., 540..., 10...))
"""
- clone = SpectralPowerDistribution(
- self.name, self.data.data, self.title)
+ clone = SpectralPowerDistribution(self.name, self.data.data,
+ self.title)
clone.name = '{0} ({1})'.format(clone.name, id(clone))
@@ -2360,9 +2335,9 @@ def name(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('name', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'name', value))
self._name = value
@property
@@ -2435,8 +2410,7 @@ def data(self, value):
data = {}
for axis in ('x', 'y', 'z'):
data[axis] = SpectralPowerDistribution(
- self._mapping[axis],
- value[self._mapping[axis]])
+ self._mapping[axis], value[self._mapping[axis]])
wavelengths = data['x'].wavelengths
np.testing.assert_array_equal(
@@ -2482,9 +2456,9 @@ def title(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('title', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'title', value))
self._title = value
@property
@@ -2682,13 +2656,21 @@ def items(self):
Property for **self.items** attribute. This is a convenient attribute
used to iterate over the tri-spectral power distribution.
+ Notes
+ -----
+ - In contrast to :func:`SpectralPowerDistribution.items` method,
+ :func:`TriSpectralPowerDistribution.items` returns a `list` as it
+ is not possible to convert its output to a `ndarray`. It is
+ possible to separate wavelengths from data by unpacking the return
+ value into the `zip` definition as follows: `zip(*tri_spd.items)`.
+
Returns
-------
- ndarray
+ list
Tri-spectral power distribution data.
"""
- return np.array(list(self.__iter__()))
+ return list(self.__iter__())
@items.setter
def items(self, value):
@@ -2782,8 +2764,7 @@ def __str__(self):
TriSpectralPowerDistribution('Observer', (510..., 540..., 10...))
"""
- return '{0}(\'{1}\', {2})'.format(self.__class__.__name__,
- self._name,
+ return '{0}(\'{1}\', {2})'.format(self.__class__.__name__, self._name,
str(self.shape))
def __repr__(self):
@@ -2826,9 +2807,11 @@ def __repr__(self):
None)
"""
- data = {'x_bar': dict(self.x.data),
- 'y_bar': dict(self.y.data),
- 'z_bar': dict(self.z.data)}
+ data = {
+ 'x_bar': dict(self.x.data),
+ 'y_bar': dict(self.y.data),
+ 'z_bar': dict(self.z.data)
+ }
return '{0}(\n \'{1}\',\n {2},\n {3},\n {4},' \
'\n {5})'.format(
@@ -2859,8 +2842,7 @@ def __hash__(self):
See :meth:`SpectralPowerDistribution.__hash__` method warning section.
"""
- return hash((frozenset(self._data['x']),
- frozenset(self._data['y']),
+ return hash((frozenset(self._data['x']), frozenset(self._data['y']),
frozenset(self._data['z'])))
def __getitem__(self, wavelength):
@@ -2905,8 +2887,8 @@ def __getitem__(self, wavelength):
[ 88.19, 23.45, 90.28]])
"""
- value = tstack(
- (self.x[wavelength], self.y[wavelength], self.z[wavelength]))
+ value = tstack((self.x[wavelength], self.y[wavelength],
+ self.z[wavelength]))
return value
@@ -3734,11 +3716,13 @@ def get(self, wavelength, default=np.nan):
wavelength = np.asarray(wavelength)
default = np.resize(default, 3)
- value = tstack([self.x.get(wavelength, default[0]),
- self.y.get(wavelength, default[1]),
- self.z.get(wavelength, default[2])])
+ value = tstack([
+ self.x.get(wavelength, default[0]),
+ self.y.get(wavelength, default[1]),
+ self.z.get(wavelength, default[2])
+ ])
- value = np.reshape(value, wavelength.shape + (3,))
+ value = np.reshape(value, wavelength.shape + (3, ))
return value
@@ -3780,11 +3764,7 @@ def is_uniform(self):
return False
return True
- def extrapolate(self,
- shape,
- method='Constant',
- left=None,
- right=None):
+ def extrapolate(self, shape, method='Constant', left=None, right=None):
"""
Extrapolates the tri-spectral power distribution following
*CIE 15:2004* recommendation. [2]_ [3]_
@@ -3908,8 +3888,8 @@ def interpolate(self, shape=SpectralShape(), method=None):
>>> tri_spd[511] = np.array([31.41, 95.27, 15.06])
>>> print(tri_spd.interpolate(SpectralShape(interval=1)))
TriSpectralPowerDistribution('Observer', (510.0, 560.0, 1.0))
- >>> tri_spd[515] # doctest: +ELLIPSIS
- array([ 21.4710405..., 100.6430015..., 18.8165196...])
+ >>> tri_spd[515] # doctest: +SKIP
+ array([ 21.4752929..., 100.6436744..., 18.8153985...])
Enforcing *Linear* interpolation:
@@ -4074,11 +4054,9 @@ def align(self,
"""
for i in self._mapping.keys():
- getattr(self, i).align(shape,
- interpolation_method,
- extrapolation_method,
- extrapolation_left,
- extrapolation_right)
+ getattr(self,
+ i).align(shape, interpolation_method, extrapolation_method,
+ extrapolation_left, extrapolation_right)
return self
@@ -4356,13 +4334,15 @@ def clone(self):
TriSpectralPowerDistribution('Observer (...)', (510..., 560..., 10...))
"""
- data = {self.mapping['x']: self.x.data.data,
- self.mapping['y']: self.y.data.data,
- self.mapping['z']: self.z.data.data}
+ data = {
+ self.mapping['x']: self.x.data.data,
+ self.mapping['y']: self.y.data.data,
+ self.mapping['z']: self.z.data.data
+ }
mapping = self.mapping.copy()
labels = self.labels.copy()
- clone = TriSpectralPowerDistribution(
- self.name, data, mapping, self.title, labels)
+ clone = TriSpectralPowerDistribution(self.name, data, mapping,
+ self.title, labels)
clone.name = '{0} ({1})'.format(clone.name, id(clone))
@@ -4415,8 +4395,8 @@ def constant_spd(k, shape=DEFAULT_SPECTRAL_SHAPE):
values = np.full(len(wavelengths), k, np.float_)
name = '{0} Constant'.format(k)
- return SpectralPowerDistribution(
- name, SpectralMapping(zip(wavelengths, values)))
+ return SpectralPowerDistribution(name,
+ SpectralMapping(zip(wavelengths, values)))
def zeros_spd(shape=DEFAULT_SPECTRAL_SHAPE):
diff --git a/colour/colorimetry/tests/tests_blackbody.py b/colour/colorimetry/tests/tests_blackbody.py
index f522f4aad9..586f8dc7d1 100644
--- a/colour/colorimetry/tests/tests_blackbody.py
+++ b/colour/colorimetry/tests/tests_blackbody.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.blackbody` module.
"""
@@ -11,10 +10,7 @@
import unittest
from itertools import permutations
-from colour.colorimetry import (
- SpectralShape,
- planck_law,
- blackbody_spd)
+from colour.colorimetry import (SpectralShape, planck_law, blackbody_spd)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -24,10 +20,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['PLANCK_LAW_DATA',
- 'BLACKBODY_SPD_DATA',
- 'TestPlanckLaw',
- 'TestBlackbodySpd']
+__all__ = [
+ 'PLANCK_LAW_DATA', 'BLACKBODY_SPD_DATA', 'TestPlanckLaw',
+ 'TestBlackbodySpd'
+]
PLANCK_LAW_DATA = {
1667: {
@@ -1029,7 +1025,8 @@
9960: 881345544.275766253471375,
9970: 878250862.944037556648254,
9980: 875169645.970686674118042,
- 9990: 872101823.746138095855713, },
+ 9990: 872101823.746138095855713,
+ },
5000: {
10: 0.000000000000000,
20: 0.000000000000000,
@@ -2029,7 +2026,8 @@
9960: 3627545620.689677238464355,
9970: 3613562359.002460479736328,
9980: 3599646364.107719421386719,
- 9990: 3585797248.344646453857422, },
+ 9990: 3585797248.344646453857422,
+ },
10000: {
10: 0.000000000000000,
20: 0.000000002126338,
@@ -3029,7 +3027,8 @@
9960: 7818858886.277912139892578,
9970: 7788114277.527709007263184,
9980: 7757520610.135956764221191,
- 9990: 7727076995.859315872192383},
+ 9990: 7727076995.859315872192383
+ },
100000: {
10: 671890609624107008.000000000000000,
20: 27976228265571860480.000000000000000,
@@ -4029,7 +4028,9 @@
9960: 83512005091.210250854492188,
9970: 83178059708.148803710937500,
9980: 82845781868.989334106445312,
- 9990: 82515161591.536300659179688}}
+ 9990: 82515161591.536300659179688
+ }
+}
BLACKBODY_SPD_DATA = (
6654278270641.816406250000000,
@@ -4502,7 +4503,7 @@
9791291163110.535156250000000,
9774601515939.068359375000000,
9757915058392.632812500000000,
- 9741232052709.107421875000000)
+ 9741232052709.107421875000000) # yapf: disable
class TestPlanckLaw(unittest.TestCase):
@@ -4533,27 +4534,19 @@ def test_n_dimensional_planck_law(self):
wl = 500 * 1e-9
p = 20472701909806.578
- np.testing.assert_almost_equal(
- planck_law(wl, 5500),
- p)
+ np.testing.assert_almost_equal(planck_law(wl, 5500), p)
wl = np.tile(wl, 6)
p = np.tile(p, 6)
- np.testing.assert_almost_equal(
- planck_law(wl, 5500),
- p)
+ np.testing.assert_almost_equal(planck_law(wl, 5500), p)
wl = np.reshape(wl, (2, 3))
p = np.reshape(p, (2, 3))
- np.testing.assert_almost_equal(
- planck_law(wl, 5500),
- p)
+ np.testing.assert_almost_equal(planck_law(wl, 5500), p)
wl = np.reshape(wl, (2, 3, 1))
p = np.reshape(p, (2, 3, 1))
- np.testing.assert_almost_equal(
- planck_law(wl, 5500),
- p)
+ np.testing.assert_almost_equal(planck_law(wl, 5500), p)
@ignore_numpy_errors
def test_nan_planck_law(self):
diff --git a/colour/colorimetry/tests/tests_cmfs.py b/colour/colorimetry/tests/tests_cmfs.py
index 45414c5131..111820d2f0 100644
--- a/colour/colorimetry/tests/tests_cmfs.py
+++ b/colour/colorimetry/tests/tests_cmfs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.cmfs` module.
"""
@@ -9,10 +8,9 @@
import unittest
-from colour.colorimetry import (
- LMS_ConeFundamentals,
- RGB_ColourMatchingFunctions,
- XYZ_ColourMatchingFunctions)
+from colour.colorimetry import (LMS_ConeFundamentals,
+ RGB_ColourMatchingFunctions,
+ XYZ_ColourMatchingFunctions)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -21,9 +19,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLMS_ConeFundamentals',
- 'TestRGB_ColourMatchingFunctions',
- 'TestXYZ_ColourMatchingFunctions']
+__all__ = [
+ 'TestLMS_ConeFundamentals', 'TestRGB_ColourMatchingFunctions',
+ 'TestXYZ_ColourMatchingFunctions'
+]
class TestLMS_ConeFundamentals(unittest.TestCase):
@@ -37,19 +36,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'mapping',
- 'labels',
- 'data',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape',
- 'l_bar',
- 'm_bar',
- 's_bar')
+ required_attributes = ('name', 'mapping', 'labels', 'data', 'x', 'y',
+ 'z', 'wavelengths', 'values', 'shape', 'l_bar',
+ 'm_bar', 's_bar')
for attribute in required_attributes:
self.assertIn(attribute, dir(LMS_ConeFundamentals))
@@ -59,25 +48,11 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__sub__',
- '__mul__',
- '__div__',
- 'get',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__hash__', '__getitem__', '__setitem__',
+ '__iter__', '__contains__', '__len__', '__eq__',
+ '__ne__', '__add__', '__sub__', '__mul__',
+ '__div__', 'get', 'extrapolate', 'interpolate',
+ 'align', 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(LMS_ConeFundamentals))
@@ -94,19 +69,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'mapping',
- 'labels',
- 'data',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape',
- 'r_bar',
- 'g_bar',
- 'b_bar')
+ required_attributes = ('name', 'mapping', 'labels', 'data', 'x', 'y',
+ 'z', 'wavelengths', 'values', 'shape', 'r_bar',
+ 'g_bar', 'b_bar')
for attribute in required_attributes:
self.assertIn(attribute, dir(RGB_ColourMatchingFunctions))
@@ -116,25 +81,11 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__sub__',
- '__mul__',
- '__div__',
- 'get',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__hash__', '__getitem__', '__setitem__',
+ '__iter__', '__contains__', '__len__', '__eq__',
+ '__ne__', '__add__', '__sub__', '__mul__',
+ '__div__', 'get', 'extrapolate', 'interpolate',
+ 'align', 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(RGB_ColourMatchingFunctions))
@@ -151,19 +102,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'mapping',
- 'labels',
- 'data',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape',
- 'x_bar',
- 'y_bar',
- 'z_bar')
+ required_attributes = ('name', 'mapping', 'labels', 'data', 'x', 'y',
+ 'z', 'wavelengths', 'values', 'shape', 'x_bar',
+ 'y_bar', 'z_bar')
for attribute in required_attributes:
self.assertIn(attribute, dir(XYZ_ColourMatchingFunctions))
@@ -173,25 +114,11 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__sub__',
- '__mul__',
- '__div__',
- 'get',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__hash__', '__getitem__', '__setitem__',
+ '__iter__', '__contains__', '__len__', '__eq__',
+ '__ne__', '__add__', '__sub__', '__mul__',
+ '__div__', 'get', 'extrapolate', 'interpolate',
+ 'align', 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(XYZ_ColourMatchingFunctions))
diff --git a/colour/colorimetry/tests/tests_correction.py b/colour/colorimetry/tests/tests_correction.py
index 7933df742c..23c4784835 100644
--- a/colour/colorimetry/tests/tests_correction.py
+++ b/colour/colorimetry/tests/tests_correction.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.correction` module.
"""
@@ -10,9 +9,8 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- SpectralPowerDistribution,
- bandpass_correction_Stearns1988)
+from colour.colorimetry import (SpectralPowerDistribution,
+ bandpass_correction_Stearns1988)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -21,9 +19,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SPD_DATA',
- 'BANDPASS_CORRECTED_STEARNS_SPD_DATA',
- 'TestBandpassCorrectionStearns1988']
+__all__ = [
+ 'SPD_DATA', 'BANDPASS_CORRECTED_STEARNS_SPD_DATA',
+ 'TestBandpassCorrectionStearns1988'
+]
SPD_DATA = (
9.3700,
@@ -41,7 +40,7 @@
69.5900,
81.7300,
88.1900,
- 86.0500)
+ 86.0500) # yapf: disable
BANDPASS_CORRECTED_STEARNS_SPD_DATA = (
9.12515000,
@@ -59,7 +58,7 @@
70.21750370,
82.14935719,
88.88373581,
- 85.87238000)
+ 85.87238000) # yapf: disable
class TestBandpassCorrectionStearns1988(unittest.TestCase):
diff --git a/colour/colorimetry/tests/tests_dominant.py b/colour/colorimetry/tests/tests_dominant.py
index d8073fcec6..b2d3443a94 100644
--- a/colour/colorimetry/tests/tests_dominant.py
+++ b/colour/colorimetry/tests/tests_dominant.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.dominant` module.
"""
@@ -11,15 +10,10 @@
import unittest
from itertools import permutations
-from colour.colorimetry import (
- CMFS,
- ILLUMINANTS,
- dominant_wavelength,
- complementary_wavelength,
- excitation_purity,
- colorimetric_purity)
-from colour.colorimetry.dominant import (
- closest_spectral_locus_wavelength)
+from colour.colorimetry import (CMFS, ILLUMINANTS, dominant_wavelength,
+ complementary_wavelength, excitation_purity,
+ colorimetric_purity)
+from colour.colorimetry.dominant import (closest_spectral_locus_wavelength)
from colour.models import XYZ_to_xy
from colour.utilities import ignore_numpy_errors
@@ -30,13 +24,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CIE_2_1931_CMFS',
- 'D65',
- 'TestClosestSpectralLocusWavelength',
- 'TestDominantWavelength',
- 'TestComplementaryWavelength',
- 'TestExcitationPurity',
- 'TestColorimetricPurity']
+__all__ = [
+ 'CIE_2_1931_CMFS', 'D65', 'TestClosestSpectralLocusWavelength',
+ 'TestDominantWavelength', 'TestComplementaryWavelength',
+ 'TestExcitationPurity', 'TestColorimetricPurity'
+]
CIE_2_1931_CMFS = CMFS['CIE 1931 2 Degree Standard Observer']
D65 = ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
@@ -86,8 +78,7 @@ def test_n_dimensional_closest_spectral_locus_wavelength(self):
xy_n = D65
i_wl, xy_wl = closest_spectral_locus_wavelength(xy, xy_n, self._xy_s)
i_wl_r, xy_wl_r = 144, np.array([0.00369694, 0.63895775])
- np.testing.assert_almost_equal(
- i_wl, i_wl_r, decimal=7)
+ np.testing.assert_almost_equal(i_wl, i_wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
xy = np.tile(xy, (6, 1))
@@ -95,8 +86,7 @@ def test_n_dimensional_closest_spectral_locus_wavelength(self):
i_wl, xy_wl = closest_spectral_locus_wavelength(xy, xy_n, self._xy_s)
i_wl_r = np.tile(i_wl_r, 6)
xy_wl_r = np.tile(xy_wl_r, (6, 1))
- np.testing.assert_almost_equal(
- i_wl, i_wl_r, decimal=7)
+ np.testing.assert_almost_equal(i_wl, i_wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
xy = np.reshape(xy, (2, 3, 2))
@@ -104,8 +94,7 @@ def test_n_dimensional_closest_spectral_locus_wavelength(self):
i_wl, xy_wl = closest_spectral_locus_wavelength(xy, xy_n, self._xy_s)
i_wl_r = np.reshape(i_wl_r, (2, 3))
xy_wl_r = np.reshape(xy_wl_r, (2, 3, 2))
- np.testing.assert_almost_equal(
- i_wl, i_wl_r, decimal=7)
+ np.testing.assert_almost_equal(i_wl, i_wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
@ignore_numpy_errors
@@ -164,11 +153,9 @@ def test_n_dimensional_dominant_wavelength(self):
xy = np.array([0.26415, 0.37770])
xy_n = D65
wl, xy_wl, xy_cwl = dominant_wavelength(xy, xy_n, CIE_2_1931_CMFS)
- wl_r, xy_wl_r, xy_cwl_r = (504,
- np.array([0.00369694, 0.63895775]),
+ wl_r, xy_wl_r, xy_cwl_r = (504, np.array([0.00369694, 0.63895775]),
np.array([0.00369694, 0.63895775]))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -178,8 +165,7 @@ def test_n_dimensional_dominant_wavelength(self):
wl_r = np.tile(wl_r, 6)
xy_wl_r = np.tile(xy_wl_r, (6, 1))
xy_cwl_r = np.tile(xy_cwl_r, (6, 1))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -189,8 +175,7 @@ def test_n_dimensional_dominant_wavelength(self):
wl_r = np.reshape(wl_r, (2, 3))
xy_wl_r = np.reshape(xy_wl_r, (2, 3, 2))
xy_cwl_r = np.reshape(xy_cwl_r, (2, 3, 2))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -251,11 +236,9 @@ def test_n_dimensional_complementary_wavelength(self):
xy = np.array([0.26415, 0.37770])
xy_n = D65
wl, xy_wl, xy_cwl = complementary_wavelength(xy, xy_n, CIE_2_1931_CMFS)
- wl_r, xy_wl_r, xy_cwl_r = (-504,
- np.array([0.48974944, 0.15140355]),
+ wl_r, xy_wl_r, xy_cwl_r = (-504, np.array([0.48974944, 0.15140355]),
np.array([0.00369694, 0.63895775]))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -265,8 +248,7 @@ def test_n_dimensional_complementary_wavelength(self):
wl_r = np.tile(wl_r, 6)
xy_wl_r = np.tile(xy_wl_r, (6, 1))
xy_cwl_r = np.tile(xy_cwl_r, (6, 1))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -276,8 +258,7 @@ def test_n_dimensional_complementary_wavelength(self):
wl_r = np.reshape(wl_r, (2, 3))
xy_wl_r = np.reshape(xy_wl_r, (2, 3, 2))
xy_cwl_r = np.reshape(xy_cwl_r, (2, 3, 2))
- np.testing.assert_almost_equal(
- wl, wl_r, decimal=7)
+ np.testing.assert_almost_equal(wl, wl_r, decimal=7)
np.testing.assert_almost_equal(xy_wl, xy_wl_r)
np.testing.assert_almost_equal(xy_cwl, xy_cwl_r)
@@ -332,25 +313,19 @@ def test_n_dimensional_excitation_purity(self):
xy_n = D65
P_e = 0.157118186993525
np.testing.assert_almost_equal(
- excitation_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ excitation_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
xy = np.tile(xy, (6, 1))
xy_n = np.tile(xy_n, (6, 1))
P_e = np.tile(P_e, 6)
np.testing.assert_almost_equal(
- excitation_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ excitation_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
xy_n = np.reshape(xy_n, (2, 3, 2))
P_e = np.reshape(P_e, (2, 3))
np.testing.assert_almost_equal(
- excitation_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ excitation_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
@ignore_numpy_errors
def test_nan_excitation_purity(self):
@@ -404,25 +379,19 @@ def test_n_dimensional_colorimetric_purity(self):
xy_n = D65
P_e = 0.265797944190812
np.testing.assert_almost_equal(
- colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
xy = np.tile(xy, (6, 1))
xy_n = np.tile(xy_n, (6, 1))
P_e = np.tile(P_e, 6)
np.testing.assert_almost_equal(
- colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
xy_n = np.reshape(xy_n, (2, 3, 2))
P_e = np.reshape(P_e, (2, 3))
np.testing.assert_almost_equal(
- colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS),
- P_e,
- decimal=7)
+ colorimetric_purity(xy, xy_n, CIE_2_1931_CMFS), P_e, decimal=7)
@ignore_numpy_errors
def test_nan_colorimetric_purity(self):
diff --git a/colour/colorimetry/tests/tests_illuminants.py b/colour/colorimetry/tests/tests_illuminants.py
index 330f954ab8..95142173f8 100644
--- a/colour/colorimetry/tests/tests_illuminants.py
+++ b/colour/colorimetry/tests/tests_illuminants.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.illuminants` module.
"""
@@ -10,9 +9,8 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- D_illuminant_relative_spd,
- CIE_standard_illuminant_A_function)
+from colour.colorimetry import (D_illuminant_relative_spd,
+ CIE_standard_illuminant_A_function)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -21,10 +19,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['D60_SPD_DATA',
- 'A_DATA',
- 'TestD_illuminantRelativeSpd',
- 'TestCIEStandardIlluminantAFunction']
+__all__ = [
+ 'D60_SPD_DATA', 'A_DATA', 'TestD_illuminantRelativeSpd',
+ 'TestCIEStandardIlluminantAFunction'
+]
D60_SPD_DATA = {
300: 0.029370758174923,
@@ -80,103 +78,104 @@
800: 62.989808616705801,
810: 54.990892361077115,
820: 60.825600670913168,
- 830: 63.893495862261560}
-
-A_DATA = np.array([
- 6.144617784123856,
- 6.947198985402079,
- 7.821349414981689,
- 8.769802283876084,
- 9.795099608867382,
- 10.899576157801631,
- 12.085345363411140,
- 13.354287257777719,
- 14.708038449875502,
- 16.147984141480254,
- 17.675252152303049,
- 19.290708903610355,
- 20.994957290865997,
- 22.788336360042955,
- 24.670922689127945,
- 26.642533365850888,
- 28.702730444663004,
- 30.850826760279453,
- 33.085892971502503,
- 35.406765707340028,
- 37.812056687427500,
- 40.300162690239553,
- 42.869276245337296,
- 45.517396929746482,
- 48.242343153313406,
- 51.041764323370195,
- 53.913153285099291,
- 56.853858940467404,
- 59.861098955389089,
- 62.931972471732792,
- 66.063472747830630,
- 69.252499658171686,
- 72.495871989904842,
- 75.790339480551324,
- 79.132594547909648,
- 82.519283669449450,
- 85.947018374529335,
- 89.412385818490364,
- 92.911958913061213,
- 96.442305992552875,
- 100.000000000000000,
- 103.581627181740913,
- 107.183795282900803,
- 110.803141239869944,
- 114.436338369157482,
- 118.080103054962819,
- 121.731200940444666,
- 125.386452630022220,
- 129.042738912085099,
- 132.697005513293647,
- 136.346267397171545,
- 139.987612621004047,
- 143.618205766130785,
- 147.235290957601734,
- 150.836194489858400,
- 154.418327075631083,
- 157.979185735603039,
- 161.516355346632452,
- 165.027509866420871,
- 168.510413252511256,
- 171.962920093394303,
- 175.382975969299480,
- 178.768617559985131,
- 182.117972516492841,
- 185.429259113445994,
- 188.700785698018507,
- 191.930949951225926,
- 195.118237976664375,
- 198.261223231287033,
- 201.358565312239051,
- 204.409008613197130,
- 207.411380863071741,
- 210.364591559332979,
- 213.267630307635471,
- 216.119565078810581,
- 218.919540393725441,
- 221.666775445909082,
- 224.360562171292912,
- 227.000263273843757,
- 229.585310215328150,
- 232.115201176917310,
- 234.589498999828919,
- 237.007829111703302,
- 239.369877444937316,
- 241.675388352737258,
- 243.924162528208456,
- 246.116054931382024,
- 248.250972728666568,
- 250.328873248841006,
- 252.349761959321199,
- 254.313690466103111,
- 256.220754540440964,
- 258.071092175015735,
- 259.864881672054366])
+ 830: 63.893495862261560
+}
+
+A_DATA = np.array(
+ [6.144617784123856,
+ 6.947198985402079,
+ 7.821349414981689,
+ 8.769802283876084,
+ 9.795099608867382,
+ 10.899576157801631,
+ 12.085345363411140,
+ 13.354287257777719,
+ 14.708038449875502,
+ 16.147984141480254,
+ 17.675252152303049,
+ 19.290708903610355,
+ 20.994957290865997,
+ 22.788336360042955,
+ 24.670922689127945,
+ 26.642533365850888,
+ 28.702730444663004,
+ 30.850826760279453,
+ 33.085892971502503,
+ 35.406765707340028,
+ 37.812056687427500,
+ 40.300162690239553,
+ 42.869276245337296,
+ 45.517396929746482,
+ 48.242343153313406,
+ 51.041764323370195,
+ 53.913153285099291,
+ 56.853858940467404,
+ 59.861098955389089,
+ 62.931972471732792,
+ 66.063472747830630,
+ 69.252499658171686,
+ 72.495871989904842,
+ 75.790339480551324,
+ 79.132594547909648,
+ 82.519283669449450,
+ 85.947018374529335,
+ 89.412385818490364,
+ 92.911958913061213,
+ 96.442305992552875,
+ 100.000000000000000,
+ 103.581627181740913,
+ 107.183795282900803,
+ 110.803141239869944,
+ 114.436338369157482,
+ 118.080103054962819,
+ 121.731200940444666,
+ 125.386452630022220,
+ 129.042738912085099,
+ 132.697005513293647,
+ 136.346267397171545,
+ 139.987612621004047,
+ 143.618205766130785,
+ 147.235290957601734,
+ 150.836194489858400,
+ 154.418327075631083,
+ 157.979185735603039,
+ 161.516355346632452,
+ 165.027509866420871,
+ 168.510413252511256,
+ 171.962920093394303,
+ 175.382975969299480,
+ 178.768617559985131,
+ 182.117972516492841,
+ 185.429259113445994,
+ 188.700785698018507,
+ 191.930949951225926,
+ 195.118237976664375,
+ 198.261223231287033,
+ 201.358565312239051,
+ 204.409008613197130,
+ 207.411380863071741,
+ 210.364591559332979,
+ 213.267630307635471,
+ 216.119565078810581,
+ 218.919540393725441,
+ 221.666775445909082,
+ 224.360562171292912,
+ 227.000263273843757,
+ 229.585310215328150,
+ 232.115201176917310,
+ 234.589498999828919,
+ 237.007829111703302,
+ 239.369877444937316,
+ 241.675388352737258,
+ 243.924162528208456,
+ 246.116054931382024,
+ 248.250972728666568,
+ 250.328873248841006,
+ 252.349761959321199,
+ 254.313690466103111,
+ 256.220754540440964,
+ 258.071092175015735,
+ 259.864881672054366]) # yapf: disable
class TestD_illuminantRelativeSpd(unittest.TestCase):
@@ -191,9 +190,9 @@ def test_D_illuminant_relative_spd(self):
definition.
"""
+ spd = D_illuminant_relative_spd(np.array([0.32168, 0.33767]))
np.testing.assert_almost_equal(
- sorted(D_illuminant_relative_spd(
- np.array([0.32168, 0.33767])).data.values()),
+ sorted(spd.data.values()),
sorted(D60_SPD_DATA.values()),
decimal=7)
diff --git a/colour/colorimetry/tests/tests_lefs.py b/colour/colorimetry/tests/tests_lefs.py
index 80a1f6b1ef..27267d852b 100644
--- a/colour/colorimetry/tests/tests_lefs.py
+++ b/colour/colorimetry/tests/tests_lefs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.lefs` module.
"""
@@ -10,9 +9,8 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- mesopic_weighting_function,
- mesopic_luminous_efficiency_function)
+from colour.colorimetry import (mesopic_weighting_function,
+ mesopic_luminous_efficiency_function)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -22,9 +20,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['MESOPIC_LEF_SPD_DATA',
- 'TestMesopicWeightingFunction',
- 'TestMesopicLuminousEfficiencyFunction']
+__all__ = [
+ 'MESOPIC_LEF_SPD_DATA', 'TestMesopicWeightingFunction',
+ 'TestMesopicLuminousEfficiencyFunction'
+]
MESOPIC_LEF_SPD_DATA = (
0.000423996221042,
@@ -427,7 +426,7 @@
0.000009291440160,
0.000008670655686,
0.000008091780515,
- 0.000007551893809)
+ 0.000007551893809) # yapf: disable
class TestMesopicWeightingFunction(unittest.TestCase):
@@ -443,23 +442,17 @@ def test_mesopic_weighting_function(self):
"""
self.assertAlmostEqual(
- mesopic_weighting_function(500, 0.2),
- 0.70522000,
- places=7)
+ mesopic_weighting_function(500, 0.2), 0.70522000, places=7)
self.assertAlmostEqual(
- mesopic_weighting_function(500,
- 0.2,
- source='Red Heavy',
- method='LRC'),
+ mesopic_weighting_function(
+ 500, 0.2, source='Red Heavy', method='LRC'),
0.90951000,
places=7)
self.assertAlmostEqual(
- mesopic_weighting_function(700,
- 10,
- source='Red Heavy',
- method='LRC'),
+ mesopic_weighting_function(
+ 700, 10, source='Red Heavy', method='LRC'),
0.00410200,
places=7)
@@ -471,27 +464,19 @@ def test_n_dimensional_planck_law(self):
wl = 500
Vm = 0.70522000
- np.testing.assert_almost_equal(
- mesopic_weighting_function(wl, 0.2),
- Vm)
+ np.testing.assert_almost_equal(mesopic_weighting_function(wl, 0.2), Vm)
wl = np.tile(wl, 6)
Vm = np.tile(Vm, 6)
- np.testing.assert_almost_equal(
- mesopic_weighting_function(wl, 0.2),
- Vm)
+ np.testing.assert_almost_equal(mesopic_weighting_function(wl, 0.2), Vm)
wl = np.reshape(wl, (2, 3))
Vm = np.reshape(Vm, (2, 3))
- np.testing.assert_almost_equal(
- mesopic_weighting_function(wl, 0.2),
- Vm)
+ np.testing.assert_almost_equal(mesopic_weighting_function(wl, 0.2), Vm)
wl = np.reshape(wl, (2, 3, 1))
Vm = np.reshape(Vm, (2, 3, 1))
- np.testing.assert_almost_equal(
- mesopic_weighting_function(wl, 0.2),
- Vm)
+ np.testing.assert_almost_equal(mesopic_weighting_function(wl, 0.2), Vm)
@ignore_numpy_errors
def test_nan_mesopic_weighting_function(self):
diff --git a/colour/colorimetry/tests/tests_lightness.py b/colour/colorimetry/tests/tests_lightness.py
index 242e1d9f42..44cd69be7b 100644
--- a/colour/colorimetry/tests/tests_lightness.py
+++ b/colour/colorimetry/tests/tests_lightness.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.lightness` module.
"""
@@ -10,10 +9,8 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- lightness_Glasser1958,
- lightness_Wyszecki1963,
- lightness_CIE1976)
+from colour.colorimetry import (lightness_Glasser1958, lightness_Wyszecki1963,
+ lightness_CIE1976, lightness_Fairchild2010)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,9 +20,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLightnessGlasser1958',
- 'TestLightnessWyszecki1963',
- 'TestLightnessCIE1976']
+__all__ = [
+ 'TestLightnessGlasser1958', 'TestLightnessWyszecki1963',
+ 'TestLightnessCIE1976', 'TestLightnessFairchild2010'
+]
class TestLightnessGlasser1958(unittest.TestCase):
@@ -41,19 +39,13 @@ def test_lightness_Glasser1958(self):
"""
self.assertAlmostEqual(
- lightness_Glasser1958(10.08),
- 36.25056265,
- places=7)
+ lightness_Glasser1958(10.08), 36.25056265, places=7)
self.assertAlmostEqual(
- lightness_Glasser1958(56.76),
- 78.81179990,
- places=7)
+ lightness_Glasser1958(56.76), 78.81179990, places=7)
self.assertAlmostEqual(
- lightness_Glasser1958(98.32),
- 98.34470526,
- places=7)
+ lightness_Glasser1958(98.32), 98.34470526, places=7)
def test_n_dimensional_lightness_Glasser1958(self):
"""
@@ -63,31 +55,19 @@ def test_n_dimensional_lightness_Glasser1958(self):
Y = 10.08
L = 36.25056265
- np.testing.assert_almost_equal(
- lightness_Glasser1958(Y),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)
Y = np.tile(Y, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- lightness_Glasser1958(Y),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)
Y = np.reshape(Y, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- lightness_Glasser1958(Y),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)
Y = np.reshape(Y, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- lightness_Glasser1958(Y),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)
@ignore_numpy_errors
def test_nan_lightness_Glasser1958(self):
@@ -113,19 +93,13 @@ def test_lightness_Wyszecki1963(self):
"""
self.assertAlmostEqual(
- lightness_Wyszecki1963(10.08),
- 37.00411491,
- places=7)
+ lightness_Wyszecki1963(10.08), 37.00411491, places=7)
self.assertAlmostEqual(
- lightness_Wyszecki1963(56.76),
- 79.07730319,
- places=7)
+ lightness_Wyszecki1963(56.76), 79.07730319, places=7)
self.assertAlmostEqual(
- lightness_Wyszecki1963(98.32),
- 98.38622505,
- places=7)
+ lightness_Wyszecki1963(98.32), 98.38622505, places=7)
def test_n_dimensional_lightness_Wyszecki1963(self):
"""
@@ -135,31 +109,19 @@ def test_n_dimensional_lightness_Wyszecki1963(self):
Y = 10.08
W = 37.004114912764535
- np.testing.assert_almost_equal(
- lightness_Wyszecki1963(Y),
- W,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Wyszecki1963(Y), W, decimal=7)
Y = np.tile(Y, 6)
W = np.tile(W, 6)
- np.testing.assert_almost_equal(
- lightness_Wyszecki1963(Y),
- W,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Wyszecki1963(Y), W, decimal=7)
Y = np.reshape(Y, (2, 3))
W = np.reshape(W, (2, 3))
- np.testing.assert_almost_equal(
- lightness_Wyszecki1963(Y),
- W,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Wyszecki1963(Y), W, decimal=7)
Y = np.reshape(Y, (2, 3, 1))
W = np.reshape(W, (2, 3, 1))
- np.testing.assert_almost_equal(
- lightness_Wyszecki1963(Y),
- W,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_Wyszecki1963(Y), W, decimal=7)
@ignore_numpy_errors
def test_nan_lightness_Wyszecki1963(self):
@@ -184,35 +146,20 @@ def test_lightness_CIE1976(self):
definition.
"""
- self.assertAlmostEqual(
- lightness_CIE1976(10.08),
- 37.98562910,
- places=7)
+ self.assertAlmostEqual(lightness_CIE1976(10.08), 37.98562910, places=7)
- self.assertAlmostEqual(
- lightness_CIE1976(56.76),
- 80.04441556,
- places=7)
+ self.assertAlmostEqual(lightness_CIE1976(56.76), 80.04441556, places=7)
- self.assertAlmostEqual(
- lightness_CIE1976(98.32),
- 99.34672790,
- places=7)
+ self.assertAlmostEqual(lightness_CIE1976(98.32), 99.34672790, places=7)
self.assertAlmostEqual(
- lightness_CIE1976(10.08, 50),
- 52.01763049,
- places=7)
+ lightness_CIE1976(10.08, 50), 52.01763049, places=7)
self.assertAlmostEqual(
- lightness_CIE1976(10.08, 75),
- 43.41887326,
- places=7)
+ lightness_CIE1976(10.08, 75), 43.41887326, places=7)
self.assertAlmostEqual(
- lightness_CIE1976(10.08, 95),
- 38.91659876,
- places=7)
+ lightness_CIE1976(10.08, 95), 38.91659876, places=7)
def test_n_dimensional_lightness_CIE1976(self):
"""
@@ -222,31 +169,19 @@ def test_n_dimensional_lightness_CIE1976(self):
Y = 10.08
Lstar = 37.98562910
- np.testing.assert_almost_equal(
- lightness_CIE1976(Y),
- Lstar,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_CIE1976(Y), Lstar, decimal=7)
Y = np.tile(Y, 6)
Lstar = np.tile(Lstar, 6)
- np.testing.assert_almost_equal(
- lightness_CIE1976(Y),
- Lstar,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_CIE1976(Y), Lstar, decimal=7)
Y = np.reshape(Y, (2, 3))
Lstar = np.reshape(Lstar, (2, 3))
- np.testing.assert_almost_equal(
- lightness_CIE1976(Y),
- Lstar,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_CIE1976(Y), Lstar, decimal=7)
Y = np.reshape(Y, (2, 3, 1))
Lstar = np.reshape(Lstar, (2, 3, 1))
- np.testing.assert_almost_equal(
- lightness_CIE1976(Y),
- Lstar,
- decimal=7)
+ np.testing.assert_almost_equal(lightness_CIE1976(Y), Lstar, decimal=7)
@ignore_numpy_errors
def test_nan_lightness_CIE1976(self):
@@ -255,7 +190,73 @@ def test_nan_lightness_CIE1976(self):
definition nan support.
"""
- lightness_CIE1976(
+ lightness_CIE1976(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+class TestLightnessFairchild2010(unittest.TestCase):
+ """
+ Defines :func:`colour.colorimetry.lightness.lightness_Fairchild2010`
+ definition unit tests methods.
+ """
+
+ def test_lightness_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.lightness.lightness_Fairchild2010`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(10.08 / 100), 23.10363383, places=7)
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(56.76 / 100), 90.51057574, places=7)
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(98.32 / 100), 96.636221285, places=7)
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(10.08 / 100, 2.75), 16.06420271, places=7)
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(1008), 100.01999667, places=7)
+
+ self.assertAlmostEqual(
+ lightness_Fairchild2010(100800), 100.01999999, places=7)
+
+ def test_n_dimensional_lightness_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.lightness.lightness_Fairchild2010`
+ definition n-dimensional arrays support.
+ """
+
+ Y = 10.08 / 100
+ L = 23.10363383
+ np.testing.assert_almost_equal(
+ lightness_Fairchild2010(Y), L, decimal=7)
+
+ Y = np.tile(Y, 6)
+ L = np.tile(L, 6)
+ np.testing.assert_almost_equal(
+ lightness_Fairchild2010(Y), L, decimal=7)
+
+ Y = np.reshape(Y, (2, 3))
+ L = np.reshape(L, (2, 3))
+ np.testing.assert_almost_equal(
+ lightness_Fairchild2010(Y), L, decimal=7)
+
+ Y = np.reshape(Y, (2, 3, 1))
+ L = np.reshape(L, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ lightness_Fairchild2010(Y), L, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_lightness_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.lightness.lightness_Fairchild2010`
+ definition nan support.
+ """
+
+ lightness_Fairchild2010(
np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
diff --git a/colour/colorimetry/tests/tests_luminance.py b/colour/colorimetry/tests/tests_luminance.py
index 6a16c9bd8f..49e60b2230 100644
--- a/colour/colorimetry/tests/tests_luminance.py
+++ b/colour/colorimetry/tests/tests_luminance.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.luminance` module.
"""
@@ -11,9 +10,8 @@
import unittest
from colour.colorimetry.luminance import (
- luminance_Newhall1943,
- luminance_CIE1976,
- luminance_ASTMD153508)
+ luminance_Newhall1943, luminance_CIE1976, luminance_ASTMD153508,
+ luminance_Fairchild2010)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,9 +21,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLuminanceNewhall1943',
- 'TestLuminanceASTMD153508',
- 'TestLuminanceCIE1976']
+__all__ = [
+ 'TestLuminanceNewhall1943', 'TestLuminanceASTMD153508',
+ 'TestLuminanceCIE1976', 'TestLuminanceFairchild2010'
+]
class TestLuminanceNewhall1943(unittest.TestCase):
@@ -41,19 +40,13 @@ def test_luminance_Newhall1943(self):
"""
self.assertAlmostEqual(
- luminance_Newhall1943(3.74629715),
- 10.40898746,
- places=7)
+ luminance_Newhall1943(3.74629715), 10.40898746, places=7)
self.assertAlmostEqual(
- luminance_Newhall1943(8.64728711),
- 71.31748010,
- places=7)
+ luminance_Newhall1943(8.64728711), 71.31748010, places=7)
self.assertAlmostEqual(
- luminance_Newhall1943(1.52569022),
- 2.06998750,
- places=7)
+ luminance_Newhall1943(1.52569022), 2.06998750, places=7)
def test_n_dimensional_luminance_Newhall1943(self):
"""
@@ -63,31 +56,19 @@ def test_n_dimensional_luminance_Newhall1943(self):
V = 3.74629715
Y = 10.408987457743208
- np.testing.assert_almost_equal(
- luminance_Newhall1943(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_Newhall1943(V), Y, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- luminance_Newhall1943(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_Newhall1943(V), Y, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- luminance_Newhall1943(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_Newhall1943(V), Y, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
- np.testing.assert_almost_equal(
- luminance_Newhall1943(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_Newhall1943(V), Y, decimal=7)
@ignore_numpy_errors
def test_nan_luminance_Newhall1943(self):
@@ -113,19 +94,13 @@ def test_luminance_ASTMD153508(self):
"""
self.assertAlmostEqual(
- luminance_ASTMD153508(3.74629715),
- 10.14880968,
- places=7)
+ luminance_ASTMD153508(3.74629715), 10.14880968, places=7)
self.assertAlmostEqual(
- luminance_ASTMD153508(8.64728711),
- 69.53240916,
- places=7)
+ luminance_ASTMD153508(8.64728711), 69.53240916, places=7)
self.assertAlmostEqual(
- luminance_ASTMD153508(1.52569022),
- 2.01830631,
- places=7)
+ luminance_ASTMD153508(1.52569022), 2.01830631, places=7)
def test_n_dimensional_luminance_ASTMD153508(self):
"""
@@ -135,31 +110,19 @@ def test_n_dimensional_luminance_ASTMD153508(self):
V = 3.74629715
Y = 10.148809678226682
- np.testing.assert_almost_equal(
- luminance_ASTMD153508(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_ASTMD153508(V), Y, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- luminance_ASTMD153508(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_ASTMD153508(V), Y, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- luminance_ASTMD153508(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_ASTMD153508(V), Y, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
- np.testing.assert_almost_equal(
- luminance_ASTMD153508(V),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_ASTMD153508(V), Y, decimal=7)
@ignore_numpy_errors
def test_nan_luminance_ASTMD153508(self):
@@ -185,34 +148,22 @@ def test_luminance_CIE1976(self):
"""
self.assertAlmostEqual(
- luminance_CIE1976(37.98562910),
- 10.08000000,
- places=7)
+ luminance_CIE1976(37.98562910), 10.08000000, places=7)
self.assertAlmostEqual(
- luminance_CIE1976(80.04441556),
- 56.76000000,
- places=7)
+ luminance_CIE1976(80.04441556), 56.76000000, places=7)
self.assertAlmostEqual(
- luminance_CIE1976(99.34672790),
- 98.32000000,
- places=7)
+ luminance_CIE1976(99.34672790), 98.32000000, places=7)
self.assertAlmostEqual(
- luminance_CIE1976(37.98562910, 50),
- 5.04000000,
- places=7)
+ luminance_CIE1976(37.98562910, 50), 5.04000000, places=7)
self.assertAlmostEqual(
- luminance_CIE1976(37.98562910, 75),
- 7.56000000,
- places=7)
+ luminance_CIE1976(37.98562910, 75), 7.56000000, places=7)
self.assertAlmostEqual(
- luminance_CIE1976(37.98562910, 95),
- 9.57600000,
- places=7)
+ luminance_CIE1976(37.98562910, 95), 9.57600000, places=7)
def test_n_dimensional_luminance_CIE1976(self):
"""
@@ -222,31 +173,19 @@ def test_n_dimensional_luminance_CIE1976(self):
Lstar = 37.98562910
Y = 10.080000000026304
- np.testing.assert_almost_equal(
- luminance_CIE1976(Lstar),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_CIE1976(Lstar), Y, decimal=7)
Lstar = np.tile(Lstar, 6)
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- luminance_CIE1976(Lstar),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_CIE1976(Lstar), Y, decimal=7)
Lstar = np.reshape(Lstar, (2, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- luminance_CIE1976(Lstar),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_CIE1976(Lstar), Y, decimal=7)
Lstar = np.reshape(Lstar, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
- np.testing.assert_almost_equal(
- luminance_CIE1976(Lstar),
- Y,
- decimal=7)
+ np.testing.assert_almost_equal(luminance_CIE1976(Lstar), Y, decimal=7)
@ignore_numpy_errors
def test_nan_luminance_CIE1976(self):
@@ -255,7 +194,79 @@ def test_nan_luminance_CIE1976(self):
definition nan support.
"""
- luminance_CIE1976(
+ luminance_CIE1976(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+class TestLuminanceFairchild2010(unittest.TestCase):
+ """
+ Defines :func:`colour.colorimetry.luminance.luminance_Fairchild2010`
+ definition unit tests methods.
+ """
+
+ def test_luminance_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.luminance.luminance_Fairchild2010`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(23.103633825753175), 0.10079999, places=7)
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(90.510575738115122), 0.56759999, places=7)
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(96.636221285055527), 0.98319999, places=7)
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(16.064202706248068, 2.75),
+ 0.10079999,
+ places=7)
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(100.01999666792653),
+ 1007.99999963,
+ places=7)
+
+ self.assertAlmostEqual(
+ luminance_Fairchild2010(100.01999999966679),
+ 100800.82383352,
+ places=7)
+
+ def test_n_dimensional_luminance_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.lightness.luminance_Fairchild2010`
+ definition n-dimensional arrays support.
+ """
+
+ L_hdr = 23.103633825753175
+ Y = 10.08 / 100
+ np.testing.assert_almost_equal(
+ luminance_Fairchild2010(L_hdr), Y, decimal=7)
+
+ L_hdr = np.tile(L_hdr, 6)
+ Y = np.tile(Y, 6)
+ np.testing.assert_almost_equal(
+ luminance_Fairchild2010(L_hdr), Y, decimal=7)
+
+ L_hdr = np.reshape(L_hdr, (2, 3))
+ Y = np.reshape(Y, (2, 3))
+ np.testing.assert_almost_equal(
+ luminance_Fairchild2010(L_hdr), Y, decimal=7)
+
+ L_hdr = np.reshape(L_hdr, (2, 3, 1))
+ Y = np.reshape(Y, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ luminance_Fairchild2010(L_hdr), Y, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_luminance_Fairchild2010(self):
+ """
+ Tests :func:`colour.colorimetry.luminance.luminance_Fairchild2010`
+ definition nan support.
+ """
+
+ luminance_Fairchild2010(
np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
diff --git a/colour/colorimetry/tests/tests_photometry.py b/colour/colorimetry/tests/tests_photometry.py
index 15561bcb16..5c9f45bdbb 100644
--- a/colour/colorimetry/tests/tests_photometry.py
+++ b/colour/colorimetry/tests/tests_photometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.photometry` module.
"""
@@ -10,12 +9,8 @@
import unittest
from colour.colorimetry import (
- ILLUMINANTS_RELATIVE_SPDS,
- LIGHT_SOURCES_RELATIVE_SPDS,
- luminous_flux,
- luminous_efficiency,
- luminous_efficacy,
- zeros_spd)
+ ILLUMINANTS_RELATIVE_SPDS, LIGHT_SOURCES_RELATIVE_SPDS, luminous_flux,
+ luminous_efficiency, luminous_efficacy, zeros_spd)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -24,9 +19,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLuminousFlux',
- 'TestLuminousEfficiency',
- 'TestLuminousEfficacy']
+__all__ = [
+ 'TestLuminousFlux', 'TestLuminousEfficiency', 'TestLuminousEfficacy'
+]
class TestLuminousFlux(unittest.TestCase):
@@ -41,20 +36,19 @@ def test_luminous_flux(self):
"""
self.assertAlmostEqual(
- luminous_flux(
- ILLUMINANTS_RELATIVE_SPDS['F2'].clone().normalise()),
+ luminous_flux(ILLUMINANTS_RELATIVE_SPDS['F2'].clone().normalise()),
28588.73612977,
places=7)
self.assertAlmostEqual(
- luminous_flux(LIGHT_SOURCES_RELATIVE_SPDS[
- 'Neodimium Incandescent']),
+ luminous_flux(
+ LIGHT_SOURCES_RELATIVE_SPDS['Neodimium Incandescent']),
23807.65552737,
places=7)
self.assertAlmostEqual(
- luminous_flux(LIGHT_SOURCES_RELATIVE_SPDS[
- 'F32T8/TL841 (Triphosphor)']),
+ luminous_flux(
+ LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)']),
13090.06759053,
places=7)
@@ -78,14 +72,14 @@ def test_luminous_efficiency(self):
places=7)
self.assertAlmostEqual(
- luminous_efficiency(LIGHT_SOURCES_RELATIVE_SPDS[
- 'Neodimium Incandescent']),
+ luminous_efficiency(
+ LIGHT_SOURCES_RELATIVE_SPDS['Neodimium Incandescent']),
0.19943936,
places=7)
self.assertAlmostEqual(
- luminous_efficiency(LIGHT_SOURCES_RELATIVE_SPDS[
- 'F32T8/TL841 (Triphosphor)']),
+ luminous_efficiency(
+ LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)']),
0.51080919,
places=7)
@@ -109,23 +103,20 @@ def test_luminous_efficacy(self):
places=7)
self.assertAlmostEqual(
- luminous_efficacy(LIGHT_SOURCES_RELATIVE_SPDS[
- 'Neodimium Incandescent']),
+ luminous_efficacy(
+ LIGHT_SOURCES_RELATIVE_SPDS['Neodimium Incandescent']),
136.21708032,
places=7)
self.assertAlmostEqual(
- luminous_efficacy(LIGHT_SOURCES_RELATIVE_SPDS[
- 'F32T8/TL841 (Triphosphor)']),
+ luminous_efficacy(
+ LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)']),
348.88267549,
places=7)
spd = zeros_spd()
spd[555] = 1
- self.assertAlmostEqual(
- luminous_efficacy(spd),
- 683.00000000,
- places=7)
+ self.assertAlmostEqual(luminous_efficacy(spd), 683.00000000, places=7)
if __name__ == '__main__':
diff --git a/colour/colorimetry/tests/tests_spectrum.py b/colour/colorimetry/tests/tests_spectrum.py
index 3dad4ca116..ac6ab204d1 100644
--- a/colour/colorimetry/tests/tests_spectrum.py
+++ b/colour/colorimetry/tests/tests_spectrum.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.spectrum` module.
"""
@@ -10,15 +9,12 @@
import numpy as np
import operator
import unittest
+import scipy
+from distutils.version import LooseVersion
from colour.colorimetry.spectrum import (
- SpectralMapping,
- SpectralShape,
- SpectralPowerDistribution,
- TriSpectralPowerDistribution,
- constant_spd,
- zeros_spd,
- ones_spd)
+ SpectralMapping, SpectralShape, SpectralPowerDistribution,
+ TriSpectralPowerDistribution, constant_spd, zeros_spd, ones_spd)
from colour.utilities import tstack
__author__ = 'Colour Developers'
@@ -28,20 +24,14 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SAMPLE_SPD_DATA',
- 'NON_UNIFORM_SAMPLE_SPD_DATA',
- 'ZEROS_SAMPLE_SPD_DATA',
- 'INTERPOLATED_SAMPLE_SPD_DATA',
- 'INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA',
- 'NORMALISED_SAMPLE_SPD_DATA',
- 'CIE_1931_2_DEGREE_STANDARD_OBSERVER',
- 'CMFS_DATA',
- 'TestSpectralShape',
- 'TestSpectralPowerDistribution',
- 'TestTriSpectralPowerDistribution',
- 'TestConstantSpd',
- 'TestZerosSpd',
- 'TestOnes_spd']
+__all__ = [
+ 'SAMPLE_SPD_DATA', 'NON_UNIFORM_SAMPLE_SPD_DATA', 'ZEROS_SAMPLE_SPD_DATA',
+ 'INTERPOLATED_SAMPLE_SPD_DATA', 'INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA',
+ 'NORMALISED_SAMPLE_SPD_DATA', 'CIE_1931_2_DEGREE_STANDARD_OBSERVER',
+ 'CMFS_DATA', 'TestSpectralShape', 'TestSpectralPowerDistribution',
+ 'TestTriSpectralPowerDistribution', 'TestConstantSpd', 'TestZerosSpd',
+ 'TestOnes_spd'
+]
SAMPLE_SPD_DATA = {
340: 0.0000,
@@ -68,7 +58,8 @@
760: 0.0000,
780: 0.0000,
800: 0.0000,
- 820: 0.0000}
+ 820: 0.0000
+}
NON_UNIFORM_SAMPLE_SPD_DATA = {
391.898: 16.331740,
@@ -124,7 +115,8 @@
723.642: 16.333122,
761.265: 41.342187,
786.089: 8.850659,
- 805.862: 8.850659}
+ 805.862: 8.850659
+}
ZEROS_SAMPLE_SPD_DATA = (
0.0000,
@@ -607,7 +599,7 @@
0.0000,
0.0000,
0.0000,
- 0.0000)
+ 0.0000) # yapf: disable
INTERPOLATED_SAMPLE_SPD_DATA = (
0.000000000000000,
@@ -1090,423 +1082,423 @@
0.000000000000000,
0.000000000000000,
0.000000000000000,
- 0.000000000000000)
+ 0.000000000000000) # yapf: disable
INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA = (
- 16.329778095156982,
- 16.722912723132556,
- 17.781520028373180,
- 19.389396167568528,
- 21.430343341950202,
- 23.788163752749799,
- 26.346659601198912,
- 28.989633088529139,
- 31.600886415972091,
- 34.064221784759340,
- 36.263441396122502,
- 38.082347451293174,
- 39.404742151502930,
- 40.114427697983402,
- 40.111243699421522,
- 39.925103629201168,
- 39.890167178851087,
- 39.799324065847429,
- 39.680556791530307,
- 39.561846086647805,
- 39.471172681947927,
- 39.436517308178743,
- 39.485860696088267,
- 39.647183576424581,
- 39.948466679935706,
- 40.374181468061238,
- 40.480943043251031,
- 39.587763148040459,
- 37.399010977790780,
- 34.259517357831442,
- 30.574008076701602,
- 26.747208922940480,
- 23.183845685087242,
- 20.288644151681090,
- 18.466330111261207,
- 18.131455042017670,
- 19.618408432819184,
- 22.601624594849554,
- 26.621530084079197,
- 31.218551456478512,
- 35.933115268017922,
- 40.312773210265746,
- 44.121677838733966,
- 47.374686358277039,
- 50.100647612970285,
- 52.328410446889080,
- 54.086823704108710,
- 55.404736228704550,
- 56.310996864751935,
- 56.834454456326178,
- 57.003957847502640,
- 56.848355882356643,
- 56.396497404963519,
- 55.677231259398624,
- 54.719406289737300,
- 53.551871340054845,
- 52.203475254426650,
- 50.703066876927998,
- 49.079495051634254,
- 47.361608622620757,
- 45.578256433962849,
- 43.758287329735850,
- 41.930550154015101,
- 40.123893750875936,
- 38.367166964393718,
- 36.689218638643744,
- 35.118897617701386,
- 33.685052745641954,
- 32.416532866540805,
- 31.342186824473270,
- 30.490863463514671,
- 29.891411627740368,
- 29.572680161225694,
- 29.538621478955591,
- 33.594913458907321,
- 41.048330707682268,
- 45.551744553974856,
- 47.142069194639774,
- 46.264235270826262,
- 43.363173423683598,
- 38.883814294360953,
- 33.271088524007610,
- 26.969926753772803,
- 20.425259624805754,
- 14.082017778255718,
- 8.385131855271933,
- 3.728429425644130,
- 0.156961054702055,
- -2.429909888257985,
- -4.133307786213816,
- -5.054357022143298,
- -5.294181979024267,
- -4.953907039834574,
- -4.134656587552058,
- -2.937555005154562,
- -1.463726675619941,
- 0.185704018073971,
- 1.909612692949324,
- 3.606874966028280,
- 5.176366454332983,
- 6.516962774885600,
- 7.527539544708277,
- 8.122379804499362,
- 8.331483145393147,
- 8.237444939499099,
- 7.923124733018005,
- 7.471382072150651,
- 6.965076503097814,
- 6.487067572060285,
- 6.120214825238840,
- 5.947377808834269,
- 6.051416069047350,
- 6.515189152078867,
- 7.421556604129607,
- 8.833103320349386,
- 10.654113910535857,
- 12.714472052266359,
- 14.843629857037500,
- 16.871039436345892,
- 18.626152901688148,
- 19.938422364560878,
- 20.637299936460693,
- 20.706835013607193,
- 20.713132277712795,
- 20.620587314920563,
- 20.396819413338232,
- 20.054405097739068,
- 19.605938072532023,
- 19.064012042126031,
- 18.441220710930018,
- 17.750157783352932,
- 17.003416963803701,
- 16.213591956691264,
- 15.393276466424567,
- 14.555064197412538,
- 13.711548854064109,
- 12.875324140788226,
- 12.058983761993822,
- 11.275121422089832,
- 10.536330825485194,
- 9.855205676588847,
- 9.244339679809721,
- 8.716326539556761,
- 8.283759960238900,
- 7.959233646265071,
- 7.755341302044216,
- 7.684676631985266,
- 7.756084346361913,
- 7.961801723672590,
- 8.289468950027061,
- 8.726726048071839,
- 9.261213040453441,
- 9.880569949818376,
- 10.572436798813163,
- 11.324453610084309,
- 12.124260406278331,
- 12.959497210041745,
- 13.817804044021063,
- 14.686820930862797,
- 15.554187893213468,
- 16.407544953719576,
- 17.234532135027642,
- 18.022789459784182,
- 18.759956950635704,
- 19.433674630228733,
- 20.031582521209774,
- 20.541320646225341,
- 20.950529027921945,
- 21.246847688946101,
- 21.417916651944331,
- 21.451375939563139,
- 21.334865574449047,
- 21.056025579248555,
- 20.604750276804520,
- 20.494345115539804,
- 22.221705466483996,
- 25.661450384909422,
- 29.775598875963166,
- 33.531925166863601,
- 36.383260994026813,
- 38.399428507026130,
- 39.690190939409774,
- 40.365311524725989,
- 40.534553496523046,
- 40.307680088349152,
- 39.794454533752578,
- 39.104640066281540,
- 38.347999919484330,
- 37.634297326909127,
- 37.374685122096146,
- 39.119690202436686,
- 40.253206514676137,
- 38.299118523707605,
- 34.130306344556416,
- 28.883500018011556,
- 23.695429584861984,
- 19.702825085896695,
- 18.042370406362124,
- 17.942146149315505,
- 17.437952042648156,
- 16.603615435584160,
- 15.527509996211428,
- 14.298009392617876,
- 13.003487292891400,
- 11.732317365119920,
- 10.572873277391340,
- 9.613528697793571,
- 8.942657294414522,
- 8.648632735342099,
- 8.638275004704358,
- 8.608461767970397,
- 8.468358252802256,
- 8.236485825233604,
- 7.918459258060551,
- 7.519893324079201,
- 7.046402796085658,
- 6.503602446876036,
- 5.897107049246431,
- 5.232531375992957,
- 4.515490199911716,
- 3.751598293798816,
- 2.946470430450363,
- 2.105721382662463,
- 1.234965923231222,
- 0.339818824952746,
- -0.574105139376856,
- -1.501191196961480,
- -2.435824575005022,
- -3.372390500711373,
- -4.305274201284425,
- -5.228860903928080,
- -6.137535835846219,
- -7.025684224242744,
- -7.887691296321547,
- -8.717942279286525,
- -9.510822400341567,
- -10.260716886690570,
- -10.962010965537431,
- -11.609089864086032,
- -12.196338809540270,
- -12.718143029104052,
- -13.168887749981261,
- -13.542958199375791,
- -13.834739604491540,
- -14.038617192532394,
- -14.148976190702248,
- -14.160201826205009,
- -14.066679326244559,
- -13.862793918024790,
- -13.542930828749602,
- -13.101475285622888,
- -12.532812515848539,
- -11.831327746630446,
- -10.991406205172515,
- -10.007433118678625,
- -8.873793714352681,
- -7.584873219398570,
- -6.135056861020184,
- -4.518729866421428,
- -2.730277462806184,
- -0.764084877378354,
- 1.385462662658177,
- 3.723979930099506,
- 6.257081697741744,
- 8.990382738381001,
- 11.929497824813376,
- 14.976162376302216,
- 5.084239426857803,
- -6.729199659283580,
- -14.622346068690167,
- -19.038675241923528,
- -20.421662619545231,
- -19.214783642116821,
- -15.861513750199864,
- -10.805328384355935,
- -4.489702985146582,
- 2.641887006866627,
- 10.145966151122160,
- 17.579059007058401,
- 24.497690134113824,
- 30.458384091726870,
- 35.017665439335978,
- 37.732058736379557,
- 38.169776201971061,
- 36.103214681666451,
- 31.478432173301290,
- 24.247019423375253,
- 14.378015306520879,
- 2.091468109328641,
- -12.204368690968362,
- -28.096681739822582,
- -45.172657682686484,
- -63.019483165012424,
- -81.224344832252967,
- -99.374429329860462,
- -117.056923303287391,
- -133.859013397986132,
- -149.367886259409232,
- -163.170728533009083,
- -174.854726864238074,
- -184.007067898548712,
- -190.214938281393415,
- -193.065524658224689,
- -192.146013674494867,
- -187.043591975656426,
- -177.345446207161871,
- -162.638763014463592,
- -142.510729043014010,
- -116.548530938265586,
- -84.339355345670725,
- -45.470388910681990,
- 0.471181721248317,
- 53.864768803115254,
- 111.894546378021516,
- 165.948982548543711,
- 206.804509755528869,
- 225.237560439823653,
- 212.024567042275038,
- 157.941962003729856,
- 53.766177765035010,
- 24.175603626092354,
- 186.235250964189390,
- 339.561150780358105,
- 476.467689739151297,
- 589.269254505121125,
- 670.280231742820547,
- 711.815008116801778,
- 706.187970291617603,
- 645.713504931820694,
- 522.705998701963495,
- 329.479838266598335,
- 58.349410290278108,
- 509.155161149940227,
- 4467.126644650926210,
- 11974.831412532214017,
- 22711.664944814707269,
- 36357.022721519322658,
- 52590.300222666955960,
- 71090.892928278495674,
- 91538.196318374888506,
- 113611.605872977001127,
- 136990.517072105722036,
- 161354.325395782070700,
- 186382.426324026688235,
- 211754.215336860768730,
- 237149.087914305157028,
- 262246.439536380639765,
- 286725.665683108149096,
- 310266.161834508704487,
- 332547.323470603034366,
- 353248.546071412158199,
- 372049.225116957037244,
- 388628.756087258341722,
- 402666.534462337323930,
- 413841.955722214595880,
- 421834.415346911351662,
- 426323.308816448086873,
- 426988.031610845879186,
- 423507.979210125980899,
- 415562.547094308654778,
- 402831.130743415385950,
- 384993.125637466786429,
- 361727.927256483701058,
- 332714.931080487207510,
- 297633.532589498150628,
- 256163.127263537549879,
- 207983.110582626046380,
- 152772.878026784601388,
- 90211.825076034423546,
- 19979.347210396190349,
- -58110.181253942544572,
- -143006.877292386692716,
- -232998.025064318004297,
- -326364.582552921143360,
- -421387.507741380017251,
- -516347.758612881123554,
- -609526.293150608194992,
- -699204.069337745895609,
- -783662.045157479238696,
- -861181.178592992131598,
- -930042.427627470111474,
- -988526.750244098482653,
- -1034915.104426060337573,
- -1067488.448156541679054,
- -1084527.739418727345765,
- -1084313.936195801245049,
- -1065127.996470948448405,
- -1025250.878227353561670,
- -962963.539448202005588,
- -876546.938116677221842,
- -764282.032215965329669,
- -624449.779729250469245,
- -455331.138639716897160,
- -255207.066930550499819,
- -22358.522584934773477,
- 243566.517701667617075,
- 535769.836361289257184,
- 845123.227935563772917,
- 1162497.212320821359754,
- 1478762.309413394192234,
- 1784789.039109614444897,
- 2071447.921305815922096,
- 2329609.475898326374590,
- 2550144.222783482633531,
- 2723922.681857613380998,
- 2841815.373017050791532,
- 2894692.816158128902316,
- 2873425.531177176162601,
- 2768884.037970530334860,
- 2571938.856434516608715,
- 2273460.506465472746640,
- 1864319.507959727896377,
- 1335386.380813611438498,
- 677531.644923461717553)
+ 16.329808636577400,
+ 16.722487609243078,
+ 17.780769796558388,
+ 19.388440919210822,
+ 21.429286697887836,
+ 23.787092853276910,
+ 26.345645106065515,
+ 28.988729176941121,
+ 31.600130786591194,
+ 34.063635655703216,
+ 36.263029504964656,
+ 38.082098055062993,
+ 39.404627026685688,
+ 40.114402140520198,
+ 40.111247588026082,
+ 39.925103635141149,
+ 39.890167058876870,
+ 39.799323872976096,
+ 39.680556569501256,
+ 39.561845869769570,
+ 39.471172495098209,
+ 39.436517166804364,
+ 39.485860606205222,
+ 39.647183534617994,
+ 39.948466673359860,
+ 40.374181475729280,
+ 40.480943048717741,
+ 39.587763146544347,
+ 37.399010971904012,
+ 34.259517350145224,
+ 30.574008069142096,
+ 26.747208916768866,
+ 23.183845680899680,
+ 20.288644149408725,
+ 18.466330110170176,
+ 18.131455040802454,
+ 19.618408431271092,
+ 22.601624593221480,
+ 26.621530082560952,
+ 31.218551455196845,
+ 35.933115267036499,
+ 40.312773209586069,
+ 44.121677838324345,
+ 47.374686358105983,
+ 50.100647613008405,
+ 52.328410447109043,
+ 54.086823704485290,
+ 55.404736229214613,
+ 56.310996865374428,
+ 56.834454457042114,
+ 57.003957848295137,
+ 56.848355883210893,
+ 56.396497405866839,
+ 55.677231260340363,
+ 54.719406290708918,
+ 53.551871341049903,
+ 52.203475255440743,
+ 50.703066877958868,
+ 49.079495052681693,
+ 47.361608623686649,
+ 45.578256435051173,
+ 43.758287330852653,
+ 41.930550155168532,
+ 40.123893752076235,
+ 38.367166965653183,
+ 36.689218639976801,
+ 35.118897619124496,
+ 33.685052747173714,
+ 32.416532868201863,
+ 31.342186826286373,
+ 30.490863465504646,
+ 29.891411629934137,
+ 29.572680163652254,
+ 29.538621481156376,
+ 33.594913456316092,
+ 41.048330705400552,
+ 45.551744552213606,
+ 47.142069193311166,
+ 46.264235269850914,
+ 43.363173422990592,
+ 38.883814293887831,
+ 33.271088523700378,
+ 26.969926753585888,
+ 20.425259624702068,
+ 14.082017778206605,
+ 8.385131855257200,
+ 3.728429425651282,
+ 0.156961054721180,
+ -2.429909888236355,
+ -4.133307786198728,
+ -5.054357022143353,
+ -5.294181979047651,
+ -4.953907039889023,
+ -4.134656587644884,
+ -2.937555005292646,
+ -1.463726675809728,
+ 0.185704017826468,
+ 1.909612692638526,
+ 3.606874965649032,
+ 5.176366453880572,
+ 6.516962774355742,
+ 7.527539544097118,
+ 8.122379803803623,
+ 8.331483144611147,
+ 8.237444938631239,
+ 7.923124732066758,
+ 7.471382071120567,
+ 6.965076501995521,
+ 6.487067570894484,
+ 6.120214824020312,
+ 5.947377807575871,
+ 6.051416067764015,
+ 6.515189150787608,
+ 7.421556602849507,
+ 8.833103319101975,
+ 10.654113909347958,
+ 12.714472051171430,
+ 14.843629856075644,
+ 16.871039435563851,
+ 18.626152901139314,
+ 19.938422364305275,
+ 20.637299936564997,
+ 20.706835013628812,
+ 20.713132276905259,
+ 20.620587314150111,
+ 20.396819412610807,
+ 20.054405097058748,
+ 19.605938071902443,
+ 19.064012041550384,
+ 18.441220710411045,
+ 17.750157782892924,
+ 17.003416963404511,
+ 16.213591956354293,
+ 15.393276466150766,
+ 14.555064197202412,
+ 13.711548853917725,
+ 12.875324140705192,
+ 12.058983761973309,
+ 11.275121422130562,
+ 10.536330825585436,
+ 9.855205676746426,
+ 9.244339680022023,
+ 8.716326539820709,
+ 8.283759960550988,
+ 7.959233646621334,
+ 7.755341302440248,
+ 7.684676632416213,
+ 7.756084346822568,
+ 7.961801724157814,
+ 8.289468950531905,
+ 8.726726048591537,
+ 9.261213040983417,
+ 9.880569950354237,
+ 10.572436799350699,
+ 11.324453610619505,
+ 12.124260406807357,
+ 12.959497210560945,
+ 13.817804044526978,
+ 14.686820931352152,
+ 15.554187893683173,
+ 16.407544954166731,
+ 17.234532135449530,
+ 18.022789460178267,
+ 18.759956950999651,
+ 19.433674630560375,
+ 20.031582521507140,
+ 20.541320646486646,
+ 20.950529028145592,
+ 21.246847689130675,
+ 21.417916652088600,
+ 21.451375939666065,
+ 21.334865574509770,
+ 21.056025579266414,
+ 20.604750276779001,
+ 20.494345115463702,
+ 22.221705466331883,
+ 25.661450384670388,
+ 29.775598875658655,
+ 33.531925166546948,
+ 36.383260993760757,
+ 38.399428506854193,
+ 39.690190939354423,
+ 40.365311524788659,
+ 40.534553496684069,
+ 40.307680088567857,
+ 39.794454533967205,
+ 39.104640066409281,
+ 38.347999919421312,
+ 37.634297326530451,
+ 37.374685121273394,
+ 39.119690201154867,
+ 40.253206513156250,
+ 38.299118522290833,
+ 34.130306343480264,
+ 28.883500017392159,
+ 23.695429584694160,
+ 19.702825086053920,
+ 18.042370406596557,
+ 17.942146149526579,
+ 17.437952042997388,
+ 16.603615436175311,
+ 15.527509997088327,
+ 14.298009393764401,
+ 13.003487294231499,
+ 11.732317366517600,
+ 10.572873278650665,
+ 9.613528698658669,
+ 8.942657294569587,
+ 8.648632734411382,
+ 8.638275005914387,
+ 8.608461770725761,
+ 8.468358277399256,
+ 8.236485894689265,
+ 7.918459394063972,
+ 7.519893546991550,
+ 7.046403124940173,
+ 6.503602899378026,
+ 5.897107641773280,
+ 5.232532123594114,
+ 4.515491116308703,
+ 3.751599391385226,
+ 2.946471720291860,
+ 2.105722874496783,
+ 1.234967625468170,
+ 0.339820744674198,
+ -0.574102996416954,
+ -1.501188826337108,
+ -2.435821973618090,
+ -3.372387666791723,
+ -4.305271134389827,
+ -5.228857604944231,
+ -6.137532306986749,
+ -7.025680469049206,
+ -7.887687319663434,
+ -8.717938087361247,
+ -9.510818000674471,
+ -10.260712288134929,
+ -10.962006178274445,
+ -11.609084899624833,
+ -12.196333680717927,
+ -12.718137750085543,
+ -13.168882336259514,
+ -13.542952667771653,
+ -13.834733973153785,
+ -14.038611480937735,
+ -14.148970419655322,
+ -14.160196017838375,
+ -14.066673504018716,
+ -13.862788106728164,
+ -13.542925054498539,
+ -13.101469575861673,
+ -12.532806899349385,
+ -11.831322253493493,
+ -10.991400866825831,
+ -10.007427967878208,
+ -8.873788785182459,
+ -7.584868547270405,
+ -6.135052482673858,
+ -4.518725819924658,
+ -2.730273787554616,
+ -0.764081614095559,
+ 1.385465471920696,
+ 3.723982241962316,
+ 6.257083467497486,
+ 8.990383919994379,
+ 11.929498370921175,
+ 14.976162260830137,
+ 5.084237255461949,
+ -6.729230790271000,
+ -14.622433089729542,
+ -19.038838171389944,
+ -20.421914563728482,
+ -19.215130795221405,
+ -15.861955394344996,
+ -10.805856889575507,
+ -4.490303809389212,
+ 2.641235317737622,
+ 10.145291963328749,
+ 17.578397598907866,
+ 24.497083695998736,
+ 30.457881726125084,
+ 35.017323160810655,
+ 37.731939471579153,
+ 38.169944675202451,
+ 36.103648065327157,
+ 31.478944095141092,
+ 24.247257545409393,
+ 14.377470469911161,
+ 2.089605892978410,
+ -12.208009328653077,
+ -28.102486071018522,
+ -45.180935210153116,
+ -63.030467622092019,
+ -81.238194182870473,
+ -99.391225768523640,
+ -117.076673255086732,
+ -133.881647518594917,
+ -149.393259435083451,
+ -163.198619880587444,
+ -174.884839731142108,
+ -184.039029862782684,
+ -190.248301151544382,
+ -193.099764473462415,
+ -192.180530704571822,
+ -187.077710720907902,
+ -177.378415398505837,
+ -162.669755613400923,
+ -142.538842241628146,
+ -116.572786159222886,
+ -84.358698242220214,
+ -45.483689366655454,
+ 0.465129591436323,
+ 53.867241377821607,
+ 111.906385750398641,
+ 165.969680931356891,
+ 206.832112792864763,
+ 225.268667207090687,
+ 212.054330046203120,
+ 157.964087182370434,
+ 53.772924487761195,
+ 24.128558965593012,
+ 155.948189345952358,
+ 238.667542187567193,
+ 279.823268952005947,
+ 286.952021100836475,
+ 267.590450095627091,
+ 229.275207397946076,
+ 179.542944469361430,
+ 125.930312771441450,
+ 75.973963765754249,
+ 37.210548913868003,
+ 17.176719677350921,
+ 17.152394375030820,
+ 19.379794324130732,
+ 21.517434431022508,
+ 23.565545988087592,
+ 25.524360287707406,
+ 27.394108622263396,
+ 29.175022284136993,
+ 30.867332565709628,
+ 32.471270759362753,
+ 33.987068157477793,
+ 35.414956052436175,
+ 36.755165736619354,
+ 38.007928502408760,
+ 39.173475642185821,
+ 40.252038448331973,
+ 41.243848213228674,
+ 42.149136229257330,
+ 42.968133788799399,
+ 43.701072184236310,
+ 44.348182707949491,
+ 44.909696652320392,
+ 45.385845309730442,
+ 45.776859972561077,
+ 46.082971933193733,
+ 46.304412484009845,
+ 46.441412917390849,
+ 46.494204525718175,
+ 46.463018601373285,
+ 46.348086436737596,
+ 46.149639324192542,
+ 45.867908556119552,
+ 45.503125424900077,
+ 45.055521222915552,
+ 44.525327242547419,
+ 43.912774776177095,
+ 43.218095116186007,
+ 42.441519554955640,
+ 41.583279384867382,
+ 40.643991169034841,
+ 39.627797988936805,
+ 38.540734852902020,
+ 37.388854826093969,
+ 36.178210973676094,
+ 34.914856360811882,
+ 33.604844052664760,
+ 32.254227114398248,
+ 30.869058611175774,
+ 29.455391608160820,
+ 28.019279170516839,
+ 26.566774363407301,
+ 25.103930251995678,
+ 23.636799901445418,
+ 22.171436376920010,
+ 20.713892743582907,
+ 19.270222066597562,
+ 17.846477411127466,
+ 16.448711842336071,
+ 15.082978425386836,
+ 13.755330225443233,
+ 12.471820307668732,
+ 11.238501737226787,
+ 10.061427579280879,
+ 8.946650898994456,
+ 7.900224761530997,
+ 6.928202232053956,
+ 6.036636375726809,
+ 5.231580257713018,
+ 4.519086943176044,
+ 3.905209497279358,
+ 3.396000985186418,
+ 2.997514472060695,
+ 2.715803023065654,
+ 2.556919703364760,
+ 2.526917578121476,
+ 2.631849712499274,
+ 2.877769171661610,
+ 3.270729020771954,
+ 3.816782324993773,
+ 4.521982149490528,
+ 5.392381559425689,
+ 6.434033619962720,
+ 7.652991396265083) # yapf: disable
NORMALISED_SAMPLE_SPD_DATA = (
0.000000000000000,
@@ -1533,7 +1525,7 @@
0.000000000000000,
0.000000000000000,
0.000000000000000,
- 0.000000000000000)
+ 0.000000000000000) # yapf: disable
CIE_1931_2_DEGREE_STANDARD_OBSERVER = {
'x_bar': {
@@ -1617,7 +1609,8 @@
765: 0.000117,
770: 0.000083,
775: 0.000059,
- 780: 0.000042},
+ 780: 0.000042
+ },
'y_bar': {
380: 0.000039,
385: 0.000064,
@@ -1699,7 +1692,8 @@
765: 0.000042,
770: 0.000030,
775: 0.000021,
- 780: 0.000015},
+ 780: 0.000015
+ },
'z_bar': {
380: 0.006450,
385: 0.010550,
@@ -1781,7 +1775,9 @@
765: 0.000000,
770: 0.000000,
775: 0.000000,
- 780: 0.000000}}
+ 780: 0.000000
+ }
+}
CMFS_DATA = {
380: np.array([0.001368, 3.90e-05, 0.006450]),
@@ -1864,7 +1860,8 @@
765: np.array([0.000117, 4.20e-05, 0.000000]),
770: np.array([8.30e-05, 3.00e-05, 0.000000]),
775: np.array([5.90e-05, 2.10e-05, 0.000000]),
- 780: np.array([4.20e-05, 1.50e-05, 0.000000])}
+ 780: np.array([4.20e-05, 1.50e-05, 0.000000])
+}
class TestSpectralMapping(unittest.TestCase):
@@ -1884,7 +1881,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('key_decimals',)
+ required_attributes = ('key_decimals', )
for attribute in required_attributes:
self.assertIn(attribute, dir(SpectralMapping))
@@ -1894,12 +1891,8 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__setitem__',
- '__getitem__',
- '__delitem__',
- '__contains__',
- '__iter__',
- '__len__')
+ required_methods = ('__setitem__', '__getitem__', '__delitem__',
+ '__contains__', '__iter__', '__len__')
for method in required_methods:
self.assertIn(method, dir(SpectralMapping))
@@ -1916,10 +1909,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('start',
- 'end',
- 'interval',
- 'boundaries')
+ required_attributes = ('start', 'end', 'interval', 'boundaries')
for attribute in required_attributes:
self.assertIn(attribute, dir(SpectralShape))
@@ -1929,14 +1919,8 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__init__',
- '__str__',
- '__repr__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
+ required_methods = ('__init__', '__str__', '__repr__', '__iter__',
+ '__contains__', '__len__', '__eq__', '__ne__',
'range')
for method in required_methods:
@@ -2032,8 +2016,7 @@ def test__ne__(self):
"""
self.assertNotEqual(
- SpectralShape(0, 10, 0.1),
- SpectralShape(1, 10, 0.1))
+ SpectralShape(0, 10, 0.1), SpectralShape(1, 10, 0.1))
def test_range(self):
"""
@@ -2068,12 +2051,8 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'data',
- 'title',
- 'wavelengths',
- 'values',
- 'shape')
+ required_attributes = ('name', 'data', 'title', 'wavelengths',
+ 'values', 'shape')
for attribute in required_attributes:
self.assertIn(attribute, dir(SpectralPowerDistribution))
@@ -2083,35 +2062,14 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__str__',
- '__repr__',
- '__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__iadd__',
- '__sub__',
- '__isub__',
- '__mul__',
- '__imul__',
- '__div__',
- '__idiv__',
- '__pow__',
- '__ipow__',
- 'get',
- 'is_uniform',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'trim_wavelengths',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__str__', '__repr__', '__hash__', '__getitem__',
+ '__setitem__', '__iter__', '__contains__',
+ '__len__', '__eq__', '__ne__', '__add__',
+ '__iadd__', '__sub__', '__isub__', '__mul__',
+ '__imul__', '__div__', '__idiv__', '__pow__',
+ '__ipow__', 'get', 'is_uniform', 'extrapolate',
+ 'interpolate', 'align', 'trim_wavelengths',
+ 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(SpectralPowerDistribution))
@@ -2122,9 +2080,8 @@ def test_wavelengths(self):
SpectralPowerDistribution.wavelengths` attribute.
"""
- np.testing.assert_almost_equal(
- self._spd.wavelengths,
- sorted(SAMPLE_SPD_DATA))
+ np.testing.assert_almost_equal(self._spd.wavelengths,
+ sorted(SAMPLE_SPD_DATA))
spd = self._spd.clone().interpolate(SpectralShape(interval=0.1))
non_uniform_spd = self._non_uniform_spd.clone().interpolate(
@@ -2140,8 +2097,17 @@ def test_values(self):
"""
np.testing.assert_almost_equal(
- self._spd.values,
- [v for k, v in sorted(SAMPLE_SPD_DATA.items())])
+ self._spd.values, [v for k, v in sorted(SAMPLE_SPD_DATA.items())])
+
+ def test_items(self):
+ """
+ Tests :attr:`colour.colorimetry.spectrum.\
+SpectralPowerDistribution.items` attribute.
+ """
+
+ np.testing.assert_array_equal(self._spd.items,
+ tstack((self._spd.wavelengths,
+ self._spd.values)))
def test_shape(self):
"""
@@ -2174,13 +2140,11 @@ def test__getitem__(self):
self.assertEqual(self._spd[400], 0.0641)
- np.testing.assert_almost_equal(
- self._spd[np.array([340, 620, 820])],
- np.array([0.0000, 0.1511, 0.0000]))
+ np.testing.assert_almost_equal(self._spd[np.array([340, 620, 820])],
+ np.array([0.0000, 0.1511, 0.0000]))
- np.testing.assert_almost_equal(
- self._spd[3:6],
- np.array([0.0641, 0.0645, 0.0562]))
+ np.testing.assert_almost_equal(self._spd[3:6],
+ np.array([0.0641, 0.0645, 0.0562]))
def test__setitem__(self):
"""
@@ -2193,19 +2157,16 @@ def test__setitem__(self):
np.testing.assert_almost_equal(spd.values, np.array(49.6700))
spd[np.array([520, 530])] = np.array([69.59, 81.73])
- np.testing.assert_almost_equal(
- spd.values,
- np.array([49.67, 69.59, 81.73]))
+ np.testing.assert_almost_equal(spd.values,
+ np.array([49.67, 69.59, 81.73]))
spd[np.array([540, 550])] = 88.19
np.testing.assert_almost_equal(
- spd.values,
- np.array([49.67, 69.59, 81.73, 88.19, 88.19]))
+ spd.values, np.array([49.67, 69.59, 81.73, 88.19, 88.19]))
spd[:] = 49.67
np.testing.assert_almost_equal(
- spd.values,
- np.array([49.67, 49.67, 49.67, 49.67, 49.67]))
+ spd.values, np.array([49.67, 49.67, 49.67, 49.67, 49.67]))
def test__iter__(self):
"""
@@ -2213,9 +2174,8 @@ def test__iter__(self):
SpectralPowerDistribution.__iter__` method.
"""
- self.assertEqual(
- {key: value for key, value in self._spd},
- SAMPLE_SPD_DATA)
+ self.assertEqual({key: value
+ for key, value in self._spd}, SAMPLE_SPD_DATA)
def test__contains__(self):
"""
@@ -2268,12 +2228,8 @@ def test_arithmetical_operations(self):
methods.
"""
- operations = (
- operator.add,
- operator.sub,
- operator.mul,
- operator.truediv,
- operator.pow)
+ operations = (operator.add, operator.sub, operator.mul,
+ operator.truediv, operator.pow)
for operation in operations:
self.assertFalse(operation(self._spd, 1) is self._spd)
@@ -2285,8 +2241,7 @@ def test_arithmetical_operations(self):
random = np.random.random(values.shape)
np.testing.assert_almost_equal(
- operation(self._spd, random).values,
- operation(values, random))
+ operation(self._spd, random).values, operation(values, random))
np.testing.assert_almost_equal(
operation(self._spd, self._spd).values,
@@ -2304,12 +2259,8 @@ def test_arithmetical_ioperation(self):
methods.
"""
- operations = (
- operator.iadd,
- operator.isub,
- operator.imul,
- operator.itruediv,
- operator.ipow)
+ operations = (operator.iadd, operator.isub, operator.imul,
+ operator.itruediv, operator.ipow)
for operation in operations:
spd = self._spd.clone()
@@ -2318,15 +2269,13 @@ def test_arithmetical_ioperation(self):
spd = self._spd.clone()
values = spd.values
np.testing.assert_almost_equal(
- operation(spd, 2).values,
- operation(values, 2))
+ operation(spd, 2).values, operation(values, 2))
spd = self._spd.clone()
values = spd.values
random = np.random.random(len(values))
np.testing.assert_almost_equal(
- operation(spd, random).values,
- operation(values, random))
+ operation(spd, random).values, operation(values, random))
spd1 = self._spd.clone()
spd2 = self._spd.clone()
@@ -2384,32 +2333,35 @@ def test_interpolate(self):
"""
np.testing.assert_almost_equal(
- self._spd.clone().interpolate(
- SpectralShape(interval=1)).values,
+ self._spd.clone().interpolate(SpectralShape(interval=1)).values,
INTERPOLATED_SAMPLE_SPD_DATA,
decimal=7)
- np.testing.assert_allclose(
- self._non_uniform_spd.clone().interpolate(
- SpectralShape(interval=1)).values,
- INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA,
- rtol=0.0000001,
- atol=0.0000001)
-
np.testing.assert_almost_equal(
self._spd.clone().interpolate(
- SpectralShape(interval=1),
- method='Linear')[410],
+ SpectralShape(interval=1), method='Linear')[410],
np.array(0.0643),
decimal=7)
np.testing.assert_almost_equal(
self._spd.clone().interpolate(
- SpectralShape(interval=1),
- method='Pchip')[410],
+ SpectralShape(interval=1), method='Pchip')[410],
np.array(0.064399379844961),
decimal=7)
+ # TODO: Remove statement whenever we make "Scipy" 0.19.0 the minimum
+ # version.
+ # Skipping tests because of "Scipy" 0.19.0 interpolation code changes.
+ if LooseVersion(scipy.__version__) < LooseVersion('0.19.0'):
+ return
+
+ np.testing.assert_allclose(
+ self._non_uniform_spd.clone().interpolate(
+ SpectralShape(interval=1)).values,
+ INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA,
+ rtol=0.0000001,
+ atol=0.0000001)
+
def test_align(self):
"""
Tests :func:`colour.colorimetry.spectrum.\
@@ -2457,9 +2409,8 @@ def test_normalise(self):
SpectralPowerDistribution.normalise` method.
"""
- np.testing.assert_almost_equal(
- self._spd.clone().normalise(100).values,
- NORMALISED_SAMPLE_SPD_DATA)
+ np.testing.assert_almost_equal(self._spd.clone().normalise(100).values,
+ NORMALISED_SAMPLE_SPD_DATA)
def test_clone(self):
"""
@@ -2482,13 +2433,9 @@ def setUp(self):
Initialises common tests attributes.
"""
- self._mapping = {'x': 'x_bar',
- 'y': 'y_bar',
- 'z': 'z_bar'}
+ self._mapping = {'x': 'x_bar', 'y': 'y_bar', 'z': 'z_bar'}
- self._labels = {'x': 'x_bar',
- 'y': 'y_bar',
- 'z': 'z_bar'}
+ self._labels = {'x': 'x_bar', 'y': 'y_bar', 'z': 'z_bar'}
self._tri_spd = TriSpectralPowerDistribution(
name='Observer',
@@ -2498,17 +2445,21 @@ def setUp(self):
self._sample_tri_spd = TriSpectralPowerDistribution(
name='Sample Observer',
- data={'x_bar': SAMPLE_SPD_DATA,
- 'y_bar': SAMPLE_SPD_DATA,
- 'z_bar': SAMPLE_SPD_DATA},
+ data={
+ 'x_bar': SAMPLE_SPD_DATA,
+ 'y_bar': SAMPLE_SPD_DATA,
+ 'z_bar': SAMPLE_SPD_DATA
+ },
mapping=self._mapping,
labels=self._labels)
self._non_uniform_sample_tri_spd = TriSpectralPowerDistribution(
name='Non Uniform Sample Observer',
- data={'x_bar': NON_UNIFORM_SAMPLE_SPD_DATA,
- 'y_bar': NON_UNIFORM_SAMPLE_SPD_DATA,
- 'z_bar': NON_UNIFORM_SAMPLE_SPD_DATA},
+ data={
+ 'x_bar': NON_UNIFORM_SAMPLE_SPD_DATA,
+ 'y_bar': NON_UNIFORM_SAMPLE_SPD_DATA,
+ 'z_bar': NON_UNIFORM_SAMPLE_SPD_DATA
+ },
mapping=self._mapping,
labels=self._labels)
@@ -2519,17 +2470,8 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'data',
- 'mapping',
- 'title',
- 'labels',
- 'x',
- 'y',
- 'z',
- 'wavelengths',
- 'values',
- 'shape')
+ required_attributes = ('name', 'data', 'mapping', 'title', 'labels',
+ 'x', 'y', 'z', 'wavelengths', 'values', 'shape')
for attribute in required_attributes:
self.assertIn(attribute, dir(TriSpectralPowerDistribution))
@@ -2539,35 +2481,14 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__str__',
- '__repr__',
- '__hash__',
- '__getitem__',
- '__setitem__',
- '__iter__',
- '__contains__',
- '__len__',
- '__eq__',
- '__ne__',
- '__add__',
- '__iadd__',
- '__sub__',
- '__isub__',
- '__mul__',
- '__imul__',
- '__div__',
- '__idiv__',
- '__pow__',
- '__ipow__',
- 'get',
- 'is_uniform',
- 'extrapolate',
- 'interpolate',
- 'align',
- 'trim_wavelengths',
- 'zeros',
- 'normalise',
- 'clone')
+ required_methods = ('__str__', '__repr__', '__hash__', '__getitem__',
+ '__setitem__', '__iter__', '__contains__',
+ '__len__', '__eq__', '__ne__', '__add__',
+ '__iadd__', '__sub__', '__isub__', '__mul__',
+ '__imul__', '__div__', '__idiv__', '__pow__',
+ '__ipow__', 'get', 'is_uniform', 'extrapolate',
+ 'interpolate', 'align', 'trim_wavelengths',
+ 'zeros', 'normalise', 'clone')
for method in required_methods:
self.assertIn(method, dir(TriSpectralPowerDistribution))
@@ -2588,6 +2509,7 @@ def test_values(self):
TriSpectralPowerDistribution.values` attribute.
"""
+ # yapf: disable
np.testing.assert_almost_equal(
self._tri_spd.values,
tstack((
@@ -2597,6 +2519,19 @@ def test_values(self):
CIE_1931_2_DEGREE_STANDARD_OBSERVER['y_bar'].items())],
[v for k, v in sorted(
CIE_1931_2_DEGREE_STANDARD_OBSERVER['z_bar'].items())])))
+ # yapf: enable
+
+ def test_items(self):
+ """
+ Tests :attr:`colour.colorimetry.spectrum.\
+TriSpectralPowerDistribution.items` attribute.
+ """
+
+ np.testing.assert_array_equal(
+ list(zip(*self._tri_spd.items))[0], self._tri_spd.wavelengths)
+
+ np.testing.assert_array_equal(
+ list(zip(*self._tri_spd.items))[1], self._tri_spd.values)
def test_shape(self):
"""
@@ -2628,9 +2563,8 @@ def test__getitem__(self):
TriSpectralPowerDistribution.__getitem__` method.
"""
- np.testing.assert_almost_equal(
- self._tri_spd[400],
- np.array([0.01431, 0.000396, 0.06785]))
+ np.testing.assert_almost_equal(self._tri_spd[400],
+ np.array([0.01431, 0.000396, 0.06785]))
np.testing.assert_almost_equal(
self._tri_spd[np.array([380, 580, 780])],
@@ -2642,7 +2576,7 @@ def test__getitem__(self):
self._tri_spd[3:6],
np.array([[0.00765, 0.000217, 0.03621],
[0.01431, 0.000396, 0.06785],
- [0.02319, 0.000640, 0.1102]]))
+ [0.02319, 0.000640, 0.1102]])) # yapf: disable
def test__setitem__(self):
"""
@@ -2657,9 +2591,8 @@ def test__setitem__(self):
mapping = {'x': 'x_bar', 'y': 'y_bar', 'z': 'z_bar'}
tri_spd = TriSpectralPowerDistribution('Observer', data, mapping)
tri_spd[510] = np.array([49.67, 49.67, 49.67])
- np.testing.assert_almost_equal(
- tri_spd.values,
- np.array([[49.67, 49.67, 49.67]]))
+ np.testing.assert_almost_equal(tri_spd.values,
+ np.array([[49.67, 49.67, 49.67]]))
tri_spd[np.array([520, 530])] = np.array([[69.59, 69.59, 69.59],
[81.73, 81.73, 81.73]])
@@ -2667,7 +2600,7 @@ def test__setitem__(self):
tri_spd.values,
np.array([[49.67, 49.67, 49.67],
[69.59, 69.59, 69.59],
- [81.73, 81.73, 81.73]]))
+ [81.73, 81.73, 81.73]])) # yapf: disable
tri_spd[np.array([540, 550])] = 88.19
np.testing.assert_almost_equal(
@@ -2676,7 +2609,7 @@ def test__setitem__(self):
[69.59, 69.59, 69.59],
[81.73, 81.73, 81.73],
[88.19, 88.19, 88.19],
- [88.19, 88.19, 88.19]]))
+ [88.19, 88.19, 88.19]])) # yapf: disable
tri_spd[:] = 49.67
np.testing.assert_almost_equal(
@@ -2685,7 +2618,7 @@ def test__setitem__(self):
[49.67, 49.67, 49.67],
[49.67, 49.67, 49.67],
[49.67, 49.67, 49.67],
- [49.67, 49.67, 49.67]]))
+ [49.67, 49.67, 49.67]])) # yapf: disable
def test__iter__(self):
"""
@@ -2693,9 +2626,9 @@ def test__iter__(self):
TriSpectralPowerDistribution.__iter__` method.
"""
- self.assertEqual(
- {key: tuple(value) for key, value in self._tri_spd},
- {key: tuple(value) for key, value in CMFS_DATA.items()})
+ dict_a = {key: tuple(value) for key, value in self._tri_spd}
+ dict_b = {key: tuple(value) for key, value in CMFS_DATA.items()}
+ self.assertEqual(dict_a, dict_b)
def test__contains__(self):
"""
@@ -2750,12 +2683,8 @@ def test_arithmetical_operation(self):
methods.
"""
- operations = (
- operator.add,
- operator.sub,
- operator.mul,
- operator.truediv,
- operator.pow)
+ operations = (operator.add, operator.sub, operator.mul,
+ operator.truediv, operator.pow)
for operation in operations:
self.assertFalse(operation(self._tri_spd, 1) is self._tri_spd)
@@ -2786,12 +2715,8 @@ def test_arithmetical_ioperation(self):
methods.
"""
- operations = (
- operator.iadd,
- operator.isub,
- operator.imul,
- operator.itruediv,
- operator.ipow)
+ operations = (operator.iadd, operator.isub, operator.imul,
+ operator.itruediv, operator.ipow)
for operation in operations:
tri_spd = self._tri_spd.clone()
@@ -2807,8 +2732,7 @@ def test_arithmetical_ioperation(self):
values = tri_spd.values
random = np.random.random(values.shape)
np.testing.assert_almost_equal(
- operation(tri_spd, random).values,
- operation(values, random))
+ operation(tri_spd, random).values, operation(values, random))
tri_spd1 = self._tri_spd.clone()
tri_spd2 = self._tri_spd.clone()
@@ -2823,20 +2747,16 @@ def test_get(self):
"""
np.testing.assert_almost_equal(
- self._tri_spd.get(380),
- np.array([0.001368, 3.9e-05, 0.00645]))
+ self._tri_spd.get(380), np.array([0.001368, 3.9e-05, 0.00645]))
np.testing.assert_almost_equal(
- self._tri_spd.get(600),
- np.array([1.0622, 0.6310, 0.0008]))
+ self._tri_spd.get(600), np.array([1.0622, 0.6310, 0.0008]))
np.testing.assert_almost_equal(
- self._tri_spd.get(700),
- np.array([0.011359, 0.004102, 0.000000]))
+ self._tri_spd.get(700), np.array([0.011359, 0.004102, 0.000000]))
np.testing.assert_almost_equal(
- self._tri_spd.get(900, np.array([0, 0, 0])),
- np.array([0, 0, 0]))
+ self._tri_spd.get(900, np.array([0, 0, 0])), np.array([0, 0, 0]))
np.testing.assert_almost_equal(
self._tri_spd.get(np.array([380, 600, 700])),
@@ -2845,8 +2765,7 @@ def test_get(self):
[1.13590000e-02, 4.10200000e-03, 0.00000000e+00]]))
np.testing.assert_array_equal(
- self._tri_spd.get(400.1),
- np.array([np.nan, np.nan, np.nan]))
+ self._tri_spd.get(400.1), np.array([np.nan, np.nan, np.nan]))
def test_is_uniform(self):
"""
@@ -2900,30 +2819,33 @@ def test_interpolate(self):
INTERPOLATED_SAMPLE_SPD_DATA,
decimal=7)
- tri_spd = self._non_uniform_sample_tri_spd.clone()
-
- tri_spd.interpolate(SpectralShape(interval=1))
- for i in sorted(self._mapping.keys()):
- np.testing.assert_allclose(
- getattr(tri_spd, i).values,
- INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA,
- rtol=0.0000001,
- atol=0.0000001)
-
np.testing.assert_almost_equal(
self._tri_spd.clone().interpolate(
- SpectralShape(interval=1),
- method='Linear')[411],
+ SpectralShape(interval=1), method='Linear')[411],
np.array([0.050334, 0.001404, 0.24018]),
decimal=7)
np.testing.assert_almost_equal(
self._tri_spd.clone().interpolate(
- SpectralShape(interval=1),
- method='Pchip')[411],
+ SpectralShape(interval=1), method='Pchip')[411],
np.array([0.04895501, 0.00136229, 0.23349933]),
decimal=7)
+ # TODO: Remove statement whenever we make "Scipy" 0.19.0 the minimum
+ # version.
+ # Skipping tests because of "Scipy" 0.19.0 interpolation code changes.
+ if LooseVersion(scipy.__version__) < LooseVersion('0.19.0'):
+ return
+
+ tri_spd = self._non_uniform_sample_tri_spd.clone()
+ tri_spd.interpolate(SpectralShape(interval=1))
+ for i in sorted(self._mapping.keys()):
+ np.testing.assert_allclose(
+ getattr(tri_spd, i).values,
+ INTERPOLATED_NON_UNIFORM_SAMPLE_SPD_DATA,
+ rtol=0.0000001,
+ atol=0.0000001)
+
def test_align(self):
"""
Tests :func:`colour.colorimetry.spectrum.\
@@ -2961,16 +2883,17 @@ def test_zeros(self):
tri_spd = TriSpectralPowerDistribution(
name='',
mapping=self._mapping,
- data={'x_bar': SAMPLE_SPD_DATA,
- 'y_bar': SAMPLE_SPD_DATA,
- 'z_bar': SAMPLE_SPD_DATA},
+ data={
+ 'x_bar': SAMPLE_SPD_DATA,
+ 'y_bar': SAMPLE_SPD_DATA,
+ 'z_bar': SAMPLE_SPD_DATA
+ },
labels=self._labels).clone()
tri_spd.zeros(SpectralShape(interval=1))
for i in self._mapping.keys():
np.testing.assert_almost_equal(
- getattr(tri_spd, i).values,
- ZEROS_SAMPLE_SPD_DATA)
+ getattr(tri_spd, i).values, ZEROS_SAMPLE_SPD_DATA)
def test_normalise(self):
"""
diff --git a/colour/colorimetry/tests/tests_transformations.py b/colour/colorimetry/tests/tests_transformations.py
index 6ba80fae14..f9efc5b1cb 100644
--- a/colour/colorimetry/tests/tests_transformations.py
+++ b/colour/colorimetry/tests/tests_transformations.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.transformations` module.
"""
@@ -10,13 +9,11 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- CMFS,
- RGB_10_degree_cmfs_to_LMS_10_degree_cmfs,
- RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs,
- RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs,
- LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs,
- LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs)
+from colour.colorimetry import (CMFS, RGB_10_degree_cmfs_to_LMS_10_degree_cmfs,
+ RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs,
+ RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs,
+ LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs,
+ LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -26,11 +23,13 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_2_degree_cmfs_to_XYZ_2_degree_cmfs',
- 'TestRGB_10_degree_cmfs_to_XYZ_10_degree_cmfs',
- 'TestRGB_10_degree_cmfs_to_LMS_10_degree_cmfs',
- 'TestLMS_2_degree_cmfs_to_XYZ_2_degree_cmfs',
- 'TestLMS_10_degree_cmfs_to_XYZ_10_degree_cmfs']
+__all__ = [
+ 'TestRGB_2_degree_cmfs_to_XYZ_2_degree_cmfs',
+ 'TestRGB_10_degree_cmfs_to_XYZ_10_degree_cmfs',
+ 'TestRGB_10_degree_cmfs_to_LMS_10_degree_cmfs',
+ 'TestLMS_2_degree_cmfs_to_XYZ_2_degree_cmfs',
+ 'TestLMS_10_degree_cmfs_to_XYZ_10_degree_cmfs'
+]
class TestRGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(unittest.TestCase):
@@ -71,26 +70,22 @@ def test_n_dimensional_RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(self):
wl = 700
XYZ = np.array([0.01135774, 0.00410200, 0.00000000])
np.testing.assert_almost_equal(
- RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.tile(wl, 6)
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3, 1))
XYZ = np.reshape(XYZ, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
@ignore_numpy_errors
def test_nan_RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(self):
@@ -141,26 +136,22 @@ def test_n_dimensional_RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(self):
wl = 700
XYZ = np.array([9.64321500e-03, 3.75263179e-03, -4.10788300e-06])
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.tile(wl, 6)
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3, 1))
XYZ = np.reshape(XYZ, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
@ignore_numpy_errors
def test_nan_RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(self):
@@ -211,26 +202,22 @@ def test_n_dimensional_RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(self):
wl = 700
LMS = np.array([0.00528607, 0.00032528, 0.00000000])
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl),
- LMS)
+ RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl), LMS)
wl = np.tile(wl, 6)
LMS = np.tile(LMS, (6, 1))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl),
- LMS)
+ RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl), LMS)
wl = np.reshape(wl, (2, 3))
LMS = np.reshape(LMS, (2, 3, 3))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl),
- LMS)
+ RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl), LMS)
wl = np.reshape(wl, (2, 3, 1))
LMS = np.reshape(LMS, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl),
- LMS)
+ RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wl), LMS)
@ignore_numpy_errors
def test_nan_RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(self):
@@ -281,26 +268,22 @@ def test_n_dimensional_LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(self):
wl = 700
XYZ = np.array([0.01096778, 0.00419594, 0.00000000])
np.testing.assert_almost_equal(
- LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.tile(wl, 6)
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3, 1))
XYZ = np.reshape(XYZ, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl),
- XYZ)
+ LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wl), XYZ)
@ignore_numpy_errors
def test_nan_LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(self):
@@ -351,26 +334,22 @@ def test_n_dimensional_LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(self):
wl = 700
XYZ = np.array([0.00981623, 0.00377614, 0.00000000])
np.testing.assert_almost_equal(
- LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.tile(wl, 6)
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
wl = np.reshape(wl, (2, 3, 1))
XYZ = np.reshape(XYZ, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl),
- XYZ)
+ LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wl), XYZ)
@ignore_numpy_errors
def test_nan_LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(self):
diff --git a/colour/colorimetry/tests/tests_tristimulus.py b/colour/colorimetry/tests/tests_tristimulus.py
index 5314b0a079..ad02e00c41 100644
--- a/colour/colorimetry/tests/tests_tristimulus.py
+++ b/colour/colorimetry/tests/tests_tristimulus.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.tristimulus` module.
"""
@@ -10,20 +9,16 @@
import numpy as np
import unittest
-from colour.colorimetry import (
- CMFS,
- CIE_standard_illuminant_A_function,
- ILLUMINANTS_RELATIVE_SPDS,
- SpectralPowerDistribution,
- SpectralShape)
+from colour.colorimetry import (CMFS, CIE_standard_illuminant_A_function,
+ ILLUMINANTS_RELATIVE_SPDS,
+ SpectralPowerDistribution, SpectralShape)
from colour.colorimetry import (
lagrange_coefficients_ASTME202211,
tristimulus_weighting_factors_ASTME202211,
adjust_tristimulus_weighting_factors_ASTME30815,
spectral_to_XYZ_integration,
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815,
- spectral_to_XYZ_ASTME30815,
- wavelength_to_XYZ)
+ spectral_to_XYZ_ASTME30815, wavelength_to_XYZ)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -32,121 +27,117 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SAMPLE_SPD',
- 'LAGRANGE_COEFFICIENTS_A',
- 'LAGRANGE_COEFFICIENTS_B',
- 'A_CIE_1964_10_10_TWF',
- 'A_CIE_1964_10_20_TWF',
- 'D65_CIE_1931_2_20_TWF',
- 'D65_CIE_1931_2_20_ATWF',
- 'TestLagrangeCoefficientsASTME202211',
- 'TestTristimulusWeightingFactorsASTME202211',
- 'TestAdjustTristimulusWeightingFactorsASTME30815',
- 'TestSpectral_to_XYZ_integration',
- 'TestSpectral_to_XYZ_ASTME30815',
- 'TestWavelength_to_XYZ']
-
-SAMPLE_SPD = SpectralPowerDistribution(
- 'Sample', {
- 340: 0.0000,
- 345: 0.0000,
- 350: 0.0000,
- 355: 0.0000,
- 360: 0.0000,
- 365: 0.0000,
- 370: 0.0000,
- 375: 0.0000,
- 380: 0.0000,
- 385: 0.0000,
- 390: 0.0000,
- 395: 0.0000,
- 400: 0.0641,
- 405: 0.0650,
- 410: 0.0654,
- 415: 0.0652,
- 420: 0.0645,
- 425: 0.0629,
- 430: 0.0605,
- 435: 0.0581,
- 440: 0.0562,
- 445: 0.0551,
- 450: 0.0543,
- 455: 0.0539,
- 460: 0.0537,
- 465: 0.0538,
- 470: 0.0541,
- 475: 0.0547,
- 480: 0.0559,
- 485: 0.0578,
- 490: 0.0603,
- 495: 0.0629,
- 500: 0.0651,
- 505: 0.0667,
- 510: 0.0680,
- 515: 0.0691,
- 520: 0.0705,
- 525: 0.0720,
- 530: 0.0736,
- 535: 0.0753,
- 540: 0.0772,
- 545: 0.0791,
- 550: 0.0809,
- 555: 0.0833,
- 560: 0.0870,
- 565: 0.0924,
- 570: 0.0990,
- 575: 0.1061,
- 580: 0.1128,
- 585: 0.1190,
- 590: 0.1251,
- 595: 0.1308,
- 600: 0.1360,
- 605: 0.1403,
- 610: 0.1439,
- 615: 0.1473,
- 620: 0.1511,
- 625: 0.1550,
- 630: 0.1590,
- 635: 0.1634,
- 640: 0.1688,
- 645: 0.1753,
- 650: 0.1828,
- 655: 0.1909,
- 660: 0.1996,
- 665: 0.2088,
- 670: 0.2187,
- 675: 0.2291,
- 680: 0.2397,
- 685: 0.2505,
- 690: 0.2618,
- 695: 0.2733,
- 700: 0.2852,
- 705: 0.0000,
- 710: 0.0000,
- 715: 0.0000,
- 720: 0.0000,
- 725: 0.0000,
- 730: 0.0000,
- 735: 0.0000,
- 740: 0.0000,
- 745: 0.0000,
- 750: 0.0000,
- 755: 0.0000,
- 760: 0.0000,
- 765: 0.0000,
- 770: 0.0000,
- 775: 0.0000,
- 780: 0.0000,
- 785: 0.0000,
- 790: 0.0000,
- 795: 0.0000,
- 800: 0.0000,
- 805: 0.0000,
- 810: 0.0000,
- 815: 0.0000,
- 820: 0.0000,
- 825: 0.0000,
- 830: 0.0000})
+__all__ = [
+ 'SAMPLE_SPD', 'LAGRANGE_COEFFICIENTS_A', 'LAGRANGE_COEFFICIENTS_B',
+ 'A_CIE_1964_10_10_TWF', 'A_CIE_1964_10_20_TWF', 'D65_CIE_1931_2_20_TWF',
+ 'D65_CIE_1931_2_20_ATWF', 'TestLagrangeCoefficientsASTME202211',
+ 'TestTristimulusWeightingFactorsASTME202211',
+ 'TestAdjustTristimulusWeightingFactorsASTME30815',
+ 'TestSpectral_to_XYZ_integration', 'TestSpectral_to_XYZ_ASTME30815',
+ 'TestWavelength_to_XYZ'
+]
+
+SAMPLE_SPD = SpectralPowerDistribution('Sample', {
+ 340: 0.0000,
+ 345: 0.0000,
+ 350: 0.0000,
+ 355: 0.0000,
+ 360: 0.0000,
+ 365: 0.0000,
+ 370: 0.0000,
+ 375: 0.0000,
+ 380: 0.0000,
+ 385: 0.0000,
+ 390: 0.0000,
+ 395: 0.0000,
+ 400: 0.0641,
+ 405: 0.0650,
+ 410: 0.0654,
+ 415: 0.0652,
+ 420: 0.0645,
+ 425: 0.0629,
+ 430: 0.0605,
+ 435: 0.0581,
+ 440: 0.0562,
+ 445: 0.0551,
+ 450: 0.0543,
+ 455: 0.0539,
+ 460: 0.0537,
+ 465: 0.0538,
+ 470: 0.0541,
+ 475: 0.0547,
+ 480: 0.0559,
+ 485: 0.0578,
+ 490: 0.0603,
+ 495: 0.0629,
+ 500: 0.0651,
+ 505: 0.0667,
+ 510: 0.0680,
+ 515: 0.0691,
+ 520: 0.0705,
+ 525: 0.0720,
+ 530: 0.0736,
+ 535: 0.0753,
+ 540: 0.0772,
+ 545: 0.0791,
+ 550: 0.0809,
+ 555: 0.0833,
+ 560: 0.0870,
+ 565: 0.0924,
+ 570: 0.0990,
+ 575: 0.1061,
+ 580: 0.1128,
+ 585: 0.1190,
+ 590: 0.1251,
+ 595: 0.1308,
+ 600: 0.1360,
+ 605: 0.1403,
+ 610: 0.1439,
+ 615: 0.1473,
+ 620: 0.1511,
+ 625: 0.1550,
+ 630: 0.1590,
+ 635: 0.1634,
+ 640: 0.1688,
+ 645: 0.1753,
+ 650: 0.1828,
+ 655: 0.1909,
+ 660: 0.1996,
+ 665: 0.2088,
+ 670: 0.2187,
+ 675: 0.2291,
+ 680: 0.2397,
+ 685: 0.2505,
+ 690: 0.2618,
+ 695: 0.2733,
+ 700: 0.2852,
+ 705: 0.0000,
+ 710: 0.0000,
+ 715: 0.0000,
+ 720: 0.0000,
+ 725: 0.0000,
+ 730: 0.0000,
+ 735: 0.0000,
+ 740: 0.0000,
+ 745: 0.0000,
+ 750: 0.0000,
+ 755: 0.0000,
+ 760: 0.0000,
+ 765: 0.0000,
+ 770: 0.0000,
+ 775: 0.0000,
+ 780: 0.0000,
+ 785: 0.0000,
+ 790: 0.0000,
+ 795: 0.0000,
+ 800: 0.0000,
+ 805: 0.0000,
+ 810: 0.0000,
+ 815: 0.0000,
+ 820: 0.0000,
+ 825: 0.0000,
+ 830: 0.0000
+})
LAGRANGE_COEFFICIENTS_A = np.array(
[[-0.0285, 0.9405, 0.1045, -0.0165],
@@ -157,7 +148,7 @@
[-0.0560, 0.4480, 0.6720, -0.0640],
[-0.0455, 0.3315, 0.7735, -0.0595],
[-0.0320, 0.2160, 0.8640, -0.0480],
- [-0.0165, 0.1045, 0.9405, -0.0285]])
+ [-0.0165, 0.1045, 0.9405, -0.0285]]) # yapf: disable
LAGRANGE_COEFFICIENTS_B = np.array(
[[0.8550, 0.1900, -0.0450],
@@ -168,7 +159,7 @@
[0.2800, 0.8400, -0.1200],
[0.1950, 0.9100, -0.1050],
[0.1200, 0.9600, -0.0800],
- [0.0550, 0.9900, -0.0450]])
+ [0.0550, 0.9900, -0.0450]]) # yapf: disable
A_CIE_1964_10_10_TWF = np.array(
[[-0.000, -0.000, -0.000],
@@ -218,7 +209,7 @@
[0.000, 0.000, 0.000],
[0.000, 0.000, 0.000],
[0.000, 0.000, 0.000],
- [0.000, 0.000, 0.000]])
+ [0.000, 0.000, 0.000]]) # yapf: disable
A_CIE_1964_10_20_TWF = np.array(
[[-0.000, -0.000, -0.001],
@@ -244,7 +235,7 @@
[0.005, 0.002, 0.000],
[0.001, 0.001, 0.000],
[0.000, 0.000, 0.000],
- [0.000, 0.000, 0.000]])
+ [0.000, 0.000, 0.000]]) # yapf: disable
D65_CIE_1931_2_20_TWF = np.array(
[[-0.001, -0.000, -0.005],
@@ -270,7 +261,7 @@
[0.002, 0.001, 0.000],
[0.000, 0.000, 0.000],
[0.000, 0.000, 0.000],
- [0.000, 0.000, 0.000]])
+ [0.000, 0.000, 0.000]]) # yapf: disable
D65_CIE_1931_2_20_ATWF = np.array(
[[0.170, 0.002, 0.785],
@@ -288,7 +279,7 @@
[7.057, 2.743, 0.000],
[2.527, 0.927, -0.000],
[0.670, 0.242, -0.000],
- [0.185, 0.067, 0.000]])
+ [0.185, 0.067, 0.000]]) # yapf: disable
class TestLagrangeCoefficientsASTME202211(unittest.TestCase):
@@ -346,16 +337,12 @@ def test_tristimulus_weighting_factors_ASTME202211(self):
twf = tristimulus_weighting_factors_ASTME202211(
cmfs, A, SpectralShape(360, 830, 10))
np.testing.assert_almost_equal(
- np.round(twf, 3),
- A_CIE_1964_10_10_TWF,
- decimal=3)
+ np.round(twf, 3), A_CIE_1964_10_10_TWF, decimal=3)
twf = tristimulus_weighting_factors_ASTME202211(
cmfs, A, SpectralShape(360, 830, 20))
np.testing.assert_almost_equal(
- np.round(twf, 3),
- A_CIE_1964_10_20_TWF,
- decimal=3)
+ np.round(twf, 3), A_CIE_1964_10_20_TWF, decimal=3)
cmfs = CMFS['CIE 1931 2 Degree Standard Observer']
D65 = ILLUMINANTS_RELATIVE_SPDS['D65'].clone().align(
@@ -363,9 +350,7 @@ def test_tristimulus_weighting_factors_ASTME202211(self):
twf = tristimulus_weighting_factors_ASTME202211(
cmfs, D65, SpectralShape(360, 830, 20))
np.testing.assert_almost_equal(
- np.round(twf, 3),
- D65_CIE_1931_2_20_TWF,
- decimal=3)
+ np.round(twf, 3), D65_CIE_1931_2_20_TWF, decimal=3)
class TestAdjustTristimulusWeightingFactorsASTME30815(unittest.TestCase):
@@ -382,8 +367,8 @@ def test_adjust_tristimulus_weighting_factors_ASTME30815(self):
np.testing.assert_almost_equal(
adjust_tristimulus_weighting_factors_ASTME30815(
- D65_CIE_1931_2_20_TWF, SpectralShape(360, 830, 20),
- SpectralShape(400, 700, 20)),
+ D65_CIE_1931_2_20_TWF,
+ SpectralShape(360, 830, 20), SpectralShape(400, 700, 20)),
D65_CIE_1931_2_20_ATWF,
decimal=3)
@@ -403,27 +388,21 @@ def test_spectral_to_XYZ_integration(self):
cmfs = CMFS['CIE 1931 2 Degree Standard Observer']
np.testing.assert_almost_equal(
- spectral_to_XYZ_integration(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['A']),
+ spectral_to_XYZ_integration(SAMPLE_SPD, cmfs,
+ ILLUMINANTS_RELATIVE_SPDS['A']),
np.array([14.46365624, 10.85827910, 2.04662343]),
decimal=7)
cmfs = CMFS['CIE 1964 10 Degree Standard Observer']
np.testing.assert_almost_equal(
- spectral_to_XYZ_integration(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['C']),
+ spectral_to_XYZ_integration(SAMPLE_SPD, cmfs,
+ ILLUMINANTS_RELATIVE_SPDS['C']),
np.array([10.77031004, 9.44863775, 6.62745989]),
decimal=7)
np.testing.assert_almost_equal(
- spectral_to_XYZ_integration(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['F2']),
+ spectral_to_XYZ_integration(SAMPLE_SPD, cmfs,
+ ILLUMINANTS_RELATIVE_SPDS['F2']),
np.array([11.57834054, 9.98738373, 3.95462625]),
decimal=7)
@@ -446,53 +425,42 @@ def test_spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(self):
cmfs = CMFS['CIE 1931 2 Degree Standard Observer']
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['A']),
+ SAMPLE_SPD, cmfs, ILLUMINANTS_RELATIVE_SPDS['A']),
np.array([14.46366344, 10.85828513, 2.04663792]),
decimal=7)
cmfs = CMFS['CIE 1964 10 Degree Standard Observer']
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['C']),
+ SAMPLE_SPD, cmfs, ILLUMINANTS_RELATIVE_SPDS['C']),
np.array([10.77033881, 9.44864632, 6.62758924]),
decimal=7)
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
- SAMPLE_SPD,
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['F2']),
+ SAMPLE_SPD, cmfs, ILLUMINANTS_RELATIVE_SPDS['F2']),
np.array([11.57837130, 9.98734511, 3.95499522]),
decimal=7)
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
SAMPLE_SPD.clone().trim_wavelengths(
- SpectralShape(400, 700, 5)),
- cmfs,
+ SpectralShape(400, 700, 5)), cmfs,
ILLUMINANTS_RELATIVE_SPDS['A']),
np.array([14.38180830, 10.74512906, 2.01579131]),
decimal=7)
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
- SAMPLE_SPD.clone().interpolate(
- SpectralShape(400, 700, 10)),
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['A']),
+ SAMPLE_SPD.clone().interpolate(SpectralShape(400, 700, 10)),
+ cmfs, ILLUMINANTS_RELATIVE_SPDS['A']),
np.array([14.38284399, 10.74577954, 2.01553721]),
decimal=7)
np.testing.assert_almost_equal(
spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
- SAMPLE_SPD.clone().interpolate(
- SpectralShape(400, 700, 20)),
- cmfs,
- ILLUMINANTS_RELATIVE_SPDS['A']),
+ SAMPLE_SPD.clone().interpolate(SpectralShape(400, 700, 20)),
+ cmfs, ILLUMINANTS_RELATIVE_SPDS['A']),
np.array([14.38356848, 10.74613294, 2.01526418]),
decimal=7)
@@ -523,8 +491,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_1nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
- self._spd.clone().align(self._cmfs.shape),
- self._cmfs,
+ self._spd.clone().align(self._cmfs.shape), self._cmfs,
self.__A),
np.array([14.46372680, 10.85832950, 2.04663200]),
decimal=7)
@@ -541,8 +508,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_1nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(400, 700, 1)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.54173397, 10.88628632, 2.04965822]),
decimal=7)
@@ -564,8 +530,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_5nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(360, 830, 5)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.46372173, 10.85832502, 2.04664734]),
decimal=7)
@@ -590,8 +555,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_5nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(400, 700, 5)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.54025742, 10.88576251, 2.04950226]),
decimal=7)
@@ -642,8 +606,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_10nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(360, 830, 10)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.47779980, 10.86358645, 2.04751388]),
decimal=7)
@@ -659,8 +622,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_10nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(400, 700, 10)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.54137532, 10.88641727, 2.04931318]),
decimal=7)
@@ -682,8 +644,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_20nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(360, 820, 20)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.50187464, 10.87217124, 2.04918305]),
decimal=7)
@@ -708,8 +669,7 @@ def test_spectral_to_XYZ_ASTME30815_mi_20nm(self):
np.testing.assert_almost_equal(
spectral_to_XYZ_ASTME30815(
self._spd.clone().align(SpectralShape(400, 700, 20)),
- self._cmfs,
- self.__A),
+ self._cmfs, self.__A),
np.array([14.54114025, 10.88634755, 2.04916445]),
decimal=7)
@@ -765,47 +725,39 @@ def test_wavelength_to_XYZ(self):
"""
np.testing.assert_almost_equal(
- wavelength_to_XYZ(
- 480,
- CMFS['CIE 1931 2 Degree Standard Observer']),
+ wavelength_to_XYZ(480,
+ CMFS['CIE 1931 2 Degree Standard Observer']),
np.array([0.09564, 0.13902, 0.81295]),
decimal=7)
np.testing.assert_almost_equal(
- wavelength_to_XYZ(
- 480,
- CMFS['CIE 2012 2 Degree Standard Observer']),
+ wavelength_to_XYZ(480,
+ CMFS['CIE 2012 2 Degree Standard Observer']),
np.array([0.08182895, 0.17880480, 0.75523790]),
decimal=7)
np.testing.assert_almost_equal(
- wavelength_to_XYZ(
- 641.5,
- CMFS['CIE 2012 2 Degree Standard Observer']),
+ wavelength_to_XYZ(641.5,
+ CMFS['CIE 2012 2 Degree Standard Observer']),
np.array([0.44575583, 0.18184213, 0.00000000]),
decimal=7)
np.testing.assert_almost_equal(
- wavelength_to_XYZ(
- 480.5,
- CMFS['CIE 2012 2 Degree Standard Observer'],
- 'Cubic Spline'),
+ wavelength_to_XYZ(480.5,
+ CMFS['CIE 2012 2 Degree Standard Observer'],
+ 'Cubic Spline'),
np.array([0.07773422, 0.18148028, 0.7337162]),
decimal=7)
np.testing.assert_almost_equal(
wavelength_to_XYZ(
- 480.5,
- CMFS['CIE 2012 2 Degree Standard Observer'],
- 'Linear'),
+ 480.5, CMFS['CIE 2012 2 Degree Standard Observer'], 'Linear'),
np.array([0.07779856, 0.18149335, 0.7340129]),
decimal=7)
np.testing.assert_almost_equal(
wavelength_to_XYZ(
- 480.5,
- CMFS['CIE 2012 2 Degree Standard Observer'],
- 'Pchip'),
+ 480.5, CMFS['CIE 2012 2 Degree Standard Observer'], 'Pchip'),
np.array([0.07773515, 0.18148048, 0.73372294]),
decimal=7)
@@ -819,30 +771,22 @@ def test_n_dimensional_wavelength_to_XYZ(self):
wl = 480
XYZ = np.array([0.09564, 0.13902, 0.81295])
np.testing.assert_almost_equal(
- wavelength_to_XYZ(wl, cmfs),
- XYZ,
- decimal=7)
+ wavelength_to_XYZ(wl, cmfs), XYZ, decimal=7)
wl = np.tile(wl, 6)
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- wavelength_to_XYZ(wl, cmfs),
- XYZ,
- decimal=7)
+ wavelength_to_XYZ(wl, cmfs), XYZ, decimal=7)
wl = np.reshape(wl, (2, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- wavelength_to_XYZ(wl, cmfs),
- XYZ,
- decimal=7)
+ wavelength_to_XYZ(wl, cmfs), XYZ, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
XYZ = np.reshape(XYZ, (2, 3, 1, 3))
np.testing.assert_almost_equal(
- wavelength_to_XYZ(wl, cmfs),
- XYZ,
- decimal=7)
+ wavelength_to_XYZ(wl, cmfs), XYZ, decimal=7)
if __name__ == '__main__':
diff --git a/colour/colorimetry/tests/tests_whiteness.py b/colour/colorimetry/tests/tests_whiteness.py
index 9250619d20..2dc5356163 100644
--- a/colour/colorimetry/tests/tests_whiteness.py
+++ b/colour/colorimetry/tests/tests_whiteness.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.colorimetry.whiteness` module.
"""
@@ -11,13 +10,9 @@
import unittest
from itertools import permutations
-from colour.colorimetry import (
- whiteness_Berger1959,
- whiteness_Taube1960,
- whiteness_Stensby1968,
- whiteness_ASTM313,
- whiteness_Ganz1979,
- whiteness_CIE2004)
+from colour.colorimetry import (whiteness_Berger1959, whiteness_Taube1960,
+ whiteness_Stensby1968, whiteness_ASTME313,
+ whiteness_Ganz1979, whiteness_CIE2004)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -27,12 +22,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestWhitenessBerger1959',
- 'TestWhitenessTaube1960',
- 'TestWhitenessStensby1968',
- 'TestWhitenessASTM313',
- 'TestWhitenessGanz1979',
- 'TestWhitenessCIE2004']
+__all__ = [
+ 'TestWhitenessBerger1959', 'TestWhitenessTaube1960',
+ 'TestWhitenessStensby1968', 'TestWhitenessASTM313',
+ 'TestWhitenessGanz1979', 'TestWhitenessCIE2004'
+]
class TestWhitenessBerger1959(unittest.TestCase):
@@ -78,25 +72,19 @@ def test_n_dimensional_whiteness_Berger1959(self):
XYZ_0 = np.array([94.80966767, 100.00000000, 107.30513595])
W = 30.36380179
np.testing.assert_almost_equal(
- whiteness_Berger1959(XYZ, XYZ_0),
- W,
- decimal=7)
+ whiteness_Berger1959(XYZ, XYZ_0), W, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
XYZ_0 = np.tile(XYZ_0, (6, 1))
W = np.tile(W, 6)
np.testing.assert_almost_equal(
- whiteness_Berger1959(XYZ, XYZ_0),
- W,
- decimal=7)
+ whiteness_Berger1959(XYZ, XYZ_0), W, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
XYZ_0 = np.reshape(XYZ_0, (2, 3, 3))
W = np.reshape(W, (2, 3))
np.testing.assert_almost_equal(
- whiteness_Berger1959(XYZ, XYZ_0),
- W,
- decimal=7)
+ whiteness_Berger1959(XYZ, XYZ_0), W, decimal=7)
@ignore_numpy_errors
def test_nan_whiteness_Berger1959(self):
@@ -156,25 +144,19 @@ def test_n_dimensional_whiteness_Taube1960(self):
XYZ_0 = np.array([94.80966767, 100.00000000, 107.30513595])
WI = 91.407173833416152
np.testing.assert_almost_equal(
- whiteness_Taube1960(XYZ, XYZ_0),
- WI,
- decimal=7)
+ whiteness_Taube1960(XYZ, XYZ_0), WI, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
XYZ_0 = np.tile(XYZ_0, (6, 1))
WI = np.tile(WI, 6)
np.testing.assert_almost_equal(
- whiteness_Taube1960(XYZ, XYZ_0),
- WI,
- decimal=7)
+ whiteness_Taube1960(XYZ, XYZ_0), WI, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
XYZ_0 = np.reshape(XYZ_0, (2, 3, 3))
WI = np.reshape(WI, (2, 3))
np.testing.assert_almost_equal(
- whiteness_Taube1960(XYZ, XYZ_0),
- WI,
- decimal=7)
+ whiteness_Taube1960(XYZ, XYZ_0), WI, decimal=7)
@ignore_numpy_errors
def test_nan_whiteness_Berger1959(self):
@@ -216,10 +198,7 @@ def test_whiteness_Stensby1968(self):
places=7)
self.assertAlmostEqual(
- whiteness_Stensby1968(
- np.array([1, 1, 1])),
- 1.00000000,
- places=7)
+ whiteness_Stensby1968(np.array([1, 1, 1])), 1.00000000, places=7)
def test_n_dimensional_whiteness_Stensby1968(self):
"""
@@ -230,23 +209,17 @@ def test_n_dimensional_whiteness_Stensby1968(self):
Lab = np.array([100.00000000, -2.46875131, -16.72486654])
WI = 142.76834569
np.testing.assert_almost_equal(
- whiteness_Stensby1968(Lab),
- WI,
- decimal=7)
+ whiteness_Stensby1968(Lab), WI, decimal=7)
Lab = np.tile(Lab, (6, 1))
WI = np.tile(WI, 6)
np.testing.assert_almost_equal(
- whiteness_Stensby1968(Lab),
- WI,
- decimal=7)
+ whiteness_Stensby1968(Lab), WI, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
WI = np.reshape(WI, (2, 3))
np.testing.assert_almost_equal(
- whiteness_Stensby1968(Lab),
- WI,
- decimal=7)
+ whiteness_Stensby1968(Lab), WI, decimal=7)
@ignore_numpy_errors
def test_nan_whiteness_Stensby1968(self):
@@ -264,65 +237,56 @@ def test_nan_whiteness_Stensby1968(self):
class TestWhitenessASTM313(unittest.TestCase):
"""
- Defines :func:`colour.colorimetry.whiteness.whiteness_ASTM313`
+ Defines :func:`colour.colorimetry.whiteness.whiteness_ASTME313`
definition unit tests methods.
"""
- def test_whiteness_ASTM313(self):
+ def test_whiteness_ASTME313(self):
"""
- Tests :func:`colour.colorimetry.whiteness.whiteness_ASTM313`
+ Tests :func:`colour.colorimetry.whiteness.whiteness_ASTME313`
definition.
"""
self.assertAlmostEqual(
- whiteness_ASTM313(
+ whiteness_ASTME313(
np.array([95.00000000, 100.00000000, 105.00000000])),
55.740000000000009,
places=7)
self.assertAlmostEqual(
- whiteness_ASTM313(
+ whiteness_ASTME313(
np.array([105.00000000, 100.00000000, 95.00000000])),
21.860000000000014,
places=7)
self.assertAlmostEqual(
- whiteness_ASTM313(
+ whiteness_ASTME313(
np.array([100.00000000, 100.00000000, 100.00000000])),
38.800000000000011,
places=7)
- def test_n_dimensional_whiteness_ASTM313(self):
+ def test_n_dimensional_whiteness_ASTME313(self):
"""
- Tests :func:`colour.colorimetry.whiteness.whiteness_ASTM313`
+ Tests :func:`colour.colorimetry.whiteness.whiteness_ASTME313`
definition n_dimensional arrays support.
"""
XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
WI = 55.740000000000009
- np.testing.assert_almost_equal(
- whiteness_ASTM313(XYZ),
- WI,
- decimal=7)
+ np.testing.assert_almost_equal(whiteness_ASTME313(XYZ), WI, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
WI = np.tile(WI, 6)
- np.testing.assert_almost_equal(
- whiteness_ASTM313(XYZ),
- WI,
- decimal=7)
+ np.testing.assert_almost_equal(whiteness_ASTME313(XYZ), WI, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
WI = np.reshape(WI, (2, 3))
- np.testing.assert_almost_equal(
- whiteness_ASTM313(XYZ),
- WI,
- decimal=7)
+ np.testing.assert_almost_equal(whiteness_ASTME313(XYZ), WI, decimal=7)
@ignore_numpy_errors
- def test_nan_whiteness_ASTM313(self):
+ def test_nan_whiteness_ASTME313(self):
"""
- Tests :func:`colour.colorimetry.whiteness.whiteness_ASTM313`
+ Tests :func:`colour.colorimetry.whiteness.whiteness_ASTME313`
definition nan support.
"""
@@ -330,7 +294,7 @@ def test_nan_whiteness_ASTM313(self):
cases = set(permutations(cases * 3, r=3))
for case in cases:
XYZ = np.array(case)
- whiteness_ASTM313(XYZ)
+ whiteness_ASTME313(XYZ)
class TestWhitenessGanz1979(unittest.TestCase):
@@ -370,30 +334,22 @@ def test_n_dimensional_whiteness_Ganz1979(self):
Y = 100
WT = np.array([85.60037660, 0.67890030])
np.testing.assert_almost_equal(
- whiteness_Ganz1979(xy, Y),
- WT,
- decimal=7)
+ whiteness_Ganz1979(xy, Y), WT, decimal=7)
xy = np.tile(xy, (6, 1))
WT = np.tile(WT, (6, 1))
np.testing.assert_almost_equal(
- whiteness_Ganz1979(xy, Y),
- WT,
- decimal=7)
+ whiteness_Ganz1979(xy, Y), WT, decimal=7)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- whiteness_Ganz1979(xy, Y),
- WT,
- decimal=7)
+ whiteness_Ganz1979(xy, Y), WT, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
Y = np.reshape(Y, (2, 3))
WT = np.reshape(WT, (2, 3, 2))
np.testing.assert_almost_equal(
- whiteness_Ganz1979(xy, Y),
- WT,
- decimal=7)
+ whiteness_Ganz1979(xy, Y), WT, decimal=7)
@ignore_numpy_errors
def test_nan_whiteness_Ganz1979(self):
@@ -423,23 +379,20 @@ def test_whiteness_CIE2004(self):
"""
np.testing.assert_almost_equal(
- whiteness_CIE2004(np.array([0.3139, 0.3311]),
- 100,
- np.array([0.3139, 0.3311])),
+ whiteness_CIE2004(
+ np.array([0.3139, 0.3311]), 100, np.array([0.3139, 0.3311])),
np.array([100.00000000, 0.00000000]),
decimal=7)
np.testing.assert_almost_equal(
- whiteness_CIE2004(np.array([0.3500, 0.3334]),
- 100,
- np.array([0.3139, 0.3311])),
+ whiteness_CIE2004(
+ np.array([0.3500, 0.3334]), 100, np.array([0.3139, 0.3311])),
np.array([67.21000000, -34.60500000]),
decimal=7)
np.testing.assert_almost_equal(
- whiteness_CIE2004(np.array([0.3334, 0.3334]),
- 100,
- np.array([0.3139, 0.3311])),
+ whiteness_CIE2004(
+ np.array([0.3334, 0.3334]), 100, np.array([0.3139, 0.3311])),
np.array([80.49000000, -18.00500000]),
decimal=7)
@@ -454,32 +407,24 @@ def test_n_dimensional_whiteness_CIE2004(self):
xy_n = np.array([0.3139, 0.3311])
WT = np.array([93.8500000, -1.30500000])
np.testing.assert_almost_equal(
- whiteness_CIE2004(xy, Y, xy_n),
- WT,
- decimal=7)
+ whiteness_CIE2004(xy, Y, xy_n), WT, decimal=7)
xy = np.tile(xy, (6, 1))
WT = np.tile(WT, (6, 1))
np.testing.assert_almost_equal(
- whiteness_CIE2004(xy, Y, xy_n),
- WT,
- decimal=7)
+ whiteness_CIE2004(xy, Y, xy_n), WT, decimal=7)
Y = np.tile(Y, 6)
xy_n = np.tile(xy_n, (6, 1))
np.testing.assert_almost_equal(
- whiteness_CIE2004(xy, Y, xy_n),
- WT,
- decimal=7)
+ whiteness_CIE2004(xy, Y, xy_n), WT, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
Y = np.reshape(Y, (2, 3))
xy_n = np.reshape(xy_n, (2, 3, 2))
WT = np.reshape(WT, (2, 3, 2))
np.testing.assert_almost_equal(
- whiteness_CIE2004(xy, Y, xy_n),
- WT,
- decimal=7)
+ whiteness_CIE2004(xy, Y, xy_n), WT, decimal=7)
@ignore_numpy_errors
def test_nan_whiteness_CIE2004(self):
diff --git a/colour/colorimetry/tests/tests_yellowness.py b/colour/colorimetry/tests/tests_yellowness.py
new file mode 100644
index 0000000000..9bd07316a8
--- /dev/null
+++ b/colour/colorimetry/tests/tests_yellowness.py
@@ -0,0 +1,154 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.colorimetry.yellowness` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+from itertools import permutations
+
+from colour.colorimetry import (yellowness_ASTMD1925, yellowness_ASTME313)
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestYellownessASTMD1925', 'TestYellownessASTM313']
+
+
+class TestYellownessASTMD1925(unittest.TestCase):
+ """
+ Defines :func:`colour.colorimetry.yellowness.yellowness_ASTMD1925`
+ definition unit tests methods.
+ """
+
+ def test_yellowness_ASTMD1925(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTMD1925`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ yellowness_ASTMD1925(
+ np.array([95.00000000, 100.00000000, 105.00000000])),
+ 10.299999999999997,
+ places=7)
+
+ self.assertAlmostEqual(
+ yellowness_ASTMD1925(
+ np.array([105.00000000, 100.00000000, 95.00000000])),
+ 33.700000000000003,
+ places=7)
+
+ self.assertAlmostEqual(
+ yellowness_ASTMD1925(
+ np.array([100.00000000, 100.00000000, 100.00000000])),
+ 22.0,
+ places=7)
+
+ def test_n_dimensional_yellowness_ASTMD1925(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTMD1925`
+ definition n_dimensional arrays support.
+ """
+
+ XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
+ YI = 10.299999999999997
+ np.testing.assert_almost_equal(
+ yellowness_ASTMD1925(XYZ), YI, decimal=7)
+
+ XYZ = np.tile(XYZ, (6, 1))
+ YI = np.tile(YI, 6)
+ np.testing.assert_almost_equal(
+ yellowness_ASTMD1925(XYZ), YI, decimal=7)
+
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ YI = np.reshape(YI, (2, 3))
+ np.testing.assert_almost_equal(
+ yellowness_ASTMD1925(XYZ), YI, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_yellowness_ASTMD1925(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTMD1925`
+ definition nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ XYZ = np.array(case)
+ yellowness_ASTMD1925(XYZ)
+
+
+class TestYellownessASTM313(unittest.TestCase):
+ """
+ Defines :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
+ definition unit tests methods.
+ """
+
+ def test_yellowness_ASTME313(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ yellowness_ASTME313(
+ np.array([95.00000000, 100.00000000, 105.00000000])),
+ 11.065000000000003,
+ places=7)
+
+ self.assertAlmostEqual(
+ yellowness_ASTME313(
+ np.array([105.00000000, 100.00000000, 95.00000000])),
+ 19.534999999999989,
+ places=7)
+
+ self.assertAlmostEqual(
+ yellowness_ASTME313(
+ np.array([100.00000000, 100.00000000, 100.00000000])),
+ 15.300000000000002,
+ places=7)
+
+ def test_n_dimensional_yellowness_ASTME313(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
+ definition n_dimensional arrays support.
+ """
+
+ XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
+ YI = 11.065000000000003
+ np.testing.assert_almost_equal(yellowness_ASTME313(XYZ), YI, decimal=7)
+
+ XYZ = np.tile(XYZ, (6, 1))
+ YI = np.tile(YI, 6)
+ np.testing.assert_almost_equal(yellowness_ASTME313(XYZ), YI, decimal=7)
+
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ YI = np.reshape(YI, (2, 3))
+ np.testing.assert_almost_equal(yellowness_ASTME313(XYZ), YI, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_yellowness_ASTME313(self):
+ """
+ Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
+ definition nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ XYZ = np.array(case)
+ yellowness_ASTME313(XYZ)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/colorimetry/transformations.py b/colour/colorimetry/transformations.py
index f5711e8746..11bab7926e 100644
--- a/colour/colorimetry/transformations.py
+++ b/colour/colorimetry/transformations.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Matching Functions Transformations
=========================================
@@ -35,11 +34,13 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs',
- 'RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs',
- 'RGB_10_degree_cmfs_to_LMS_10_degree_cmfs',
- 'LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs',
- 'LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs']
+__all__ = [
+ 'RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs',
+ 'RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs',
+ 'RGB_10_degree_cmfs_to_LMS_10_degree_cmfs',
+ 'LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs',
+ 'LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs'
+]
def RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wavelength):
@@ -84,13 +85,15 @@ def RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(wavelength):
rgb = rgb_bar / np.sum(rgb_bar)
- M1 = np.array([[0.49000, 0.31000, 0.20000],
- [0.17697, 0.81240, 0.01063],
- [0.00000, 0.01000, 0.99000]])
+ M1 = np.array(
+ [[0.49000, 0.31000, 0.20000],
+ [0.17697, 0.81240, 0.01063],
+ [0.00000, 0.01000, 0.99000]]) # yapf: disable
- M2 = np.array([[0.66697, 1.13240, 1.20063],
- [0.66697, 1.13240, 1.20063],
- [0.66697, 1.13240, 1.20063]])
+ M2 = np.array(
+ [[0.66697, 1.13240, 1.20063],
+ [0.66697, 1.13240, 1.20063],
+ [0.66697, 1.13240, 1.20063]]) # yapf: disable
xyz = dot_vector(M1, rgb)
xyz /= dot_vector(M2, rgb)
@@ -151,9 +154,10 @@ def RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(wavelength):
rgb_bar = cmfs.get(wavelength)
- M = np.array([[0.341080, 0.189145, 0.387529],
- [0.139058, 0.837460, 0.073316],
- [0.000000, 0.039553, 2.026200]])
+ M = np.array(
+ [[0.341080, 0.189145, 0.387529],
+ [0.139058, 0.837460, 0.073316],
+ [0.000000, 0.039553, 2.026200]]) # yapf: disable
xyz_bar = dot_vector(M, rgb_bar)
@@ -198,9 +202,10 @@ def RGB_10_degree_cmfs_to_LMS_10_degree_cmfs(wavelength):
rgb_bar = cmfs.get(wavelength)
- M = np.array([[0.1923252690, 0.749548882, 0.0675726702],
- [0.0192290085, 0.940908496, 0.113830196],
- [0.0000000000, 0.0105107859, 0.991427669]])
+ M = np.array(
+ [[0.1923252690, 0.749548882, 0.0675726702],
+ [0.0192290085, 0.940908496, 0.113830196],
+ [0.0000000000, 0.0105107859, 0.991427669]]) # yapf: disable
lms_bar = dot_vector(M, rgb_bar)
lms_bar[..., -1][np.asarray(np.asarray(wavelength) > 505)] = 0
@@ -245,9 +250,10 @@ def LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(wavelength):
lms_bar = cmfs.get(wavelength)
- M = np.array([[1.94735469, -1.41445123, 0.36476327],
- [0.68990272, 0.34832189, 0.00000000],
- [0.00000000, 0.00000000, 1.93485343]])
+ M = np.array(
+ [[1.94735469, -1.41445123, 0.36476327],
+ [0.68990272, 0.34832189, 0.00000000],
+ [0.00000000, 0.00000000, 1.93485343]]) # yapf: disable
xyz_bar = dot_vector(M, lms_bar)
@@ -291,9 +297,10 @@ def LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(wavelength):
lms_bar = cmfs.get(wavelength)
- M = np.array([[1.93986443, -1.34664359, 0.43044935],
- [0.69283932, 0.34967567, 0.00000000],
- [0.00000000, 0.00000000, 2.14687945]])
+ M = np.array(
+ [[1.93986443, -1.34664359, 0.43044935],
+ [0.69283932, 0.34967567, 0.00000000],
+ [0.00000000, 0.00000000, 2.14687945]]) # yapf: disable
xyz_bar = dot_vector(M, lms_bar)
diff --git a/colour/colorimetry/tristimulus.py b/colour/colorimetry/tristimulus.py
index 96d4df6625..73b8d3fc03 100644
--- a/colour/colorimetry/tristimulus.py
+++ b/colour/colorimetry/tristimulus.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Tristimulus Values
==================
@@ -39,22 +38,13 @@
import numpy as np
-from colour.algebra import (
- CubicSplineInterpolator,
- LinearInterpolator,
- PchipInterpolator,
- SpragueInterpolator,
- lagrange_coefficients)
-from colour.colorimetry import (
- DEFAULT_SPECTRAL_SHAPE,
- SpectralShape,
- STANDARD_OBSERVERS_CMFS, ones_spd)
-from colour.utilities import (
- CaseInsensitiveMapping,
- filter_kwargs,
- is_string,
- tsplit,
- warning)
+from colour.algebra import (CubicSplineInterpolator, LinearInterpolator,
+ PchipInterpolator, SpragueInterpolator,
+ lagrange_coefficients)
+from colour.colorimetry import (DEFAULT_SPECTRAL_SHAPE, SpectralShape,
+ STANDARD_OBSERVERS_CMFS, ones_spd)
+from colour.utilities import (CaseInsensitiveMapping, filter_kwargs, is_string,
+ tsplit, warning)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -63,20 +53,19 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ASTME30815_PRACTISE_SHAPE',
- 'lagrange_coefficients_ASTME202211',
- 'tristimulus_weighting_factors_ASTME202211',
- 'adjust_tristimulus_weighting_factors_ASTME30815',
- 'spectral_to_XYZ_integration',
- 'spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815',
- 'spectral_to_XYZ_ASTME30815',
- 'SPECTRAL_TO_XYZ_METHODS',
- 'spectral_to_XYZ',
- 'wavelength_to_XYZ']
+__all__ = [
+ 'ASTME30815_PRACTISE_SHAPE', 'lagrange_coefficients_ASTME202211',
+ 'tristimulus_weighting_factors_ASTME202211',
+ 'adjust_tristimulus_weighting_factors_ASTME30815',
+ 'spectral_to_XYZ_integration',
+ 'spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815',
+ 'spectral_to_XYZ_ASTME30815', 'SPECTRAL_TO_XYZ_METHODS', 'spectral_to_XYZ',
+ 'wavelength_to_XYZ'
+]
ASTME30815_PRACTISE_SHAPE = DEFAULT_SPECTRAL_SHAPE
"""
-*ASTM E308–15* practise shape: (360, 780, 1).
+*ASTM E308-15* practise shape: (360, 780, 1).
ASTME30815_PRACTISE_SHAPE : SpectralShape
"""
@@ -86,9 +75,7 @@
_TRISTIMULUS_WEIGHTING_FACTORS_CACHE = None
-def lagrange_coefficients_ASTME202211(
- interval=10,
- interval_type='inner'):
+def lagrange_coefficients_ASTME202211(interval=10, interval_type='inner'):
"""
Computes the *Lagrange Coefficients* for given interval size using practise
*ASTM E2022-11* method [1]_.
@@ -151,8 +138,8 @@ def lagrange_coefficients_ASTME202211(
r_n += 1
d = 4
- lica = _LAGRANGE_INTERPOLATING_COEFFICIENTS_CACHE[name_lica] = (
- np.asarray([lagrange_coefficients(r, d) for r in r_n]))
+ lica = _LAGRANGE_INTERPOLATING_COEFFICIENTS_CACHE[name_lica] = (np.asarray(
+ [lagrange_coefficients(r, d) for r in r_n]))
return lica
@@ -264,19 +251,20 @@ def tristimulus_weighting_factors_ASTME202211(cmfs, illuminant, shape):
Y = cmfs.values
S = illuminant.values
- W = S[::shape.interval, np.newaxis] * Y[::shape.interval, :]
+ interval_i = np.int_(shape.interval)
+ W = S[::interval_i, np.newaxis] * Y[::interval_i, :]
# First and last measurement intervals *Lagrange Coefficients*.
- c_c = lagrange_coefficients_ASTME202211(shape.interval, 'boundary')
+ c_c = lagrange_coefficients_ASTME202211(interval_i, 'boundary')
# Intermediate measurement intervals *Lagrange Coefficients*.
- c_b = lagrange_coefficients_ASTME202211(shape.interval, 'inner')
+ c_b = lagrange_coefficients_ASTME202211(interval_i, 'inner')
# Total wavelengths count.
w_c = len(Y)
# Measurement interval interpolated values count.
r_c = c_b.shape[0]
# Last interval first interpolated wavelength.
- w_lif = w_c - (w_c - 1) % shape.interval - 1 - r_c
+ w_lif = w_c - (w_c - 1) % interval_i - 1 - r_c
# Intervals count.
i_c = W.shape[0]
@@ -291,8 +279,8 @@ def tristimulus_weighting_factors_ASTME202211(cmfs, illuminant, shape):
# Last interval.
for j in range(r_c):
for k in range(i_cm, i_cm - 3, -1):
- W[k, i] = (W[k, i] + c_c[r_c - j - 1, i_cm - k] *
- S[j + w_lif] * Y[j + w_lif, i])
+ W[k, i] = (W[k, i] + c_c[r_c - j - 1, i_cm - k] * S[j + w_lif]
+ * Y[j + w_lif, i])
# Intermediate intervals.
for j in range(i_c - 3):
@@ -304,7 +292,7 @@ def tristimulus_weighting_factors_ASTME202211(cmfs, illuminant, shape):
W[j + 3, i] = W[j + 3, i] + c_b[k, 3] * S[w_i] * Y[w_i, i]
# Extrapolation of potential incomplete interval.
- for j in range(int(w_c - ((w_c - 1) % shape.interval)), w_c, 1):
+ for j in range(int(w_c - ((w_c - 1) % interval_i)), w_c, 1):
W[i_cm, i] = W[i_cm, i] + S[j] * Y[j, i]
W *= 100 / np.sum(W, axis=0)[1]
@@ -386,11 +374,9 @@ def adjust_tristimulus_weighting_factors_ASTME30815(W, shape_r, shape_t):
def spectral_to_XYZ_integration(
spd,
- cmfs=STANDARD_OBSERVERS_CMFS[
- 'CIE 1931 2 Degree Standard Observer'],
- illuminant=ones_spd(
- STANDARD_OBSERVERS_CMFS[
- 'CIE 1931 2 Degree Standard Observer'].shape)):
+ cmfs=STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer'],
+ illuminant=ones_spd(STANDARD_OBSERVERS_CMFS[
+ 'CIE 1931 2 Degree Standard Observer'].shape)):
"""
Converts given spectral power distribution to *CIE XYZ* tristimulus values
using given colour matching functions and illuminant accordingly to
@@ -551,8 +537,8 @@ def spectral_to_XYZ_tristimulus_weighting_factors_ASTME30815(
spd = spd.clone().trim_wavelengths(cmfs.shape)
W = tristimulus_weighting_factors_ASTME202211(
- cmfs, illuminant, SpectralShape(
- cmfs.shape.start, cmfs.shape.end, spd.shape.interval))
+ cmfs, illuminant,
+ SpectralShape(cmfs.shape.start, cmfs.shape.end, spd.shape.interval))
start_w = cmfs.shape.start
end_w = cmfs.shape.start + spd.shape.interval * (W.shape[0] - 1)
W = adjust_tristimulus_weighting_factors_ASTME30815(
@@ -674,35 +660,34 @@ def spectral_to_XYZ_ASTME30815(
# Extrapolation of additional 20nm padding intervals.
spd.align(SpectralShape(spd.shape.start - 20, spd.shape.end + 20, 10))
for i in range(2):
- spd[spd.wavelengths[i]] = (3 * spd.values[i + 2] -
- 3 * spd.values[i + 4] +
- spd.values[i + 6])
+ spd[spd.wavelengths[i]] = (
+ 3 * spd.values[i + 2] -
+ 3 * spd.values[i + 4] + spd.values[i + 6]) # yapf: disable
i_e = len(spd) - 1 - i
- spd[spd.wavelengths[i_e]] = (spd.values[i_e - 6] -
- 3 * spd.values[i_e - 4] +
- 3 * spd.values[i_e - 2])
+ spd[spd.wavelengths[i_e]] = (
+ spd.values[i_e - 6] - 3 * spd.values[i_e - 4] +
+ 3 * spd.values[i_e - 2])
# Interpolating every odd numbered values.
# TODO: Investigate code vectorisation.
for i in range(3, len(spd) - 3, 2):
- spd[spd.wavelengths[i]] = (-0.0625 * spd.values[i - 3] +
- 0.5625 * spd.values[i - 1] +
- 0.5625 * spd.values[i + 1] -
- 0.0625 * spd.values[i + 3])
+ spd[spd.wavelengths[i]] = (
+ -0.0625 * spd.values[i - 3] + 0.5625 * spd.values[i - 1] +
+ 0.5625 * spd.values[i + 1] - 0.0625 * spd.values[i + 3])
# Discarding the additional 20nm padding intervals.
- spd.trim_wavelengths(SpectralShape(spd.shape.start + 20,
- spd.shape.end - 20,
- 10))
+ spd.trim_wavelengths(
+ SpectralShape(spd.shape.start + 20, spd.shape.end - 20, 10))
XYZ = method(spd, cmfs, illuminant)
return XYZ
-SPECTRAL_TO_XYZ_METHODS = CaseInsensitiveMapping(
- {'ASTM E308-15': spectral_to_XYZ_ASTME30815,
- 'Integration': spectral_to_XYZ_integration})
+SPECTRAL_TO_XYZ_METHODS = CaseInsensitiveMapping({
+ 'ASTM E308-15': spectral_to_XYZ_ASTME30815,
+ 'Integration': spectral_to_XYZ_integration
+})
"""
Supported spectral power distribution to *CIE XYZ* tristimulus values
conversion methods
@@ -714,8 +699,7 @@ def spectral_to_XYZ_ASTME30815(
- 'astm2015': 'ASTM E308-15'
"""
-SPECTRAL_TO_XYZ_METHODS['astm2015'] = (
- SPECTRAL_TO_XYZ_METHODS['ASTM E308-15'])
+SPECTRAL_TO_XYZ_METHODS['astm2015'] = (SPECTRAL_TO_XYZ_METHODS['ASTM E308-15'])
def spectral_to_XYZ(
@@ -813,10 +797,10 @@ def spectral_to_XYZ(
return function(spd, cmfs, illuminant, **kwargs)
-def wavelength_to_XYZ(wavelength,
- cmfs=STANDARD_OBSERVERS_CMFS[
- 'CIE 1931 2 Degree Standard Observer'],
- method=None):
+def wavelength_to_XYZ(
+ wavelength,
+ cmfs=STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer'],
+ method=None):
"""
Converts given wavelength :math:`\lambda` to *CIE XYZ* tristimulus values
using given colour matching functions.
@@ -903,9 +887,8 @@ def wavelength_to_XYZ(wavelength,
cmfs_shape = cmfs.shape
if (np.min(wavelength) < cmfs_shape.start or
np.max(wavelength) > cmfs_shape.end):
- raise ValueError(
- '"{0} nm" wavelength is not in "[{1}, {2}]" domain!'.format(
- wavelength, cmfs_shape.start, cmfs_shape.end))
+ raise ValueError('"{0} nm" wavelength is not in "[{1}, {2}]" domain!'.
+ format(wavelength, cmfs_shape.start, cmfs_shape.end))
if wavelength not in cmfs:
wavelengths, values, = cmfs.wavelengths, cmfs.values
@@ -935,16 +918,17 @@ def wavelength_to_XYZ(wavelength,
'interpolating functions having a uniformly spaced '
'independent variable!'))
else:
- raise ValueError(
- 'Undefined "{0}" interpolator!'.format(method))
+ raise ValueError('Undefined "{0}" interpolator!'.format(method))
- interpolators = [interpolator(wavelengths, values[..., i])
- for i in range(values.shape[-1])]
+ interpolators = [
+ interpolator(wavelengths, values[..., i])
+ for i in range(values.shape[-1])
+ ]
XYZ = np.dstack([i(np.ravel(wavelength)) for i in interpolators])
else:
XYZ = cmfs[wavelength]
- XYZ = np.reshape(XYZ, np.asarray(wavelength).shape + (3,))
+ XYZ = np.reshape(XYZ, np.asarray(wavelength).shape + (3, ))
return XYZ
diff --git a/colour/colorimetry/whiteness.py b/colour/colorimetry/whiteness.py
index f933aa209c..c4328153f7 100644
--- a/colour/colorimetry/whiteness.py
+++ b/colour/colorimetry/whiteness.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Whiteness Index :math:`W`
=========================
@@ -10,7 +9,7 @@
- :func:`whiteness_Berger1959`
- :func:`whiteness_Taube1960`
- :func:`whiteness_Stensby1968`
-- :func:`whiteness_ASTM313`
+- :func:`whiteness_ASTME313`
- :func:`whiteness_Ganz1979`
- :func:`whiteness_CIE2004`
@@ -47,14 +46,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['whiteness_Berger1959',
- 'whiteness_Taube1960',
- 'whiteness_Stensby1968',
- 'whiteness_ASTM313',
- 'whiteness_Ganz1979',
- 'whiteness_CIE2004',
- 'WHITENESS_METHODS',
- 'whiteness']
+__all__ = [
+ 'whiteness_Berger1959', 'whiteness_Taube1960', 'whiteness_Stensby1968',
+ 'whiteness_ASTME313', 'whiteness_Ganz1979', 'whiteness_CIE2004',
+ 'WHITENESS_METHODS', 'whiteness'
+]
def whiteness_Berger1959(XYZ, XYZ_0):
@@ -176,10 +172,10 @@ def whiteness_Stensby1968(Lab):
return WI
-def whiteness_ASTM313(XYZ):
+def whiteness_ASTME313(XYZ):
"""
Returns the *whiteness* index :math:`WI` of given sample *CIE XYZ*
- tristimulus values using *ASTM 313* method. [2]_
+ tristimulus values using *ASTM E313* method. [2]_
Parameters
----------
@@ -202,7 +198,7 @@ def whiteness_ASTM313(XYZ):
Examples
--------
>>> XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
- >>> whiteness_ASTM313(XYZ) # doctest: +ELLIPSIS
+ >>> whiteness_ASTME313(XYZ) # doctest: +ELLIPSIS
55.7400000...
"""
@@ -339,18 +335,19 @@ def whiteness_CIE2004(xy,
return WT
-WHITENESS_METHODS = CaseInsensitiveMapping(
- {'Berger 1959': whiteness_Berger1959,
- 'Taube 1960': whiteness_Taube1960,
- 'Stensby 1968': whiteness_Stensby1968,
- 'ASTM 313': whiteness_ASTM313,
- 'Ganz 1979': whiteness_Ganz1979,
- 'CIE 2004': whiteness_CIE2004})
+WHITENESS_METHODS = CaseInsensitiveMapping({
+ 'Berger 1959': whiteness_Berger1959,
+ 'Taube 1960': whiteness_Taube1960,
+ 'Stensby 1968': whiteness_Stensby1968,
+ 'ASTM E313': whiteness_ASTME313,
+ 'Ganz 1979': whiteness_Ganz1979,
+ 'CIE 2004': whiteness_CIE2004
+})
"""
Supported *whiteness* computations methods.
WHITENESS_METHODS : CaseInsensitiveMapping
- **{'CIE 2004', 'Berger 1959', 'Taube 1960', 'Stensby 1968', 'ASTM 313',
+ **{'CIE 2004', 'Berger 1959', 'Taube 1960', 'Stensby 1968', 'ASTM E313',
'Ganz 1979', 'CIE 2004'}**
Aliases:
@@ -367,15 +364,15 @@ def whiteness(method='CIE 2004', **kwargs):
Parameters
----------
method : unicode, optional
- **{'CIE 2004', 'Berger 1959', 'Taube 1960', 'Stensby 1968', 'ASTM 313',
- 'Ganz 1979', 'CIE 2004'}**,
+ **{'CIE 2004', 'Berger 1959', 'Taube 1960', 'Stensby 1968',
+ 'ASTM E313', 'Ganz 1979', 'CIE 2004'}**,
Computation method.
Other Parameters
----------------
XYZ : array_like
{:func:`whiteness_Berger1959`, :func:`whiteness_Taube1960`,
- :func:`whiteness_ASTM313`},
+ :func:`whiteness_ASTME313`},
*CIE XYZ* tristimulus values of sample.
XYZ_0 : array_like
{:func:`whiteness_Berger1959`, :func:`whiteness_Taube1960`},
diff --git a/colour/colorimetry/yellowness.py b/colour/colorimetry/yellowness.py
new file mode 100644
index 0000000000..dc5041ea39
--- /dev/null
+++ b/colour/colorimetry/yellowness.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Yellowness Index :math:`Y`
+==========================
+
+Defines *yellowness* index :math:`Y` computation objects:
+
+- :func:`yellowness_ASTMD1925`
+- :func:`yellowness_ASTME313`
+
+See Also
+--------
+`Yellowness Jupyter Notebook
+`_
+
+References
+----------
+.. [1] X-Rite, & Pantone. (2012). Color iQC and Color iMatch Color
+ Calculations Guide. Retrieved from
+ http://www.xrite.com/documents/literature/en/\
+09_Color_Calculations_en.pdf
+"""
+
+from __future__ import division, unicode_literals
+
+from colour.utilities import CaseInsensitiveMapping, tsplit
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = [
+ 'yellowness_ASTMD1925', 'yellowness_ASTME313', 'YELLOWNESS_METHODS',
+ 'yellowness'
+]
+
+
+def yellowness_ASTMD1925(XYZ):
+ """
+ Returns the *yellowness* index :math:`YI` of given sample *CIE XYZ*
+ tristimulus values using *ASTM D1925* method. [1]_
+
+ ASTM D1925 has been specifically developed for the definition of the
+ Yellowness of homogeneous, non-fluorescent, almost neutral-transparent,
+ white-scattering or opaque plastics as they will be reviewed under daylight
+ condition. It can be other materials as well, as long as they fit into this
+ description.
+
+ Parameters
+ ----------
+ XYZ : array_like
+ *CIE XYZ* tristimulus values of sample.
+
+ Returns
+ -------
+ numeric or ndarray
+ *Whiteness* :math:`YI`.
+
+ Notes
+ -----
+ - Input *CIE XYZ* tristimulus values are in domain [0, 100].
+
+ Warning
+ -------
+ The input domain of that definition is non standard!
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
+ >>> yellowness_ASTMD1925(XYZ) # doctest: +ELLIPSIS
+ 10.2999999...
+ """
+
+ X, Y, Z = tsplit(XYZ)
+
+ YI = (100 * (1.28 * X - 1.06 * Z)) / Y
+
+ return YI
+
+
+def yellowness_ASTME313(XYZ):
+ """
+ Returns the *yellowness* index :math:`YI` of given sample *CIE XYZ*
+ tristimulus values using *ASTM E313* method. [1]_
+
+ ASTM E313 has successfully been used for a variety of white or near white
+ materials. This includes coatings, Plastics, Textiles.
+
+ Parameters
+ ----------
+ XYZ : array_like
+ *CIE XYZ* tristimulus values of sample.
+
+ Returns
+ -------
+ numeric or ndarray
+ *Whiteness* :math:`YI`.
+
+ Notes
+ -----
+ - Input *CIE XYZ* tristimulus values are in domain [0, 100].
+
+ Warning
+ -------
+ The input domain of that definition is non standard!
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
+ >>> yellowness_ASTME313(XYZ) # doctest: +ELLIPSIS
+ 11.0650000...
+ """
+
+ _X, Y, Z = tsplit(XYZ)
+
+ WI = 100 * (1 - (0.847 * Z) / Y)
+
+ return WI
+
+
+YELLOWNESS_METHODS = CaseInsensitiveMapping({
+ 'ASTM D1925': yellowness_ASTMD1925,
+ 'ASTM E313': yellowness_ASTME313
+})
+"""
+Supported *yellowness* computations methods.
+
+YELLOWNESS_METHODS : CaseInsensitiveMapping
+ **{'ASTM E313', 'ASTM D1925'}**
+"""
+
+
+def yellowness(XYZ, method='ASTM E313'):
+ """
+ Returns the *yellowness* :math:`W` using given method.
+
+ Parameters
+ ----------
+ XYZ : array_like
+ *CIE XYZ* tristimulus values of sample.
+ method : unicode, optional
+ **{'ASTM E313', 'ASTM D1925'}**,
+ Computation method.
+
+ Returns
+ -------
+ numeric or ndarray
+ *yellowness* :math:`Y`.
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
+ >>> yellowness(XYZ) # doctest: +ELLIPSIS
+ 11.0650000...
+ >>> method = 'ASTM D1925'
+ >>> yellowness(XYZ, method=method) # doctest: +ELLIPSIS
+ 10.2999999...
+ """
+
+ return YELLOWNESS_METHODS.get(method)(XYZ)
diff --git a/colour/constants/__init__.py b/colour/constants/__init__.py
index af8df511cc..2e4aedff7b 100644
--- a/colour/constants/__init__.py
+++ b/colour/constants/__init__.py
@@ -4,16 +4,12 @@
from __future__ import absolute_import
from .cie import CIE_E, CIE_K, K_M, KP_M
-from .codata import (
- AVOGADRO_CONSTANT,
- BOLTZMANN_CONSTANT,
- LIGHT_SPEED,
- PLANCK_CONSTANT)
+from .codata import (AVOGADRO_CONSTANT, BOLTZMANN_CONSTANT, LIGHT_SPEED,
+ PLANCK_CONSTANT)
from .common import FLOATING_POINT_NUMBER_PATTERN, INTEGER_THRESHOLD, EPSILON
__all__ = ['CIE_E', 'CIE_K', 'K_M', 'KP_M']
-__all__ += ['AVOGADRO_CONSTANT',
- 'BOLTZMANN_CONSTANT',
- 'LIGHT_SPEED',
- 'PLANCK_CONSTANT']
+__all__ += [
+ 'AVOGADRO_CONSTANT', 'BOLTZMANN_CONSTANT', 'LIGHT_SPEED', 'PLANCK_CONSTANT'
+]
__all__ += ['FLOATING_POINT_NUMBER_PATTERN', 'INTEGER_THRESHOLD', 'EPSILON']
diff --git a/colour/constants/cie.py b/colour/constants/cie.py
index 8a7f6a7c5b..24d3e3b6d7 100644
--- a/colour/constants/cie.py
+++ b/colour/constants/cie.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE Constants
=============
@@ -17,10 +16,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CIE_E',
- 'CIE_K',
- 'K_M',
- 'KP_M']
+__all__ = ['CIE_E', 'CIE_K', 'K_M', 'KP_M']
CIE_E = 216 / 24389
"""
diff --git a/colour/constants/codata.py b/colour/constants/codata.py
index 988d417392..627eceb36e 100644
--- a/colour/constants/codata.py
+++ b/colour/constants/codata.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Fundamental Physical Constants
==============================
@@ -18,10 +17,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['AVOGADRO_CONSTANT',
- 'BOLTZMANN_CONSTANT',
- 'LIGHT_SPEED',
- 'PLANCK_CONSTANT']
+__all__ = [
+ 'AVOGADRO_CONSTANT', 'BOLTZMANN_CONSTANT', 'LIGHT_SPEED', 'PLANCK_CONSTANT'
+]
AVOGADRO_CONSTANT = 6.02214179e23
"""
diff --git a/colour/constants/common.py b/colour/constants/common.py
index bd4d07afab..ba1e3aeeba 100644
--- a/colour/constants/common.py
+++ b/colour/constants/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Common Constants
================
@@ -10,6 +9,8 @@
from __future__ import division, unicode_literals
+import numpy as np
+
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
@@ -17,9 +18,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['FLOATING_POINT_NUMBER_PATTERN',
- 'INTEGER_THRESHOLD',
- 'EPSILON']
+__all__ = ['FLOATING_POINT_NUMBER_PATTERN', 'INTEGER_THRESHOLD', 'EPSILON']
FLOATING_POINT_NUMBER_PATTERN = '[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?'
"""
@@ -35,7 +34,7 @@
INTEGER_THRESHOLD : numeric
"""
-EPSILON = 1e-15
+EPSILON = np.finfo(np.float_).eps
"""
Default epsilon value for tolerance and singularities avoidance in various
computations.
diff --git a/colour/corresponding/__init__.py b/colour/corresponding/__init__.py
index a91d97f926..b3f2503962 100644
--- a/colour/corresponding/__init__.py
+++ b/colour/corresponding/__init__.py
@@ -5,19 +5,20 @@
from .dataset import * # noqa
from . import dataset
-from .prediction import (
- corresponding_chromaticities_prediction_CIE1994,
- corresponding_chromaticities_prediction_CMCCAT2000,
- corresponding_chromaticities_prediction_Fairchild1990,
- corresponding_chromaticities_prediction_VonKries,
- CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS,
- corresponding_chromaticities_prediction)
+from .prediction import (corresponding_chromaticities_prediction_CIE1994,
+ corresponding_chromaticities_prediction_CMCCAT2000,
+ corresponding_chromaticities_prediction_Fairchild1990,
+ corresponding_chromaticities_prediction_VonKries,
+ CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS,
+ corresponding_chromaticities_prediction)
__all__ = []
__all__ += dataset.__all__
-__all__ += ['corresponding_chromaticities_prediction_CIE1994',
- 'corresponding_chromaticities_prediction_CMCCAT2000',
- 'corresponding_chromaticities_prediction_Fairchild1990',
- 'corresponding_chromaticities_prediction_VonKries',
- 'CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS',
- 'corresponding_chromaticities_prediction']
+__all__ += [
+ 'corresponding_chromaticities_prediction_CIE1994',
+ 'corresponding_chromaticities_prediction_CMCCAT2000',
+ 'corresponding_chromaticities_prediction_Fairchild1990',
+ 'corresponding_chromaticities_prediction_VonKries',
+ 'CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS',
+ 'corresponding_chromaticities_prediction'
+]
diff --git a/colour/corresponding/dataset/__init__.py b/colour/corresponding/dataset/__init__.py
index 8c5e15e5a8..ee74bee4fb 100644
--- a/colour/corresponding/dataset/__init__.py
+++ b/colour/corresponding/dataset/__init__.py
@@ -4,8 +4,8 @@
from __future__ import absolute_import
from .corresponding_chromaticities import (
- BRENEMAN_EXPERIMENTS,
- BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES)
+ BRENEMAN_EXPERIMENTS, BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES)
-__all__ = ['BRENEMAN_EXPERIMENTS',
- 'BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES']
+__all__ = [
+ 'BRENEMAN_EXPERIMENTS', 'BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES'
+]
diff --git a/colour/corresponding/dataset/corresponding_chromaticities.py b/colour/corresponding/dataset/corresponding_chromaticities.py
index 9ffba4b476..2861210c07 100644
--- a/colour/corresponding/dataset/corresponding_chromaticities.py
+++ b/colour/corresponding/dataset/corresponding_chromaticities.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Breneman Corresponding Chromaticities Dataset
=============================================
@@ -34,27 +33,21 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['BrenemanExperimentResult',
- 'PrimariesChromaticityCoordinates',
- 'BRENEMAN_EXPERIMENT_1_RESULTS',
- 'BRENEMAN_EXPERIMENT_2_RESULTS',
- 'BRENEMAN_EXPERIMENT_3_RESULTS',
- 'BRENEMAN_EXPERIMENT_4_RESULTS',
- 'BRENEMAN_EXPERIMENT_5_RESULTS',
- 'BRENEMAN_EXPERIMENT_6_RESULTS',
- 'BRENEMAN_EXPERIMENT_7_RESULTS',
- 'BRENEMAN_EXPERIMENT_10_RESULTS',
- 'BRENEMAN_EXPERIMENT_8_RESULTS',
- 'BRENEMAN_EXPERIMENT_9_RESULTS',
- 'BRENEMAN_EXPERIMENT_11_RESULTS',
- 'BRENEMAN_EXPERIMENT_12_RESULTS',
- 'BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES',
- 'BRENEMAN_EXPERIMENTS']
+__all__ = [
+ 'BrenemanExperimentResult', 'PrimariesChromaticityCoordinates',
+ 'BRENEMAN_EXPERIMENT_1_RESULTS', 'BRENEMAN_EXPERIMENT_2_RESULTS',
+ 'BRENEMAN_EXPERIMENT_3_RESULTS', 'BRENEMAN_EXPERIMENT_4_RESULTS',
+ 'BRENEMAN_EXPERIMENT_5_RESULTS', 'BRENEMAN_EXPERIMENT_6_RESULTS',
+ 'BRENEMAN_EXPERIMENT_7_RESULTS', 'BRENEMAN_EXPERIMENT_10_RESULTS',
+ 'BRENEMAN_EXPERIMENT_8_RESULTS', 'BRENEMAN_EXPERIMENT_9_RESULTS',
+ 'BRENEMAN_EXPERIMENT_11_RESULTS', 'BRENEMAN_EXPERIMENT_12_RESULTS',
+ 'BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES', 'BRENEMAN_EXPERIMENTS'
+]
class BrenemanExperimentResult(
- namedtuple('BrenemanExperimentResult',
- ('name', 'uvp_t', 'uvp_m', 's_uvp', 'd_uvp_i', 'd_uvp_g'))):
+ namedtuple('BrenemanExperimentResult',
+ ('name', 'uvp_t', 'uvp_m', 's_uvp', 'd_uvp_i', 'd_uvp_g'))):
"""
Experiment result.
@@ -76,25 +69,28 @@ class BrenemanExperimentResult(
:math:`\delta_uv_g^p`.
"""
- def __new__(
- cls, name, uvp_t, uvp_m, s_uvp=None, d_uvp_i=None, d_uvp_g=None):
+ def __new__(cls,
+ name,
+ uvp_t,
+ uvp_m,
+ s_uvp=None,
+ d_uvp_i=None,
+ d_uvp_g=None):
"""
Returns a new instance of the :class:`BrenemanExperimentResult` class.
"""
return super(BrenemanExperimentResult, cls).__new__(
- cls,
- name,
+ cls, name,
np.array(uvp_t),
np.array(uvp_m),
- np.array(s_uvp),
- np.array(d_uvp_i),
- np.array(d_uvp_g))
+ np.array(s_uvp), np.array(d_uvp_i), np.array(d_uvp_g))
class PrimariesChromaticityCoordinates(
- namedtuple('PrimariesChromaticityCoordinates',
- ('experiment', 'illuminants', 'Y', 'P_uvp', 'D_uvp', 'T_uvp'))):
+ namedtuple('PrimariesChromaticityCoordinates',
+ ('experiment', 'illuminants', 'Y', 'P_uvp', 'D_uvp',
+ 'T_uvp'))):
"""
Chromaticity coordinates of primaries.
@@ -114,22 +110,25 @@ class PrimariesChromaticityCoordinates(
Chromaticity coordinates :math:`uv^p` of primary :math:`T`.
"""
- def __new__(
- cls, name, uvp_t, uvp_m, s_uvp=None, d_uvp_i=None, d_uvp_g=None):
+ def __new__(cls,
+ name,
+ uvp_t,
+ uvp_m,
+ s_uvp=None,
+ d_uvp_i=None,
+ d_uvp_g=None):
"""
Returns a new instance of the :class:`BrenemanExperimentResult` class.
"""
return super(PrimariesChromaticityCoordinates, cls).__new__(
- cls,
- name,
+ cls, name,
np.array(uvp_t),
np.array(uvp_m),
- np.array(s_uvp),
- np.array(d_uvp_i),
- np.array(d_uvp_g))
+ np.array(s_uvp), np.array(d_uvp_i), np.array(d_uvp_g))
+# yapf: disable
BRENEMAN_EXPERIMENT_1_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -170,6 +169,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.278, 0.456), (0.231, 0.365), (4, 25), (0, 2), (-5, 7)))
+# yapf: enable
"""
*Breneman (1987)* experiment 1 results.
@@ -182,6 +182,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_2_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -222,6 +223,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.258, 0.431), (0.244, 0.349), (4, 19), (-3, 13), (-4, 19)))
+# yapf: enable
"""
*Breneman (1987)* experiment 2 results.
@@ -234,6 +236,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_3_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -274,6 +277,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.258, 0.432), (0.238, 0.396), (4, 8), (5, 3), (4, -11)))
+# yapf: enable
"""
*Breneman (1987)* experiment 3 results.
@@ -286,6 +290,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_4_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -326,6 +331,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.278, 0.455), (0.229, 0.388), (6, 14), (1, 12), (3, 0)))
+# yapf: enable
"""
*Breneman (1987)* experiment 4 results.
@@ -338,6 +344,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_5_RESULTS = (
BrenemanExperimentResult(
'Gray',
@@ -375,6 +382,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.245, 0.364), (0.239, 0.401), (4, 16)))
+# yapf: enable
"""
*Breneman (1987)* experiment 5 results.
@@ -386,6 +394,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_6_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -426,6 +435,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.276, 0.456), (0.227, 0.369), (6, 27), (-2, 4), (-3, 9)))
+# yapf: enable
"""
*Breneman (1987)* experiment 6 results.
@@ -438,6 +448,7 @@ def __new__(
- Observers Count : 8
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_7_RESULTS = (
BrenemanExperimentResult(
'Gray',
@@ -475,6 +486,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.245, 0.365), (0.240, 0.398), (4, 10)))
+# yapf: enable
"""
*Breneman (1987)* experiment 7 results.
@@ -486,6 +498,7 @@ def __new__(
- Observers Count : 8
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_8_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -526,6 +539,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.277, 0.454), (0.226, 0.389), (4, 10), (1, 4), (1, -8)))
+# yapf: enable
"""
*Breneman (1987)* experiment 8 results.
@@ -538,6 +552,7 @@ def __new__(
- Observers Count : 8
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_9_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -599,6 +614,7 @@ def __new__(
BrenemanExperimentResult(
'(Purple)h',
(0.277, 0.456), (0.236, 0.422), (6, 11), None, (-2, -29)))
+# yapf: enable
"""
*Breneman (1987)* experiment 9 results.
@@ -613,6 +629,7 @@ def __new__(
luminescence level of the lighter colors.
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_10_RESULTS = (
BrenemanExperimentResult(
'Gray',
@@ -650,6 +667,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.245, 0.366), (0.240, 0.402), (3, 12)))
+# yapf: enable
"""
*Breneman (1987)* experiment 10 results.
@@ -661,6 +679,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_11_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -701,6 +720,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.245, 0.366), (0.216, 0.419), (4, 13), (-3, 8), (4, -2)))
+# yapf: enable
"""
*Breneman (1987)* experiment 1 results.
@@ -713,6 +733,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENT_12_RESULTS = (
BrenemanExperimentResult(
'Illuminant',
@@ -753,6 +774,7 @@ def __new__(
BrenemanExperimentResult(
'Purple',
(0.246, 0.366), (0.222, 0.404), (5, 15), (-4, 2), (4, 2)))
+# yapf: enable
"""
*Breneman (1987)* experiment 12 results.
@@ -765,6 +787,7 @@ def __new__(
- Observers Count : 7
"""
+# yapf: disable
BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES = {
1: PrimariesChromaticityCoordinates(
1, ('A', 'D65'), 1500,
@@ -793,6 +816,7 @@ def __new__(
12: PrimariesChromaticityCoordinates(
12, ('D55', 'green'), 75,
(0.661, 0.505), (0.039, 0.598), (0.345, 0.127))}
+# yapf: enable
"""
*Breneman (1987)* experiments primaries chromaticities.
@@ -811,7 +835,8 @@ def __new__(
9: BRENEMAN_EXPERIMENT_9_RESULTS,
10: BRENEMAN_EXPERIMENT_10_RESULTS,
11: BRENEMAN_EXPERIMENT_11_RESULTS,
- 12: BRENEMAN_EXPERIMENT_12_RESULTS}
+ 12: BRENEMAN_EXPERIMENT_12_RESULTS
+}
"""
*Breneman (1987)* experiments.
diff --git a/colour/corresponding/prediction.py b/colour/corresponding/prediction.py
index f8c30e5353..962be19118 100644
--- a/colour/corresponding/prediction.py
+++ b/colour/corresponding/prediction.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Corresponding Chromaticities Prediction
=======================================
@@ -26,19 +25,12 @@
from collections import namedtuple
from colour.adaptation import (
- chromatic_adaptation_CIE1994,
- chromatic_adaptation_CMCCAT2000,
- chromatic_adaptation_Fairchild1990,
- chromatic_adaptation_VonKries)
+ chromatic_adaptation_CIE1994, chromatic_adaptation_CMCCAT2000,
+ chromatic_adaptation_Fairchild1990, chromatic_adaptation_VonKries)
from colour.corresponding import (
- BRENEMAN_EXPERIMENTS,
- BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES)
-from colour.models import (
- Luv_to_uv,
- Luv_uv_to_xy,
- XYZ_to_Luv,
- XYZ_to_xy,
- xy_to_XYZ)
+ BRENEMAN_EXPERIMENTS, BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES)
+from colour.models import (Luv_to_uv, Luv_uv_to_xy, XYZ_to_Luv, XYZ_to_xy,
+ xy_to_XYZ)
from colour.utilities import CaseInsensitiveMapping, filter_kwargs
__author__ = 'Colour Developers'
@@ -48,18 +40,20 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CorrespondingChromaticitiesPrediction',
- 'corresponding_chromaticities_prediction_CIE1994',
- 'corresponding_chromaticities_prediction_CMCCAT2000',
- 'corresponding_chromaticities_prediction_Fairchild1990',
- 'corresponding_chromaticities_prediction_VonKries',
- 'CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS',
- 'corresponding_chromaticities_prediction']
+__all__ = [
+ 'CorrespondingChromaticitiesPrediction',
+ 'corresponding_chromaticities_prediction_CIE1994',
+ 'corresponding_chromaticities_prediction_CMCCAT2000',
+ 'corresponding_chromaticities_prediction_Fairchild1990',
+ 'corresponding_chromaticities_prediction_VonKries',
+ 'CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS',
+ 'corresponding_chromaticities_prediction'
+]
class CorrespondingChromaticitiesPrediction(
- namedtuple('CorrespondingChromaticitiesPrediction',
- ('name', 'uvp_t', 'uvp_m', 'uvp_p'))):
+ namedtuple('CorrespondingChromaticitiesPrediction',
+ ('name', 'uvp_t', 'uvp_m', 'uvp_p'))):
"""
Defines a chromatic adaptation model prediction.
@@ -119,20 +113,17 @@ def corresponding_chromaticities_prediction_CIE1994(experiment=1):
xy_o2 = Luv_uv_to_xy(illuminants.uvp_m)
# :math:`Y_o` is set to an arbitrary value in domain [18, 100].
Y_o = 18
- E_o1 = E_o2 = BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES[
- experiment].Y
+ E_o1 = E_o2 = BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES[experiment].Y
prediction = []
for result in experiment_results:
XYZ_1 = xy_to_XYZ(Luv_uv_to_xy(result.uvp_t)) * 100
- XYZ_2 = chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)
+ XYZ_2 = chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1,
+ E_o2)
uvp = Luv_to_uv(XYZ_to_Luv(XYZ_2, xy_o2), xy_o2)
- prediction.append(CorrespondingChromaticitiesPrediction(
- result.name,
- result.uvp_t,
- result.uvp_m,
- uvp))
+ prediction.append(
+ CorrespondingChromaticitiesPrediction(result.name, result.uvp_t,
+ result.uvp_m, uvp))
return tuple(prediction)
@@ -179,20 +170,17 @@ def corresponding_chromaticities_prediction_CMCCAT2000(experiment=1):
XYZ_w = xy_to_XYZ(Luv_uv_to_xy(illuminants.uvp_t)) * 100
XYZ_wr = xy_to_XYZ(Luv_uv_to_xy(illuminants.uvp_m)) * 100
xy_wr = XYZ_to_xy(XYZ_wr)
- L_A1 = L_A2 = BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES[
- experiment].Y
+ L_A1 = L_A2 = BRENEMAN_EXPERIMENTS_PRIMARIES_CHROMATICITIES[experiment].Y
prediction = []
for result in experiment_results:
XYZ_1 = xy_to_XYZ(Luv_uv_to_xy(result.uvp_t)) * 100
- XYZ_2 = chromatic_adaptation_CMCCAT2000(
- XYZ_1, XYZ_w, XYZ_wr, L_A1, L_A2)
+ XYZ_2 = chromatic_adaptation_CMCCAT2000(XYZ_1, XYZ_w, XYZ_wr, L_A1,
+ L_A2)
uvp = Luv_to_uv(XYZ_to_Luv(XYZ_2, xy_wr), xy_wr)
- prediction.append(CorrespondingChromaticitiesPrediction(
- result.name,
- result.uvp_t,
- result.uvp_m,
- uvp))
+ prediction.append(
+ CorrespondingChromaticitiesPrediction(result.name, result.uvp_t,
+ result.uvp_m, uvp))
return tuple(prediction)
@@ -244,14 +232,11 @@ def corresponding_chromaticities_prediction_Fairchild1990(experiment=1):
prediction = []
for result in experiment_results:
XYZ_1 = xy_to_XYZ(Luv_uv_to_xy(result.uvp_t)) * 100
- XYZ_2 = chromatic_adaptation_Fairchild1990(
- XYZ_1, XYZ_n, XYZ_r, Y_n)
+ XYZ_2 = chromatic_adaptation_Fairchild1990(XYZ_1, XYZ_n, XYZ_r, Y_n)
uvp = Luv_to_uv(XYZ_to_Luv(XYZ_2, xy_r), xy_r)
- prediction.append(CorrespondingChromaticitiesPrediction(
- result.name,
- result.uvp_t,
- result.uvp_m,
- uvp))
+ prediction.append(
+ CorrespondingChromaticitiesPrediction(result.name, result.uvp_t,
+ result.uvp_m, uvp))
return tuple(prediction)
@@ -310,21 +295,19 @@ def corresponding_chromaticities_prediction_VonKries(experiment=1,
XYZ_1 = xy_to_XYZ(Luv_uv_to_xy(result.uvp_t))
XYZ_2 = chromatic_adaptation_VonKries(XYZ_1, XYZ_w, XYZ_wr, transform)
uvp = Luv_to_uv(XYZ_to_Luv(XYZ_2, xy_wr), xy_wr)
- prediction.append(CorrespondingChromaticitiesPrediction(
- result.name,
- result.uvp_t,
- result.uvp_m,
- uvp))
+ prediction.append(
+ CorrespondingChromaticitiesPrediction(result.name, result.uvp_t,
+ result.uvp_m, uvp))
return tuple(prediction)
-CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS = CaseInsensitiveMapping(
- {'CIE 1994': corresponding_chromaticities_prediction_CIE1994,
- 'CMCCAT2000': corresponding_chromaticities_prediction_CMCCAT2000,
- 'Fairchild 1990': corresponding_chromaticities_prediction_Fairchild1990,
- 'Von Kries': corresponding_chromaticities_prediction_VonKries})
-
+CORRESPONDING_CHROMATICITIES_PREDICTION_MODELS = CaseInsensitiveMapping({
+ 'CIE 1994': corresponding_chromaticities_prediction_CIE1994,
+ 'CMCCAT2000': corresponding_chromaticities_prediction_CMCCAT2000,
+ 'Fairchild 1990': corresponding_chromaticities_prediction_Fairchild1990,
+ 'Von Kries': corresponding_chromaticities_prediction_VonKries
+})
"""
Aggregated corresponding chromaticities prediction models.
diff --git a/colour/corresponding/tests/tests_prediction.py b/colour/corresponding/tests/tests_prediction.py
index 0698a7713f..d5ae1a9ee6 100644
--- a/colour/corresponding/tests/tests_prediction.py
+++ b/colour/corresponding/tests/tests_prediction.py
@@ -1,6 +1,5 @@
# !/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.corresponding.prediction` module.
"""
@@ -23,70 +22,72 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['VONKRIES_PREDICTION_DATA',
- 'CIE1994_PREDICTION_DATA',
- 'CMCCAT2000_PREDICTION_DATA',
- 'FAIRCHILD1990_PREDICTION_DATA',
- 'TestCorrespondingChromaticitiesPredictionVonKries',
- 'TestCorrespondingChromaticitiesPredictionCIE1994',
- 'TestCorrespondingChromaticitiesPredictionCMCCAT2000',
- 'TestCorrespondingChromaticitiesPredictionFairchild1990']
-
-VONKRIES_PREDICTION_DATA = np.array([
- [(0.199, 0.487), (0.199994235295863, 0.470596132542110)],
- [(0.420, 0.509), (0.414913855668385, 0.503766204685646)],
- [(0.249, 0.497), (0.244202332779817, 0.483154861151019)],
- [(0.302, 0.548), (0.307287743499555, 0.543174463393956)],
- [(0.290, 0.537), (0.294129765202449, 0.531627707350365)],
- [(0.257, 0.554), (0.261399171975815, 0.549476532253197)],
- [(0.192, 0.529), (0.199113248438711, 0.512769667764083)],
- [(0.129, 0.521), (0.142266217705415, 0.499812542997584)],
- [(0.133, 0.469), (0.138134593378073, 0.443768079552099)],
- [(0.158, 0.340), (0.154188271421900, 0.338322678880046)],
- [(0.178, 0.426), (0.175297924104065, 0.404343935551269)],
- [(0.231, 0.365), (0.213004721499844, 0.354595262694384)]])
-
-CIE1994_PREDICTION_DATA = np.array([
- [(0.199, 0.487), (0.215767890780959, 0.498895367826280)],
- [(0.420, 0.509), (0.410267748469504, 0.513821531425251)],
- [(0.249, 0.497), (0.260571497362321, 0.505148168687439)],
- [(0.302, 0.548), (0.311801622971574, 0.544064249771824)],
- [(0.290, 0.537), (0.301614668967021, 0.535375706603034)],
- [(0.257, 0.554), (0.269684273997378, 0.549604431199331)],
- [(0.192, 0.529), (0.212643185166644, 0.525635424809257)],
- [(0.129, 0.521), (0.152356526399028, 0.519785490832987)],
- [(0.133, 0.469), (0.144776887283650, 0.484297760360214)],
- [(0.158, 0.340), (0.158080133044082, 0.408581420625705)],
- [(0.178, 0.426), (0.189260852492846, 0.456756636791417)],
- [(0.231, 0.365), (0.239473218525016, 0.420497483443809)]])
-
-CMCCAT2000_PREDICTION_DATA = np.array([
- [(0.199, 0.487), (0.200011273633451, 0.470539230354398)],
- [(0.420, 0.509), (0.407637147823942, 0.504672206472439)],
- [(0.249, 0.497), (0.243303933122086, 0.483443483088972)],
- [(0.302, 0.548), (0.302738872704423, 0.542771391372065)],
- [(0.290, 0.537), (0.290517242292583, 0.531547633697717)],
- [(0.257, 0.554), (0.258674719568568, 0.548764239788161)],
- [(0.192, 0.529), (0.198993053394577, 0.512765194539863)],
- [(0.129, 0.521), (0.143324176185281, 0.499673343018787)],
- [(0.133, 0.469), (0.138424584031183, 0.442678688047099)],
- [(0.158, 0.340), (0.153353027792519, 0.330121253315695)],
- [(0.178, 0.426), (0.175382057838771, 0.401725889182425)],
- [(0.231, 0.365), (0.213770919959778, 0.348685954116193)]])
-
-FAIRCHILD1990_PREDICTION_DATA = np.array([
- [(0.199, 0.487), (0.200554934448681, 0.470155699619516)],
- [(0.420, 0.509), (0.389214449896027, 0.514002881379267)],
- [(0.249, 0.497), (0.241570029196649, 0.486033850388237)],
- [(0.302, 0.548), (0.290619228590390, 0.550282593092481)],
- [(0.290, 0.537), (0.280611339160018, 0.538348403477048)],
- [(0.257, 0.554), (0.248379871541202, 0.555741679220336)],
- [(0.192, 0.529), (0.194404361202511, 0.515869077684087)],
- [(0.129, 0.521), (0.139197382975043, 0.499578426956623)],
- [(0.133, 0.469), (0.140948349615191, 0.436038790232095)],
- [(0.158, 0.340), (0.170240154737059, 0.311121250518367)],
- [(0.178, 0.426), (0.184104505156227, 0.393143101221379)],
- [(0.231, 0.365), (0.229252692804442, 0.338033995795458)]])
+__all__ = [
+ 'VONKRIES_PREDICTION_DATA', 'CIE1994_PREDICTION_DATA',
+ 'CMCCAT2000_PREDICTION_DATA', 'FAIRCHILD1990_PREDICTION_DATA',
+ 'TestCorrespondingChromaticitiesPredictionVonKries',
+ 'TestCorrespondingChromaticitiesPredictionCIE1994',
+ 'TestCorrespondingChromaticitiesPredictionCMCCAT2000',
+ 'TestCorrespondingChromaticitiesPredictionFairchild1990'
+]
+
+# yapf: disable
+VONKRIES_PREDICTION_DATA = np.array(
+ [[(0.199, 0.487), (0.199994235295863, 0.470596132542110)],
+ [(0.420, 0.509), (0.414913855668385, 0.503766204685646)],
+ [(0.249, 0.497), (0.244202332779817, 0.483154861151019)],
+ [(0.302, 0.548), (0.307287743499555, 0.543174463393956)],
+ [(0.290, 0.537), (0.294129765202449, 0.531627707350365)],
+ [(0.257, 0.554), (0.261399171975815, 0.549476532253197)],
+ [(0.192, 0.529), (0.199113248438711, 0.512769667764083)],
+ [(0.129, 0.521), (0.142266217705415, 0.499812542997584)],
+ [(0.133, 0.469), (0.138134593378073, 0.443768079552099)],
+ [(0.158, 0.340), (0.154188271421900, 0.338322678880046)],
+ [(0.178, 0.426), (0.175297924104065, 0.404343935551269)],
+ [(0.231, 0.365), (0.213004721499844, 0.354595262694384)]])
+
+CIE1994_PREDICTION_DATA = np.array(
+ [[(0.199, 0.487), (0.215767890780959, 0.498895367826280)],
+ [(0.420, 0.509), (0.410267748469504, 0.513821531425251)],
+ [(0.249, 0.497), (0.260571497362321, 0.505148168687439)],
+ [(0.302, 0.548), (0.311801622971574, 0.544064249771824)],
+ [(0.290, 0.537), (0.301614668967021, 0.535375706603034)],
+ [(0.257, 0.554), (0.269684273997378, 0.549604431199331)],
+ [(0.192, 0.529), (0.212643185166644, 0.525635424809257)],
+ [(0.129, 0.521), (0.152356526399028, 0.519785490832987)],
+ [(0.133, 0.469), (0.144776887283650, 0.484297760360214)],
+ [(0.158, 0.340), (0.158080133044082, 0.408581420625705)],
+ [(0.178, 0.426), (0.189260852492846, 0.456756636791417)],
+ [(0.231, 0.365), (0.239473218525016, 0.420497483443809)]])
+
+CMCCAT2000_PREDICTION_DATA = np.array(
+ [[(0.199, 0.487), (0.200011273633451, 0.470539230354398)],
+ [(0.420, 0.509), (0.407637147823942, 0.504672206472439)],
+ [(0.249, 0.497), (0.243303933122086, 0.483443483088972)],
+ [(0.302, 0.548), (0.302738872704423, 0.542771391372065)],
+ [(0.290, 0.537), (0.290517242292583, 0.531547633697717)],
+ [(0.257, 0.554), (0.258674719568568, 0.548764239788161)],
+ [(0.192, 0.529), (0.198993053394577, 0.512765194539863)],
+ [(0.129, 0.521), (0.143324176185281, 0.499673343018787)],
+ [(0.133, 0.469), (0.138424584031183, 0.442678688047099)],
+ [(0.158, 0.340), (0.153353027792519, 0.330121253315695)],
+ [(0.178, 0.426), (0.175382057838771, 0.401725889182425)],
+ [(0.231, 0.365), (0.213770919959778, 0.348685954116193)]])
+
+FAIRCHILD1990_PREDICTION_DATA = np.array(
+ [[(0.199, 0.487), (0.200554934448681, 0.470155699619516)],
+ [(0.420, 0.509), (0.389214449896027, 0.514002881379267)],
+ [(0.249, 0.497), (0.241570029196649, 0.486033850388237)],
+ [(0.302, 0.548), (0.290619228590390, 0.550282593092481)],
+ [(0.290, 0.537), (0.280611339160018, 0.538348403477048)],
+ [(0.257, 0.554), (0.248379871541202, 0.555741679220336)],
+ [(0.192, 0.529), (0.194404361202511, 0.515869077684087)],
+ [(0.129, 0.521), (0.139197382975043, 0.499578426956623)],
+ [(0.133, 0.469), (0.140948349615191, 0.436038790232095)],
+ [(0.158, 0.340), (0.170240154737059, 0.311121250518367)],
+ [(0.178, 0.426), (0.184104505156227, 0.393143101221379)],
+ [(0.231, 0.365), (0.229252692804442, 0.338033995795458)]])
+# yapf: enable
class TestCorrespondingChromaticitiesPredictionVonKries(unittest.TestCase):
@@ -103,9 +104,9 @@ def test_corresponding_chromaticities_prediction_VonKries(self):
"""
np.testing.assert_almost_equal(
- np.array([(p.uvp_m, p.uvp_p)
- for p in
- corresponding_chromaticities_prediction_VonKries()]),
+ np.array(
+ [(p.uvp_m, p.uvp_p)
+ for p in corresponding_chromaticities_prediction_VonKries()]),
VONKRIES_PREDICTION_DATA,
decimal=7)
@@ -123,9 +124,9 @@ def test_corresponding_chromaticities_prediction_CIE1994(self):
"""
np.testing.assert_almost_equal(
- np.array([(p.uvp_m, p.uvp_p)
- for p in
- corresponding_chromaticities_prediction_CIE1994()]),
+ np.array(
+ [(p.uvp_m, p.uvp_p)
+ for p in corresponding_chromaticities_prediction_CIE1994()]),
CIE1994_PREDICTION_DATA,
decimal=7)
@@ -144,15 +145,16 @@ def test_corresponding_chromaticities_prediction_CMCCAT2000(self):
"""
np.testing.assert_almost_equal(
- np.array([(p.uvp_m, p.uvp_p)
- for p in
- corresponding_chromaticities_prediction_CMCCAT2000()]),
+ np.array([
+ (p.uvp_m, p.uvp_p)
+ for p in corresponding_chromaticities_prediction_CMCCAT2000()
+ ]),
CMCCAT2000_PREDICTION_DATA,
decimal=7)
class TestCorrespondingChromaticitiesPredictionFairchild1990(
- unittest.TestCase): # noqa
+ unittest.TestCase): # noqa
"""
Defines :func:`colour.corresponding.prediction.\
corresponding_chromaticities_prediction_Fairchild1990` definition unit tests
diff --git a/colour/difference/__init__.py b/colour/difference/__init__.py
index 2a2eb03b4a..ae8d2b6a45 100644
--- a/colour/difference/__init__.py
+++ b/colour/difference/__init__.py
@@ -3,24 +3,13 @@
from __future__ import absolute_import
-from .delta_e import (
- DELTA_E_METHODS,
- delta_E,
- delta_E_CIE1976,
- delta_E_CIE1994,
- delta_E_CIE2000,
- delta_E_CMC)
-from .delta_e_luo2006 import (
- delta_E_CAM02LCD,
- delta_E_CAM02SCD,
- delta_E_CAM02UCS)
+from .delta_e import (DELTA_E_METHODS, delta_E, delta_E_CIE1976,
+ delta_E_CIE1994, delta_E_CIE2000, delta_E_CMC)
+from .delta_e_luo2006 import (delta_E_CAM02LCD, delta_E_CAM02SCD,
+ delta_E_CAM02UCS)
-__all__ = ['DELTA_E_METHODS',
- 'delta_E',
- 'delta_E_CIE1976',
- 'delta_E_CIE1994',
- 'delta_E_CIE2000',
- 'delta_E_CMC']
-__all__ += ['delta_E_CAM02LCD',
- 'delta_E_CAM02SCD',
- 'delta_E_CAM02UCS']
+__all__ = [
+ 'DELTA_E_METHODS', 'delta_E', 'delta_E_CIE1976', 'delta_E_CIE1994',
+ 'delta_E_CIE2000', 'delta_E_CMC'
+]
+__all__ += ['delta_E_CAM02LCD', 'delta_E_CAM02SCD', 'delta_E_CAM02UCS']
diff --git a/colour/difference/delta_e.py b/colour/difference/delta_e.py
index c164d1a885..e18995c0cc 100644
--- a/colour/difference/delta_e.py
+++ b/colour/difference/delta_e.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
:math:`\Delta E_{ab}` - Delta E Colour Difference
=================================================
@@ -40,12 +39,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['delta_E_CIE1976',
- 'delta_E_CIE1994',
- 'delta_E_CIE2000',
- 'delta_E_CMC',
- 'DELTA_E_METHODS',
- 'delta_E']
+__all__ = [
+ 'delta_E_CIE1976', 'delta_E_CIE1994', 'delta_E_CIE2000', 'delta_E_CMC',
+ 'DELTA_E_METHODS', 'delta_E'
+]
def delta_E_CIE1976(Lab_1, Lab_2):
@@ -250,9 +247,9 @@ def delta_E_CIE2000(Lab_1, Lab_2, textiles=False):
h_1_prime = np.degrees(np.arctan2(b_1, a_1_prime)) % 360
h_2_prime = np.degrees(np.arctan2(b_2, a_2_prime)) % 360
- h_bar_prime = np.where(np.fabs(h_1_prime - h_2_prime) <= 180,
- 0.5 * (h_1_prime + h_2_prime),
- (0.5 * (h_1_prime + h_2_prime + 360)))
+ h_bar_prime = np.where(
+ np.fabs(h_1_prime - h_2_prime) <= 180, 0.5 * (h_1_prime + h_2_prime),
+ (0.5 * (h_1_prime + h_2_prime + 360)))
t = (1 - 0.17 * np.cos(np.deg2rad(h_bar_prime - 30)) +
0.24 * np.cos(np.deg2rad(2 * h_bar_prime)) +
@@ -268,8 +265,9 @@ def delta_E_CIE2000(Lab_1, Lab_2, textiles=False):
delta_H_prime = (2 * np.sqrt(c_1_prime * c_2_prime) *
np.sin(np.deg2rad(0.5 * delta_h_prime)))
- s_L = 1 + ((0.015 * (l_bar_prime - 50) * (l_bar_prime - 50)) /
- np.sqrt(20 + (l_bar_prime - 50) * (l_bar_prime - 50)))
+ s_L = 1 + ((0.015 * (l_bar_prime - 50) *
+ (l_bar_prime - 50)) / np.sqrt(20 + (l_bar_prime - 50) *
+ (l_bar_prime - 50)))
s_C = 1 + 0.045 * c_bar_prime
s_H = 1 + 0.015 * c_bar_prime * t
@@ -281,11 +279,9 @@ def delta_E_CIE2000(Lab_1, Lab_2, textiles=False):
r_C = np.sqrt(c_bar_prime7 / (c_bar_prime7 + 25 ** 7))
r_T = -2 * r_C * np.sin(np.deg2rad(2 * delta_theta))
- d_E = np.sqrt(
- (delta_L_prime / (k_L * s_L)) ** 2 +
- (delta_C_prime / (k_C * s_C)) ** 2 +
- (delta_H_prime / (k_H * s_H)) ** 2 +
- (delta_C_prime / (k_C * s_C)) * (delta_H_prime / (k_H * s_H)) * r_T)
+ d_E = np.sqrt((delta_L_prime / (k_L * s_L)) ** 2 + (delta_C_prime / (
+ k_C * s_C)) ** 2 + (delta_H_prime / (k_H * s_H)) ** 2 + (
+ delta_C_prime / (k_C * s_C)) * (delta_H_prime / (k_H * s_H)) * r_T)
return d_E
@@ -338,9 +334,10 @@ def delta_E_CMC(Lab_1, Lab_2, l=2, c=1):
s_c = 0.0638 * c_1 / (1 + 0.0131 * c_1) + 0.638
h_1 = np.degrees(np.arctan2(b_1, a_1)) % 360
- t = np.where(np.logical_and(h_1 >= 164, h_1 <= 345),
- 0.56 + np.fabs(0.2 * np.cos(np.deg2rad(h_1 + 168))),
- 0.36 + np.fabs(0.4 * np.cos(np.deg2rad(h_1 + 35))))
+ t = np.where(
+ np.logical_and(h_1 >= 164, h_1 <= 345),
+ 0.56 + np.fabs(0.2 * np.cos(np.deg2rad(h_1 + 168))),
+ 0.36 + np.fabs(0.4 * np.cos(np.deg2rad(h_1 + 35))))
c_4 = c_1 * c_1 * c_1 * c_1
f = np.sqrt(c_4 / (c_4 + 1900))
@@ -361,11 +358,12 @@ def delta_E_CMC(Lab_1, Lab_2, l=2, c=1):
return d_E
-DELTA_E_METHODS = CaseInsensitiveMapping(
- {'CIE 1976': delta_E_CIE1976,
- 'CIE 1994': delta_E_CIE1994,
- 'CIE 2000': delta_E_CIE2000,
- 'CMC': delta_E_CMC})
+DELTA_E_METHODS = CaseInsensitiveMapping({
+ 'CIE 1976': delta_E_CIE1976,
+ 'CIE 1994': delta_E_CIE1994,
+ 'CIE 2000': delta_E_CIE2000,
+ 'CMC': delta_E_CMC
+})
"""
Supported *Delta E* computations methods.
diff --git a/colour/difference/delta_e_luo2006.py b/colour/difference/delta_e_luo2006.py
index 0ffb089b1e..eec6859e1a 100644
--- a/colour/difference/delta_e_luo2006.py
+++ b/colour/difference/delta_e_luo2006.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
:math:`\Delta E'` - Delta E Colour Difference - Luo, Cui and Li (2006)
======================================================================
@@ -41,28 +40,28 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['delta_E_Luo2006',
- 'delta_E_CAM02LCD',
- 'delta_E_CAM02SCD',
- 'delta_E_CAM02UCS']
+__all__ = [
+ 'delta_E_Luo2006', 'delta_E_CAM02LCD', 'delta_E_CAM02SCD',
+ 'delta_E_CAM02UCS'
+]
def delta_E_Luo2006(Jpapbp_1, Jpapbp_2, coefficients):
"""
Returns the difference :math:`\Delta E'` between two given
- *Luo et al. (2016)* *CAM02-LCD*, *CAM02-SCD*, or *CAM02-UCS* colourspaces
+ *Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, or *CAM02-UCS* colourspaces
:math:`J'a'b'` arrays.
Parameters
----------
Jpapbp_1 : array_like
- Standard / reference *Luo et al.* (2016) *CAM02-LCD*, *CAM02-SCD*, or
+ Standard / reference *Luo et al.* (2006) *CAM02-LCD*, *CAM02-SCD*, or
*CAM02-UCS* colourspaces :math:`J'a'b'` array.
Jpapbp_2 : array_like
- Sample / test *Luo et al. (2016)* *CAM02-LCD*, *CAM02-SCD*, or
+ Sample / test *Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, or
*CAM02-UCS* colourspaces :math:`J'a'b'` array.
coefficients : array_like
- Coefficients of one of the *Luo et al. (2016)* *CAM02-LCD*,
+ Coefficients of one of the *Luo et al. (2006)* *CAM02-LCD*,
*CAM02-SCD*, or *CAM02-UCS* colourspaces.
Returns
@@ -83,8 +82,7 @@ def delta_E_Luo2006(Jpapbp_1, Jpapbp_2, coefficients):
J_p_2, a_p_2, b_p_2 = tsplit(Jpapbp_2)
K_L, c_1_, c_2_ = tsplit(coefficients)
- d_E = np.sqrt(((J_p_1 - J_p_2) / K_L) ** 2 +
- (a_p_1 - a_p_2) ** 2 +
+ d_E = np.sqrt(((J_p_1 - J_p_2) / K_L) ** 2 + (a_p_1 - a_p_2) ** 2 +
(b_p_1 - b_p_2) ** 2)
return d_E
@@ -92,15 +90,15 @@ def delta_E_Luo2006(Jpapbp_1, Jpapbp_2, coefficients):
def delta_E_CAM02LCD(Jpapbp_1, Jpapbp_2):
"""
Returns the difference :math:`\Delta E'` between two given
- *Luo et al. (2016)* *CAM02-LCD* colourspaces :math:`J'a'b'` arrays.
+ *Luo et al. (2006)* *CAM02-LCD* colourspaces :math:`J'a'b'` arrays.
Parameters
----------
Jpapbp_1 : array_like
- Standard / reference *Luo et al.* (2016) *CAM02-LCD* colourspaces
+ Standard / reference *Luo et al.* (2006) *CAM02-LCD* colourspaces
:math:`J'a'b'` array.
Jpapbp_2 : array_like
- Sample / test *Luo et al.* (2016) *CAM02-LCD* colourspaces
+ Sample / test *Luo et al.* (2006) *CAM02-LCD* colourspaces
:math:`J'a'b'` array.
Returns
@@ -115,22 +113,22 @@ def delta_E_CAM02LCD(Jpapbp_1, Jpapbp_2):
>>> delta_E_CAM02LCD(Jpapbp_1, Jpapbp_2) # doctest: +ELLIPSIS
0.0001034...
"""
- return delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
+ return delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
def delta_E_CAM02SCD(Jpapbp_1, Jpapbp_2):
"""
Returns the difference :math:`\Delta E'` between two given
- *Luo et al. (2016)* *CAM02-SCD* colourspaces :math:`J'a'b'` arrays.
+ *Luo et al. (2006)* *CAM02-SCD* colourspaces :math:`J'a'b'` arrays.
Parameters
----------
Jpapbp_1 : array_like
- Standard / reference *Luo et al.* (2016) *CAM02-SCD* colourspaces
+ Standard / reference *Luo et al.* (2006) *CAM02-SCD* colourspaces
:math:`J'a'b'` array.
Jpapbp_2 : array_like
- Sample / test *Luo et al.* (2016) *CAM02-SCD* colourspaces
+ Sample / test *Luo et al.* (2006) *CAM02-SCD* colourspaces
:math:`J'a'b'` array.
Returns
@@ -145,22 +143,22 @@ def delta_E_CAM02SCD(Jpapbp_1, Jpapbp_2):
>>> delta_E_CAM02SCD(Jpapbp_1, Jpapbp_2) # doctest: +ELLIPSIS
0.0001034...
"""
- return delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-SCD'])
+ return delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-SCD'])
def delta_E_CAM02UCS(Jpapbp_1, Jpapbp_2):
"""
Returns the difference :math:`\Delta E'` between two given
- *Luo et al. (2016)* *CAM02-UCS* colourspaces :math:`J'a'b'` arrays.
+ *Luo et al. (2006)* *CAM02-UCS* colourspaces :math:`J'a'b'` arrays.
Parameters
----------
Jpapbp_1 : array_like
- Standard / reference *Luo et al.* (2016) *CAM02-UCS* colourspaces
+ Standard / reference *Luo et al.* (2006) *CAM02-UCS* colourspaces
:math:`J'a'b'` array.
Jpapbp_2 : array_like
- Sample / test *Luo et al.* (2016) *CAM02-UCS* colourspaces
+ Sample / test *Luo et al.* (2006) *CAM02-UCS* colourspaces
:math:`J'a'b'` array.
Returns
@@ -175,5 +173,5 @@ def delta_E_CAM02UCS(Jpapbp_1, Jpapbp_2):
>>> delta_E_CAM02UCS(Jpapbp_1, Jpapbp_2) # doctest: +ELLIPSIS
0.0001034...
"""
- return delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-UCS'])
+ return delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-UCS'])
diff --git a/colour/difference/tests/tests_delta_e.py b/colour/difference/tests/tests_delta_e.py
index ebd6084819..82ee8b3bae 100644
--- a/colour/difference/tests/tests_delta_e.py
+++ b/colour/difference/tests/tests_delta_e.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.difference.delta_e` module.
"""
@@ -11,11 +10,8 @@
import unittest
from itertools import permutations
-from colour.difference import (
- delta_E_CIE1976,
- delta_E_CIE1994,
- delta_E_CIE2000,
- delta_E_CMC)
+from colour.difference import (delta_E_CIE1976, delta_E_CIE1994,
+ delta_E_CIE2000, delta_E_CMC)
from colour.algebra import euclidean_distance
from colour.utilities import ignore_numpy_errors
@@ -27,10 +23,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestDelta_E_CIE1976',
- 'TestDelta_E_CIE1994',
- 'TestDelta_E_CIE2000',
- 'TestDelta_E_CMC']
+__all__ = [
+ 'TestDelta_E_CIE1976', 'TestDelta_E_CIE1994', 'TestDelta_E_CIE2000',
+ 'TestDelta_E_CMC'
+]
class TestDelta_E_CIE1976(unittest.TestCase):
@@ -144,25 +140,19 @@ def test_n_dimensional_delta_E_CIE1994(self):
Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835])
delta_E = 83.779225500887094
np.testing.assert_almost_equal(
- delta_E_CIE1994(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE1994(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.tile(Lab_1, (6, 1))
Lab_2 = np.tile(Lab_2, (6, 1))
delta_E = np.tile(delta_E, 6)
np.testing.assert_almost_equal(
- delta_E_CIE1994(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE1994(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.reshape(Lab_1, (2, 3, 3))
Lab_2 = np.reshape(Lab_2, (2, 3, 3))
delta_E = np.reshape(delta_E, (2, 3))
np.testing.assert_almost_equal(
- delta_E_CIE1994(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE1994(Lab_1, Lab_2), delta_E, decimal=7)
@ignore_numpy_errors
def test_nan_delta_E_CIE1994(self):
@@ -245,25 +235,19 @@ def test_n_dimensional_delta_E_CIE2000(self):
Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835])
delta_E = 94.035649026659485
np.testing.assert_almost_equal(
- delta_E_CIE2000(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE2000(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.tile(Lab_1, (6, 1))
Lab_2 = np.tile(Lab_2, (6, 1))
delta_E = np.tile(delta_E, 6)
np.testing.assert_almost_equal(
- delta_E_CIE2000(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE2000(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.reshape(Lab_1, (2, 3, 3))
Lab_2 = np.reshape(Lab_2, (2, 3, 3))
delta_E = np.reshape(delta_E, (2, 3))
np.testing.assert_almost_equal(
- delta_E_CIE2000(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CIE2000(Lab_1, Lab_2), delta_E, decimal=7)
@ignore_numpy_errors
def test_nan_delta_E_CIE2000(self):
@@ -326,7 +310,7 @@ def test_delta_E_CIE2000_Sharma2004(self):
[90.8027, -2.0831, 1.4410],
[90.9257, -0.5406, -0.9208],
[6.7747, -0.2908, -2.4247],
- [2.0776, 0.0795, -1.1350]])
+ [2.0776, 0.0795, -1.1350]]) # yapf: disable
Lab_2 = np.array(
[[50.0000, 0.0000, -82.7485],
@@ -362,7 +346,7 @@ def test_delta_E_CIE2000_Sharma2004(self):
[91.1528, -1.6435, 0.0447],
[88.6381, -0.8985, -0.7239],
[5.8714, -0.0985, -2.2286],
- [0.9033, -0.0636, -0.5514]])
+ [0.9033, -0.0636, -0.5514]]) # yapf: disable
d_E = np.array(
[2.0425,
@@ -398,12 +382,10 @@ def test_delta_E_CIE2000_Sharma2004(self):
1.4441,
1.5381,
0.6377,
- 0.9082])
+ 0.9082]) # yapf: disable
np.testing.assert_almost_equal(
- delta_E_CIE2000(Lab_1, Lab_2),
- d_E,
- decimal=4)
+ delta_E_CIE2000(Lab_1, Lab_2), d_E, decimal=4)
class TestDelta_E_CMC(unittest.TestCase):
@@ -472,25 +454,19 @@ def test_n_dimensional_delta_E_CMC(self):
Lab_2 = np.array([100.00000000, 426.67945353, 72.39590835])
delta_E = 172.70477129
np.testing.assert_almost_equal(
- delta_E_CMC(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CMC(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.tile(Lab_1, (6, 1))
Lab_2 = np.tile(Lab_2, (6, 1))
delta_E = np.tile(delta_E, 6)
np.testing.assert_almost_equal(
- delta_E_CMC(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CMC(Lab_1, Lab_2), delta_E, decimal=7)
Lab_1 = np.reshape(Lab_1, (2, 3, 3))
Lab_2 = np.reshape(Lab_2, (2, 3, 3))
delta_E = np.reshape(delta_E, (2, 3))
np.testing.assert_almost_equal(
- delta_E_CMC(Lab_1, Lab_2),
- delta_E,
- decimal=7)
+ delta_E_CMC(Lab_1, Lab_2), delta_E, decimal=7)
@ignore_numpy_errors
def test_nan_delta_E_CMC(self):
diff --git a/colour/difference/tests/tests_delta_e_luo2006.py b/colour/difference/tests/tests_delta_e_luo2006.py
index 205c612302..72e798c837 100644
--- a/colour/difference/tests/tests_delta_e_luo2006.py
+++ b/colour/difference/tests/tests_delta_e_luo2006.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.difference.delta_e_luo2006` module.
"""
@@ -11,10 +10,8 @@
import unittest
from itertools import permutations
-from colour.difference import (
- delta_E_CAM02LCD,
- delta_E_CAM02SCD,
- delta_E_CAM02UCS)
+from colour.difference import (delta_E_CAM02LCD, delta_E_CAM02SCD,
+ delta_E_CAM02UCS)
from colour.difference.delta_e_luo2006 import delta_E_Luo2006
from colour.models.ucs_luo2006 import COEFFICIENTS_UCS_LUO2006
@@ -90,8 +87,8 @@ def test_n_dimensional_delta_E_Luo2006(self):
Jpapbp_2 = np.array([54.90433134, -0.08442362, -0.06848314])
delta_E_p = 0.00010344
np.testing.assert_almost_equal(
- delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
delta_E_p,
decimal=7)
@@ -99,8 +96,8 @@ def test_n_dimensional_delta_E_Luo2006(self):
Jpapbp_2 = np.tile(Jpapbp_2, (6, 1))
delta_E_p = np.tile(delta_E_p, 6)
np.testing.assert_almost_equal(
- delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
delta_E_p,
decimal=7)
@@ -108,8 +105,8 @@ def test_n_dimensional_delta_E_Luo2006(self):
Jpapbp_2 = np.reshape(Jpapbp_2, (2, 3, 3))
delta_E_p = np.reshape(delta_E_p, (2, 3))
np.testing.assert_almost_equal(
- delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
delta_E_p,
decimal=7)
@@ -125,8 +122,8 @@ def test_nan_delta_E_Luo2006(self):
for case in cases:
Jpapbp_1 = np.array(case)
Jpapbp_2 = np.array(case)
- delta_E_Luo2006(
- Jpapbp_1, Jpapbp_2, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ delta_E_Luo2006(Jpapbp_1, Jpapbp_2,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
if __name__ == '__main__':
diff --git a/colour/examples/adaptation/examples_cie1994.py b/colour/examples/adaptation/examples_cie1994.py
index fdef7a884e..3dbd66e931 100644
--- a/colour/examples/adaptation/examples_cie1994.py
+++ b/colour/examples/adaptation/examples_cie1994.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *CIE 1994* chromatic adaptation model computations.
"""
@@ -20,7 +19,7 @@
'adaptation model.\n'
'\n\t"XYZ_1":\n\t\t{0}\n\t"xy_o1":\n\t\t{1}\n\t"xy_o2":\n\t\t{2}'
'\n\t"Y_o":\n\t\t{3}\n\t"E_o1":\n\t\t{4}'
- '\n\t"E_o2":\n\t\t{5}'.format(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)))
-print(colour.chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
+ '\n\t"E_o2":\n\t\t{5}'.format(XYZ_1, xy_o1, xy_o2, Y_o, E_o1,
+ E_o2)))
+print(
+ colour.chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
diff --git a/colour/examples/adaptation/examples_cmccat2000.py b/colour/examples/adaptation/examples_cmccat2000.py
index 17b628ef3e..abebb8c7cd 100644
--- a/colour/examples/adaptation/examples_cmccat2000.py
+++ b/colour/examples/adaptation/examples_cmccat2000.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *CMCCAT2000* chromatic adaptation model computations.
"""
@@ -19,7 +18,7 @@
'chromatic adaptation model.\n'
'\n\t"XYZ":\n\t\t{0}\n\t"XYZ_w":\n\t\t{1}\n\t"XYZ_wr":\n\t\t{2}'
'\n\t"L_A1":\n\t\t{3}\n\t"L_A2":\n\t\t{4}'.format(
- XYZ, XYZ_w, XYZ_wr, L_A1, L_A2)))
+ XYZ, XYZ_w, XYZ_wr, L_A1, L_A2)))
print(colour.chromatic_adaptation_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2))
print('\n')
@@ -29,6 +28,6 @@
'chromatic adaptation model.\n'
'\n\t"XYZ_c":\n\t\t{0}\n\t"XYZ_w":\n\t\t{1}\n\t"XYZ_wr":\n\t\t{2}'
'\n\t"L_A1":\n\t\t{3}\n\t"L_A2":\n\t\t{4}'.format(
- XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2)))
+ XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2)))
print(colour.chromatic_adaptation_CMCCAT2000(
XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2, method='Reverse'))
diff --git a/colour/examples/adaptation/examples_fairchild1990.py b/colour/examples/adaptation/examples_fairchild1990.py
index 4ff935ebb7..58725ec9ef 100644
--- a/colour/examples/adaptation/examples_fairchild1990.py
+++ b/colour/examples/adaptation/examples_fairchild1990.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Fairchild (1990)* chromatic adaptation model computations.
"""
diff --git a/colour/examples/adaptation/examples_vonkries.py b/colour/examples/adaptation/examples_vonkries.py
index 8006eb9f67..e8d6626f19 100644
--- a/colour/examples/adaptation/examples_vonkries.py
+++ b/colour/examples/adaptation/examples_vonkries.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Von Kries* chromatic adaptation model computations.
"""
@@ -15,7 +14,7 @@
message_box(('Computing the chromatic adaptation matrix from two source '
'"CIE XYZ" tristimulus values arrays, default CAT is "CAT02".\n'
'\n\t"XYZ_w":\n\t\t{0}\n\t"XYZ_wr":\n\t\t{1}'.format(
- XYZ_w, XYZ_wr)))
+ XYZ_w, XYZ_wr)))
print(colour.chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr))
print('\n')
@@ -32,9 +31,7 @@
A = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['A']
D65 = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
print(colour.chromatic_adaptation_matrix_VonKries(
- colour.xy_to_XYZ(A),
- colour.xy_to_XYZ(D65),
- transform='Von Kries'))
+ colour.xy_to_XYZ(A), colour.xy_to_XYZ(D65), transform='Von Kries'))
print('\n')
@@ -44,7 +41,4 @@
'"CIE Standard Illuminant D Series D65" using "Sharp" CAT.\n'
'\n\t"XYZ":\n\t\t{0}'.format(XYZ)))
print(colour.chromatic_adaptation_VonKries(
- XYZ,
- colour.xy_to_XYZ(A),
- colour.xy_to_XYZ(D65),
- transform='Sharp'))
+ XYZ, colour.xy_to_XYZ(A), colour.xy_to_XYZ(D65), transform='Sharp'))
diff --git a/colour/examples/algebra/examples_interpolation.py b/colour/examples/algebra/examples_interpolation.py
index 58e1c06c41..4acf509db6 100644
--- a/colour/examples/algebra/examples_interpolation.py
+++ b/colour/examples/algebra/examples_interpolation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases interpolation computations.
"""
@@ -41,7 +40,8 @@
760: 0.0000,
780: 0.0000,
800: 0.0000,
- 820: 0.0000}
+ 820: 0.0000
+}
non_uniform_spd_data = {
340.1: 0.0000,
@@ -68,61 +68,70 @@
760: 0.0000,
780: 0.0000,
800: 0.0000,
- 820.9: 0.0000}
+ 820.9: 0.0000
+}
-base_spd = colour.SpectralPowerDistribution(
- 'Reference',
- uniform_spd_data)
+base_spd = colour.SpectralPowerDistribution('Reference', uniform_spd_data)
uniform_interpolated_spd = colour.SpectralPowerDistribution(
- 'Uniform - Sprague Interpolation',
- uniform_spd_data)
+ 'Uniform - Sprague Interpolation', uniform_spd_data)
uniform_pchip_interpolated_spd = colour.SpectralPowerDistribution(
- 'Uniform - Pchip Interpolation',
- uniform_spd_data)
+ 'Uniform - Pchip Interpolation', uniform_spd_data)
non_uniform_interpolated_spd = colour.SpectralPowerDistribution(
- 'Non Uniform - Cubic Spline Interpolation',
- non_uniform_spd_data)
+ 'Non Uniform - Cubic Spline Interpolation', non_uniform_spd_data)
uniform_interpolated_spd.interpolate(colour.SpectralShape(interval=1))
-uniform_pchip_interpolated_spd.interpolate(colour.SpectralShape(interval=1),
- method='Pchip')
+uniform_pchip_interpolated_spd.interpolate(
+ colour.SpectralShape(interval=1), method='Pchip')
non_uniform_interpolated_spd.interpolate(colour.SpectralShape(interval=1))
shape = base_spd.shape
x_limit_min, x_limit_max, y_limit_min, y_limit_max = [], [], [], []
-pylab.plot(base_spd.wavelengths,
- base_spd.values,
- 'ro-',
- label=base_spd.name,
- linewidth=2)
-pylab.plot(uniform_interpolated_spd.wavelengths,
- uniform_interpolated_spd.values,
- label=uniform_interpolated_spd.name,
- linewidth=2)
-pylab.plot(uniform_pchip_interpolated_spd.wavelengths,
- uniform_pchip_interpolated_spd.values,
- label=uniform_pchip_interpolated_spd.name,
- linewidth=2)
-pylab.plot(non_uniform_interpolated_spd.wavelengths,
- non_uniform_interpolated_spd.values,
- label=non_uniform_interpolated_spd.name,
- linewidth=2)
+pylab.plot(
+ base_spd.wavelengths,
+ base_spd.values,
+ 'ro-',
+ label=base_spd.name,
+ linewidth=2)
+pylab.plot(
+ uniform_interpolated_spd.wavelengths,
+ uniform_interpolated_spd.values,
+ label=uniform_interpolated_spd.name,
+ linewidth=2)
+pylab.plot(
+ uniform_pchip_interpolated_spd.wavelengths,
+ uniform_pchip_interpolated_spd.values,
+ label=uniform_pchip_interpolated_spd.name,
+ linewidth=2)
+pylab.plot(
+ non_uniform_interpolated_spd.wavelengths,
+ non_uniform_interpolated_spd.values,
+ label=non_uniform_interpolated_spd.name,
+ linewidth=2)
x_limit_min.append(shape.start)
x_limit_max.append(shape.end)
y_limit_min.append(min(base_spd.values))
y_limit_max.append(max(base_spd.values))
-settings = {'x_label': 'Wavelength $\\lambda$ (nm)',
- 'y_label': 'Spectral Power Distribution',
- 'x_tighten': True,
- 'legend': True,
- 'legend_location': 'upper left',
- 'x_ticker': True,
- 'y_ticker': True,
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max))}
+settings = {
+ 'x_label':
+ 'Wavelength $\\lambda$ (nm)',
+ 'y_label':
+ 'Spectral Power Distribution',
+ 'x_tighten':
+ True,
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper left',
+ 'x_ticker':
+ True,
+ 'y_ticker':
+ True,
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max))
+}
boundaries(**settings)
decorate(**settings)
diff --git a/colour/examples/appearance/examples_atd95.py b/colour/examples/appearance/examples_atd95.py
index 56b5e0c3a8..8713612fd5 100644
--- a/colour/examples/appearance/examples_atd95.py
+++ b/colour/examples/appearance/examples_atd95.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *ATD (1995)* colour appearance model computations.
"""
diff --git a/colour/examples/appearance/examples_ciecam02.py b/colour/examples/appearance/examples_ciecam02.py
index 2429f8778d..41927e7071 100644
--- a/colour/examples/appearance/examples_ciecam02.py
+++ b/colour/examples/appearance/examples_ciecam02.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *CIECAM02* colour appearance model computations.
"""
@@ -27,8 +26,9 @@
J = 41.73109113
C = 0.10470776
h = 219.04843266
+specification = colour.CIECAM02_Specification(J, C, h)
message_box(('Converting to "CIE XYZ" tristimulus values using given '
'parameters:\n'
'\n\tJ: {0}\n\tC: {1}\n\th: {2}\n\tXYZ_w: {3}\n\tL_A: {4}'
'\n\tY_b: {5}').format(J, C, h, XYZ_w, L_A, Y_b))
-print(colour.CIECAM02_to_XYZ(J, C, h, XYZ_w, L_A, Y_b))
+print(colour.CIECAM02_to_XYZ(specification, XYZ_w, L_A, Y_b))
diff --git a/colour/examples/appearance/examples_hunt.py b/colour/examples/appearance/examples_hunt.py
index 9bc2f1727e..f5d0f4f3db 100644
--- a/colour/examples/appearance/examples_hunt.py
+++ b/colour/examples/appearance/examples_hunt.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Hunt* colour appearance model computations.
"""
@@ -20,19 +19,11 @@
message_box(('Converting to "Hunt" colour appearance model '
'specification using given parameters:\n'
'\n\tXYZ: {0}\n\tXYZ_w: {1}\n\tXYZ_b: {2}\n\tL_A: {3}'
- '\n\tsurround: {4}\n\tCCT_w: {5}'.format(XYZ,
- XYZ_w,
- XYZ_b,
- L_A,
- surround,
- CCT_w)))
+ '\n\tsurround: {4}\n\tCCT_w: {5}'.format(XYZ, XYZ_w, XYZ_b, L_A,
+ surround, CCT_w)))
-specification = colour.XYZ_to_Hunt(XYZ,
- XYZ_w,
- XYZ_b,
- L_A,
- surround,
- CCT_w=CCT_w)
+specification = colour.XYZ_to_Hunt(
+ XYZ, XYZ_w, XYZ_b, L_A, surround, CCT_w=CCT_w)
print(specification)
print('\n')
diff --git a/colour/examples/appearance/examples_llab.py b/colour/examples/appearance/examples_llab.py
index 304878f7ac..0ec1bd7e86 100644
--- a/colour/examples/appearance/examples_llab.py
+++ b/colour/examples/appearance/examples_llab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *LLAB(l:c)* colour appearance model computations.
"""
diff --git a/colour/examples/appearance/examples_nayatani95.py b/colour/examples/appearance/examples_nayatani95.py
index 0a5e4331ca..0b740bc8cf 100644
--- a/colour/examples/appearance/examples_nayatani95.py
+++ b/colour/examples/appearance/examples_nayatani95.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Nayatani (1995)* colour appearance model computations.
"""
diff --git a/colour/examples/appearance/examples_rlab.py b/colour/examples/appearance/examples_rlab.py
index 59f88e4d35..1b66615eb5 100644
--- a/colour/examples/appearance/examples_rlab.py
+++ b/colour/examples/appearance/examples_rlab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *RLAB* colour appearance model computations.
"""
diff --git a/colour/examples/characterisation/examples_colour_checkers.py b/colour/examples/characterisation/examples_colour_checkers.py
index a3dab97ebf..1d42a980df 100644
--- a/colour/examples/characterisation/examples_colour_checkers.py
+++ b/colour/examples/characterisation/examples_colour_checkers.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour rendition charts computations.
"""
@@ -37,12 +36,9 @@
'\n\t("Patch Name", ["R", "G", "B"])'))
for index, name, xyY in data:
RGB = colour.XYZ_to_RGB(
- colour.xyY_to_XYZ(xyY),
- illuminant,
- colour.ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D65'],
- colour.sRGB_COLOURSPACE.XYZ_to_RGB_matrix,
- 'Bradford',
+ colour.xyY_to_XYZ(xyY), illuminant,
+ colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'],
+ colour.sRGB_COLOURSPACE.XYZ_to_RGB_matrix, 'Bradford',
colour.sRGB_COLOURSPACE.encoding_cctf)
RGB = [int(round(x * 255)) if x >= 0 else 0 for x in np.ravel(RGB)]
diff --git a/colour/examples/characterisation/examples_fitting.py b/colour/examples/characterisation/examples_fitting.py
index 7c5c2ab108..da8842a7fc 100644
--- a/colour/examples/characterisation/examples_fitting.py
+++ b/colour/examples/characterisation/examples_fitting.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour fitting computations.
"""
@@ -40,7 +39,7 @@
(0.35499180, 0.36538033, 0.36757315),
(0.19011528, 0.19180135, 0.19309001),
(0.08525591, 0.08890588, 0.09252104),
- (0.03039192, 0.03118624, 0.03278316)))
+ (0.03039192, 0.03118624, 0.03278316))) # yapf: disable
measured = (
((0.15579559, 0.09715755, 0.07514556),
@@ -66,6 +65,6 @@
(0.33045354, 0.32904184, 0.33228886),
(0.18001305, 0.17978567, 0.18004416),
(0.10283975, 0.10424680, 0.10384975),
- (0.04742204, 0.04772203, 0.04914226)))
+ (0.04742204, 0.04772203, 0.04914226))) # yapf: disable
print(colour.first_order_colour_fit(reference, measured))
diff --git a/colour/examples/colorimetry/examples_blackbody.py b/colour/examples/colorimetry/examples_blackbody.py
index 1683aa102d..0073a31a1a 100644
--- a/colour/examples/colorimetry/examples_blackbody.py
+++ b/colour/examples/colorimetry/examples_blackbody.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases blackbody / planckian radiator computations.
"""
diff --git a/colour/examples/colorimetry/examples_cmfs.py b/colour/examples/colorimetry/examples_cmfs.py
index 43df0e4e87..f282343391 100644
--- a/colour/examples/colorimetry/examples_cmfs.py
+++ b/colour/examples/colorimetry/examples_cmfs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour matching functions computations.
"""
@@ -21,8 +20,8 @@
'matching functions to "CIE 1931 2 Degree Standard Observer" at '
'wavelength 700 nm.'))
print(colour.RGB_2_degree_cmfs_to_XYZ_2_degree_cmfs(700))
-print(colour.STANDARD_OBSERVERS_CMFS[
- 'CIE 1931 2 Degree Standard Observer'][700])
+print(
+ colour.STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer'][700])
print('\n')
@@ -30,8 +29,8 @@
'matching functions to "CIE 1964 10 Degree Standard Observer" at '
'wavelength 700 nm.'))
print(colour.RGB_10_degree_cmfs_to_XYZ_10_degree_cmfs(700))
-print(colour.STANDARD_OBSERVERS_CMFS[
- 'CIE 1964 10 Degree Standard Observer'][700])
+print(colour.STANDARD_OBSERVERS_CMFS['CIE 1964 10 Degree Standard Observer'][
+ 700])
print('\n')
@@ -49,8 +48,8 @@
'"CIE 2012 2 Degree Standard Observer" spectral sensitivity '
'functions at wavelength 700 nm.'))
print(colour.LMS_2_degree_cmfs_to_XYZ_2_degree_cmfs(700))
-print(colour.STANDARD_OBSERVERS_CMFS[
- 'CIE 2012 2 Degree Standard Observer'][700])
+print(
+ colour.STANDARD_OBSERVERS_CMFS['CIE 2012 2 Degree Standard Observer'][700])
print('\n')
@@ -59,5 +58,5 @@
'"CIE 2012 10 Degree Standard Observer" spectral sensitivity '
'functions at wavelength 700 nm.'))
print(colour.LMS_10_degree_cmfs_to_XYZ_10_degree_cmfs(700))
-print(colour.STANDARD_OBSERVERS_CMFS[
- 'CIE 2012 10 Degree Standard Observer'][700])
+print(colour.STANDARD_OBSERVERS_CMFS['CIE 2012 10 Degree Standard Observer'][
+ 700])
diff --git a/colour/examples/colorimetry/examples_correction.py b/colour/examples/colorimetry/examples_correction.py
index c55d99431b..9e81bb540a 100644
--- a/colour/examples/colorimetry/examples_correction.py
+++ b/colour/examples/colorimetry/examples_correction.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour spectral bandpass dependence correction computations.
"""
@@ -97,7 +96,8 @@
765: 0.465,
770: 0.448,
775: 0.432,
- 780: 0.421}
+ 780: 0.421
+}
spd = colour.SpectralPowerDistribution('Sample', sample_spd_data)
uncorrected_values = spd.values
diff --git a/colour/examples/colorimetry/examples_dominant.py b/colour/examples/colorimetry/examples_dominant.py
index 90a2dc4a3f..bb683a99dc 100644
--- a/colour/examples/colorimetry/examples_dominant.py
+++ b/colour/examples/colorimetry/examples_dominant.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases dominant wavelength and purity of a colour computations.
"""
diff --git a/colour/examples/colorimetry/examples_illuminants.py b/colour/examples/colorimetry/examples_illuminants.py
index 55ee48cee0..7d6118e86f 100644
--- a/colour/examples/colorimetry/examples_illuminants.py
+++ b/colour/examples/colorimetry/examples_illuminants.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases illuminants dataset.
"""
diff --git a/colour/examples/colorimetry/examples_lefs.py b/colour/examples/colorimetry/examples_lefs.py
index 227f558fda..d5946da43b 100644
--- a/colour/examples/colorimetry/examples_lefs.py
+++ b/colour/examples/colorimetry/examples_lefs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases luminous efficiency functions computations.
"""
diff --git a/colour/examples/colorimetry/examples_light_sources.py b/colour/examples/colorimetry/examples_light_sources.py
index 93d936703b..837b3c6d9c 100644
--- a/colour/examples/colorimetry/examples_light_sources.py
+++ b/colour/examples/colorimetry/examples_light_sources.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases light sources dataset.
"""
diff --git a/colour/examples/colorimetry/examples_lightness.py b/colour/examples/colorimetry/examples_lightness.py
index 0876d315f1..4ff318d1d8 100644
--- a/colour/examples/colorimetry/examples_lightness.py
+++ b/colour/examples/colorimetry/examples_lightness.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Lightness* computations.
"""
@@ -38,6 +37,14 @@
print('\n')
+message_box(('Computing "Lightness" using "Fairchild and Wyble (2010)" method '
+ 'for given "luminance" value:\n'
+ '\n\t{0}'.format(Y)))
+print(colour.lightness_Fairchild2010(Y / 100.0))
+print(colour.lightness(Y / 100.0, method='Fairchild 2010'))
+
+print('\n')
+
message_box(('Computing "Lightness" using "CIE 1976" method for '
'given "luminance" value:\n'
'\n\t{0}'.format(Y)))
diff --git a/colour/examples/colorimetry/examples_luminance.py b/colour/examples/colorimetry/examples_luminance.py
index 48766b16fb..ef5a728b7e 100644
--- a/colour/examples/colorimetry/examples_luminance.py
+++ b/colour/examples/colorimetry/examples_luminance.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Luminance* computations.
"""
@@ -30,6 +29,15 @@
print('\n')
+L = 23.10363383
+message_box(('Computing "luminance" using "Fairchild and Wyble (2010)" method '
+ 'for given "Lightness":\n'
+ '\n\t{0}'.format(L)))
+print(colour.luminance_Fairchild2010(L) * 100)
+print(colour.luminance(L, method='Fairchild 2010') * 100)
+
+print('\n')
+
message_box(('Computing "luminance" using "ASTM D1535-08e1" method for given '
'"Munsell" value:\n'
'\n\t{0}'.format(V)))
diff --git a/colour/examples/colorimetry/examples_photometry.py b/colour/examples/colorimetry/examples_photometry.py
index e1317f448d..f0c5ee06a5 100644
--- a/colour/examples/colorimetry/examples_photometry.py
+++ b/colour/examples/colorimetry/examples_photometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Photometry* computations.
"""
diff --git a/colour/examples/colorimetry/examples_spectrum.py b/colour/examples/colorimetry/examples_spectrum.py
index d20189d77f..f9f7ca24af 100644
--- a/colour/examples/colorimetry/examples_spectrum.py
+++ b/colour/examples/colorimetry/examples_spectrum.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour spectrum computations.
"""
@@ -93,7 +92,8 @@
765: 0.465,
770: 0.448,
775: 0.432,
- 780: 0.421}
+ 780: 0.421
+}
spd = colour.SpectralPowerDistribution('Sample', sample_spd_data)
diff --git a/colour/examples/colorimetry/examples_tristimulus.py b/colour/examples/colorimetry/examples_tristimulus.py
index 5e6d9f16e5..6c3bfb0053 100644
--- a/colour/examples/colorimetry/examples_tristimulus.py
+++ b/colour/examples/colorimetry/examples_tristimulus.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *CIE XYZ* tristimulus values computations.
"""
@@ -91,7 +90,8 @@
765: 0.465,
770: 0.448,
775: 0.432,
- 780: 0.421}
+ 780: 0.421
+}
spd = colour.SpectralPowerDistribution('Sample', sample_spd_data)
@@ -112,6 +112,5 @@
message_box(('Computing *CIE XYZ* tristimulus values for a single given '
'wavelength in nm.'))
-print(colour.wavelength_to_XYZ(
- 546.1,
- colour.CMFS['CIE 1931 2 Degree Standard Observer']))
+print(colour.wavelength_to_XYZ(546.1, colour.CMFS[
+ 'CIE 1931 2 Degree Standard Observer']))
diff --git a/colour/examples/colorimetry/examples_whiteness.py b/colour/examples/colorimetry/examples_whiteness.py
index 6a101b97a8..8fde014a13 100644
--- a/colour/examples/colorimetry/examples_whiteness.py
+++ b/colour/examples/colorimetry/examples_whiteness.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *whiteness* computations.
"""
@@ -39,11 +38,11 @@
print('\n')
-message_box(('Computing "whiteness" using "ASTM 313" method for '
+message_box(('Computing "whiteness" using "ASTM E313" method for '
'given sample "CIE XYZ" tristimulus values:\n'
'\n\t{0}'.format(XYZ)))
-print(colour.whiteness_ASTM313(XYZ))
-print(colour.whiteness(XYZ=XYZ, method='ASTM 313'))
+print(colour.whiteness_ASTME313(XYZ))
+print(colour.whiteness(XYZ=XYZ, method='ASTM E313'))
print('\n')
diff --git a/colour/examples/colorimetry/examples_yellowness.py b/colour/examples/colorimetry/examples_yellowness.py
new file mode 100644
index 0000000000..1e63c2fd19
--- /dev/null
+++ b/colour/examples/colorimetry/examples_yellowness.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Showcases *yellowness* computations.
+"""
+
+import colour
+from colour.utilities.verbose import message_box
+
+message_box('"Yellowness" Computations')
+
+XYZ = (95.00000000, 100.00000000, 105.00000000)
+message_box(('Computing "yellowness" using "ASTM D1925" method for '
+ 'given sample "CIE XYZ" tristimulus values:\n'
+ '\n\t{0}'.format(XYZ)))
+print(colour.yellowness_ASTMD1925(XYZ))
+print(colour.yellowness(XYZ=XYZ, method='ASTM D1925'))
+
+print('\n')
+
+message_box(('Computing "yellowness" using "ASTM E313" method for '
+ 'given sample "CIE XYZ" tristimulus values:\n'
+ '\n\t{0}'.format(XYZ)))
+print(colour.yellowness_ASTME313(XYZ))
+print(colour.yellowness(XYZ=XYZ, method='ASTM E313'))
diff --git a/colour/examples/corresponding/examples_prediction.py b/colour/examples/corresponding/examples_prediction.py
index b8dc746b03..ea7af76413 100644
--- a/colour/examples/corresponding/examples_prediction.py
+++ b/colour/examples/corresponding/examples_prediction.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases corresponding chromaticities prediction computations.
"""
diff --git a/colour/examples/difference/examples_delta_e.py b/colour/examples/difference/examples_delta_e.py
index 2178bf112a..57048aa58a 100644
--- a/colour/examples/difference/examples_delta_e.py
+++ b/colour/examples/difference/examples_delta_e.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Delta E* colour difference computations.
"""
diff --git a/colour/examples/difference/examples_delta_e_luo2006.py b/colour/examples/difference/examples_delta_e_luo2006.py
index 6af8e918bd..eeb835d4c9 100644
--- a/colour/examples/difference/examples_delta_e_luo2006.py
+++ b/colour/examples/difference/examples_delta_e_luo2006.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Delta E* colour difference computation objects based on
*Luo et al. (2006)* *CAM02-LCD*, *CAM02-SCD*, and *CAM02-UCS* colourspaces.
diff --git a/colour/examples/examples_colour.py b/colour/examples/examples_colour.py
index 2a5efe8cb0..111a431ae8 100644
--- a/colour/examples/examples_colour.py
+++ b/colour/examples/examples_colour.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases overall *Colour* examples.
"""
@@ -45,32 +44,28 @@
XYZ = (0.07049534, 0.10080000, 0.09558313)
illuminant = (0.34570, 0.35850)
-message_box('Using 1d "array_like" parameter:\n'
- '\n{0}'.format(XYZ))
+message_box('Using 1d "array_like" parameter:\n' '\n{0}'.format(XYZ))
print(colour.XYZ_to_Lab(XYZ, illuminant=illuminant))
print('\n')
XYZ = np.tile(XYZ, (6, 1))
illuminant = np.tile(illuminant, (6, 1))
-message_box('Using 2d "array_like" parameter:\n'
- '\n{0}'.format(XYZ))
+message_box('Using 2d "array_like" parameter:\n' '\n{0}'.format(XYZ))
print(colour.XYZ_to_Lab(XYZ, illuminant=illuminant))
print('\n')
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
-message_box('Using 3d "array_like" parameter:\n'
- '\n{0}'.format(XYZ))
+message_box('Using 3d "array_like" parameter:\n' '\n{0}'.format(XYZ))
print(colour.XYZ_to_Lab(XYZ, illuminant=illuminant))
print('\n')
XYZ = np.reshape(XYZ, (3, 2, 1, 3))
illuminant = np.reshape(illuminant, (3, 2, 1, 2))
-message_box('Using 4d "array_like" parameter:\n'
- '\n{0}'.format(XYZ))
+message_box('Using 4d "array_like" parameter:\n' '\n{0}'.format(XYZ))
print(colour.XYZ_to_Lab(XYZ, illuminant=illuminant))
print('\n')
@@ -107,8 +102,8 @@
'\nY_o:\n\n{3}\n\n'
'\nE_o1:\n\n{4}\n\n'
'\nE_o2:\n\n{5}'.format(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)))
-print(colour.chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
+print(
+ colour.chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
print('\n')
@@ -120,8 +115,8 @@
'\nY_o:\n\n{3}\n\n'
'\nE_o1:\n\n{4}\n\n'
'\nE_o2:\n\n{5}'.format(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)))
-print(colour.chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
+print(
+ colour.chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
print('\n')
@@ -137,8 +132,8 @@
'\nY_o:\n\n{3}\n\n'
'\nE_o1:\n\n{4}\n\n'
'\nE_o2:\n\n{5}'.format(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)))
-print(colour.chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
+print(
+ colour.chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
print('\n')
@@ -155,5 +150,5 @@
'\nY_o:\n\n{3}\n\n'
'\nE_o1:\n\n{4}\n\n'
'\nE_o2:\n\n{5}'.format(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)))
-print(colour.chromatic_adaptation_CIE1994(
- XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
+print(
+ colour.chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2))
diff --git a/colour/examples/io/examples_ies_tm2714.py b/colour/examples/io/examples_ies_tm2714.py
index e5d033ed3d..816b0dad1b 100644
--- a/colour/examples/io/examples_ies_tm2714.py
+++ b/colour/examples/io/examples_ies_tm2714.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases input / output *IES TM-27-14* spectral data XML files related
examples.
@@ -17,8 +16,8 @@
message_box('"IES TM-27-14" Spectral Data "XML" File IO')
message_box('Reading spectral data from "IES TM-27-14" "XML" file.')
-spd = colour.IES_TM2714_Spd(os.path.join(RESOURCES_DIRECTORY,
- 'TM27 Sample Spectral Data.spdx'))
+spd = colour.IES_TM2714_Spd(
+ os.path.join(RESOURCES_DIRECTORY, 'TM27 Sample Spectral Data.spdx'))
spd.read()
print(spd)
diff --git a/colour/examples/io/examples_tabular.py b/colour/examples/io/examples_tabular.py
index 569106b122..3bca3462c2 100644
--- a/colour/examples/io/examples_tabular.py
+++ b/colour/examples/io/examples_tabular.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases input / output *CSV* tabular data related examples.
"""
diff --git a/colour/examples/models/examples_aces_idt.py b/colour/examples/models/examples_aces_idt.py
index bd22c58c6b..a0bbb35d65 100644
--- a/colour/examples/models/examples_aces_idt.py
+++ b/colour/examples/models/examples_aces_idt.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Academy Color Encoding System* *Input Device Transform* related
computations.
diff --git a/colour/examples/models/examples_deprecated.py b/colour/examples/models/examples_deprecated.py
index a94049cf96..21ca633349 100644
--- a/colour/examples/models/examples_deprecated.py
+++ b/colour/examples/models/examples_deprecated.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases deprecated colour models computations.
"""
diff --git a/colour/examples/models/examples_derivation.py b/colour/examples/models/examples_derivation.py
index 7238c50444..3aba6b5f9e 100644
--- a/colour/examples/models/examples_derivation.py
+++ b/colour/examples/models/examples_derivation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *RGB* colourspace derivation.
"""
@@ -15,16 +14,14 @@
primaries = np.array(
[[0.73470, 0.26530],
[0.00000, 1.00000],
- [0.00010, -0.07700]])
+ [0.00010, -0.07700]]) # yapf: disable
whitepoint = (0.32168, 0.33767)
message_box(('Computing the normalised primary matrix for "ACES2065-1" '
'colourspace transforming from "ACES2065-1" colourspace to '
'"CIE XYZ" tristimulus values using user defined primaries '
'matrix and whitepoint:\n'
- '\n\t{0}\n\t{1}\n\t{2}\n\n\t{3}'.format(primaries[0],
- primaries[1],
- primaries[2],
- whitepoint)))
+ '\n\t{0}\n\t{1}\n\t{2}\n\n\t{3}'.format(
+ primaries[0], primaries[1], primaries[2], whitepoint)))
print(colour.normalised_primary_matrix(primaries, whitepoint))
print('\n')
@@ -41,24 +38,25 @@
message_box(('Computing the normalised primary matrix for "ACES2065-1" '
'colourspace transforming from "CIE XYZ" tristimulus values to '
'"ACES2065-1" colourspace using colour models dataset.'))
-print(np.linalg.inv(colour.normalised_primary_matrix(
- colour.ACES_2065_1_COLOURSPACE.primaries,
- colour.ACES_2065_1_COLOURSPACE.whitepoint)))
+print(np.linalg.inv(
+ colour.normalised_primary_matrix(
+ colour.ACES_2065_1_COLOURSPACE.primaries,
+ colour.ACES_2065_1_COLOURSPACE.whitepoint)))
print('\n')
message_box(('Computing "sRGB" colourspace primaries chromatically adapted to '
'"CIE Standard Illuminant D50":\n'))
print(colour.chromatically_adapted_primaries(
- colour.sRGB_COLOURSPACE.primaries,
- colour.sRGB_COLOURSPACE.whitepoint,
+ colour.sRGB_COLOURSPACE.primaries, colour.sRGB_COLOURSPACE.whitepoint,
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']))
print('\n')
-npm = np.array([[0.41240000, 0.35760000, 0.18050000],
- [0.21260000, 0.71520000, 0.07220000],
- [0.01930000, 0.11920000, 0.95050000]])
+npm = np.array(
+ [[0.41240000, 0.35760000, 0.18050000],
+ [0.21260000, 0.71520000, 0.07220000],
+ [0.01930000, 0.11920000, 0.95050000]]) # yapf: disable
message_box(('Computing the primaries and whitepoint from given '
'normalised primary matrix:\n'
'\n{0}'.format(npm)))
@@ -69,7 +67,5 @@
RGB = (56.00000000, 16.00000000, 100.00000000)
message_box(('Computing "RGB" luminance of given "RGB" values:\n'
'\n\t{0}'.format(RGB)))
-print(colour.RGB_luminance(
- RGB,
- colour.sRGB_COLOURSPACE.primaries,
- colour.sRGB_COLOURSPACE.whitepoint))
+print(colour.RGB_luminance(RGB, colour.sRGB_COLOURSPACE.primaries,
+ colour.sRGB_COLOURSPACE.whitepoint))
diff --git a/colour/examples/models/examples_ictcp.py b/colour/examples/models/examples_ictcp.py
index 2af08500eb..5cf76af003 100644
--- a/colour/examples/models/examples_ictcp.py
+++ b/colour/examples/models/examples_ictcp.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
diff --git a/colour/examples/models/examples_models.py b/colour/examples/models/examples_models.py
index 8169f08320..38563f0f8d 100644
--- a/colour/examples/models/examples_models.py
+++ b/colour/examples/models/examples_models.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour models computations.
"""
@@ -25,9 +24,9 @@
print('\n')
message_box('Using an alternative illuminant.')
-print(colour.XYZ_to_xyY(
- (0.00000000, 0.00000000, 0.00000000),
- colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D60']))
+print(
+ colour.XYZ_to_xyY((0.00000000, 0.00000000, 0.00000000), colour.ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D60']))
print('\n')
@@ -57,13 +56,10 @@
message_box(('Converting to "RGB" colourspace from given "CIE XYZ" '
'tristimulus values:\n'
'\n\t{0}'.format(XYZ)))
-print(colour.XYZ_to_RGB(
- XYZ,
- colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'],
- colour.sRGB_COLOURSPACE.whitepoint,
- colour.sRGB_COLOURSPACE.XYZ_to_RGB_matrix,
- 'Bradford',
- colour.sRGB_COLOURSPACE.encoding_cctf))
+D50 = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']
+print(colour.XYZ_to_RGB(XYZ, D50, colour.sRGB_COLOURSPACE.whitepoint,
+ colour.sRGB_COLOURSPACE.XYZ_to_RGB_matrix, 'Bradford',
+ colour.sRGB_COLOURSPACE.encoding_cctf))
print('\n')
@@ -71,22 +67,16 @@
message_box(('Converting to "CIE XYZ" tristimulus values from given "RGB" '
'colourspace values:\n'
'\n\t{0}'.format(RGB)))
-print(colour.RGB_to_XYZ(
- RGB,
- colour.sRGB_COLOURSPACE.whitepoint,
- colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'],
- colour.sRGB_COLOURSPACE.RGB_to_XYZ_matrix,
- 'Bradford',
- colour.sRGB_COLOURSPACE.decoding_cctf))
+print(colour.RGB_to_XYZ(RGB, colour.sRGB_COLOURSPACE.whitepoint, D50,
+ colour.sRGB_COLOURSPACE.RGB_to_XYZ_matrix, 'Bradford',
+ colour.sRGB_COLOURSPACE.decoding_cctf))
print('\n')
message_box(('Converting to "sRGB" colourspace from given "CIE XYZ" '
'tristimulus values using convenient definition:\n'
'\n\t{0}'.format(XYZ)))
-print(colour.XYZ_to_sRGB(
- XYZ,
- colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']))
+print(colour.XYZ_to_sRGB(XYZ, D50))
print('\n')
@@ -240,3 +230,31 @@
print(colour.IPT_to_XYZ(IPT))
print('\n')
+
+message_box(('Converting to "hdr-CIELab" colourspace from given "CIE XYZ" '
+ 'tristimulus values:\n'
+ '\n\t{0}'.format(XYZ)))
+print(colour.XYZ_to_hdr_CIELab(XYZ))
+
+print('\n')
+
+Lab_hdr = (95.74235944, 5.52263656, 11.72798167)
+message_box(('Converting to "CIE XYZ" tristimulus values from given '
+ '"hdr-CIELab" colourspace values:\n'
+ '\n\t{0}'.format(Lab_hdr)))
+print(colour.hdr_CIELab_to_XYZ(Lab_hdr))
+
+print('\n')
+
+message_box(('Converting to "hdr-IPT" colourspace from given "CIE XYZ" '
+ 'tristimulus values:\n'
+ '\n\t{0}'.format(XYZ)))
+print(colour.XYZ_to_hdr_IPT(XYZ))
+
+print('\n')
+
+IPT_hdr = (92.21400245, 3.0073719, 14.7243821)
+message_box(('Converting to "CIE XYZ" tristimulus values from given "hdr-IPT" '
+ 'colourspace values:\n'
+ '\n\t{0}'.format(IPT_hdr)))
+print(colour.hdr_IPT_to_XYZ(IPT_hdr))
diff --git a/colour/examples/models/examples_prismatic.py b/colour/examples/models/examples_prismatic.py
new file mode 100644
index 0000000000..5d13e38f7b
--- /dev/null
+++ b/colour/examples/models/examples_prismatic.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Showcases *Prismatic* colourspace computations.
+"""
+
+import colour
+from colour.utilities.verbose import message_box
+
+message_box('"Prismatic" Colourspace Computations')
+
+RGB = (0.25, 0.50, 0.75)
+message_box(('Converting from "RGB" colourspace to "Prismatic" colourspace '
+ 'given "RGB" values:\n'
+ '\n\t{0}'.format(RGB)))
+print(colour.RGB_to_Prismatic(RGB))
+
+print('\n')
+
+Lrgb = (0.7500000, 0.1666667, 0.3333333, 0.5000000)
+message_box(('Converting from "Prismatic" colourspace to "RGB" colourspace '
+ 'given "Lrgb" values:\n'
+ '\n\t{0}'.format(Lrgb)))
+print(colour.Prismatic_to_RGB(Lrgb))
+
+print('\n')
+
+message_box(('Applying 50% desaturation in "Prismatic" colourspace to'
+ 'given "RGB" values:\n'
+ '\n\t{0}'.format(RGB)))
+saturation = 0.5
+Lrgb = colour.RGB_to_Prismatic(RGB)
+Lrgb[..., 1:] = 1.0 / 3.0 + saturation * (Lrgb[..., 1:] - 1.0 / 3.0)
+print(colour.Prismatic_to_RGB(Lrgb))
diff --git a/colour/examples/models/examples_rgb.py b/colour/examples/models/examples_rgb.py
index 76d87ccc02..5c43571838 100644
--- a/colour/examples/models/examples_rgb.py
+++ b/colour/examples/models/examples_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *RGB* *colourspaces* computations.
"""
@@ -23,8 +22,7 @@
print('Name:\n"{0}"'.format(colourspace.name))
print('\nPrimaries:\n{0}'.format(colourspace.primaries))
print(('\nNormalised primary matrix to "CIE XYZ" '
- 'tristimulus values:\n{0}').format(
- colourspace.RGB_to_XYZ_matrix))
+ 'tristimulus values:\n{0}').format(colourspace.RGB_to_XYZ_matrix))
print('\nNormalised primary matrix to "ACES2065-1":\n{0}'.format(
colourspace.XYZ_to_RGB_matrix))
print('\nOpto-electronic transfer function from '
@@ -37,11 +35,10 @@
message_box(('Computing "ACES2065-1" colourspace to "Rec. 709" colourspace '
'matrix.'))
cat = colour.chromatic_adaptation_matrix_VonKries(
- colour.xy_to_XYZ(colour.RGB_COLOURSPACES['ACES2065-1'].whitepoint),
+ colour.xy_to_XYZ(colourspace.whitepoint),
colour.xy_to_XYZ(colour.RGB_COLOURSPACES['Rec. 709'].whitepoint))
print(np.dot(colour.RGB_COLOURSPACES['Rec. 709'].XYZ_to_RGB_matrix,
- np.dot(cat,
- colour.RGB_COLOURSPACES['ACES2065-1'].RGB_to_XYZ_matrix)))
+ np.dot(cat, colourspace.RGB_to_XYZ_matrix)))
print('\n')
@@ -49,6 +46,5 @@
message_box(('Converting from "Rec. 709" colourspace to "ACEScg" colourspace '
'given "RGB" values:\n'
'\n\t{0}'.format(RGB)))
-print(colour.RGB_to_RGB(RGB,
- colour.RGB_COLOURSPACES['Rec. 709'],
+print(colour.RGB_to_RGB(RGB, colour.RGB_COLOURSPACES['Rec. 709'],
colour.RGB_COLOURSPACES['ACEScg']))
diff --git a/colour/examples/models/examples_transfer_functions.py b/colour/examples/models/examples_transfer_functions.py
index 545fe00614..6ad0665393 100644
--- a/colour/examples/models/examples_transfer_functions.py
+++ b/colour/examples/models/examples_transfer_functions.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour component transfer functions (CCTF) relates computations.
"""
@@ -62,7 +61,7 @@
message_box(('Encoding to video component signal value using a pure gamma '
'function and given linear-light value:\n'
'\n\t{0}'.format(C)))
-print(colour.gamma_function(C, 1 / 2.2))
+print(colour.function_gamma(C, 1 / 2.2))
print('\n')
@@ -70,4 +69,4 @@
message_box(('Decoding to linear-light value using a pure gamma function and '
'given video component signal value:\n'
'\n\t{0}'.format(N)))
-print(colour.gamma_function(N, 2.2))
+print(colour.function_gamma(N, 2.2))
diff --git a/colour/examples/models/examples_ycbcr.py b/colour/examples/models/examples_ycbcr.py
index d1864c79d8..e766a1021b 100644
--- a/colour/examples/models/examples_ycbcr.py
+++ b/colour/examples/models/examples_ycbcr.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Y'CbCr* *colour encoding* computations.
"""
diff --git a/colour/examples/notation/examples_munsell.py b/colour/examples/notation/examples_munsell.py
index e03c03f459..a2f3d09cec 100644
--- a/colour/examples/notation/examples_munsell.py
+++ b/colour/examples/notation/examples_munsell.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Munsell Renotation System* computations.
"""
diff --git a/colour/examples/notation/examples_triplet.py b/colour/examples/notation/examples_triplet.py
index df71fa3d9c..6dceca62d5 100644
--- a/colour/examples/notation/examples_triplet.py
+++ b/colour/examples/notation/examples_triplet.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases hexadecimal triplet computations.
"""
diff --git a/colour/examples/phenomenons/examples_rayleigh.py b/colour/examples/phenomenons/examples_rayleigh.py
index fe427c36c1..4d9dbb6c2f 100644
--- a/colour/examples/phenomenons/examples_rayleigh.py
+++ b/colour/examples/phenomenons/examples_rayleigh.py
@@ -1,15 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Rayleigh Optical Depth* computations examples.
"""
import colour
from colour.phenomenons import (
- rayleigh_optical_depth,
- rayleigh_scattering_spd,
- scattering_cross_section)
+ rayleigh_optical_depth, rayleigh_scattering_spd, scattering_cross_section)
from colour.utilities.verbose import message_box
message_box('"Rayleigh" Optical Depth Computations')
diff --git a/colour/examples/plotting/examples_characterisation_plots.py b/colour/examples/plotting/examples_characterisation_plots.py
index cf000382e1..a32b24b734 100644
--- a/colour/examples/plotting/examples_characterisation_plots.py
+++ b/colour/examples/plotting/examples_characterisation_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases characterisation plotting examples.
"""
@@ -28,9 +27,12 @@
message_box(('Plotting "BabelColor Average" colour rendition charts spectral '
'power distributions.'))
-multi_spd_plot([colour.COLOURCHECKERS_SPDS['BabelColor Average'][value]
- for key, value in
- sorted(COLOURCHECKER_INDEXES_TO_NAMES_MAPPING.items())],
- use_spds_colours=True,
- title=('BabelColor Average - '
- 'Relative Spectral Power Distributions'))
+multi_spd_plot(
+ [
+ colour.COLOURCHECKERS_SPDS['BabelColor Average'][value]
+ for key, value in sorted(
+ COLOURCHECKER_INDEXES_TO_NAMES_MAPPING.items())
+ ],
+ use_spds_colours=True,
+ title=('BabelColor Average - '
+ 'Relative Spectral Power Distributions'))
diff --git a/colour/examples/plotting/examples_colorimetry_plots.py b/colour/examples/plotting/examples_colorimetry_plots.py
index c808e06354..ee9f4a4667 100644
--- a/colour/examples/plotting/examples_colorimetry_plots.py
+++ b/colour/examples/plotting/examples_colorimetry_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colorimetry plotting examples.
"""
@@ -31,9 +30,8 @@
message_box(('Plotting "CIE Standard Illuminant "A", "B", and "C" with their '
'normalised colours.'))
-multi_illuminants_relative_spd_plot(['A', 'B', 'C'],
- use_spds_colours=True,
- normalise_spds_colours=True)
+multi_illuminants_relative_spd_plot(
+ ['A', 'B', 'C'], use_spds_colours=True, normalise_spds_colours=True)
print('\n')
@@ -126,7 +124,8 @@
765: 0.465,
770: 0.448,
775: 0.432,
- 780: 0.421}
+ 780: 0.421
+}
# http://speclib.jpl.nasa.gov/speclibdata/
# jhu.becknic.manmade.roofing.metal.solid.0525uuua.spectrum.txt # noqa
@@ -352,7 +351,8 @@
796: 9.31,
798: 9.26,
800: 9.21,
- 820: 8.59}
+ 820: 8.59
+}
# http://speclib.jpl.nasa.gov/speclibdata/
# jhu.becknic.manmade.construction.marble.solid.0722uuu.spectrum.txt
@@ -578,21 +578,22 @@
796: 84.31,
798: 84.34,
800: 84.34,
- 820: 84.47}
+ 820: 84.47
+}
message_box('Plotting various single spectral power distributions.')
single_spd_plot(colour.SpectralPowerDistribution('Custom', sample_spd_data))
-single_spd_plot(colour.SpectralPowerDistribution(
- 'Galvanized Steel Metal',
- galvanized_steel_metal_spd_data))
+single_spd_plot(
+ colour.SpectralPowerDistribution('Galvanized Steel Metal',
+ galvanized_steel_metal_spd_data))
print('\n')
message_box('Plotting multiple spectral power distributions.')
-multi_spd_plot((colour.SpectralPowerDistribution(
- 'Galvanized Steel Metal',
- galvanized_steel_metal_spd_data),
- colour.SpectralPowerDistribution('White Marble', white_marble_spd_data)))
+multi_spd_plot(
+ (colour.SpectralPowerDistribution('Galvanized Steel Metal',
+ galvanized_steel_metal_spd_data),
+ colour.SpectralPowerDistribution('White Marble', white_marble_spd_data)))
print('\n')
@@ -798,7 +799,8 @@
774: 9.2280000e-002,
776: 9.0480000e-002,
778: 9.0020000e-002,
- 780: 8.8190000e-002}
+ 780: 8.8190000e-002
+}
street_light_spd = colour.SpectralPowerDistribution('Street Light',
street_light_spd_data)
@@ -808,23 +810,28 @@
bandpass_corrected_street_light_spd = colour.bandpass_correction(
bandpass_corrected_street_light_spd, method='Stearns 1988')
-multi_spd_plot((street_light_spd, bandpass_corrected_street_light_spd),
- title='Stearns Bandpass Correction')
+multi_spd_plot(
+ (street_light_spd, bandpass_corrected_street_light_spd),
+ title='Stearns Bandpass Correction')
print('\n')
message_box('Plotting a single "cone fundamentals" colour matching functions.')
-single_cmfs_plot('Stockman & Sharpe 2 Degree Cone Fundamentals',
- y_label='Sensitivity',
- bounding_box=(390, 870, 0, 1.1))
+single_cmfs_plot(
+ 'Stockman & Sharpe 2 Degree Cone Fundamentals',
+ y_label='Sensitivity',
+ bounding_box=(390, 870, 0, 1.1))
print('\n')
message_box('Plotting multiple "cone fundamentals" colour matching functions.')
-multi_cmfs_plot(['Stockman & Sharpe 2 Degree Cone Fundamentals',
- 'Stockman & Sharpe 10 Degree Cone Fundamentals'],
- y_label='Sensitivity',
- bounding_box=(390, 870, 0, 1.1))
+multi_cmfs_plot(
+ [
+ 'Stockman & Sharpe 2 Degree Cone Fundamentals',
+ 'Stockman & Sharpe 10 Degree Cone Fundamentals'
+ ],
+ y_label='Sensitivity',
+ bounding_box=(390, 870, 0, 1.1))
print('\n')
@@ -832,20 +839,28 @@
pprint(sorted(colour.CMFS.keys()))
single_cmfs_plot('CIE 1931 2 Degree Standard Observer')
single_cmfs_plot('CIE 1964 10 Degree Standard Observer')
-single_cmfs_plot('Stiles & Burch 1955 2 Degree RGB CMFs',
- bounding_box=(390, 830, -0.5, 3.5))
-single_cmfs_plot('Stiles & Burch 1959 10 Degree RGB CMFs',
- bounding_box=(390, 830, -0.5, 3.5))
+single_cmfs_plot(
+ 'Stiles & Burch 1955 2 Degree RGB CMFs',
+ bounding_box=(390, 830, -0.5, 3.5))
+single_cmfs_plot(
+ 'Stiles & Burch 1959 10 Degree RGB CMFs',
+ bounding_box=(390, 830, -0.5, 3.5))
print('\n')
message_box('Comparing various colour matching functions.')
-multi_cmfs_plot(['CIE 1931 2 Degree Standard Observer',
- 'CIE 1964 10 Degree Standard Observer'])
-multi_cmfs_plot(['CIE 2012 10 Degree Standard Observer',
- 'CIE 1964 10 Degree Standard Observer'])
-multi_cmfs_plot(['Wright & Guild 1931 2 Degree RGB CMFs',
- 'Stiles & Burch 1955 2 Degree RGB CMFs'])
+multi_cmfs_plot([
+ 'CIE 1931 2 Degree Standard Observer',
+ 'CIE 1964 10 Degree Standard Observer'
+])
+multi_cmfs_plot([
+ 'CIE 2012 10 Degree Standard Observer',
+ 'CIE 1964 10 Degree Standard Observer'
+])
+multi_cmfs_plot([
+ 'Wright & Guild 1931 2 Degree RGB CMFs',
+ 'Stiles & Burch 1955 2 Degree RGB CMFs'
+])
print('\n')
@@ -856,12 +871,13 @@
print('\n')
message_box('Plotting photopic luminous efficiency functions.')
-multi_spd_plot(colour.PHOTOPIC_LEFS.values(),
- title='Luminous Efficiency Functions',
- y_label='Luminous Efficiency',
- legend_location='upper right',
- y_tighten=True,
- margins=(0, 0, 0, .1))
+multi_spd_plot(
+ colour.PHOTOPIC_LEFS.values(),
+ title='Luminous Efficiency Functions',
+ y_label='Luminous Efficiency',
+ legend_location='upper right',
+ y_tighten=True,
+ margins=(0, 0, 0, .1))
print('\n')
@@ -883,13 +899,14 @@
mesopic_luminous_efficiency_function = (
colour.mesopic_luminous_efficiency_function(0.2))
-multi_spd_plot((mesopic_luminous_efficiency_function,
- colour.PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
- colour.SCOTOPIC_LEFS['CIE 1951 Scotopic Standard Observer']),
- y_label='Luminous Efficiency',
- legend_location='upper right',
- y_tighten=True,
- margins=(0, 0, 0, .1))
+multi_spd_plot(
+ (mesopic_luminous_efficiency_function,
+ colour.PHOTOPIC_LEFS['CIE 1924 Photopic Standard Observer'],
+ colour.SCOTOPIC_LEFS['CIE 1951 Scotopic Standard Observer']),
+ y_label='Luminous Efficiency',
+ legend_location='upper right',
+ y_tighten=True,
+ margins=(0, 0, 0, .1))
print('\n')
@@ -904,8 +921,8 @@
print('\n')
message_box('Plotting various blackbody spectral radiance.')
-blackbody_spectral_radiance_plot(temperature=3500,
- blackbody='VY Canis Majoris')
+blackbody_spectral_radiance_plot(
+ temperature=3500, blackbody='VY Canis Majoris')
blackbody_spectral_radiance_plot(temperature=5778, blackbody='The Sun')
blackbody_spectral_radiance_plot(temperature=12130, blackbody='Rigel')
@@ -918,28 +935,29 @@
ASTM_G_173_spd.interpolate(colour.SpectralShape(interval=5), method='Linear')
-blackbody_spd = colour.blackbody_spd(
- 5778,
- ASTM_G_173_spd.shape)
+blackbody_spd = colour.blackbody_spd(5778, ASTM_G_173_spd.shape)
blackbody_spd.name = 'The Sun - 5778K'
-multi_spd_plot((ASTM_G_173_spd, blackbody_spd),
- y_label='W / (sr m$^2$) / m',
- legend_location='upper right')
+multi_spd_plot(
+ (ASTM_G_173_spd, blackbody_spd),
+ y_label='W / (sr m$^2$) / m',
+ legend_location='upper right')
print('\n')
message_box('Plotting various "blackbody" spectral power distributions.')
blackbody_spds = [
colour.blackbody_spd(i, colour.SpectralShape(0, 10000, 10))
- for i in range(1000, 15000, 1000)]
-
-multi_spd_plot(blackbody_spds,
- y_label='W / (sr m$^2$) / m',
- use_spds_colours=True,
- normalise_spds_colours=True,
- legend_location='upper right',
- bounding_box=(0, 1250, 0, 2.5e15))
+ for i in range(1000, 15000, 1000)
+]
+
+multi_spd_plot(
+ blackbody_spds,
+ y_label='W / (sr m$^2$) / m',
+ use_spds_colours=True,
+ normalise_spds_colours=True,
+ legend_location='upper right',
+ bounding_box=(0, 1250, 0, 2.5e15))
print('\n')
diff --git a/colour/examples/plotting/examples_common_plots.py b/colour/examples/plotting/examples_common_plots.py
index 4f400bedac..c6302932ba 100644
--- a/colour/examples/plotting/examples_common_plots.py
+++ b/colour/examples/plotting/examples_common_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases common plotting examples.
"""
diff --git a/colour/examples/plotting/examples_corresponding.py b/colour/examples/plotting/examples_corresponding.py
index cfd6458bbc..56c4c077d3 100644
--- a/colour/examples/plotting/examples_corresponding.py
+++ b/colour/examples/plotting/examples_corresponding.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases corresponding chromaticities prediction plotting examples.
"""
diff --git a/colour/examples/plotting/examples_diagrams_plots.py b/colour/examples/plotting/examples_diagrams_plots.py
index ceb92a7924..57a93cf3a2 100644
--- a/colour/examples/plotting/examples_diagrams_plots.py
+++ b/colour/examples/plotting/examples_diagrams_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *CIE* chromaticity diagrams plotting examples.
"""
diff --git a/colour/examples/plotting/examples_models_plots.py b/colour/examples/plotting/examples_models_plots.py
index 422efacb6c..71e68e526c 100644
--- a/colour/examples/plotting/examples_models_plots.py
+++ b/colour/examples/plotting/examples_models_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour models plotting examples.
"""
@@ -44,27 +43,21 @@
message_box('Plotting "RGB" chromaticity coordinates in '
'"CIE 1931 Chromaticity Diagram".')
RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
- RGB,
- 'Rec. 709',
- colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
+ RGB, 'Rec. 709', colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
print('\n')
message_box('Plotting "RGB" chromaticity coordinates in '
'"CIE 1960 UCS Chromaticity Diagram".')
RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
- RGB,
- 'Rec. 709',
- colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
+ RGB, 'Rec. 709', colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
print('\n')
message_box('Plotting "RGB" chromaticity coordinates in '
'"CIE 1976 UCS Chromaticity Diagram".')
RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(
- RGB,
- 'Rec. 709',
- colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
+ RGB, 'Rec. 709', colourspaces=['ACEScg', 'S-Gamut', 'Pointer Gamut'])
print('\n')
@@ -72,10 +65,11 @@
'"CIE 1931 Chromaticity Diagram".'))
colour.RGB_COLOURSPACES['Awful RGB'] = colour.RGB_Colourspace(
'Awful RGB',
- primaries=np.array([[0.10, 0.20],
- [0.30, 0.15],
- [0.05, 0.60]]),
- whitepoint=np.array([1.0 / 3.0, 1.0 / 3.0]))
+ primaries=np.array(
+ [[0.10, 0.20],
+ [0.30, 0.15],
+ [0.05, 0.60]]),
+ whitepoint=np.array([1.0 / 3.0, 1.0 / 3.0])) # yapf: disable
pprint(sorted(colour.RGB_COLOURSPACES.keys()))
RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(['Rec. 709', 'Awful RGB'])
diff --git a/colour/examples/plotting/examples_notation_plots.py b/colour/examples/plotting/examples_notation_plots.py
index fa55b151d9..0265e7be36 100644
--- a/colour/examples/plotting/examples_notation_plots.py
+++ b/colour/examples/plotting/examples_notation_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour notation systems plotting examples.
"""
@@ -18,5 +17,4 @@
print('\n')
message_box('Plotting multiple "Munsell" value functions.')
-multi_munsell_value_function_plot(['Ladd 1955',
- 'Saunderson 1944'])
+multi_munsell_value_function_plot(['Ladd 1955', 'Saunderson 1944'])
diff --git a/colour/examples/plotting/examples_phenomenon_plots.py b/colour/examples/plotting/examples_phenomenon_plots.py
index 1527ea1460..6c8190d3ec 100644
--- a/colour/examples/plotting/examples_phenomenon_plots.py
+++ b/colour/examples/plotting/examples_phenomenon_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases optical phenomenons plotting examples.
"""
@@ -27,11 +26,12 @@
rayleigh_spd = rayleigh_scattering_spd(CO2_concentration=ppm)
rayleigh_spd.name = name_template.format(ppm)
rayleigh_spds.append(rayleigh_spd)
-multi_spd_plot(rayleigh_spds,
- title=('Rayleigh Optical Depth - '
- 'Comparing "C02" Concentration Influence'),
- y_label='Optical Depth',
- legend_location='upper right')
+multi_spd_plot(
+ rayleigh_spds,
+ title=('Rayleigh Optical Depth - '
+ 'Comparing "C02" Concentration Influence'),
+ y_label='Optical Depth',
+ legend_location='upper right')
print('\n')
diff --git a/colour/examples/plotting/examples_quality_plots.py b/colour/examples/plotting/examples_quality_plots.py
index eab24512f0..8db40c58b5 100644
--- a/colour/examples/plotting/examples_quality_plots.py
+++ b/colour/examples/plotting/examples_quality_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour quality plotting examples.
"""
@@ -21,10 +20,10 @@
message_box(('Plotting various illuminants and light sources '
'"Colour Rendering Index (CRI)".'))
-multi_spd_colour_rendering_index_bars_plot((
- colour.ILLUMINANTS_RELATIVE_SPDS['F2'],
- colour.LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)'],
- colour.LIGHT_SOURCES_RELATIVE_SPDS['Kinoton 75P']))
+multi_spd_colour_rendering_index_bars_plot(
+ (colour.ILLUMINANTS_RELATIVE_SPDS['F2'],
+ colour.LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)'],
+ colour.LIGHT_SOURCES_RELATIVE_SPDS['Kinoton 75P']))
print('\n')
@@ -36,7 +35,7 @@
message_box(('Plotting various illuminants and light sources '
'"Colour Quality Scale (CQS)".'))
-multi_spd_colour_quality_scale_bars_plot((
- colour.ILLUMINANTS_RELATIVE_SPDS['F2'],
- colour.LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)'],
- colour.LIGHT_SOURCES_RELATIVE_SPDS['Kinoton 75P']))
+multi_spd_colour_quality_scale_bars_plot(
+ (colour.ILLUMINANTS_RELATIVE_SPDS['F2'],
+ colour.LIGHT_SOURCES_RELATIVE_SPDS['F32T8/TL841 (Triphosphor)'],
+ colour.LIGHT_SOURCES_RELATIVE_SPDS['Kinoton 75P']))
diff --git a/colour/examples/plotting/examples_temperature_plots.py b/colour/examples/plotting/examples_temperature_plots.py
index 3e2013d925..a0372fd4c7 100644
--- a/colour/examples/plotting/examples_temperature_plots.py
+++ b/colour/examples/plotting/examples_temperature_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour temperature and correlated colour temperature plotting
examples.
diff --git a/colour/examples/plotting/examples_volume_plots.py b/colour/examples/plotting/examples_volume_plots.py
index b0d5b9332e..915eb4b9a6 100644
--- a/colour/examples/plotting/examples_volume_plots.py
+++ b/colour/examples/plotting/examples_volume_plots.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases colour models volume and gamut plotting examples.
"""
@@ -10,27 +9,27 @@
from colour.plotting import * # noqa
from colour.utilities.verbose import message_box
-
message_box('Colour Models Volume and Gamut Plots')
colour_plotting_defaults()
message_box(('Plotting "Rec. 709" RGB colourspace volume in "CIE xyY" '
'colourspace.'))
-RGB_colourspaces_gamuts_plot(('Rec. 709',),
- reference_colourspace='CIE xyY')
+RGB_colourspaces_gamuts_plot(('Rec. 709', ), reference_colourspace='CIE xyY')
print('\n')
message_box(('Comparing "Rec. 709" and "ACEScg" RGB colourspaces volume '
'in "CIE Lab" colourspace.'))
-RGB_colourspaces_gamuts_plot(('Rec. 709', 'ACEScg'),
- reference_colourspace='CIE Lab',
- style={
- 'face_colours': (None, (0.25, 0.25, 0.25)),
- 'edge_colours': (None, (0.25, 0.25, 0.25)),
- 'edge_alpha': (1.0, 0.1),
- 'face_alpha': (1.0, 0.0)})
+RGB_colourspaces_gamuts_plot(
+ ('Rec. 709', 'ACEScg'),
+ reference_colourspace='CIE Lab',
+ style={
+ 'face_colours': (None, (0.25, 0.25, 0.25)),
+ 'edge_colours': (None, (0.25, 0.25, 0.25)),
+ 'edge_alpha': (1.0, 0.1),
+ 'face_alpha': (1.0, 0.0)
+ })
print('\n')
@@ -39,15 +38,16 @@
RGB = np.random.random((32, 32, 3))
-RGB_scatter_plot(RGB,
- 'ACEScg',
- reference_colourspace='CIE Lab',
- colourspaces=('ACEScg', 'Rec. 709'),
- face_colours=((0.25, 0.25, 0.25), None),
- edge_colours=((0.25, 0.25, 0.25), None),
- edge_alpha=(0.1, 0.5),
- face_alpha=(0.1, 0.5),
- grid_face_colours=(0.1, 0.1, 0.1),
- grid_edge_colours=(0.1, 0.1, 0.1),
- grid_edge_alpha=0.5,
- grid_face_alpha=0.1)
+RGB_scatter_plot(
+ RGB,
+ 'ACEScg',
+ reference_colourspace='CIE Lab',
+ colourspaces=('ACEScg', 'Rec. 709'),
+ face_colours=((0.25, 0.25, 0.25), None),
+ edge_colours=((0.25, 0.25, 0.25), None),
+ edge_alpha=(0.1, 0.5),
+ face_alpha=(0.1, 0.5),
+ grid_face_colours=(0.1, 0.1, 0.1),
+ grid_edge_colours=(0.1, 0.1, 0.1),
+ grid_edge_alpha=0.5,
+ grid_face_alpha=0.1)
diff --git a/colour/examples/quality/examples_cqs.py b/colour/examples/quality/examples_cqs.py
index f6a2967f8b..f6e325f73a 100644
--- a/colour/examples/quality/examples_cqs.py
+++ b/colour/examples/quality/examples_cqs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Colour Quality Scale* (CQS) computations.
"""
@@ -13,23 +12,23 @@
message_box('"Colour Quality Scale (CQS)" Computations')
message_box('Computing "F2" illuminant "Colour Quality Scale (CQS)".')
-print(colour.colour_quality_scale(
- colour.ILLUMINANTS_RELATIVE_SPDS['F2']))
+print(colour.colour_quality_scale(colour.ILLUMINANTS_RELATIVE_SPDS['F2']))
print('\n')
message_box(('Computing "H38HT-100" mercury lamp "Colour Quality Scale (CQS)" '
'with detailed output data.'))
-pprint(colour.colour_quality_scale(
- colour.LIGHT_SOURCES_RELATIVE_SPDS['H38HT-100 (Mercury)'],
- additional_data=True))
+pprint(
+ colour.colour_quality_scale(
+ colour.LIGHT_SOURCES_RELATIVE_SPDS['H38HT-100 (Mercury)'],
+ additional_data=True))
print('\n')
message_box('Computing "SDW-T 100W/LV Super HPS" lamp '
'"Colour Quality Scale (CQS)".')
-print(colour.colour_quality_scale(
- colour.LIGHT_SOURCES_RELATIVE_SPDS['SDW-T 100W/LV (Super HPS)']))
+print(colour.colour_quality_scale(colour.LIGHT_SOURCES_RELATIVE_SPDS[
+ 'SDW-T 100W/LV (Super HPS)']))
print('\n')
@@ -115,7 +114,8 @@
765: 0.00340568,
770: 0.00261153,
775: 0.00258850,
- 780: 0.00293663}
+ 780: 0.00293663
+}
print(colour.colour_quality_scale(
colour.SpectralPowerDistribution('Sample', SAMPLE_SPD_DATA)))
diff --git a/colour/examples/quality/examples_cri.py b/colour/examples/quality/examples_cri.py
index 06a033db47..e370cd8dab 100644
--- a/colour/examples/quality/examples_cri.py
+++ b/colour/examples/quality/examples_cri.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases *Colour Rendering Index* (CRI) computations.
"""
@@ -13,23 +12,21 @@
message_box('Colour Rendering Index Computations')
message_box('Computing "F2" illuminant "Colour Rendering Index (CRI)".')
-print(colour.colour_rendering_index(
- colour.ILLUMINANTS_RELATIVE_SPDS['F2']))
+print(colour.colour_rendering_index(colour.ILLUMINANTS_RELATIVE_SPDS['F2']))
print('\n')
message_box(('Computing "F2" illuminant "Colour Rendering Index" (CRI) with '
'detailed output data.'))
-pprint(colour.colour_rendering_index(
- colour.ILLUMINANTS_RELATIVE_SPDS['F2'],
- additional_data=True))
+pprint(
+ colour.colour_rendering_index(
+ colour.ILLUMINANTS_RELATIVE_SPDS['F2'], additional_data=True))
print('\n')
message_box('Computing "CIE Standard Illuminant A" '
'"Colour Rendering Index (CRI)".')
-print(colour.colour_rendering_index(
- colour.ILLUMINANTS_RELATIVE_SPDS['A']))
+print(colour.colour_rendering_index(colour.ILLUMINANTS_RELATIVE_SPDS['A']))
print('\n')
@@ -115,7 +112,8 @@
765: 0.00340568,
770: 0.00261153,
775: 0.00258850,
- 780: 0.00293663}
+ 780: 0.00293663
+}
print(colour.colour_rendering_index(
colour.SpectralPowerDistribution('Sample', SAMPLE_SPD_DATA)))
diff --git a/colour/examples/recovery/examples_meng2015.py b/colour/examples/recovery/examples_meng2015.py
new file mode 100644
index 0000000000..4ae64a1b43
--- /dev/null
+++ b/colour/examples/recovery/examples_meng2015.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Showcases reflectance recovery computations using *Meng et al. (2015)* method.
+"""
+
+import colour
+from colour.utilities.verbose import message_box
+
+message_box('"Meng et al. (2015)" - Reflectance Recovery Computations')
+
+XYZ = (1.14176346, 1.00000000, 0.49815206)
+message_box(('Recovering reflectance using "Meng et al. (2015)" method from '
+ 'given "XYZ" tristimulus values:\n'
+ '\n\tXYZ: {0}'.format(XYZ)))
+print(colour.XYZ_to_spectral_Meng2015(XYZ))
diff --git a/colour/examples/recovery/examples_smits1999.py b/colour/examples/recovery/examples_smits1999.py
index 9d3eb81b89..c600b36594 100644
--- a/colour/examples/recovery/examples_smits1999.py
+++ b/colour/examples/recovery/examples_smits1999.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases reflectance recovery computations using *Smits (1999)* method.
"""
@@ -18,8 +17,8 @@
print('\n')
-message_box((
- 'An analysis of "Smits (1999)" method is available at the '
- 'following url : '
- 'http://nbviewer.jupyter.org/github/colour-science/colour-website/'
- 'blob/master/ipython/about_reflectance_recovery.ipynb'))
+message_box(
+ ('An analysis of "Smits (1999)" method is available at the '
+ 'following url : '
+ 'http://nbviewer.jupyter.org/github/colour-science/colour-website/'
+ 'blob/master/ipython/about_reflectance_recovery.ipynb'))
diff --git a/colour/examples/temperature/examples_cct.py b/colour/examples/temperature/examples_cct.py
index 76277aba12..308f3dee9f 100644
--- a/colour/examples/temperature/examples_cct.py
+++ b/colour/examples/temperature/examples_cct.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases correlated colour temperature computations.
"""
diff --git a/colour/examples/volume/examples_rgb.py b/colour/examples/volume/examples_rgb.py
index 7c813907c1..aebd98cf4a 100644
--- a/colour/examples/volume/examples_rgb.py
+++ b/colour/examples/volume/examples_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Showcases RGB colourspace volume computations.
"""
@@ -20,14 +19,11 @@
message_box(('Computing "ProPhoto RGB" RGB colourspace volume using '
'{0} samples.'.format(samples)))
print(colour.RGB_colourspace_volume_MonteCarlo(
- colour.PROPHOTO_RGB_COLOURSPACE,
- samples=samples,
- limits=limits * 1.1))
+ colour.PROPHOTO_RGB_COLOURSPACE, samples=samples, limits=limits * 1.1))
print('\n')
message_box(('Computing "ProPhoto RGB" RGB colourspace coverage of Pointer\'s '
'Gamut using {0} samples.'.format(samples)))
print(colour.RGB_colourspace_pointer_gamut_coverage_MonteCarlo(
- colour.PROPHOTO_RGB_COLOURSPACE,
- samples=samples))
+ colour.PROPHOTO_RGB_COLOURSPACE, samples=samples))
diff --git a/colour/io/__init__.py b/colour/io/__init__.py
index a471d23839..ebc35086bc 100644
--- a/colour/io/__init__.py
+++ b/colour/io/__init__.py
@@ -5,15 +5,14 @@
from .ies_tm2714 import IES_TM2714_Spd
from .image import read_image, write_image
-from .tabular import (
- read_spectral_data_from_csv_file,
- read_spds_from_csv_file,
- write_spds_to_csv_file)
+from .tabular import (read_spectral_data_from_csv_file,
+ read_spds_from_csv_file, write_spds_to_csv_file)
from .xrite import read_spds_from_xrite_file
__all__ = ['IES_TM2714_Spd']
__all__ += ['read_image', 'write_image']
-__all__ += ['read_spectral_data_from_csv_file',
- 'read_spds_from_csv_file',
- 'write_spds_to_csv_file']
+__all__ += [
+ 'read_spectral_data_from_csv_file', 'read_spds_from_csv_file',
+ 'write_spds_to_csv_file'
+]
__all__ += ['read_spds_from_xrite_file']
diff --git a/colour/io/common.py b/colour/io/common.py
index defae8acc5..dd8d461ae7 100644
--- a/colour/io/common.py
+++ b/colour/io/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Input / Output Common Utilities
===============================
diff --git a/colour/io/ies_tm2714.py b/colour/io/ies_tm2714.py
index 8402a50bf6..3ef8baf6ce 100644
--- a/colour/io/ies_tm2714.py
+++ b/colour/io/ies_tm2714.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
IES TM-27-14 Data Input / Output
================================
@@ -34,25 +33,19 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['IES_TM2714_VERSION',
- 'IES_TM2714_NAMESPACE',
- 'IES_TM2714_ElementSpecification',
- 'IES_TM2714_Header',
- 'IES_TM2714_Spd']
+__all__ = [
+ 'IES_TM2714_VERSION', 'IES_TM2714_NAMESPACE',
+ 'IES_TM2714_ElementSpecification', 'IES_TM2714_Header', 'IES_TM2714_Spd'
+]
IES_TM2714_VERSION = '1.0'
IES_TM2714_NAMESPACE = 'http://www.ies.org/iestm2714'
class IES_TM2714_ElementSpecification(
- namedtuple(
- 'IES_TM2714_ElementSpecification',
- ('element',
- 'attribute',
- 'type',
- 'required',
- 'read_conversion',
- 'write_conversion'))):
+ namedtuple('IES_TM2714_ElementSpecification',
+ ('element', 'attribute', 'type', 'required',
+ 'read_conversion', 'write_conversion'))):
"""
*IES TM-27-14* spectral data XML file element specification.
@@ -87,12 +80,7 @@ def __new__(cls,
"""
return super(IES_TM2714_ElementSpecification, cls).__new__(
- cls,
- element,
- attribute,
- type_,
- required,
- read_conversion,
+ cls, element, attribute, type_, required, read_conversion,
write_conversion)
@@ -166,45 +154,33 @@ def __init__(self,
comments=None):
self._mapping = Structure(**{
- 'element': 'Header',
- 'elements': (
- IES_TM2714_ElementSpecification(
- 'Manufacturer',
- 'manufacturer'),
- IES_TM2714_ElementSpecification(
+ 'element':
+ 'Header',
+ 'elements': (IES_TM2714_ElementSpecification(
+ 'Manufacturer',
+ 'manufacturer'), IES_TM2714_ElementSpecification(
'CatalogNumber',
- 'catalog_number'),
- IES_TM2714_ElementSpecification(
- 'Description',
- 'description',
- required=True),
- IES_TM2714_ElementSpecification(
- 'DocumentCreator',
- 'document_creator',
- required=True),
- IES_TM2714_ElementSpecification(
- 'UniqueIdentifier',
- 'unique_identifier'),
- IES_TM2714_ElementSpecification(
- 'MeasurementEquipment',
- 'measurement_equipment'),
- IES_TM2714_ElementSpecification(
- 'Laboratory',
- 'laboratory'),
- IES_TM2714_ElementSpecification(
- 'ReportNumber',
- 'report_number'),
- IES_TM2714_ElementSpecification(
- 'ReportDate',
- 'report_date'),
- IES_TM2714_ElementSpecification(
- 'DocumentCreationDate',
- 'document_creation_date',
- required=True),
- IES_TM2714_ElementSpecification(
- 'Comments',
- 'comments',
- False))})
+ 'catalog_number'), IES_TM2714_ElementSpecification(
+ 'Description', 'description',
+ required=True), IES_TM2714_ElementSpecification(
+ 'DocumentCreator',
+ 'document_creator',
+ required=True), IES_TM2714_ElementSpecification(
+ 'UniqueIdentifier', 'unique_identifier'),
+ IES_TM2714_ElementSpecification(
+ 'MeasurementEquipment', 'measurement_equipment'),
+ IES_TM2714_ElementSpecification(
+ 'Laboratory',
+ 'laboratory'), IES_TM2714_ElementSpecification(
+ 'ReportNumber', 'report_number'),
+ IES_TM2714_ElementSpecification(
+ 'ReportDate', 'report_date'),
+ IES_TM2714_ElementSpecification(
+ 'DocumentCreationDate',
+ 'document_creation_date',
+ required=True), IES_TM2714_ElementSpecification(
+ 'Comments', 'comments', False))
+ })
self._manufacturer = None
self.manufacturer = manufacturer
@@ -256,8 +232,7 @@ def mapping(self, value):
Attribute value.
"""
- raise AttributeError(
- '"{0}" attribute is read only!'.format('mapping'))
+ raise AttributeError('"{0}" attribute is read only!'.format('mapping'))
@property
def manufacturer(self):
@@ -284,9 +259,9 @@ def manufacturer(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('manufacturer', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'manufacturer', value))
self._manufacturer = value
@property
@@ -314,9 +289,9 @@ def catalog_number(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('catalog_number', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'catalog_number', value))
self._catalog_number = value
@property
@@ -344,9 +319,9 @@ def description(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('description', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'description', value))
self._description = value
@property
@@ -374,9 +349,9 @@ def document_creator(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('document_creator', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'document_creator', value))
self._document_creator = value
@property
@@ -404,9 +379,9 @@ def unique_identifier(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('unique_identifier', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'unique_identifier', value))
self._unique_identifier = value
@property
@@ -434,10 +409,9 @@ def measurement_equipment(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format(
- 'measurement_equipment', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'measurement_equipment', value))
self._measurement_equipment = value
@property
@@ -465,9 +439,9 @@ def laboratory(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('laboratory', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'laboratory', value))
self._laboratory = value
@property
@@ -495,9 +469,9 @@ def report_number(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('report_number', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'report_number', value))
self._report_number = value
@property
@@ -525,9 +499,9 @@ def report_date(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('report_date', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'report_date', value))
self._report_date = value
@property
@@ -555,10 +529,9 @@ def document_creation_date(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format(
- 'document_creation_date', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'document_creation_date', value))
self._document_creation_date = value
@property
@@ -586,9 +559,9 @@ def comments(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('comments', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'comments', value))
self._comments = value
@@ -641,13 +614,13 @@ class IES_TM2714_Spd(SpectralPowerDistribution):
*Transmission Geometry*
- - 0:0: Normal / normal.
- - di:0: Diffuse / normal, regular component included.
- - de:0: Diffuse / normal, regular component excluded.
- - 0:di: Normal / diffuse, regular component included.
- - 0:de: Normal / diffuse, regular component excluded.
- - d:d: Diffuse / diffuse.
- - other: User-specified in comments.
+ - 0:0: Normal / normal.
+ - di:0: Diffuse / normal, regular component included.
+ - de:0: Diffuse / normal, regular component excluded.
+ - 0:di: Normal / diffuse, regular component included.
+ - 0:de: Normal / diffuse, regular component excluded.
+ - d:d: Diffuse / diffuse.
+ - other: User-specified in comments.
Attributes
----------
@@ -691,35 +664,29 @@ def __init__(self,
super(IES_TM2714_Spd, self).__init__(name=None, data={})
self._mapping = Structure(**{
- 'element': 'SpectralDistribution',
+ 'element':
+ 'SpectralDistribution',
'elements': (
IES_TM2714_ElementSpecification(
- 'SpectralQuantity',
- 'spectral_quantity',
- required=True),
- IES_TM2714_ElementSpecification(
- 'ReflectionGeometry',
- 'reflection_geometry'),
+ 'SpectralQuantity', 'spectral_quantity',
+ required=True), IES_TM2714_ElementSpecification(
+ 'ReflectionGeometry', 'reflection_geometry'),
IES_TM2714_ElementSpecification(
'TransmissionGeometry',
- 'transmission_geometry'),
- IES_TM2714_ElementSpecification(
- 'BandwidthFWHM',
- 'bandwidth_FWHM',
- read_conversion=np.float_),
+ 'transmission_geometry'), IES_TM2714_ElementSpecification(
+ 'BandwidthFWHM',
+ 'bandwidth_FWHM',
+ read_conversion=np.float_),
IES_TM2714_ElementSpecification(
'BandwidthCorrected',
'bandwidth_corrected',
- read_conversion=(
- lambda x: True
- if x == 'true' else False),
+ read_conversion=(lambda x: True if x == 'true' else False),
write_conversion=(
- lambda x: 'true'
- if x is True else 'False'))),
- 'data': IES_TM2714_ElementSpecification(
- 'SpectralData',
- 'wavelength',
- required=True)})
+ lambda x: 'true' if x is True else 'False'))),
+ 'data':
+ IES_TM2714_ElementSpecification(
+ 'SpectralData', 'wavelength', required=True)
+ })
self._path = None
self.path = path
@@ -763,8 +730,7 @@ def mapping(self, value):
Attribute value.
"""
- raise AttributeError(
- '"{0}" attribute is read only!'.format('mapping'))
+ raise AttributeError('"{0}" attribute is read only!'.format('mapping'))
@property
def path(self):
@@ -791,9 +757,9 @@ def path(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('path', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'path', value))
self._path = value
@property
@@ -821,9 +787,9 @@ def header(self, value):
"""
if value is not None:
- assert isinstance(value, IES_TM2714_Header), (
- ('"{0}" attribute: "{1}" is not a "IES_TM2714_Header" '
- 'instance!').format('header', value))
+ assert isinstance(value, IES_TM2714_Header), ((
+ '"{0}" attribute: "{1}" is not a "IES_TM2714_Header" '
+ 'instance!').format('header', value))
self._header = value
@property
@@ -851,9 +817,9 @@ def spectral_quantity(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('spectral_quantity', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'spectral_quantity', value))
self._spectral_quantity = value
@property
@@ -881,10 +847,9 @@ def reflection_geometry(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format(
- 'reflection_geometry', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'reflection_geometry', value))
self._reflection_geometry = value
@property
@@ -912,10 +877,9 @@ def transmission_geometry(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format(
- 'transmission_geometry', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'transmission_geometry', value))
self._transmission_geometry = value
@property
@@ -1008,7 +972,7 @@ def read(self):
tree = ElementTree.parse(self._path)
root = tree.getroot()
- namespace = re.match('\{(.*)\}', root.tag).group(1)
+ namespace = re.match('{(.*)}', root.tag).group(1)
self.name = os.path.splitext(os.path.basename(self._path))[0]
@@ -1017,18 +981,18 @@ def read(self):
for header_element in (self.header, self):
mapping = header_element.mapping
for specification in mapping.elements:
- element = root.find(formatter.format(
- namespace, mapping.element, specification.element))
+ element = root.find(
+ formatter.format(namespace, mapping.element,
+ specification.element))
if element is not None:
- setattr(header_element,
- specification.attribute,
+ setattr(header_element, specification.attribute,
specification.read_conversion(element.text))
# Reading spectral data.
- for spectral_data in iterator('{{{0}}}{1}'.format(
- namespace, self.mapping.data.element)):
- wavelength = np.float_(spectral_data.attrib[
- self.mapping.data.attribute])
+ for spectral_data in iterator(
+ '{{{0}}}{1}'.format(namespace, self.mapping.data.element)):
+ wavelength = np.float_(
+ spectral_data.attrib[self.mapping.data.attribute])
value = np.float_(spectral_data.text)
self[wavelength] = value
@@ -1060,8 +1024,10 @@ def write(self):
"""
root = ElementTree.Element('IESTM2714')
- root.attrib = {'xmlns': IES_TM2714_NAMESPACE,
- 'version': IES_TM2714_VERSION}
+ root.attrib = {
+ 'xmlns': IES_TM2714_NAMESPACE,
+ 'version': IES_TM2714_VERSION
+ }
spectral_distribution = None
for header_element in (self.header, self):
@@ -1082,8 +1048,9 @@ def write(self):
mapping.data.element)
element_child.text = mapping.data.write_conversion(value)
element_child.attrib = {
- mapping.data.attribute: mapping.data.write_conversion(
- wavelength)}
+ mapping.data.attribute:
+ mapping.data.write_conversion(wavelength)
+ }
xml = minidom.parseString(ElementTree.tostring(root)).toprettyxml()
diff --git a/colour/io/image.py b/colour/io/image.py
index a724fb230a..a6bf08d00e 100644
--- a/colour/io/image.py
+++ b/colour/io/image.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Image Input / Output Utilities
==============================
@@ -22,37 +21,38 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['BitDepth_Specification',
- 'BIT_DEPTH_MAPPING',
- 'read_image',
- 'write_image']
+__all__ = [
+ 'BitDepth_Specification', 'BIT_DEPTH_MAPPING', 'read_image', 'write_image'
+]
-BitDepth_Specification = namedtuple(
- 'BitDepth_Specification',
- ('name', 'numpy', 'openimageio', 'domain', 'clip'))
+BitDepth_Specification = namedtuple('BitDepth_Specification',
+ ('name', 'numpy', 'openimageio', 'domain',
+ 'clip'))
if is_openimageio_installed():
from OpenImageIO import UINT8, UINT16, HALF, FLOAT
- BIT_DEPTH_MAPPING = CaseInsensitiveMapping(
- {'uint8': BitDepth_Specification(
- 'uint8', np.uint8, UINT8, 255, True),
- 'uint16': BitDepth_Specification(
- 'uint16', np.uint16, UINT16, 65535, True),
- 'float16': BitDepth_Specification(
- 'float16', np.float16, HALF, 1, False),
- 'float32': BitDepth_Specification(
- 'float32', np.float32, FLOAT, 1, False)})
+ BIT_DEPTH_MAPPING = CaseInsensitiveMapping({
+ 'uint8':
+ BitDepth_Specification('uint8', np.uint8, UINT8, 255, True),
+ 'uint16':
+ BitDepth_Specification('uint16', np.uint16, UINT16, 65535, True),
+ 'float16':
+ BitDepth_Specification('float16', np.float16, HALF, 1, False),
+ 'float32':
+ BitDepth_Specification('float32', np.float32, FLOAT, 1, False)
+ })
else:
- BIT_DEPTH_MAPPING = CaseInsensitiveMapping(
- {'uint8': BitDepth_Specification(
- 'uint8', np.uint8, None, 255, True),
- 'uint16': BitDepth_Specification(
- 'uint16', np.uint16, None, 65535, True),
- 'float16': BitDepth_Specification(
- 'float16', np.float16, None, 1, False),
- 'float32': BitDepth_Specification(
- 'float32', np.float32, None, 1, False)})
+ BIT_DEPTH_MAPPING = CaseInsensitiveMapping({
+ 'uint8':
+ BitDepth_Specification('uint8', np.uint8, None, 255, True),
+ 'uint16':
+ BitDepth_Specification('uint16', np.uint16, None, 65535, True),
+ 'float16':
+ BitDepth_Specification('float16', np.float16, None, 1, False),
+ 'float32':
+ BitDepth_Specification('float32', np.float32, None, 1, False)
+ })
def read_image(path, bit_depth='float32'):
@@ -91,8 +91,7 @@ def read_image(path, bit_depth='float32'):
image = ImageInput.open(path)
specification = image.spec()
- shape = (specification.height,
- specification.width,
+ shape = (specification.height, specification.width,
specification.nchannels)
return np.squeeze(np.array(image.read_image(bit_depth)).reshape(shape))
diff --git a/colour/io/tabular.py b/colour/io/tabular.py
index 008f560fa4..510f68f4cd 100644
--- a/colour/io/tabular.py
+++ b/colour/io/tabular.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CSV Tabular Data Input / Output
===============================
@@ -27,9 +26,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['read_spectral_data_from_csv_file',
- 'read_spds_from_csv_file',
- 'write_spds_to_csv_file']
+__all__ = [
+ 'read_spectral_data_from_csv_file', 'read_spds_from_csv_file',
+ 'write_spds_to_csv_file'
+]
def read_spectral_data_from_csv_file(path,
@@ -120,9 +120,8 @@ def read_spectral_data_from_csv_file(path,
"""
with open(path, 'rU') as csv_file:
- reader = csv.DictReader(csv_file,
- delimiter=str(delimiter),
- fieldnames=fields)
+ reader = csv.DictReader(
+ csv_file, delimiter=str(delimiter), fieldnames=fields)
if len(reader.fieldnames) == 1:
raise RuntimeError(('A "CSV" spectral data file should define '
'the following fields: '
@@ -143,10 +142,7 @@ def read_spectral_data_from_csv_file(path,
return data
-def read_spds_from_csv_file(path,
- delimiter=',',
- fields=None,
- default=0):
+def read_spds_from_csv_file(path, delimiter=',', fields=None, default=0):
"""
Reads the spectral data from given *CSV* file and return its content as an
*OrderedDict* of
@@ -186,20 +182,14 @@ def read_spds_from_csv_file(path,
SpectralPowerDistribution('1', (380.0, 780.0, 5.0))
"""
- data = read_spectral_data_from_csv_file(path,
- delimiter,
- fields,
- default)
+ data = read_spectral_data_from_csv_file(path, delimiter, fields, default)
spds = OrderedDict(((key, SpectralPowerDistribution(key, value))
for key, value in data.items()))
return spds
-def write_spds_to_csv_file(spds,
- path,
- delimiter=',',
- fields=None):
+def write_spds_to_csv_file(spds, path, delimiter=',', fields=None):
"""
Writes the given spectral power distributions to given *CSV* file.
@@ -236,10 +226,11 @@ def write_spds_to_csv_file(spds,
wavelengths = tuple(spds.values())[0].wavelengths
with open(path, 'w') as csv_file:
fields = list(fields) if fields is not None else sorted(spds.keys())
- writer = csv.DictWriter(csv_file,
- delimiter=str(delimiter),
- fieldnames=['wavelength'] + fields,
- lineterminator='\n')
+ writer = csv.DictWriter(
+ csv_file,
+ delimiter=str(delimiter),
+ fieldnames=['wavelength'] + fields,
+ lineterminator='\n')
# Python 2.7.x / 3.4.x only.
# writer.writeheader()
writer.writerow(dict((name, name) for name in writer.fieldnames))
diff --git a/colour/io/tests/tests_ies_tm2714.py b/colour/io/tests/tests_ies_tm2714.py
index d86f7509e3..298ee47f17 100644
--- a/colour/io/tests/tests_ies_tm2714.py
+++ b/colour/io/tests/tests_ies_tm2714.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.io.iestm2714` module.
"""
@@ -35,12 +34,14 @@
'ReportNumber': 'N/A',
'ReportDate': 'N/A',
'DocumentCreationDate': '2014-06-23',
- 'Comments': 'Ambient temperature 25 degrees C.'}
+ 'Comments': 'Ambient temperature 25 degrees C.'
+}
FLUORESCENT_FILE_SPECTRAL_DESCRIPTION = {
'SpectralQuantity': 'relative',
'BandwidthFWHM': 2.0,
- 'BandwidthCorrected': True}
+ 'BandwidthCorrected': True
+}
FLUORESCENT_FILE_SPECTRAL_DATA = {
400.0: 0.034,
@@ -127,7 +128,8 @@
808.8: 0.029,
810.7: 0.039,
812.7: 0.030,
- 850.1: 0.030}
+ 850.1: 0.030
+}
class TestIES_TM2714_Header(unittest.TestCase):
@@ -141,18 +143,11 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('mapping',
- 'manufacturer',
- 'catalog_number',
- 'description',
- 'document_creator',
- 'unique_identifier',
- 'measurement_equipment',
- 'laboratory',
- 'report_number',
- 'report_date',
- 'document_creation_date',
- 'comments')
+ required_attributes = ('mapping', 'manufacturer', 'catalog_number',
+ 'description', 'document_creator',
+ 'unique_identifier', 'measurement_equipment',
+ 'laboratory', 'report_number', 'report_date',
+ 'document_creation_date', 'comments')
for attribute in required_attributes:
self.assertIn(attribute, dir(IES_TM2714_Header))
@@ -183,13 +178,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('mapping',
- 'path',
- 'header',
- 'spectral_quantity',
- 'reflection_geometry',
- 'transmission_geometry',
- 'bandwidth_FWHM',
+ required_attributes = ('mapping', 'path', 'header',
+ 'spectral_quantity', 'reflection_geometry',
+ 'transmission_geometry', 'bandwidth_FWHM',
'bandwidth_corrected')
for attribute in required_attributes:
@@ -200,7 +191,7 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('read',)
+ required_methods = ('read', )
for method in required_methods:
self.assertIn(method, dir(IES_TM2714_Spd))
@@ -216,8 +207,8 @@ def test_read(self, spd=None):
"""
if spd is None:
- spd = IES_TM2714_Spd(os.path.join(RESOURCES_DIRECTORY,
- 'Fluorescent.spdx'))
+ spd = IES_TM2714_Spd(
+ os.path.join(RESOURCES_DIRECTORY, 'Fluorescent.spdx'))
self.assertTrue(spd.read())
self.assertDictEqual(dict(spd.data), FLUORESCENT_FILE_SPECTRAL_DATA)
@@ -228,8 +219,7 @@ def test_read(self, spd=None):
for specification in read.mapping.elements:
if key == specification.element:
self.assertEquals(
- getattr(read, specification.attribute),
- value)
+ getattr(read, specification.attribute), value)
def test_write(self):
"""
diff --git a/colour/io/tests/tests_tabular.py b/colour/io/tests/tests_tabular.py
index 01389ac993..49cc4d5f04 100644
--- a/colour/io/tests/tests_tabular.py
+++ b/colour/io/tests/tests_tabular.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.io.tabular` module.
"""
@@ -14,10 +13,8 @@
from six import text_type
from colour.colorimetry import SpectralPowerDistribution
-from colour.io import (
- read_spectral_data_from_csv_file,
- read_spds_from_csv_file,
- write_spds_to_csv_file)
+from colour.io import (read_spectral_data_from_csv_file,
+ read_spds_from_csv_file, write_spds_to_csv_file)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -26,11 +23,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RESOURCES_DIRECTORY',
- 'COLOURCHECKER_N_OHTA_1',
- 'TestReadSpectralDataFromCsvFile',
- 'TestReadSpdsFromCsvFile',
- 'TestWriteSpdsToCsvFile']
+__all__ = [
+ 'RESOURCES_DIRECTORY', 'COLOURCHECKER_N_OHTA_1',
+ 'TestReadSpectralDataFromCsvFile', 'TestReadSpdsFromCsvFile',
+ 'TestWriteSpdsToCsvFile'
+]
RESOURCES_DIRECTORY = os.path.join(os.path.dirname(__file__), 'resources')
@@ -115,7 +112,8 @@
765.0: 0.465,
770.0: 0.448,
775.0: 0.432,
- 780.0: 0.421}
+ 780.0: 0.421
+}
class TestReadSpectralDataFromCsvFile(unittest.TestCase):
@@ -135,25 +133,18 @@ def test_read_spectral_data_from_csv_file(self):
'colorchecker_n_ohta.csv')
data = read_spectral_data_from_csv_file(colour_checker_n_ohta)
self.assertListEqual(
- sorted(data),
- sorted([text_type(x) for x in range(1, 25)]))
+ sorted(data), sorted([text_type(x) for x in range(1, 25)]))
self.assertDictEqual(data['1'], COLOURCHECKER_N_OHTA_1)
- linss2_10e_5 = os.path.join(RESOURCES_DIRECTORY,
- 'linss2_10e_5.csv')
- data = read_spectral_data_from_csv_file(linss2_10e_5,
- fields=['wavelength',
- 'l_bar',
- 'm_bar',
- 's_bar'])
+ linss2_10e_5 = os.path.join(RESOURCES_DIRECTORY, 'linss2_10e_5.csv')
+ data = read_spectral_data_from_csv_file(
+ linss2_10e_5, fields=['wavelength', 'l_bar', 'm_bar', 's_bar'])
self.assertListEqual(sorted(data), ['l_bar', 'm_bar', 's_bar'])
self.assertEqual(data['s_bar'][760], 0)
- data = read_spectral_data_from_csv_file(linss2_10e_5,
- fields=['wavelength',
- 'l_bar',
- 'm_bar',
- 's_bar'],
- default=-1)
+ data = read_spectral_data_from_csv_file(
+ linss2_10e_5,
+ fields=['wavelength', 'l_bar', 'm_bar', 's_bar'],
+ default=-1)
self.assertEqual(data['s_bar'][760], -1)
diff --git a/colour/io/tests/tests_xrite.py b/colour/io/tests/tests_xrite.py
index a2c4e81a79..21a21ee423 100644
--- a/colour/io/tests/tests_xrite.py
+++ b/colour/io/tests/tests_xrite.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.io.xrite` module.
"""
@@ -20,9 +19,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RESOURCES_DIRECTORY',
- 'COLOURCHECKER_XRITE_1',
- 'TestReadSpdsFromXRiteFile']
+__all__ = [
+ 'RESOURCES_DIRECTORY', 'COLOURCHECKER_XRITE_1', 'TestReadSpdsFromXRiteFile'
+]
RESOURCES_DIRECTORY = os.path.join(os.path.dirname(__file__), 'resources')
@@ -62,7 +61,8 @@
700.0: 0.0066,
710.0: 0.0066,
720.0: 0.0066,
- 730.0: 0.0065}
+ 730.0: 0.0065
+}
class TestReadSpdsFromXRiteFile(unittest.TestCase):
diff --git a/colour/io/xrite.py b/colour/io/xrite.py
index caff6327c9..7a44a4149d 100644
--- a/colour/io/xrite.py
+++ b/colour/io/xrite.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
X-Rite Data Input
=================
@@ -26,8 +25,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XRITE_FILE_ENCODING',
- 'read_spds_from_xrite_file']
+__all__ = ['XRITE_FILE_ENCODING', 'read_spds_from_xrite_file']
XRITE_FILE_ENCODING = 'utf-8'
@@ -82,16 +80,16 @@ def read_spds_from_xrite_file(path):
is_spectral_data = False
if is_spectral_data_format:
- wavelengths = [np.float_(x)
- for x in re.findall('nm(\d+)', line)]
+ wavelengths = [
+ np.float_(x) for x in re.findall('nm(\d+)', line)
+ ]
index = len(wavelengths)
if is_spectral_data:
tokens = line.split()
values = [np.float_(x) for x in tokens[-index:]]
- xrite_spds[tokens[1]] = (
- SpectralPowerDistribution(tokens[1],
- dict(zip(wavelengths, values))))
+ xrite_spds[tokens[1]] = (SpectralPowerDistribution(
+ tokens[1], dict(zip(wavelengths, values))))
if line == 'BEGIN_DATA_FORMAT':
is_spectral_data_format = True
diff --git a/colour/models/__init__.py b/colour/models/__init__.py
index 3594e72d9c..41d5ab8c89 100644
--- a/colour/models/__init__.py
+++ b/colour/models/__init__.py
@@ -3,74 +3,56 @@
from __future__ import absolute_import
-from .cie_xyy import (
- XYZ_to_xyY,
- xyY_to_XYZ,
- xy_to_xyY,
- xyY_to_xy,
- xy_to_XYZ,
- XYZ_to_xy)
+from .cie_xyy import (XYZ_to_xyY, xyY_to_XYZ, xy_to_xyY, xyY_to_xy, xy_to_XYZ,
+ XYZ_to_xy)
from .cie_lab import XYZ_to_Lab, Lab_to_XYZ, Lab_to_LCHab, LCHab_to_Lab
-from .cie_luv import (
- XYZ_to_Luv,
- Luv_to_XYZ,
- Luv_to_uv,
- Luv_uv_to_xy,
- Luv_to_LCHuv,
- LCHuv_to_Luv)
+from .cie_luv import (XYZ_to_Luv, Luv_to_XYZ, Luv_to_uv, Luv_uv_to_xy,
+ Luv_to_LCHuv, LCHuv_to_Luv)
from .cie_ucs import XYZ_to_UCS, UCS_to_XYZ, UCS_to_uv, UCS_uv_to_xy
from .cie_uvw import XYZ_to_UVW
-from .hunter_lab import (
- XYZ_to_K_ab_HunterLab1966,
- XYZ_to_Hunter_Lab,
- Hunter_Lab_to_XYZ)
+from .hdr_cie_lab import XYZ_to_hdr_CIELab, hdr_CIELab_to_XYZ
+from .hunter_lab import (XYZ_to_K_ab_HunterLab1966, XYZ_to_Hunter_Lab,
+ Hunter_Lab_to_XYZ)
from .hunter_rdab import XYZ_to_Hunter_Rdab
from .ipt import XYZ_to_IPT, IPT_to_XYZ, IPT_hue_angle
-from .ucs_luo2006 import (
- JMh_CIECAM02_to_CAM02LCD,
- CAM02LCD_to_JMh_CIECAM02,
- JMh_CIECAM02_to_CAM02SCD,
- CAM02SCD_to_JMh_CIECAM02,
- JMh_CIECAM02_to_CAM02UCS,
- CAM02UCS_to_JMh_CIECAM02)
-from .common import (
- COLOURSPACE_MODELS,
- COLOURSPACE_MODELS_LABELS,
- XYZ_to_colourspace_model)
+from .hdr_ipt import XYZ_to_hdr_IPT, hdr_IPT_to_XYZ
+from .ucs_luo2006 import (JMh_CIECAM02_to_CAM02LCD, CAM02LCD_to_JMh_CIECAM02,
+ JMh_CIECAM02_to_CAM02SCD, CAM02SCD_to_JMh_CIECAM02,
+ JMh_CIECAM02_to_CAM02UCS, CAM02UCS_to_JMh_CIECAM02)
+from .common import (COLOURSPACE_MODELS, COLOURSPACE_MODELS_LABELS,
+ XYZ_to_colourspace_model)
from .dataset import * # noqa
from . import dataset
from .rgb import * # noqa
from . import rgb
-__all__ = ['XYZ_to_xyY',
- 'xyY_to_XYZ',
- 'xy_to_xyY',
- 'xyY_to_xy',
- 'xy_to_XYZ',
- 'XYZ_to_xy']
+__all__ = [
+ 'XYZ_to_xyY', 'xyY_to_XYZ', 'xy_to_xyY', 'xyY_to_xy', 'xy_to_XYZ',
+ 'XYZ_to_xy'
+]
__all__ += ['XYZ_to_Lab', 'Lab_to_XYZ', 'Lab_to_LCHab', 'LCHab_to_Lab']
-__all__ += ['XYZ_to_Luv',
- 'Luv_to_XYZ',
- 'Luv_to_uv',
- 'Luv_uv_to_xy',
- 'Luv_to_LCHuv',
- 'LCHuv_to_Luv']
+__all__ += [
+ 'XYZ_to_Luv', 'Luv_to_XYZ', 'Luv_to_uv', 'Luv_uv_to_xy', 'Luv_to_LCHuv',
+ 'LCHuv_to_Luv'
+]
__all__ += ['XYZ_to_UCS', 'UCS_to_XYZ', 'UCS_to_uv', 'UCS_uv_to_xy']
__all__ += ['XYZ_to_UVW']
-__all__ += ['XYZ_to_K_ab_HunterLab1966',
- 'XYZ_to_Hunter_Lab',
- 'Hunter_Lab_to_XYZ',
- 'XYZ_to_Hunter_Rdab']
+__all__ += ['XYZ_to_hdr_CIELab', 'hdr_CIELab_to_XYZ']
+__all__ += [
+ 'XYZ_to_K_ab_HunterLab1966', 'XYZ_to_Hunter_Lab', 'Hunter_Lab_to_XYZ',
+ 'XYZ_to_Hunter_Rdab'
+]
__all__ += ['XYZ_to_Hunter_Rdab']
__all__ += ['XYZ_to_IPT', 'IPT_to_XYZ', 'IPT_hue_angle']
-__all__ += ['JMh_CIECAM02_to_CAM02LCD',
- 'CAM02LCD_to_JMh_CIECAM02',
- 'JMh_CIECAM02_to_CAM02SCD',
- 'CAM02SCD_to_JMh_CIECAM02',
- 'JMh_CIECAM02_to_CAM02UCS',
- 'CAM02UCS_to_JMh_CIECAM02']
-__all__ += ['COLOURSPACE_MODELS',
- 'COLOURSPACE_MODELS_LABELS',
- 'XYZ_to_colourspace_model']
+__all__ += ['XYZ_to_hdr_IPT', 'hdr_IPT_to_XYZ']
+__all__ += [
+ 'JMh_CIECAM02_to_CAM02LCD', 'CAM02LCD_to_JMh_CIECAM02',
+ 'JMh_CIECAM02_to_CAM02SCD', 'CAM02SCD_to_JMh_CIECAM02',
+ 'JMh_CIECAM02_to_CAM02UCS', 'CAM02UCS_to_JMh_CIECAM02'
+]
+__all__ += [
+ 'COLOURSPACE_MODELS', 'COLOURSPACE_MODELS_LABELS',
+ 'XYZ_to_colourspace_model'
+]
__all__ += dataset.__all__
__all__ += rgb.__all__
diff --git a/colour/models/cie_lab.py b/colour/models/cie_lab.py
index 45c17eeb25..5656ee378d 100644
--- a/colour/models/cie_lab.py
+++ b/colour/models/cie_lab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE Lab Colourspace
===================
@@ -41,10 +40,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_to_Lab',
- 'Lab_to_XYZ',
- 'Lab_to_LCHab',
- 'LCHab_to_Lab']
+__all__ = ['XYZ_to_Lab', 'Lab_to_XYZ', 'Lab_to_LCHab', 'LCHab_to_Lab']
def XYZ_to_Lab(
@@ -86,8 +82,7 @@ def XYZ_to_Lab(
XYZ_f = XYZ / XYZ_r
XYZ_f = np.where(XYZ_f > CIE_E,
- np.power(XYZ_f, 1 / 3),
- (CIE_K * XYZ_f + 16) / 116)
+ np.power(XYZ_f, 1 / 3), (CIE_K * XYZ_f + 16) / 116)
X_f, Y_f, Z_f = tsplit(XYZ_f)
diff --git a/colour/models/cie_luv.py b/colour/models/cie_luv.py
index 2450724fb3..a513a4b06d 100644
--- a/colour/models/cie_luv.py
+++ b/colour/models/cie_luv.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE Luv Colourspace
===================
@@ -46,12 +45,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_to_Luv',
- 'Luv_to_XYZ',
- 'Luv_to_uv',
- 'Luv_uv_to_xy',
- 'Luv_to_LCHuv',
- 'LCHuv_to_Luv']
+__all__ = [
+ 'XYZ_to_Luv', 'Luv_to_XYZ', 'Luv_to_uv', 'Luv_uv_to_xy', 'Luv_to_LCHuv',
+ 'LCHuv_to_Luv'
+]
def XYZ_to_Luv(
@@ -142,12 +139,12 @@ def Luv_to_XYZ(
Y = np.where(L > CIE_E * CIE_K, ((L + 16) / 116) ** 3, L / CIE_K)
- a = 1 / 3 * ((52 * L / (u + 13 * L *
- (4 * X_r / (X_r + 15 * Y_r + 3 * Z_r)))) - 1)
+ a = 1 / 3 * ((52 * L / (u + 13 * L * (4 * X_r /
+ (X_r + 15 * Y_r + 3 * Z_r)))) - 1)
b = -5 * Y
c = -1 / 3.0
- d = Y * (39 * L / (v + 13 * L *
- (9 * Y_r / (X_r + 15 * Y_r + 3 * Z_r))) - 5)
+ d = Y * (39 * L / (v + 13 * L * (9 * Y_r /
+ (X_r + 15 * Y_r + 3 * Z_r))) - 5)
X = (d - b) / (a - c)
Z = X * a + b
@@ -193,8 +190,7 @@ def Luv_to_uv(
X, Y, Z = tsplit(Luv_to_XYZ(Luv, illuminant))
- uv = tstack((4 * X / (X + 15 * Y + 3 * Z),
- 9 * Y / (X + 15 * Y + 3 * Z)))
+ uv = tstack((4 * X / (X + 15 * Y + 3 * Z), 9 * Y / (X + 15 * Y + 3 * Z)))
return uv
@@ -233,8 +229,7 @@ def Luv_uv_to_xy(uv):
u, v = tsplit(uv)
- xy = tstack((9 * u / (6 * u - 16 * v + 12),
- 4 * v / (6 * u - 16 * v + 12)))
+ xy = tstack((9 * u / (6 * u - 16 * v + 12), 4 * v / (6 * u - 16 * v + 12)))
return xy
diff --git a/colour/models/cie_ucs.py b/colour/models/cie_ucs.py
index 3433b69c98..f8dba6b40e 100644
--- a/colour/models/cie_ucs.py
+++ b/colour/models/cie_ucs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE UCS Colourspace
===================
@@ -38,10 +37,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_to_UCS',
- 'UCS_to_XYZ',
- 'UCS_to_uv',
- 'UCS_uv_to_xy']
+__all__ = ['XYZ_to_UCS', 'UCS_to_XYZ', 'UCS_to_uv', 'UCS_uv_to_xy']
def XYZ_to_UCS(XYZ):
diff --git a/colour/models/cie_uvw.py b/colour/models/cie_uvw.py
index d9b0734bf6..b997aaa0f2 100644
--- a/colour/models/cie_uvw.py
+++ b/colour/models/cie_uvw.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE UVW Colourspace
===================
@@ -24,13 +23,8 @@
from __future__ import division, unicode_literals
from colour.colorimetry import ILLUMINANTS
-from colour.models import (
- UCS_to_uv,
- XYZ_to_UCS,
- XYZ_to_xyY,
- xy_to_xyY,
- xyY_to_XYZ,
- xyY_to_xy)
+from colour.models import (UCS_to_uv, XYZ_to_UCS, XYZ_to_xyY, xy_to_xyY,
+ xyY_to_XYZ, xyY_to_xy)
from colour.utilities import tsplit, tstack
__author__ = 'Colour Developers'
@@ -86,8 +80,7 @@ def XYZ_to_UVW(
_x, _y, Y = tsplit(xyY)
u, v = tsplit(UCS_to_uv(XYZ_to_UCS(XYZ)))
- u_0, v_0 = tsplit(
- UCS_to_uv(XYZ_to_UCS(xyY_to_XYZ(xy_to_xyY(illuminant)))))
+ u_0, v_0 = tsplit(UCS_to_uv(XYZ_to_UCS(xyY_to_XYZ(xy_to_xyY(illuminant)))))
W = 25 * Y ** (1 / 3) - 17
U = 13 * W * (u - u_0)
diff --git a/colour/models/cie_xyy.py b/colour/models/cie_xyy.py
index cb3631293d..a6303c5708 100644
--- a/colour/models/cie_xyy.py
+++ b/colour/models/cie_xyy.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE xyY Colourspace
===================
@@ -40,12 +39,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_to_xyY',
- 'xyY_to_XYZ',
- 'xy_to_xyY',
- 'xyY_to_xy',
- 'xy_to_XYZ',
- 'XYZ_to_xy']
+__all__ = [
+ 'XYZ_to_xyY', 'xyY_to_XYZ', 'xy_to_xyY', 'xyY_to_xy', 'xy_to_XYZ',
+ 'XYZ_to_xy'
+]
def XYZ_to_xyY(
@@ -92,8 +89,7 @@ def XYZ_to_xyY(
XYZ_n[..., 0:2] = xy_w
xyY = np.where(
- np.all(XYZ == 0, axis=-1)[..., np.newaxis],
- XYZ_n,
+ np.all(XYZ == 0, axis=-1)[..., np.newaxis], XYZ_n,
tstack((X / (X + Y + Z), Y / (X + Y + Z), Y)))
return xyY
diff --git a/colour/models/common.py b/colour/models/common.py
index 6dc29bea00..e963f148e4 100644
--- a/colour/models/common.py
+++ b/colour/models/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Common Colour Models Utilities
==============================
@@ -10,21 +9,10 @@
from __future__ import division, unicode_literals
-from colour.models import (
- Lab_to_LCHab,
- Luv_to_LCHuv,
- Luv_to_uv,
- UCS_to_uv,
- XYZ_to_IPT,
- XYZ_to_Hunter_Lab,
- XYZ_to_Hunter_Rdab,
- XYZ_to_Lab,
- XYZ_to_Luv,
- XYZ_to_UCS,
- XYZ_to_UVW,
- XYZ_to_xy,
- XYZ_to_xyY,
- xy_to_XYZ)
+from colour.models import (Lab_to_LCHab, Luv_to_LCHuv, Luv_to_uv, UCS_to_uv,
+ XYZ_to_IPT, XYZ_to_Hunter_Lab, XYZ_to_Hunter_Rdab,
+ XYZ_to_Lab, XYZ_to_Luv, XYZ_to_UCS, XYZ_to_UVW,
+ XYZ_to_xy, XYZ_to_xyY, xy_to_XYZ)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -33,24 +21,14 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['COLOURSPACE_MODELS',
- 'COLOURSPACE_MODELS_LABELS',
- 'XYZ_to_colourspace_model']
-
-COLOURSPACE_MODELS = (
- 'CIE XYZ',
- 'CIE xyY',
- 'CIE Lab',
- 'CIE LCHab',
- 'CIE Luv',
- 'CIE Luv uv',
- 'CIE LCHuv',
- 'CIE UCS',
- 'CIE UCS uv',
- 'CIE UVW',
- 'IPT',
- 'Hunter Lab',
- 'Hunter Rdab')
+__all__ = [
+ 'COLOURSPACE_MODELS', 'COLOURSPACE_MODELS_LABELS',
+ 'XYZ_to_colourspace_model'
+]
+
+COLOURSPACE_MODELS = ('CIE XYZ', 'CIE xyY', 'CIE Lab', 'CIE LCHab', 'CIE Luv',
+ 'CIE Luv uv', 'CIE LCHuv', 'CIE UCS', 'CIE UCS uv',
+ 'CIE UVW', 'IPT', 'Hunter Lab', 'Hunter Rdab')
COLOURSPACE_MODELS_LABELS = {
'CIE XYZ': ('X', 'Y', 'Z'),
@@ -65,7 +43,8 @@
'CIE UVW': ('U', 'V', 'W'),
'IPT': ('P', 'T', 'I'),
'Hunter Lab': ('$a^*$', '$b^*$', '$L^*$'),
- 'Hunter Rdab': ('$a$', '$b$', '$Rd$')}
+ 'Hunter Rdab': ('$a$', '$b$', '$Rd$')
+}
"""
Colourspace models labels mapping.
@@ -175,8 +154,7 @@ def XYZ_to_colourspace_model(XYZ, illuminant, model):
values = XYZ_to_Hunter_Rdab(XYZ * 100, xy_to_XYZ(illuminant) * 100)
if values is None:
- raise ValueError(
- '"{0}" not found in colourspace models: "{1}".'.format(
- model, ', '.join(COLOURSPACE_MODELS)))
+ raise ValueError('"{0}" not found in colourspace models: "{1}".'.
+ format(model, ', '.join(COLOURSPACE_MODELS)))
return values
diff --git a/colour/models/dataset/__init__.py b/colour/models/dataset/__init__.py
index c83c939a4d..a8c3e174a5 100644
--- a/colour/models/dataset/__init__.py
+++ b/colour/models/dataset/__init__.py
@@ -3,11 +3,10 @@
from __future__ import absolute_import
-from .pointer_gamut import (
- POINTER_GAMUT_ILLUMINANT,
- POINTER_GAMUT_DATA,
- POINTER_GAMUT_BOUNDARIES)
+from .pointer_gamut import (POINTER_GAMUT_ILLUMINANT, POINTER_GAMUT_DATA,
+ POINTER_GAMUT_BOUNDARIES)
-__all__ = ['POINTER_GAMUT_ILLUMINANT',
- 'POINTER_GAMUT_DATA',
- 'POINTER_GAMUT_BOUNDARIES']
+__all__ = [
+ 'POINTER_GAMUT_ILLUMINANT', 'POINTER_GAMUT_DATA',
+ 'POINTER_GAMUT_BOUNDARIES'
+]
diff --git a/colour/models/dataset/pointer_gamut.py b/colour/models/dataset/pointer_gamut.py
index 05084ac545..9f33e27e44 100644
--- a/colour/models/dataset/pointer_gamut.py
+++ b/colour/models/dataset/pointer_gamut.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Pointer's Gamut
===============
@@ -15,7 +14,7 @@
References
----------
-.. [1] Pointer, M. R. (1980). Pointer’s Gamut Data. Retrieved from
+.. [1] Pointer, M. R. (1980). Pointer's Gamut Data. Retrieved from
http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls
"""
@@ -32,9 +31,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['POINTER_GAMUT_ILLUMINANT',
- 'POINTER_GAMUT_DATA',
- 'POINTER_GAMUT_BOUNDARIES']
+__all__ = [
+ 'POINTER_GAMUT_ILLUMINANT', 'POINTER_GAMUT_DATA',
+ 'POINTER_GAMUT_BOUNDARIES'
+]
POINTER_GAMUT_ILLUMINANT = (
LIGHT_SOURCES['CIE 1931 2 Degree Standard Observer']['SC'])
@@ -44,622 +44,622 @@
POINTER_GAMUT_ILLUMINANT : ndarray
"""
-POINTER_GAMUT_DATA = np.array([
- [15, 10, 0],
- [15, 15, 10],
- [15, 14, 20],
- [15, 35, 30],
- [15, 27, 40],
- [15, 10, 50],
- [15, 4, 60],
- [15, 5, 70],
- [15, 6, 80],
- [15, 4, 90],
- [15, 9, 100],
- [15, 9, 110],
- [15, 4, 120],
- [15, 5, 130],
- [15, 7, 140],
- [15, 7, 150],
- [15, 8, 160],
- [15, 13, 170],
- [15, 10, 180],
- [15, 7, 190],
- [15, 5, 200],
- [15, 0, 210],
- [15, 2, 220],
- [15, 10, 230],
- [15, 8, 240],
- [15, 9, 250],
- [15, 12, 260],
- [15, 14, 270],
- [15, 10, 280],
- [15, 20, 290],
- [15, 30, 300],
- [15, 62, 310],
- [15, 60, 320],
- [15, 20, 330],
- [15, 26, 340],
- [15, 15, 350],
- [20, 30, 0],
- [20, 30, 10],
- [20, 34, 20],
- [20, 48, 30],
- [20, 40, 40],
- [20, 21, 50],
- [20, 15, 60],
- [20, 15, 70],
- [20, 15, 80],
- [20, 12, 90],
- [20, 16, 100],
- [20, 18, 110],
- [20, 14, 120],
- [20, 18, 130],
- [20, 20, 140],
- [20, 21, 150],
- [20, 24, 160],
- [20, 25, 170],
- [20, 25, 180],
- [20, 19, 190],
- [20, 19, 200],
- [20, 12, 210],
- [20, 12, 220],
- [20, 20, 230],
- [20, 16, 240],
- [20, 21, 250],
- [20, 24, 260],
- [20, 31, 270],
- [20, 29, 280],
- [20, 40, 290],
- [20, 55, 300],
- [20, 76, 310],
- [20, 71, 320],
- [20, 50, 330],
- [20, 49, 340],
- [20, 37, 350],
- [25, 43, 0],
- [25, 45, 10],
- [25, 49, 20],
- [25, 59, 30],
- [25, 53, 40],
- [25, 34, 50],
- [25, 26, 60],
- [25, 25, 70],
- [25, 24, 80],
- [25, 20, 90],
- [25, 23, 100],
- [25, 27, 110],
- [25, 23, 120],
- [25, 30, 130],
- [25, 32, 140],
- [25, 34, 150],
- [25, 36, 160],
- [25, 36, 170],
- [25, 38, 180],
- [25, 30, 190],
- [25, 29, 200],
- [25, 17, 210],
- [25, 20, 220],
- [25, 29, 230],
- [25, 26, 240],
- [25, 32, 250],
- [25, 34, 260],
- [25, 42, 270],
- [25, 45, 280],
- [25, 60, 290],
- [25, 72, 300],
- [25, 85, 310],
- [25, 79, 320],
- [25, 72, 330],
- [25, 63, 340],
- [25, 52, 350],
- [30, 56, 0],
- [30, 56, 10],
- [30, 61, 20],
- [30, 68, 30],
- [30, 66, 40],
- [30, 45, 50],
- [30, 37, 60],
- [30, 36, 70],
- [30, 32, 80],
- [30, 28, 90],
- [30, 30, 100],
- [30, 35, 110],
- [30, 32, 120],
- [30, 40, 130],
- [30, 42, 140],
- [30, 45, 150],
- [30, 48, 160],
- [30, 47, 170],
- [30, 48, 180],
- [30, 40, 190],
- [30, 37, 200],
- [30, 26, 210],
- [30, 28, 220],
- [30, 36, 230],
- [30, 34, 240],
- [30, 40, 250],
- [30, 41, 260],
- [30, 50, 270],
- [30, 55, 280],
- [30, 69, 290],
- [30, 81, 300],
- [30, 88, 310],
- [30, 84, 320],
- [30, 86, 330],
- [30, 73, 340],
- [30, 65, 350],
- [35, 68, 0],
- [35, 64, 10],
- [35, 69, 20],
- [35, 75, 30],
- [35, 79, 40],
- [35, 60, 50],
- [35, 48, 60],
- [35, 46, 70],
- [35, 40, 80],
- [35, 36, 90],
- [35, 37, 100],
- [35, 44, 110],
- [35, 41, 120],
- [35, 48, 130],
- [35, 52, 140],
- [35, 57, 150],
- [35, 58, 160],
- [35, 57, 170],
- [35, 57, 180],
- [35, 48, 190],
- [35, 42, 200],
- [35, 34, 210],
- [35, 35, 220],
- [35, 42, 230],
- [35, 41, 240],
- [35, 49, 250],
- [35, 46, 260],
- [35, 55, 270],
- [35, 60, 280],
- [35, 71, 290],
- [35, 79, 300],
- [35, 85, 310],
- [35, 85, 320],
- [35, 89, 330],
- [35, 82, 340],
- [35, 73, 350],
- [40, 77, 0],
- [40, 70, 10],
- [40, 74, 20],
- [40, 82, 30],
- [40, 90, 40],
- [40, 75, 50],
- [40, 59, 60],
- [40, 56, 70],
- [40, 48, 80],
- [40, 44, 90],
- [40, 45, 100],
- [40, 52, 110],
- [40, 49, 120],
- [40, 56, 130],
- [40, 60, 140],
- [40, 68, 150],
- [40, 68, 160],
- [40, 65, 170],
- [40, 64, 180],
- [40, 55, 190],
- [40, 45, 200],
- [40, 43, 210],
- [40, 40, 220],
- [40, 46, 230],
- [40, 47, 240],
- [40, 54, 250],
- [40, 51, 260],
- [40, 60, 270],
- [40, 61, 280],
- [40, 69, 290],
- [40, 72, 300],
- [40, 80, 310],
- [40, 86, 320],
- [40, 89, 330],
- [40, 87, 340],
- [40, 79, 350],
- [45, 79, 0],
- [45, 73, 10],
- [45, 76, 20],
- [45, 84, 30],
- [45, 94, 40],
- [45, 90, 50],
- [45, 70, 60],
- [45, 67, 70],
- [45, 55, 80],
- [45, 53, 90],
- [45, 51, 100],
- [45, 59, 110],
- [45, 57, 120],
- [45, 64, 130],
- [45, 69, 140],
- [45, 75, 150],
- [45, 76, 160],
- [45, 70, 170],
- [45, 69, 180],
- [45, 59, 190],
- [45, 46, 200],
- [45, 49, 210],
- [45, 45, 220],
- [45, 49, 230],
- [45, 49, 240],
- [45, 55, 250],
- [45, 55, 260],
- [45, 60, 270],
- [45, 60, 280],
- [45, 65, 290],
- [45, 64, 300],
- [45, 71, 310],
- [45, 82, 320],
- [45, 86, 330],
- [45, 87, 340],
- [45, 82, 350],
- [50, 77, 0],
- [50, 73, 10],
- [50, 76, 20],
- [50, 83, 30],
- [50, 93, 40],
- [50, 100, 50],
- [50, 82, 60],
- [50, 76, 70],
- [50, 64, 80],
- [50, 60, 90],
- [50, 58, 100],
- [50, 66, 110],
- [50, 64, 120],
- [50, 70, 130],
- [50, 76, 140],
- [50, 81, 150],
- [50, 82, 160],
- [50, 75, 170],
- [50, 71, 180],
- [50, 62, 190],
- [50, 46, 200],
- [50, 51, 210],
- [50, 48, 220],
- [50, 51, 230],
- [50, 50, 240],
- [50, 55, 250],
- [50, 56, 260],
- [50, 57, 270],
- [50, 57, 280],
- [50, 58, 290],
- [50, 57, 300],
- [50, 62, 310],
- [50, 74, 320],
- [50, 80, 330],
- [50, 83, 340],
- [50, 84, 350],
- [55, 72, 0],
- [55, 71, 10],
- [55, 74, 20],
- [55, 80, 30],
- [55, 88, 40],
- [55, 102, 50],
- [55, 93, 60],
- [55, 85, 70],
- [55, 72, 80],
- [55, 68, 90],
- [55, 65, 100],
- [55, 74, 110],
- [55, 71, 120],
- [55, 77, 130],
- [55, 82, 140],
- [55, 84, 150],
- [55, 85, 160],
- [55, 76, 170],
- [55, 72, 180],
- [55, 62, 190],
- [55, 45, 200],
- [55, 54, 210],
- [55, 51, 220],
- [55, 52, 230],
- [55, 50, 240],
- [55, 52, 250],
- [55, 51, 260],
- [55, 50, 270],
- [55, 53, 280],
- [55, 50, 290],
- [55, 50, 300],
- [55, 55, 310],
- [55, 66, 320],
- [55, 72, 330],
- [55, 78, 340],
- [55, 79, 350],
- [60, 65, 0],
- [60, 65, 10],
- [60, 68, 20],
- [60, 75, 30],
- [60, 82, 40],
- [60, 99, 50],
- [60, 103, 60],
- [60, 94, 70],
- [60, 82, 80],
- [60, 75, 90],
- [60, 72, 100],
- [60, 82, 110],
- [60, 78, 120],
- [60, 82, 130],
- [60, 87, 140],
- [60, 84, 150],
- [60, 83, 160],
- [60, 75, 170],
- [60, 69, 180],
- [60, 60, 190],
- [60, 43, 200],
- [60, 50, 210],
- [60, 49, 220],
- [60, 50, 230],
- [60, 47, 240],
- [60, 48, 250],
- [60, 46, 260],
- [60, 45, 270],
- [60, 46, 280],
- [60, 43, 290],
- [60, 42, 300],
- [60, 47, 310],
- [60, 57, 320],
- [60, 63, 330],
- [60, 71, 340],
- [60, 73, 350],
- [65, 57, 0],
- [65, 57, 10],
- [65, 61, 20],
- [65, 67, 30],
- [65, 72, 40],
- [65, 88, 50],
- [65, 106, 60],
- [65, 102, 70],
- [65, 94, 80],
- [65, 83, 90],
- [65, 80, 100],
- [65, 87, 110],
- [65, 84, 120],
- [65, 85, 130],
- [65, 89, 140],
- [65, 83, 150],
- [65, 78, 160],
- [65, 71, 170],
- [65, 64, 180],
- [65, 55, 190],
- [65, 39, 200],
- [65, 46, 210],
- [65, 45, 220],
- [65, 45, 230],
- [65, 42, 240],
- [65, 43, 250],
- [65, 40, 260],
- [65, 39, 270],
- [65, 40, 280],
- [65, 36, 290],
- [65, 35, 300],
- [65, 41, 310],
- [65, 48, 320],
- [65, 54, 330],
- [65, 62, 340],
- [65, 63, 350],
- [70, 50, 0],
- [70, 48, 10],
- [70, 51, 20],
- [70, 56, 30],
- [70, 60, 40],
- [70, 75, 50],
- [70, 98, 60],
- [70, 108, 70],
- [70, 105, 80],
- [70, 90, 90],
- [70, 86, 100],
- [70, 92, 110],
- [70, 90, 120],
- [70, 88, 130],
- [70, 90, 140],
- [70, 80, 150],
- [70, 69, 160],
- [70, 65, 170],
- [70, 60, 180],
- [70, 49, 190],
- [70, 35, 200],
- [70, 40, 210],
- [70, 38, 220],
- [70, 39, 230],
- [70, 36, 240],
- [70, 36, 250],
- [70, 33, 260],
- [70, 33, 270],
- [70, 34, 280],
- [70, 29, 290],
- [70, 30, 300],
- [70, 34, 310],
- [70, 40, 320],
- [70, 45, 330],
- [70, 51, 340],
- [70, 53, 350],
- [75, 40, 0],
- [75, 39, 10],
- [75, 40, 20],
- [75, 45, 30],
- [75, 47, 40],
- [75, 59, 50],
- [75, 85, 60],
- [75, 103, 70],
- [75, 115, 80],
- [75, 98, 90],
- [75, 94, 100],
- [75, 95, 110],
- [75, 94, 120],
- [75, 89, 130],
- [75, 83, 140],
- [75, 72, 150],
- [75, 59, 160],
- [75, 57, 170],
- [75, 51, 180],
- [75, 41, 190],
- [75, 30, 200],
- [75, 32, 210],
- [75, 32, 220],
- [75, 32, 230],
- [75, 29, 240],
- [75, 29, 250],
- [75, 27, 260],
- [75, 26, 270],
- [75, 25, 280],
- [75, 24, 290],
- [75, 24, 300],
- [75, 27, 310],
- [75, 31, 320],
- [75, 36, 330],
- [75, 40, 340],
- [75, 40, 350],
- [80, 30, 0],
- [80, 30, 10],
- [80, 30, 20],
- [80, 33, 30],
- [80, 35, 40],
- [80, 45, 50],
- [80, 66, 60],
- [80, 82, 70],
- [80, 115, 80],
- [80, 106, 90],
- [80, 100, 100],
- [80, 100, 110],
- [80, 95, 120],
- [80, 84, 130],
- [80, 71, 140],
- [80, 58, 150],
- [80, 49, 160],
- [80, 45, 170],
- [80, 41, 180],
- [80, 32, 190],
- [80, 22, 200],
- [80, 24, 210],
- [80, 23, 220],
- [80, 24, 230],
- [80, 21, 240],
- [80, 21, 250],
- [80, 20, 260],
- [80, 20, 270],
- [80, 18, 280],
- [80, 18, 290],
- [80, 17, 300],
- [80, 20, 310],
- [80, 24, 320],
- [80, 27, 330],
- [80, 28, 340],
- [80, 30, 350],
- [85, 19, 0],
- [85, 18, 10],
- [85, 19, 20],
- [85, 21, 30],
- [85, 22, 40],
- [85, 30, 50],
- [85, 45, 60],
- [85, 58, 70],
- [85, 83, 80],
- [85, 111, 90],
- [85, 106, 100],
- [85, 96, 110],
- [85, 83, 120],
- [85, 64, 130],
- [85, 54, 140],
- [85, 44, 150],
- [85, 34, 160],
- [85, 30, 170],
- [85, 29, 180],
- [85, 23, 190],
- [85, 14, 200],
- [85, 14, 210],
- [85, 15, 220],
- [85, 15, 230],
- [85, 12, 240],
- [85, 13, 250],
- [85, 13, 260],
- [85, 13, 270],
- [85, 11, 280],
- [85, 12, 290],
- [85, 12, 300],
- [85, 14, 310],
- [85, 16, 320],
- [85, 18, 330],
- [85, 18, 340],
- [85, 17, 350],
- [90, 8, 0],
- [90, 7, 10],
- [90, 9, 20],
- [90, 10, 30],
- [90, 10, 40],
- [90, 15, 50],
- [90, 23, 60],
- [90, 34, 70],
- [90, 48, 80],
- [90, 90, 90],
- [90, 108, 100],
- [90, 84, 110],
- [90, 50, 120],
- [90, 35, 130],
- [90, 30, 140],
- [90, 20, 150],
- [90, 15, 160],
- [90, 15, 170],
- [90, 16, 180],
- [90, 13, 190],
- [90, 7, 200],
- [90, 4, 210],
- [90, 6, 220],
- [90, 7, 230],
- [90, 4, 240],
- [90, 4, 250],
- [90, 6, 260],
- [90, 6, 270],
- [90, 4, 280],
- [90, 5, 290],
- [90, 5, 300],
- [90, 6, 310],
- [90, 8, 320],
- [90, 9, 330],
- [90, 4, 340],
- [90, 6, 350]])
+POINTER_GAMUT_DATA = np.array(
+ [[15, 10, 0],
+ [15, 15, 10],
+ [15, 14, 20],
+ [15, 35, 30],
+ [15, 27, 40],
+ [15, 10, 50],
+ [15, 4, 60],
+ [15, 5, 70],
+ [15, 6, 80],
+ [15, 4, 90],
+ [15, 9, 100],
+ [15, 9, 110],
+ [15, 4, 120],
+ [15, 5, 130],
+ [15, 7, 140],
+ [15, 7, 150],
+ [15, 8, 160],
+ [15, 13, 170],
+ [15, 10, 180],
+ [15, 7, 190],
+ [15, 5, 200],
+ [15, 0, 210],
+ [15, 2, 220],
+ [15, 10, 230],
+ [15, 8, 240],
+ [15, 9, 250],
+ [15, 12, 260],
+ [15, 14, 270],
+ [15, 10, 280],
+ [15, 20, 290],
+ [15, 30, 300],
+ [15, 62, 310],
+ [15, 60, 320],
+ [15, 20, 330],
+ [15, 26, 340],
+ [15, 15, 350],
+ [20, 30, 0],
+ [20, 30, 10],
+ [20, 34, 20],
+ [20, 48, 30],
+ [20, 40, 40],
+ [20, 21, 50],
+ [20, 15, 60],
+ [20, 15, 70],
+ [20, 15, 80],
+ [20, 12, 90],
+ [20, 16, 100],
+ [20, 18, 110],
+ [20, 14, 120],
+ [20, 18, 130],
+ [20, 20, 140],
+ [20, 21, 150],
+ [20, 24, 160],
+ [20, 25, 170],
+ [20, 25, 180],
+ [20, 19, 190],
+ [20, 19, 200],
+ [20, 12, 210],
+ [20, 12, 220],
+ [20, 20, 230],
+ [20, 16, 240],
+ [20, 21, 250],
+ [20, 24, 260],
+ [20, 31, 270],
+ [20, 29, 280],
+ [20, 40, 290],
+ [20, 55, 300],
+ [20, 76, 310],
+ [20, 71, 320],
+ [20, 50, 330],
+ [20, 49, 340],
+ [20, 37, 350],
+ [25, 43, 0],
+ [25, 45, 10],
+ [25, 49, 20],
+ [25, 59, 30],
+ [25, 53, 40],
+ [25, 34, 50],
+ [25, 26, 60],
+ [25, 25, 70],
+ [25, 24, 80],
+ [25, 20, 90],
+ [25, 23, 100],
+ [25, 27, 110],
+ [25, 23, 120],
+ [25, 30, 130],
+ [25, 32, 140],
+ [25, 34, 150],
+ [25, 36, 160],
+ [25, 36, 170],
+ [25, 38, 180],
+ [25, 30, 190],
+ [25, 29, 200],
+ [25, 17, 210],
+ [25, 20, 220],
+ [25, 29, 230],
+ [25, 26, 240],
+ [25, 32, 250],
+ [25, 34, 260],
+ [25, 42, 270],
+ [25, 45, 280],
+ [25, 60, 290],
+ [25, 72, 300],
+ [25, 85, 310],
+ [25, 79, 320],
+ [25, 72, 330],
+ [25, 63, 340],
+ [25, 52, 350],
+ [30, 56, 0],
+ [30, 56, 10],
+ [30, 61, 20],
+ [30, 68, 30],
+ [30, 66, 40],
+ [30, 45, 50],
+ [30, 37, 60],
+ [30, 36, 70],
+ [30, 32, 80],
+ [30, 28, 90],
+ [30, 30, 100],
+ [30, 35, 110],
+ [30, 32, 120],
+ [30, 40, 130],
+ [30, 42, 140],
+ [30, 45, 150],
+ [30, 48, 160],
+ [30, 47, 170],
+ [30, 48, 180],
+ [30, 40, 190],
+ [30, 37, 200],
+ [30, 26, 210],
+ [30, 28, 220],
+ [30, 36, 230],
+ [30, 34, 240],
+ [30, 40, 250],
+ [30, 41, 260],
+ [30, 50, 270],
+ [30, 55, 280],
+ [30, 69, 290],
+ [30, 81, 300],
+ [30, 88, 310],
+ [30, 84, 320],
+ [30, 86, 330],
+ [30, 73, 340],
+ [30, 65, 350],
+ [35, 68, 0],
+ [35, 64, 10],
+ [35, 69, 20],
+ [35, 75, 30],
+ [35, 79, 40],
+ [35, 60, 50],
+ [35, 48, 60],
+ [35, 46, 70],
+ [35, 40, 80],
+ [35, 36, 90],
+ [35, 37, 100],
+ [35, 44, 110],
+ [35, 41, 120],
+ [35, 48, 130],
+ [35, 52, 140],
+ [35, 57, 150],
+ [35, 58, 160],
+ [35, 57, 170],
+ [35, 57, 180],
+ [35, 48, 190],
+ [35, 42, 200],
+ [35, 34, 210],
+ [35, 35, 220],
+ [35, 42, 230],
+ [35, 41, 240],
+ [35, 49, 250],
+ [35, 46, 260],
+ [35, 55, 270],
+ [35, 60, 280],
+ [35, 71, 290],
+ [35, 79, 300],
+ [35, 85, 310],
+ [35, 85, 320],
+ [35, 89, 330],
+ [35, 82, 340],
+ [35, 73, 350],
+ [40, 77, 0],
+ [40, 70, 10],
+ [40, 74, 20],
+ [40, 82, 30],
+ [40, 90, 40],
+ [40, 75, 50],
+ [40, 59, 60],
+ [40, 56, 70],
+ [40, 48, 80],
+ [40, 44, 90],
+ [40, 45, 100],
+ [40, 52, 110],
+ [40, 49, 120],
+ [40, 56, 130],
+ [40, 60, 140],
+ [40, 68, 150],
+ [40, 68, 160],
+ [40, 65, 170],
+ [40, 64, 180],
+ [40, 55, 190],
+ [40, 45, 200],
+ [40, 43, 210],
+ [40, 40, 220],
+ [40, 46, 230],
+ [40, 47, 240],
+ [40, 54, 250],
+ [40, 51, 260],
+ [40, 60, 270],
+ [40, 61, 280],
+ [40, 69, 290],
+ [40, 72, 300],
+ [40, 80, 310],
+ [40, 86, 320],
+ [40, 89, 330],
+ [40, 87, 340],
+ [40, 79, 350],
+ [45, 79, 0],
+ [45, 73, 10],
+ [45, 76, 20],
+ [45, 84, 30],
+ [45, 94, 40],
+ [45, 90, 50],
+ [45, 70, 60],
+ [45, 67, 70],
+ [45, 55, 80],
+ [45, 53, 90],
+ [45, 51, 100],
+ [45, 59, 110],
+ [45, 57, 120],
+ [45, 64, 130],
+ [45, 69, 140],
+ [45, 75, 150],
+ [45, 76, 160],
+ [45, 70, 170],
+ [45, 69, 180],
+ [45, 59, 190],
+ [45, 46, 200],
+ [45, 49, 210],
+ [45, 45, 220],
+ [45, 49, 230],
+ [45, 49, 240],
+ [45, 55, 250],
+ [45, 55, 260],
+ [45, 60, 270],
+ [45, 60, 280],
+ [45, 65, 290],
+ [45, 64, 300],
+ [45, 71, 310],
+ [45, 82, 320],
+ [45, 86, 330],
+ [45, 87, 340],
+ [45, 82, 350],
+ [50, 77, 0],
+ [50, 73, 10],
+ [50, 76, 20],
+ [50, 83, 30],
+ [50, 93, 40],
+ [50, 100, 50],
+ [50, 82, 60],
+ [50, 76, 70],
+ [50, 64, 80],
+ [50, 60, 90],
+ [50, 58, 100],
+ [50, 66, 110],
+ [50, 64, 120],
+ [50, 70, 130],
+ [50, 76, 140],
+ [50, 81, 150],
+ [50, 82, 160],
+ [50, 75, 170],
+ [50, 71, 180],
+ [50, 62, 190],
+ [50, 46, 200],
+ [50, 51, 210],
+ [50, 48, 220],
+ [50, 51, 230],
+ [50, 50, 240],
+ [50, 55, 250],
+ [50, 56, 260],
+ [50, 57, 270],
+ [50, 57, 280],
+ [50, 58, 290],
+ [50, 57, 300],
+ [50, 62, 310],
+ [50, 74, 320],
+ [50, 80, 330],
+ [50, 83, 340],
+ [50, 84, 350],
+ [55, 72, 0],
+ [55, 71, 10],
+ [55, 74, 20],
+ [55, 80, 30],
+ [55, 88, 40],
+ [55, 102, 50],
+ [55, 93, 60],
+ [55, 85, 70],
+ [55, 72, 80],
+ [55, 68, 90],
+ [55, 65, 100],
+ [55, 74, 110],
+ [55, 71, 120],
+ [55, 77, 130],
+ [55, 82, 140],
+ [55, 84, 150],
+ [55, 85, 160],
+ [55, 76, 170],
+ [55, 72, 180],
+ [55, 62, 190],
+ [55, 45, 200],
+ [55, 54, 210],
+ [55, 51, 220],
+ [55, 52, 230],
+ [55, 50, 240],
+ [55, 52, 250],
+ [55, 51, 260],
+ [55, 50, 270],
+ [55, 53, 280],
+ [55, 50, 290],
+ [55, 50, 300],
+ [55, 55, 310],
+ [55, 66, 320],
+ [55, 72, 330],
+ [55, 78, 340],
+ [55, 79, 350],
+ [60, 65, 0],
+ [60, 65, 10],
+ [60, 68, 20],
+ [60, 75, 30],
+ [60, 82, 40],
+ [60, 99, 50],
+ [60, 103, 60],
+ [60, 94, 70],
+ [60, 82, 80],
+ [60, 75, 90],
+ [60, 72, 100],
+ [60, 82, 110],
+ [60, 78, 120],
+ [60, 82, 130],
+ [60, 87, 140],
+ [60, 84, 150],
+ [60, 83, 160],
+ [60, 75, 170],
+ [60, 69, 180],
+ [60, 60, 190],
+ [60, 43, 200],
+ [60, 50, 210],
+ [60, 49, 220],
+ [60, 50, 230],
+ [60, 47, 240],
+ [60, 48, 250],
+ [60, 46, 260],
+ [60, 45, 270],
+ [60, 46, 280],
+ [60, 43, 290],
+ [60, 42, 300],
+ [60, 47, 310],
+ [60, 57, 320],
+ [60, 63, 330],
+ [60, 71, 340],
+ [60, 73, 350],
+ [65, 57, 0],
+ [65, 57, 10],
+ [65, 61, 20],
+ [65, 67, 30],
+ [65, 72, 40],
+ [65, 88, 50],
+ [65, 106, 60],
+ [65, 102, 70],
+ [65, 94, 80],
+ [65, 83, 90],
+ [65, 80, 100],
+ [65, 87, 110],
+ [65, 84, 120],
+ [65, 85, 130],
+ [65, 89, 140],
+ [65, 83, 150],
+ [65, 78, 160],
+ [65, 71, 170],
+ [65, 64, 180],
+ [65, 55, 190],
+ [65, 39, 200],
+ [65, 46, 210],
+ [65, 45, 220],
+ [65, 45, 230],
+ [65, 42, 240],
+ [65, 43, 250],
+ [65, 40, 260],
+ [65, 39, 270],
+ [65, 40, 280],
+ [65, 36, 290],
+ [65, 35, 300],
+ [65, 41, 310],
+ [65, 48, 320],
+ [65, 54, 330],
+ [65, 62, 340],
+ [65, 63, 350],
+ [70, 50, 0],
+ [70, 48, 10],
+ [70, 51, 20],
+ [70, 56, 30],
+ [70, 60, 40],
+ [70, 75, 50],
+ [70, 98, 60],
+ [70, 108, 70],
+ [70, 105, 80],
+ [70, 90, 90],
+ [70, 86, 100],
+ [70, 92, 110],
+ [70, 90, 120],
+ [70, 88, 130],
+ [70, 90, 140],
+ [70, 80, 150],
+ [70, 69, 160],
+ [70, 65, 170],
+ [70, 60, 180],
+ [70, 49, 190],
+ [70, 35, 200],
+ [70, 40, 210],
+ [70, 38, 220],
+ [70, 39, 230],
+ [70, 36, 240],
+ [70, 36, 250],
+ [70, 33, 260],
+ [70, 33, 270],
+ [70, 34, 280],
+ [70, 29, 290],
+ [70, 30, 300],
+ [70, 34, 310],
+ [70, 40, 320],
+ [70, 45, 330],
+ [70, 51, 340],
+ [70, 53, 350],
+ [75, 40, 0],
+ [75, 39, 10],
+ [75, 40, 20],
+ [75, 45, 30],
+ [75, 47, 40],
+ [75, 59, 50],
+ [75, 85, 60],
+ [75, 103, 70],
+ [75, 115, 80],
+ [75, 98, 90],
+ [75, 94, 100],
+ [75, 95, 110],
+ [75, 94, 120],
+ [75, 89, 130],
+ [75, 83, 140],
+ [75, 72, 150],
+ [75, 59, 160],
+ [75, 57, 170],
+ [75, 51, 180],
+ [75, 41, 190],
+ [75, 30, 200],
+ [75, 32, 210],
+ [75, 32, 220],
+ [75, 32, 230],
+ [75, 29, 240],
+ [75, 29, 250],
+ [75, 27, 260],
+ [75, 26, 270],
+ [75, 25, 280],
+ [75, 24, 290],
+ [75, 24, 300],
+ [75, 27, 310],
+ [75, 31, 320],
+ [75, 36, 330],
+ [75, 40, 340],
+ [75, 40, 350],
+ [80, 30, 0],
+ [80, 30, 10],
+ [80, 30, 20],
+ [80, 33, 30],
+ [80, 35, 40],
+ [80, 45, 50],
+ [80, 66, 60],
+ [80, 82, 70],
+ [80, 115, 80],
+ [80, 106, 90],
+ [80, 100, 100],
+ [80, 100, 110],
+ [80, 95, 120],
+ [80, 84, 130],
+ [80, 71, 140],
+ [80, 58, 150],
+ [80, 49, 160],
+ [80, 45, 170],
+ [80, 41, 180],
+ [80, 32, 190],
+ [80, 22, 200],
+ [80, 24, 210],
+ [80, 23, 220],
+ [80, 24, 230],
+ [80, 21, 240],
+ [80, 21, 250],
+ [80, 20, 260],
+ [80, 20, 270],
+ [80, 18, 280],
+ [80, 18, 290],
+ [80, 17, 300],
+ [80, 20, 310],
+ [80, 24, 320],
+ [80, 27, 330],
+ [80, 28, 340],
+ [80, 30, 350],
+ [85, 19, 0],
+ [85, 18, 10],
+ [85, 19, 20],
+ [85, 21, 30],
+ [85, 22, 40],
+ [85, 30, 50],
+ [85, 45, 60],
+ [85, 58, 70],
+ [85, 83, 80],
+ [85, 111, 90],
+ [85, 106, 100],
+ [85, 96, 110],
+ [85, 83, 120],
+ [85, 64, 130],
+ [85, 54, 140],
+ [85, 44, 150],
+ [85, 34, 160],
+ [85, 30, 170],
+ [85, 29, 180],
+ [85, 23, 190],
+ [85, 14, 200],
+ [85, 14, 210],
+ [85, 15, 220],
+ [85, 15, 230],
+ [85, 12, 240],
+ [85, 13, 250],
+ [85, 13, 260],
+ [85, 13, 270],
+ [85, 11, 280],
+ [85, 12, 290],
+ [85, 12, 300],
+ [85, 14, 310],
+ [85, 16, 320],
+ [85, 18, 330],
+ [85, 18, 340],
+ [85, 17, 350],
+ [90, 8, 0],
+ [90, 7, 10],
+ [90, 9, 20],
+ [90, 10, 30],
+ [90, 10, 40],
+ [90, 15, 50],
+ [90, 23, 60],
+ [90, 34, 70],
+ [90, 48, 80],
+ [90, 90, 90],
+ [90, 108, 100],
+ [90, 84, 110],
+ [90, 50, 120],
+ [90, 35, 130],
+ [90, 30, 140],
+ [90, 20, 150],
+ [90, 15, 160],
+ [90, 15, 170],
+ [90, 16, 180],
+ [90, 13, 190],
+ [90, 7, 200],
+ [90, 4, 210],
+ [90, 6, 220],
+ [90, 7, 230],
+ [90, 4, 240],
+ [90, 4, 250],
+ [90, 6, 260],
+ [90, 6, 270],
+ [90, 4, 280],
+ [90, 5, 290],
+ [90, 5, 300],
+ [90, 6, 310],
+ [90, 8, 320],
+ [90, 9, 330],
+ [90, 4, 340],
+ [90, 6, 350]]) # yapf: disable
"""
*Pointer's Gamut* data as a tuple of *CIE LCHab* colourspace matrices.
POINTER_GAMUT_DATA : ndarray
"""
-POINTER_GAMUT_BOUNDARIES = np.array([
- [0.659, 0.316],
- [0.634, 0.351],
- [0.594, 0.391],
- [0.557, 0.427],
- [0.523, 0.462],
- [0.482, 0.491],
- [0.444, 0.515],
- [0.409, 0.546],
- [0.371, 0.558],
- [0.332, 0.573],
- [0.288, 0.584],
- [0.242, 0.576],
- [0.202, 0.530],
- [0.177, 0.454],
- [0.151, 0.389],
- [0.151, 0.330],
- [0.162, 0.295],
- [0.157, 0.266],
- [0.159, 0.245],
- [0.142, 0.214],
- [0.141, 0.195],
- [0.129, 0.168],
- [0.138, 0.141],
- [0.145, 0.129],
- [0.145, 0.106],
- [0.161, 0.094],
- [0.188, 0.084],
- [0.252, 0.104],
- [0.324, 0.127],
- [0.393, 0.165],
- [0.451, 0.199],
- [0.508, 0.226]])
+POINTER_GAMUT_BOUNDARIES = np.array(
+ [[0.659, 0.316],
+ [0.634, 0.351],
+ [0.594, 0.391],
+ [0.557, 0.427],
+ [0.523, 0.462],
+ [0.482, 0.491],
+ [0.444, 0.515],
+ [0.409, 0.546],
+ [0.371, 0.558],
+ [0.332, 0.573],
+ [0.288, 0.584],
+ [0.242, 0.576],
+ [0.202, 0.530],
+ [0.177, 0.454],
+ [0.151, 0.389],
+ [0.151, 0.330],
+ [0.162, 0.295],
+ [0.157, 0.266],
+ [0.159, 0.245],
+ [0.142, 0.214],
+ [0.141, 0.195],
+ [0.129, 0.168],
+ [0.138, 0.141],
+ [0.145, 0.129],
+ [0.145, 0.106],
+ [0.161, 0.094],
+ [0.188, 0.084],
+ [0.252, 0.104],
+ [0.324, 0.127],
+ [0.393, 0.165],
+ [0.451, 0.199],
+ [0.508, 0.226]]) # yapf: disable
"""
*Pointer's Gamut* *xy* chromaticity coordinates boundaries.
diff --git a/colour/models/hdr_cie_lab.py b/colour/models/hdr_cie_lab.py
new file mode 100644
index 0000000000..4be3374883
--- /dev/null
+++ b/colour/models/hdr_cie_lab.py
@@ -0,0 +1,188 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+hdr-CIELAB Colourspace
+======================
+
+Defines the *hdr-CIELAB* colourspace transformations:
+
+- :func:`XYZ_to_hdr_CIELab`
+- :func:`hdr_CIELab_to_XYZ`
+
+See Also
+--------
+`hdr-CIELAB Colourspace Jupyter Notebook
+`_
+
+References
+----------
+.. [1] Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT:
+ Simple Models for Describing the Color of High-Dynamic-Range and
+ Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference
+ (pp. 322–326). ISBN:9781629932156
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.colorimetry import (ILLUMINANTS, lightness_Fairchild2010,
+ luminance_Fairchild2010)
+from colour.models import xy_to_xyY, xyY_to_XYZ
+from colour.utilities import tsplit, tstack
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['XYZ_to_hdr_CIELab', 'hdr_CIELab_to_XYZ', 'exponent_hdr_CIELab']
+
+
+def XYZ_to_hdr_CIELab(
+ XYZ,
+ illuminant=ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'],
+ Y_s=0.2,
+ Y_abs=100):
+ """
+ Converts from *CIE XYZ* tristimulus values to *hdr-CIELAB* colourspace.
+
+ Parameters
+ ----------
+ XYZ : array_like
+ *CIE XYZ* tristimulus values.
+ illuminant : array_like, optional
+ Reference *illuminant* *xy* chromaticity coordinates or *CIE xyY*
+ colourspace array.
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in domain [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ ndarray
+ *hdr-CIELAB* colourspace array.
+
+ Notes
+ -----
+ - Conversion to polar coordinates to compute the *chroma* :math:`C_{hdr}`
+ and *hue* :math:`h_{hdr}` correlates can be safely performed with
+ :func:`colour.Lab_to_LCHab` definition.
+ - Conversion to cartesian coordinates from the *Lightness*
+ :math:`L_{hdr}`, *chroma* :math:`C_{hdr}` and *hue* :math:`h_{hdr}`
+ correlates can be safely performed with :func:`colour.LCHab_to_Lab`
+ definition.
+ - Input *CIE XYZ* tristimulus values are in domain [0, math:`\infty`].
+ - Input *illuminant* *xy* chromaticity coordinates or *CIE xyY*
+ colourspace array are in domain [0, :math:`\infty`].
+
+ Examples
+ --------
+ >>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ >>> XYZ_to_hdr_CIELab(XYZ) # doctest: +ELLIPSIS
+ array([ 24.9020664..., -46.8312760..., -10.14274843])
+ """
+
+ X, Y, Z = tsplit(XYZ)
+ X_n, Y_n, Z_n = tsplit(xyY_to_XYZ(xy_to_xyY(illuminant)))
+
+ e = exponent_hdr_CIELab(Y_s, Y_abs)
+
+ L_hdr = lightness_Fairchild2010(Y / Y_n, e)
+ a_hdr = 5 * (lightness_Fairchild2010(X / X_n, e) - L_hdr)
+ b_hdr = 2 * (L_hdr - lightness_Fairchild2010(Z / Z_n, e))
+
+ Lab_hdr = tstack((L_hdr, a_hdr, b_hdr))
+
+ return Lab_hdr
+
+
+def hdr_CIELab_to_XYZ(
+ Lab_hdr,
+ illuminant=ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'],
+ Y_s=0.2,
+ Y_abs=100):
+ """
+ Converts from *hdr-CIELAB* colourspace to *CIE XYZ* tristimulus values.
+
+ Parameters
+ ----------
+ Lab_hdr : array_like
+ *hdr-CIELAB* colourspace array.
+ illuminant : array_like, optional
+ Reference *illuminant* *xy* chromaticity coordinates or *CIE xyY*
+ colourspace array.
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in domain [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ ndarray
+ *CIE XYZ* tristimulus values.
+
+ Notes
+ -----
+ - Input *illuminant* *xy* chromaticity coordinates or *CIE xyY*
+ colourspace array are in domain [0, :math:`\infty`].
+ - Output *CIE XYZ* tristimulus values are in range [0, math:`\infty`].
+
+ Examples
+ --------
+ >>> Lab_hdr = np.array([24.90206646, -46.83127607, -10.14274843])
+ >>> hdr_CIELab_to_XYZ(Lab_hdr) # doctest: +ELLIPSIS
+ array([ 0.0704953..., 0.1008 , 0.0955831...])
+ """
+
+ L_hdr, a_hdr, b_hdr = tsplit(Lab_hdr)
+ X_n, Y_n, Z_n = tsplit(xyY_to_XYZ(xy_to_xyY(illuminant)))
+
+ e = exponent_hdr_CIELab(Y_s, Y_abs)
+
+ Y = luminance_Fairchild2010(L_hdr, e) * Y_n
+ X = luminance_Fairchild2010((a_hdr + 5 * L_hdr) / 5, e) * X_n
+ Z = luminance_Fairchild2010((-b_hdr + 2 * L_hdr) / 2, e) * Z_n
+
+ XYZ = tstack((X, Y, Z))
+
+ return XYZ
+
+
+def exponent_hdr_CIELab(Y_s, Y_abs):
+ """
+ Computes *hdr-CIELAB* colourspace *Lightness* :math:`\epsilon` exponent.
+
+ Parameters
+ ----------
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in range [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ array_like
+ *hdr-CIELAB* colourspace *Lightness* :math:`\epsilon` exponent.
+
+ Examples
+ --------
+ >>> exponent_hdr_CIELab(0.2, 100) # doctest: +ELLIPSIS
+ 1.8360198...
+ """
+
+ Y_s = np.asarray(Y_s)
+ Y_abs = np.asarray(Y_abs)
+
+ lf = np.log(318) / np.log(Y_abs)
+ sf = 1.25 - 0.25 * (Y_s / 0.184)
+ epsilon = 1.50 * sf * lf
+
+ return epsilon
diff --git a/colour/models/hdr_ipt.py b/colour/models/hdr_ipt.py
new file mode 100644
index 0000000000..2806b22d71
--- /dev/null
+++ b/colour/models/hdr_ipt.py
@@ -0,0 +1,150 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+hdr-IPT Colourspace
+===================
+
+Defines the *hdr-IPT* colourspace transformations:
+
+- :func:`XYZ_to_hdr_IPT`
+- :func:`hdr_IPT_to_XYZ`
+
+See Also
+--------
+`hdr-IPT Colourspace Jupyter Notebook
+`_
+
+References
+----------
+.. [1] Fairchild, M. D., & Wyble, D. R. (2010). hdr-CIELAB and hdr-IPT:
+ Simple Models for Describing the Color of High-Dynamic-Range and
+ Wide-Color-Gamut Images. In Proc. of Color and Imaging Conference
+ (pp. 322–326). ISBN:9781629932156
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.colorimetry import lightness_Fairchild2010, luminance_Fairchild2010
+from colour.models.ipt import (IPT_XYZ_TO_LMS_MATRIX, IPT_LMS_TO_XYZ_MATRIX,
+ IPT_LMS_TO_IPT_MATRIX, IPT_IPT_TO_LMS_MATRIX)
+from colour.utilities import dot_vector
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['XYZ_to_hdr_IPT', 'hdr_IPT_to_XYZ', 'exponent_hdr_IPT']
+
+
+def XYZ_to_hdr_IPT(XYZ, Y_s=0.2, Y_abs=100):
+ """
+ Converts from *CIE XYZ* tristimulus values to *hdr-IPT* colourspace.
+
+ Parameters
+ ----------
+ XYZ : array_like
+ *CIE XYZ* tristimulus values.
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in domain [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ ndarray
+ *hdr-IPT* colourspace array.
+
+ Notes
+ -----
+ - Input *CIE XYZ* tristimulus values needs to be adapted for
+ *CIE Standard Illuminant D Series* *D65*.
+
+ Examples
+ --------
+ >>> XYZ = np.array([0.96907232, 1.00000000, 1.12179215])
+ >>> XYZ_to_hdr_IPT(XYZ) # doctest: +ELLIPSIS
+ array([ 94.6592917..., 0.3804177..., -0.2673118...])
+ """
+
+ e = exponent_hdr_IPT(Y_s, Y_abs)[..., np.newaxis]
+
+ LMS = dot_vector(IPT_XYZ_TO_LMS_MATRIX, XYZ)
+ LMS_prime = np.sign(LMS) * np.abs(lightness_Fairchild2010(LMS, e))
+ IPT = dot_vector(IPT_LMS_TO_IPT_MATRIX, LMS_prime)
+
+ return IPT
+
+
+def hdr_IPT_to_XYZ(IPT_hdr, Y_s=0.2, Y_abs=100):
+ """
+ Converts from *hdr-IPT* colourspace to *CIE XYZ* tristimulus values.
+
+ Parameters
+ ----------
+ IPT_hdr : array_like
+ *hdr-IPT* colourspace array.
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in domain [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ ndarray
+ *CIE XYZ* tristimulus values.
+
+ Examples
+ --------
+ >>> IPT_hdr = np.array([94.65929175, 0.38041773, -0.26731187])
+ >>> hdr_IPT_to_XYZ(IPT_hdr) # doctest: +ELLIPSIS
+ array([ 0.9690723..., 1. , 1.1217921...])
+ """
+
+ e = exponent_hdr_IPT(Y_s, Y_abs)[..., np.newaxis]
+
+ LMS = dot_vector(IPT_IPT_TO_LMS_MATRIX, IPT_hdr)
+ LMS_prime = np.sign(LMS) * np.abs(luminance_Fairchild2010(LMS, e))
+ XYZ = dot_vector(IPT_LMS_TO_XYZ_MATRIX, LMS_prime)
+
+ return XYZ
+
+
+def exponent_hdr_IPT(Y_s, Y_abs):
+ """
+ Computes *hdr-IPT* colourspace *Lightness* :math:`\epsilon` exponent.
+
+ Parameters
+ ----------
+ Y_s : numeric or array_like
+ Relative luminance :math:`Y_s` of the surround in range [0, 1].
+ Y_abs : numeric or array_like
+ Absolute luminance :math:`Y_{abs}` of the scene diffuse white in
+ :math:`cd/m^2`.
+
+ Returns
+ -------
+ array_like
+ *hdr-IPT* colourspace *Lightness* :math:`\epsilon` exponent.
+
+ Examples
+ --------
+ >>> exponent_hdr_IPT(0.2, 100) # doctest: +ELLIPSIS
+ 1.6891383...
+ """
+
+ Y_s = np.asarray(Y_s)
+ Y_abs = np.asarray(Y_abs)
+
+ lf = np.log(318) / np.log(Y_abs)
+ sf = 1.25 - 0.25 * (Y_s / 0.184)
+ epsilon = 1.38 * sf * lf
+
+ return epsilon
diff --git a/colour/models/hunter_lab.py b/colour/models/hunter_lab.py
index 65c3c07c3c..334552bd9c 100644
--- a/colour/models/hunter_lab.py
+++ b/colour/models/hunter_lab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Hunter L,a,b Colour Scale
=========================
@@ -37,9 +36,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XYZ_to_K_ab_HunterLab1966',
- 'XYZ_to_Hunter_Lab',
- 'Hunter_Lab_to_XYZ']
+__all__ = [
+ 'XYZ_to_K_ab_HunterLab1966', 'XYZ_to_Hunter_Lab', 'Hunter_Lab_to_XYZ'
+]
def XYZ_to_K_ab_HunterLab1966(XYZ):
@@ -87,12 +86,11 @@ def XYZ_to_K_ab_HunterLab1966(XYZ):
return K_ab
-def XYZ_to_Hunter_Lab(
- XYZ,
- XYZ_n=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
- K_ab=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
+def XYZ_to_Hunter_Lab(XYZ,
+ XYZ_n=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
+ K_ab=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
"""
Converts from *CIE XYZ* tristimulus values to *Hunter L,a,b* colour scale.
@@ -129,8 +127,7 @@ def XYZ_to_Hunter_Lab(
X, Y, Z = tsplit(XYZ)
X_n, Y_n, Z_n = tsplit(XYZ_n)
K_a, K_b = (tsplit(XYZ_to_K_ab_HunterLab1966(XYZ_n))
- if K_ab is None else
- tsplit(K_ab))
+ if K_ab is None else tsplit(K_ab))
Y_Y_n = Y / Y_n
sqrt_Y_Y_n = np.sqrt(Y_Y_n)
@@ -144,12 +141,11 @@ def XYZ_to_Hunter_Lab(
return Lab
-def Hunter_Lab_to_XYZ(
- Lab,
- XYZ_n=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
- K_ab=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
+def Hunter_Lab_to_XYZ(Lab,
+ XYZ_n=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
+ K_ab=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
"""
Converts from *Hunter L,a,b* colour scale to *CIE XYZ* tristimulus values.
@@ -187,8 +183,7 @@ def Hunter_Lab_to_XYZ(
L, a, b = tsplit(Lab)
X_n, Y_n, Z_n = tsplit(XYZ_n)
K_a, K_b = (tsplit(XYZ_to_K_ab_HunterLab1966(XYZ_n))
- if K_ab is None else
- tsplit(K_ab))
+ if K_ab is None else tsplit(K_ab))
L_100 = L / 100
L_100_2 = L_100 ** 2
diff --git a/colour/models/hunter_rdab.py b/colour/models/hunter_rdab.py
index 9194906b1a..9032b7933e 100644
--- a/colour/models/hunter_rdab.py
+++ b/colour/models/hunter_rdab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Hunter Rd,a,b Colour Scale
==========================
@@ -38,12 +37,11 @@
__all__ = ['XYZ_to_Hunter_Rdab']
-def XYZ_to_Hunter_Rdab(
- XYZ,
- XYZ_n=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
- K_ab=HUNTERLAB_ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
+def XYZ_to_Hunter_Rdab(XYZ,
+ XYZ_n=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].XYZ_n,
+ K_ab=HUNTERLAB_ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer']['D50'].K_ab):
"""
Converts from *CIE XYZ* tristimulus values to *Hunter Rd,a,b* colour scale.
@@ -83,8 +81,7 @@ def XYZ_to_Hunter_Rdab(
X, Y, Z = tsplit(XYZ)
X_n, Y_n, Z_n = tsplit(XYZ_n)
K_a, K_b = (tsplit(XYZ_to_K_ab_HunterLab1966(XYZ_n))
- if K_ab is None else
- tsplit(K_ab))
+ if K_ab is None else tsplit(K_ab))
f = 0.51 * ((21 + 0.2 * Y) / (1 + 0.2 * Y))
Y_Yn = Y / Y_n
diff --git a/colour/models/ipt.py b/colour/models/ipt.py
index 0211a156b9..d89ae7615b 100644
--- a/colour/models/ipt.py
+++ b/colour/models/ipt.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
IPT Colourspace
===============
@@ -14,6 +13,12 @@
- :func:`IPT_hue_angle`
+See Also
+--------
+`IPT Colourspace Jupyter Notebook
+`_
+
References
----------
.. [1] Fairchild, M. D. (2013). IPT Colourspace. In Color Appearance Models
@@ -33,18 +38,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['IPT_XYZ_TO_LMS_MATRIX',
- 'IPT_LMS_TO_XYZ_MATRIX',
- 'IPT_LMS_TO_IPT_MATRIX',
- 'IPT_IPT_TO_LMS_MATRIX',
- 'XYZ_to_IPT',
- 'IPT_to_XYZ',
- 'IPT_hue_angle']
-
-IPT_XYZ_TO_LMS_MATRIX = np.array([
- [0.4002, 0.7075, -0.0807],
- [-0.2280, 1.1500, 0.0612],
- [0.0000, 0.0000, 0.9184]])
+__all__ = [
+ 'IPT_XYZ_TO_LMS_MATRIX', 'IPT_LMS_TO_XYZ_MATRIX', 'IPT_LMS_TO_IPT_MATRIX',
+ 'IPT_IPT_TO_LMS_MATRIX', 'XYZ_to_IPT', 'IPT_to_XYZ', 'IPT_hue_angle'
+]
+
+IPT_XYZ_TO_LMS_MATRIX = np.array(
+ [[0.4002, 0.7075, -0.0807],
+ [-0.2280, 1.1500, 0.0612],
+ [0.0000, 0.0000, 0.9184]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to normalised cone responses matrix.
@@ -58,10 +60,10 @@
IPT_LMS_TO_XYZ_MATRIX : array_like, (3, 3)
"""
-IPT_LMS_TO_IPT_MATRIX = np.array([
- [0.4000, 0.4000, 0.2000],
- [4.4550, -4.8510, 0.3960],
- [0.8056, 0.3572, -1.1628]])
+IPT_LMS_TO_IPT_MATRIX = np.array(
+ [[0.4000, 0.4000, 0.2000],
+ [4.4550, -4.8510, 0.3960],
+ [0.8056, 0.3572, -1.1628]]) # yapf: disable
"""
Normalised cone responses to *IPT* colourspace matrix.
diff --git a/colour/models/rgb/__init__.py b/colour/models/rgb/__init__.py
index 32c166bc1e..9169cc9e33 100644
--- a/colour/models/rgb/__init__.py
+++ b/colour/models/rgb/__init__.py
@@ -3,12 +3,9 @@
from __future__ import absolute_import
-from .derivation import (
- normalised_primary_matrix,
- chromatically_adapted_primaries,
- primaries_whitepoint,
- RGB_luminance_equation,
- RGB_luminance)
+from .derivation import (normalised_primary_matrix,
+ chromatically_adapted_primaries, primaries_whitepoint,
+ RGB_luminance_equation, RGB_luminance)
from .rgb_colourspace import RGB_Colourspace
from .rgb_colourspace import XYZ_to_RGB, RGB_to_XYZ
from .rgb_colourspace import RGB_to_RGB_matrix, RGB_to_RGB
@@ -18,28 +15,17 @@
from . import dataset
from .common import XYZ_to_sRGB, sRGB_to_XYZ
from .aces_it import spectral_to_aces_relative_exposure_values
-from .deprecated import (
- RGB_to_HSV,
- HSV_to_RGB,
- RGB_to_HSL,
- HSL_to_RGB,
- RGB_to_CMY,
- CMY_to_RGB,
- CMY_to_CMYK,
- CMYK_to_CMY)
-from .ycbcr import (
- YCBCR_WEIGHTS,
- RGB_to_YCbCr,
- YCbCr_to_RGB,
- RGB_to_YcCbcCrc,
- YcCbcCrc_to_RGB)
+from .deprecated import (RGB_to_HSV, HSV_to_RGB, RGB_to_HSL, HSL_to_RGB,
+ RGB_to_CMY, CMY_to_RGB, CMY_to_CMYK, CMYK_to_CMY)
+from .prismatic import RGB_to_Prismatic, Prismatic_to_RGB
+from .ycbcr import (YCBCR_WEIGHTS, RGB_to_YCbCr, YCbCr_to_RGB, RGB_to_YcCbcCrc,
+ YcCbcCrc_to_RGB)
from .ictcp import RGB_to_ICTCP, ICTCP_to_RGB
-__all__ = ['normalised_primary_matrix',
- 'chromatically_adapted_primaries',
- 'primaries_whitepoint',
- 'RGB_luminance_equation',
- 'RGB_luminance']
+__all__ = [
+ 'normalised_primary_matrix', 'chromatically_adapted_primaries',
+ 'primaries_whitepoint', 'RGB_luminance_equation', 'RGB_luminance'
+]
__all__ += ['RGB_Colourspace']
__all__ += ['XYZ_to_RGB', 'RGB_to_XYZ']
__all__ += ['RGB_to_RGB_matrix', 'RGB_to_RGB']
@@ -47,17 +33,13 @@
__all__ += dataset.__all__
__all__ += ['XYZ_to_sRGB', 'sRGB_to_XYZ']
__all__ += ['spectral_to_aces_relative_exposure_values']
-__all__ += ['RGB_to_HSV',
- 'HSV_to_RGB',
- 'RGB_to_HSL',
- 'HSL_to_RGB',
- 'RGB_to_CMY',
- 'CMY_to_RGB',
- 'CMY_to_CMYK',
- 'CMYK_to_CMY']
-__all__ += ['YCBCR_WEIGHTS',
- 'RGB_to_YCbCr',
- 'YCbCr_to_RGB',
- 'RGB_to_YcCbcCrc',
- 'YcCbcCrc_to_RGB']
+__all__ += [
+ 'RGB_to_HSV', 'HSV_to_RGB', 'RGB_to_HSL', 'HSL_to_RGB', 'RGB_to_CMY',
+ 'CMY_to_RGB', 'CMY_to_CMYK', 'CMYK_to_CMY'
+]
+__all__ += ['RGB_to_Prismatic', 'Prismatic_to_RGB']
+__all__ += [
+ 'YCBCR_WEIGHTS', 'RGB_to_YCbCr', 'YCbCr_to_RGB', 'RGB_to_YcCbcCrc',
+ 'YcCbcCrc_to_RGB'
+]
__all__ += ['RGB_to_ICTCP', 'ICTCP_to_RGB']
diff --git a/colour/models/rgb/aces_it.py b/colour/models/rgb/aces_it.py
index afad237e73..5b390e9992 100644
--- a/colour/models/rgb/aces_it.py
+++ b/colour/models/rgb/aces_it.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Academy Color Encoding System - Input Transform
===============================================
@@ -49,17 +48,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['FLARE_PERCENTAGE',
- 'S_FLARE_FACTOR',
- 'spectral_to_aces_relative_exposure_values']
+__all__ = [
+ 'FLARE_PERCENTAGE', 'S_FLARE_FACTOR',
+ 'spectral_to_aces_relative_exposure_values'
+]
FLARE_PERCENTAGE = 0.00500
S_FLARE_FACTOR = 0.18000 / (0.18000 + FLARE_PERCENTAGE)
def spectral_to_aces_relative_exposure_values(
- spd,
- illuminant=ILLUMINANTS_RELATIVE_SPDS['D60']):
+ spd, illuminant=ILLUMINANTS_RELATIVE_SPDS['D60']):
"""
Converts given spectral power distribution to *ACES2065-1* colourspace
relative exposure values.
@@ -106,8 +105,7 @@ def spectral_to_aces_relative_exposure_values(
spd = spd.values
illuminant = illuminant.values
- r_bar, g_bar, b_bar = (ACES_RICD.r_bar.values,
- ACES_RICD.g_bar.values,
+ r_bar, g_bar, b_bar = (ACES_RICD.r_bar.values, ACES_RICD.g_bar.values,
ACES_RICD.b_bar.values)
def k(x, y):
diff --git a/colour/models/rgb/common.py b/colour/models/rgb/common.py
index f49286b930..2e647cb5f5 100644
--- a/colour/models/rgb/common.py
+++ b/colour/models/rgb/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Common RGB Colour Models Utilities
==================================
@@ -68,12 +67,13 @@ def XYZ_to_sRGB(XYZ,
"""
sRGB = RGB_COLOURSPACES['sRGB']
- return XYZ_to_RGB(XYZ,
- illuminant,
- sRGB.whitepoint,
- sRGB.XYZ_to_RGB_matrix,
- chromatic_adaptation_transform,
- sRGB.encoding_cctf if apply_encoding_cctf else None)
+ return XYZ_to_RGB(
+ XYZ,
+ illuminant,
+ sRGB.whitepoint,
+ sRGB.XYZ_to_RGB_matrix,
+ chromatic_adaptation_transform,
+ sRGB.encoding_cctf if apply_encoding_cctf else None) # yapf: disable
def sRGB_to_XYZ(RGB,
@@ -116,9 +116,10 @@ def sRGB_to_XYZ(RGB,
"""
sRGB = RGB_COLOURSPACES['sRGB']
- return RGB_to_XYZ(RGB,
- sRGB.whitepoint,
- illuminant,
- sRGB.RGB_to_XYZ_matrix,
- chromatic_adaptation_method,
- sRGB.decoding_cctf if apply_decoding_cctf else None)
+ return RGB_to_XYZ(
+ RGB,
+ sRGB.whitepoint,
+ illuminant,
+ sRGB.RGB_to_XYZ_matrix,
+ chromatic_adaptation_method,
+ sRGB.decoding_cctf if apply_decoding_cctf else None) # yapf: disable
diff --git a/colour/models/rgb/dataset/__init__.py b/colour/models/rgb/dataset/__init__.py
index c0504612c0..c4d857199d 100644
--- a/colour/models/rgb/dataset/__init__.py
+++ b/colour/models/rgb/dataset/__init__.py
@@ -4,12 +4,9 @@
from __future__ import absolute_import
from colour.utilities import CaseInsensitiveMapping
-from .aces import (
- ACES_2065_1_COLOURSPACE,
- ACES_CC_COLOURSPACE,
- ACES_CCT_COLOURSPACE,
- ACES_CG_COLOURSPACE,
- ACES_PROXY_COLOURSPACE)
+from .aces import (ACES_2065_1_COLOURSPACE, ACES_CC_COLOURSPACE,
+ ACES_CCT_COLOURSPACE, ACES_CG_COLOURSPACE,
+ ACES_PROXY_COLOURSPACE)
from .aces_it import ACES_RICD
from .adobe_rgb_1998 import ADOBE_RGB_1998_COLOURSPACE
from .adobe_wide_gamut_rgb import ADOBE_WIDE_GAMUT_RGB_COLOURSPACE
@@ -24,77 +21,72 @@
from .don_rgb_4 import DON_RGB_4_COLOURSPACE
from .eci_rgb_v2 import ECI_RGB_V2_COLOURSPACE
from .ekta_space_ps5 import EKTA_SPACE_PS_5_COLOURSPACE
+from .gopro import PROTUNE_NATIVE_COLOURSPACE
from .max_rgb import MAX_RGB_COLOURSPACE
from .ntsc_rgb import NTSC_RGB_COLOURSPACE
from .pal_secam_rgb import PAL_SECAM_RGB_COLOURSPACE
from .rec_2020 import REC_2020_COLOURSPACE
from .rec_709 import REC_709_COLOURSPACE
-from .red import (
- RED_COLOR_COLOURSPACE,
- RED_COLOR_2_COLOURSPACE,
- RED_COLOR_3_COLOURSPACE,
- RED_COLOR_4_COLOURSPACE,
- DRAGON_COLOR_COLOURSPACE,
- DRAGON_COLOR_2_COLOURSPACE,
- RED_WIDE_GAMUT_RGB_COLOURSPACE)
-from .rimm_romm_rgb import (
- ROMM_RGB_COLOURSPACE,
- RIMM_RGB_COLOURSPACE,
- ERIMM_RGB_COLOURSPACE,
- PROPHOTO_RGB_COLOURSPACE)
+from .red import (RED_COLOR_COLOURSPACE, RED_COLOR_2_COLOURSPACE,
+ RED_COLOR_3_COLOURSPACE, RED_COLOR_4_COLOURSPACE,
+ DRAGON_COLOR_COLOURSPACE, DRAGON_COLOR_2_COLOURSPACE,
+ RED_WIDE_GAMUT_RGB_COLOURSPACE)
+from .rimm_romm_rgb import (ROMM_RGB_COLOURSPACE, RIMM_RGB_COLOURSPACE,
+ ERIMM_RGB_COLOURSPACE, PROPHOTO_RGB_COLOURSPACE)
from .russell_rgb import RUSSELL_RGB_COLOURSPACE
from .smptec_rgb import SMPTE_C_RGB_COLOURSPACE
-from .sony import (S_GAMUT_COLOURSPACE,
- S_GAMUT3_COLOURSPACE,
+from .sony import (S_GAMUT_COLOURSPACE, S_GAMUT3_COLOURSPACE,
S_GAMUT3_CINE_COLOURSPACE)
from .srgb import sRGB_COLOURSPACE
from .v_gamut import V_GAMUT_COLOURSPACE
from .xtreme_rgb import XTREME_RGB_COLOURSPACE
-RGB_COLOURSPACES = CaseInsensitiveMapping(
- {ACES_2065_1_COLOURSPACE.name: ACES_2065_1_COLOURSPACE,
- ACES_CC_COLOURSPACE.name: ACES_CC_COLOURSPACE,
- ACES_CCT_COLOURSPACE.name: ACES_CCT_COLOURSPACE,
- ACES_PROXY_COLOURSPACE.name: ACES_PROXY_COLOURSPACE,
- ACES_CG_COLOURSPACE.name: ACES_CG_COLOURSPACE,
- ADOBE_RGB_1998_COLOURSPACE.name: ADOBE_RGB_1998_COLOURSPACE,
- ADOBE_WIDE_GAMUT_RGB_COLOURSPACE.name: ADOBE_WIDE_GAMUT_RGB_COLOURSPACE,
- ALEXA_WIDE_GAMUT_RGB_COLOURSPACE.name: ALEXA_WIDE_GAMUT_RGB_COLOURSPACE,
- APPLE_RGB_COLOURSPACE.name: APPLE_RGB_COLOURSPACE,
- BEST_RGB_COLOURSPACE.name: BEST_RGB_COLOURSPACE,
- BETA_RGB_COLOURSPACE.name: BETA_RGB_COLOURSPACE,
- CIE_RGB_COLOURSPACE.name: CIE_RGB_COLOURSPACE,
- CINEMA_GAMUT_COLOURSPACE.name: CINEMA_GAMUT_COLOURSPACE,
- COLOR_MATCH_RGB_COLOURSPACE.name: COLOR_MATCH_RGB_COLOURSPACE,
- DCI_P3_COLOURSPACE.name: DCI_P3_COLOURSPACE,
- DCI_P3_P_COLOURSPACE.name: DCI_P3_P_COLOURSPACE,
- DON_RGB_4_COLOURSPACE.name: DON_RGB_4_COLOURSPACE,
- ECI_RGB_V2_COLOURSPACE.name: ECI_RGB_V2_COLOURSPACE,
- EKTA_SPACE_PS_5_COLOURSPACE.name: EKTA_SPACE_PS_5_COLOURSPACE,
- MAX_RGB_COLOURSPACE.name: MAX_RGB_COLOURSPACE,
- NTSC_RGB_COLOURSPACE.name: NTSC_RGB_COLOURSPACE,
- PAL_SECAM_RGB_COLOURSPACE.name: PAL_SECAM_RGB_COLOURSPACE,
- REC_709_COLOURSPACE.name: REC_709_COLOURSPACE,
- REC_2020_COLOURSPACE.name: REC_2020_COLOURSPACE,
- RED_COLOR_COLOURSPACE.name: RED_COLOR_COLOURSPACE,
- RED_COLOR_2_COLOURSPACE.name: RED_COLOR_2_COLOURSPACE,
- RED_COLOR_3_COLOURSPACE.name: RED_COLOR_3_COLOURSPACE,
- RED_COLOR_4_COLOURSPACE.name: RED_COLOR_4_COLOURSPACE,
- RED_WIDE_GAMUT_RGB_COLOURSPACE.name: RED_WIDE_GAMUT_RGB_COLOURSPACE,
- DRAGON_COLOR_COLOURSPACE.name: DRAGON_COLOR_COLOURSPACE,
- DRAGON_COLOR_2_COLOURSPACE.name: DRAGON_COLOR_2_COLOURSPACE,
- ROMM_RGB_COLOURSPACE.name: ROMM_RGB_COLOURSPACE,
- RIMM_RGB_COLOURSPACE.name: RIMM_RGB_COLOURSPACE,
- ERIMM_RGB_COLOURSPACE.name: ERIMM_RGB_COLOURSPACE,
- PROPHOTO_RGB_COLOURSPACE.name: PROPHOTO_RGB_COLOURSPACE,
- RUSSELL_RGB_COLOURSPACE.name: RUSSELL_RGB_COLOURSPACE,
- SMPTE_C_RGB_COLOURSPACE.name: SMPTE_C_RGB_COLOURSPACE,
- S_GAMUT_COLOURSPACE.name: S_GAMUT_COLOURSPACE,
- S_GAMUT3_COLOURSPACE.name: S_GAMUT3_COLOURSPACE,
- S_GAMUT3_CINE_COLOURSPACE.name: S_GAMUT3_CINE_COLOURSPACE,
- sRGB_COLOURSPACE.name: sRGB_COLOURSPACE,
- V_GAMUT_COLOURSPACE.name: V_GAMUT_COLOURSPACE,
- XTREME_RGB_COLOURSPACE.name: XTREME_RGB_COLOURSPACE})
+RGB_COLOURSPACES = CaseInsensitiveMapping({
+ ACES_2065_1_COLOURSPACE.name: ACES_2065_1_COLOURSPACE,
+ ACES_CC_COLOURSPACE.name: ACES_CC_COLOURSPACE,
+ ACES_CCT_COLOURSPACE.name: ACES_CCT_COLOURSPACE,
+ ACES_PROXY_COLOURSPACE.name: ACES_PROXY_COLOURSPACE,
+ ACES_CG_COLOURSPACE.name: ACES_CG_COLOURSPACE,
+ ADOBE_RGB_1998_COLOURSPACE.name: ADOBE_RGB_1998_COLOURSPACE,
+ ADOBE_WIDE_GAMUT_RGB_COLOURSPACE.name: ADOBE_WIDE_GAMUT_RGB_COLOURSPACE,
+ ALEXA_WIDE_GAMUT_RGB_COLOURSPACE.name: ALEXA_WIDE_GAMUT_RGB_COLOURSPACE,
+ APPLE_RGB_COLOURSPACE.name: APPLE_RGB_COLOURSPACE,
+ BEST_RGB_COLOURSPACE.name: BEST_RGB_COLOURSPACE,
+ BETA_RGB_COLOURSPACE.name: BETA_RGB_COLOURSPACE,
+ CIE_RGB_COLOURSPACE.name: CIE_RGB_COLOURSPACE,
+ CINEMA_GAMUT_COLOURSPACE.name: CINEMA_GAMUT_COLOURSPACE,
+ COLOR_MATCH_RGB_COLOURSPACE.name: COLOR_MATCH_RGB_COLOURSPACE,
+ DCI_P3_COLOURSPACE.name: DCI_P3_COLOURSPACE,
+ DCI_P3_P_COLOURSPACE.name: DCI_P3_P_COLOURSPACE,
+ DON_RGB_4_COLOURSPACE.name: DON_RGB_4_COLOURSPACE,
+ ECI_RGB_V2_COLOURSPACE.name: ECI_RGB_V2_COLOURSPACE,
+ EKTA_SPACE_PS_5_COLOURSPACE.name: EKTA_SPACE_PS_5_COLOURSPACE,
+ PROTUNE_NATIVE_COLOURSPACE.name: PROTUNE_NATIVE_COLOURSPACE,
+ MAX_RGB_COLOURSPACE.name: MAX_RGB_COLOURSPACE,
+ NTSC_RGB_COLOURSPACE.name: NTSC_RGB_COLOURSPACE,
+ PAL_SECAM_RGB_COLOURSPACE.name: PAL_SECAM_RGB_COLOURSPACE,
+ REC_709_COLOURSPACE.name: REC_709_COLOURSPACE,
+ REC_2020_COLOURSPACE.name: REC_2020_COLOURSPACE,
+ RED_COLOR_COLOURSPACE.name: RED_COLOR_COLOURSPACE,
+ RED_COLOR_2_COLOURSPACE.name: RED_COLOR_2_COLOURSPACE,
+ RED_COLOR_3_COLOURSPACE.name: RED_COLOR_3_COLOURSPACE,
+ RED_COLOR_4_COLOURSPACE.name: RED_COLOR_4_COLOURSPACE,
+ RED_WIDE_GAMUT_RGB_COLOURSPACE.name: RED_WIDE_GAMUT_RGB_COLOURSPACE,
+ DRAGON_COLOR_COLOURSPACE.name: DRAGON_COLOR_COLOURSPACE,
+ DRAGON_COLOR_2_COLOURSPACE.name: DRAGON_COLOR_2_COLOURSPACE,
+ ROMM_RGB_COLOURSPACE.name: ROMM_RGB_COLOURSPACE,
+ RIMM_RGB_COLOURSPACE.name: RIMM_RGB_COLOURSPACE,
+ ERIMM_RGB_COLOURSPACE.name: ERIMM_RGB_COLOURSPACE,
+ PROPHOTO_RGB_COLOURSPACE.name: PROPHOTO_RGB_COLOURSPACE,
+ RUSSELL_RGB_COLOURSPACE.name: RUSSELL_RGB_COLOURSPACE,
+ SMPTE_C_RGB_COLOURSPACE.name: SMPTE_C_RGB_COLOURSPACE,
+ S_GAMUT_COLOURSPACE.name: S_GAMUT_COLOURSPACE,
+ S_GAMUT3_COLOURSPACE.name: S_GAMUT3_COLOURSPACE,
+ S_GAMUT3_CINE_COLOURSPACE.name: S_GAMUT3_CINE_COLOURSPACE,
+ sRGB_COLOURSPACE.name: sRGB_COLOURSPACE,
+ V_GAMUT_COLOURSPACE.name: V_GAMUT_COLOURSPACE,
+ XTREME_RGB_COLOURSPACE.name: XTREME_RGB_COLOURSPACE
+})
"""
Aggregated *RGB* colourspaces.
@@ -106,55 +98,35 @@
- 'adobe1998': ADOBE_RGB_1998_COLOURSPACE.name
- 'prophoto': PROPHOTO_RGB_COLOURSPACE.name
"""
+# yapf: disable
RGB_COLOURSPACES['aces'] = (
RGB_COLOURSPACES[ACES_2065_1_COLOURSPACE.name])
RGB_COLOURSPACES['adobe1998'] = (
RGB_COLOURSPACES[ADOBE_RGB_1998_COLOURSPACE.name])
RGB_COLOURSPACES['prophoto'] = (
RGB_COLOURSPACES[PROPHOTO_RGB_COLOURSPACE.name])
+# yapf: enable
__all__ = ['ACES_RICD']
__all__ += ['RGB_COLOURSPACES']
-__all__ += ['ACES_2065_1_COLOURSPACE',
- 'ACES_CC_COLOURSPACE',
- 'ACES_CCT_COLOURSPACE',
- 'ACES_PROXY_COLOURSPACE',
- 'ACES_CG_COLOURSPACE',
- 'ADOBE_RGB_1998_COLOURSPACE',
- 'ADOBE_WIDE_GAMUT_RGB_COLOURSPACE',
- 'ALEXA_WIDE_GAMUT_RGB_COLOURSPACE',
- 'APPLE_RGB_COLOURSPACE',
- 'BEST_RGB_COLOURSPACE',
- 'BETA_RGB_COLOURSPACE',
- 'CIE_RGB_COLOURSPACE',
- 'CINEMA_GAMUT_COLOURSPACE',
- 'COLOR_MATCH_RGB_COLOURSPACE',
- 'DCI_P3_COLOURSPACE',
- 'DCI_P3_P_COLOURSPACE',
- 'DON_RGB_4_COLOURSPACE',
- 'ECI_RGB_V2_COLOURSPACE',
- 'EKTA_SPACE_PS_5_COLOURSPACE',
- 'MAX_RGB_COLOURSPACE',
- 'NTSC_RGB_COLOURSPACE',
- 'PAL_SECAM_RGB_COLOURSPACE',
- 'REC_709_COLOURSPACE',
- 'REC_2020_COLOURSPACE',
- 'RED_COLOR_COLOURSPACE',
- 'RED_COLOR_2_COLOURSPACE',
- 'RED_COLOR_3_COLOURSPACE',
- 'RED_COLOR_4_COLOURSPACE',
- 'DRAGON_COLOR_COLOURSPACE',
- 'DRAGON_COLOR_2_COLOURSPACE',
- 'RED_WIDE_GAMUT_RGB_COLOURSPACE',
- 'ROMM_RGB_COLOURSPACE',
- 'RIMM_RGB_COLOURSPACE',
- 'ERIMM_RGB_COLOURSPACE',
- 'PROPHOTO_RGB_COLOURSPACE',
- 'RUSSELL_RGB_COLOURSPACE',
- 'SMPTE_C_RGB_COLOURSPACE',
- 'S_GAMUT_COLOURSPACE',
- 'S_GAMUT3_COLOURSPACE',
- 'S_GAMUT3_CINE_COLOURSPACE',
- 'sRGB_COLOURSPACE',
- 'V_GAMUT_COLOURSPACE',
- 'XTREME_RGB_COLOURSPACE']
+__all__ += [
+ 'ACES_2065_1_COLOURSPACE', 'ACES_CC_COLOURSPACE', 'ACES_CCT_COLOURSPACE',
+ 'ACES_PROXY_COLOURSPACE', 'ACES_CG_COLOURSPACE',
+ 'ADOBE_RGB_1998_COLOURSPACE', 'ADOBE_WIDE_GAMUT_RGB_COLOURSPACE',
+ 'ALEXA_WIDE_GAMUT_RGB_COLOURSPACE', 'APPLE_RGB_COLOURSPACE',
+ 'BEST_RGB_COLOURSPACE', 'BETA_RGB_COLOURSPACE', 'CIE_RGB_COLOURSPACE',
+ 'CINEMA_GAMUT_COLOURSPACE', 'COLOR_MATCH_RGB_COLOURSPACE',
+ 'DCI_P3_COLOURSPACE', 'DCI_P3_P_COLOURSPACE', 'DON_RGB_4_COLOURSPACE',
+ 'ECI_RGB_V2_COLOURSPACE', 'EKTA_SPACE_PS_5_COLOURSPACE',
+ 'PROTUNE_NATIVE_COLOURSPACE', 'MAX_RGB_COLOURSPACE',
+ 'NTSC_RGB_COLOURSPACE', 'PAL_SECAM_RGB_COLOURSPACE', 'REC_709_COLOURSPACE',
+ 'REC_2020_COLOURSPACE', 'RED_COLOR_COLOURSPACE', 'RED_COLOR_2_COLOURSPACE',
+ 'RED_COLOR_3_COLOURSPACE', 'RED_COLOR_4_COLOURSPACE',
+ 'DRAGON_COLOR_COLOURSPACE', 'DRAGON_COLOR_2_COLOURSPACE',
+ 'RED_WIDE_GAMUT_RGB_COLOURSPACE', 'ROMM_RGB_COLOURSPACE',
+ 'RIMM_RGB_COLOURSPACE', 'ERIMM_RGB_COLOURSPACE',
+ 'PROPHOTO_RGB_COLOURSPACE', 'RUSSELL_RGB_COLOURSPACE',
+ 'SMPTE_C_RGB_COLOURSPACE', 'S_GAMUT_COLOURSPACE', 'S_GAMUT3_COLOURSPACE',
+ 'S_GAMUT3_CINE_COLOURSPACE', 'sRGB_COLOURSPACE', 'V_GAMUT_COLOURSPACE',
+ 'XTREME_RGB_COLOURSPACE'
+]
diff --git a/colour/models/rgb/dataset/aces.py b/colour/models/rgb/dataset/aces.py
index beaeee23f1..57d09a0be6 100644
--- a/colour/models/rgb/dataset/aces.py
+++ b/colour/models/rgb/dataset/aces.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Academy Color Encoding System
=============================
@@ -66,15 +65,9 @@
from colour.colorimetry import ILLUMINANTS
from colour.models.rgb import (
- RGB_Colourspace,
- normalised_primary_matrix,
- linear_function,
- log_encoding_ACEScc,
- log_decoding_ACEScc,
- log_encoding_ACEScct,
- log_decoding_ACEScct,
- log_encoding_ACESproxy,
- log_decoding_ACESproxy)
+ RGB_Colourspace, function_linear, normalised_primary_matrix,
+ log_encoding_ACEScc, log_decoding_ACEScc, log_encoding_ACEScct,
+ log_decoding_ACEScct, log_encoding_ACESproxy, log_decoding_ACESproxy)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -83,24 +76,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['AP0',
- 'AP1',
- 'ACES_ILLUMINANT',
- 'ACES_WHITEPOINT',
- 'AP0_TO_XYZ_MATRIX',
- 'XYZ_TO_AP0_MATRIX',
- 'AP1_TO_XYZ_MATRIX',
- 'XYZ_TO_AP1_MATRIX',
- 'ACES_2065_1_COLOURSPACE',
- 'ACES_CG_COLOURSPACE',
- 'ACES_CC_COLOURSPACE',
- 'ACES_CCT_COLOURSPACE',
- 'ACES_PROXY_COLOURSPACE']
+__all__ = [
+ 'AP0', 'AP1', 'ACES_ILLUMINANT', 'ACES_WHITEPOINT', 'AP0_TO_XYZ_MATRIX',
+ 'XYZ_TO_AP0_MATRIX', 'AP1_TO_XYZ_MATRIX', 'XYZ_TO_AP1_MATRIX',
+ 'ACES_2065_1_COLOURSPACE', 'ACES_CG_COLOURSPACE', 'ACES_CC_COLOURSPACE',
+ 'ACES_CCT_COLOURSPACE', 'ACES_PROXY_COLOURSPACE'
+]
AP0 = np.array(
[[0.73470, 0.26530],
[0.00000, 1.00000],
- [0.00010, -0.07700]])
+ [0.00010, -0.07700]]) # yapf: disable
"""
*ACES Primaries 0* or *AP0* primaries.
@@ -110,7 +96,7 @@
AP1 = np.array(
[[0.71300, 0.29300],
[0.16500, 0.83000],
- [0.12800, 0.04400]])
+ [0.12800, 0.04400]]) # yapf: disable
"""
*ACES Primaries 1* or *AP1* primaries (known as *Rec. 2020+* primaries prior
to *ACES* 1.0 release).
@@ -136,7 +122,7 @@
AP0_TO_XYZ_MATRIX = np.array(
[[0.9525523959, 0.0000000000, 0.0000936786],
[0.3439664498, 0.7281660966, -0.0721325464],
- [0.0000000000, 0.0000000000, 1.0088251844]])
+ [0.0000000000, 0.0000000000, 1.0088251844]]) # yapf: disable
"""
*ACES Primaries 0* to *CIE XYZ* tristimulus values matrix defined as per [2].
AP0_TO_XYZ_MATRIX : array_like, (3, 3)
@@ -145,7 +131,7 @@
XYZ_TO_AP0_MATRIX = np.array(
[[1.0498110175, 0.0000000000, -0.0000974845],
[- 0.4959030231, 1.3733130458, 0.0982400361],
- [0.0000000000, 0.0000000000, 0.9912520182]])
+ [0.0000000000, 0.0000000000, 0.9912520182]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *ACES Primaries 0* matrix.
@@ -173,8 +159,8 @@
ACES_ILLUMINANT,
AP0_TO_XYZ_MATRIX,
XYZ_TO_AP0_MATRIX,
- linear_function,
- linear_function)
+ function_linear,
+ function_linear) # yapf: disable
"""
*ACES2065-1* colourspace, base encoding, used for exchange of full fidelity
images and archiving.
@@ -189,8 +175,8 @@
ACES_ILLUMINANT,
AP1_TO_XYZ_MATRIX,
XYZ_TO_AP1_MATRIX,
- linear_function,
- linear_function)
+ function_linear,
+ function_linear) # yapf: disable
"""
*ACEScg* colourspace, a working space for paint/compositor applications that
don’t support ACES2065-1 or ACEScc.
@@ -206,7 +192,7 @@
AP1_TO_XYZ_MATRIX,
XYZ_TO_AP1_MATRIX,
log_encoding_ACEScc,
- log_decoding_ACEScc)
+ log_decoding_ACEScc) # yapf: disable
"""
*ACEScc* colourspace, a working space for color correctors, target for ASC-CDL
values created on-set.
@@ -222,7 +208,7 @@
AP1_TO_XYZ_MATRIX,
XYZ_TO_AP1_MATRIX,
log_encoding_ACEScct,
- log_decoding_ACEScct)
+ log_decoding_ACEScct) # yapf: disable
"""
*ACEScct* colourspace, an alternative working space for colour correctors,
intended to be transient and internal to software or hardware systems,
@@ -239,7 +225,7 @@
AP1_TO_XYZ_MATRIX,
XYZ_TO_AP1_MATRIX,
log_encoding_ACESproxy,
- log_decoding_ACESproxy)
+ log_decoding_ACESproxy) # yapf: disable
"""
*ACESproxy* colourspace, a lightweight encoding for transmission over HD-SDI
(or other production transmission schemes), onset look management. Not
diff --git a/colour/models/rgb/dataset/aces_it.py b/colour/models/rgb/dataset/aces_it.py
index fdeb89e062..61aa76eba6 100644
--- a/colour/models/rgb/dataset/aces_it.py
+++ b/colour/models/rgb/dataset/aces_it.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Academy Color Encoding System - Input Transform Dataset
=======================================================
@@ -44,8 +43,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ACES_RICD_DATA',
- 'ACES_RICD']
+__all__ = ['ACES_RICD_DATA', 'ACES_RICD']
ACES_RICD_DATA = {
'r_bar': {
@@ -519,7 +517,8 @@
827.0: 0.0000000,
828.0: 0.0000000,
829.0: 0.0000000,
- 830.0: 0.0000000},
+ 830.0: 0.0000000
+ },
'g_bar': {
360.0: 0.0000000,
361.0: 0.0000000,
@@ -991,7 +990,8 @@
827.0: 0.0000000,
828.0: 0.0000000,
829.0: 0.0000000,
- 830.0: 0.0000000},
+ 830.0: 0.0000000
+ },
'b_bar': {
360.0: 5.70e-06,
361.0: 6.40e-06,
@@ -1463,7 +1463,9 @@
827.0: 0.0000000,
828.0: 0.0000000,
829.0: 0.0000000,
- 830.0: 0.0000000}}
+ 830.0: 0.0000000
+ }
+}
ACES_RICD = RGB_ColourMatchingFunctions('ACES RICD', ACES_RICD_DATA)
"""
diff --git a/colour/models/rgb/dataset/adobe_rgb_1998.py b/colour/models/rgb/dataset/adobe_rgb_1998.py
index c9e41ce5c3..c6f453b217 100644
--- a/colour/models/rgb/dataset/adobe_rgb_1998.py
+++ b/colour/models/rgb/dataset/adobe_rgb_1998.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Adobe RGB (1998) Colourspace
============================
@@ -27,7 +26,7 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import RGB_Colourspace, gamma_function
+from colour.models.rgb import RGB_Colourspace, function_gamma
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -36,17 +35,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ADOBE_RGB_1998_PRIMARIES',
- 'ADOBE_RGB_1998_ILLUMINANT',
- 'ADOBE_RGB_1998_WHITEPOINT',
- 'ADOBE_RGB_1998_TO_XYZ_MATRIX',
- 'XYZ_TO_ADOBE_RGB_1998_MATRIX',
- 'ADOBE_RGB_1998_COLOURSPACE']
+__all__ = [
+ 'ADOBE_RGB_1998_PRIMARIES', 'ADOBE_RGB_1998_ILLUMINANT',
+ 'ADOBE_RGB_1998_WHITEPOINT', 'ADOBE_RGB_1998_TO_XYZ_MATRIX',
+ 'XYZ_TO_ADOBE_RGB_1998_MATRIX', 'ADOBE_RGB_1998_COLOURSPACE'
+]
ADOBE_RGB_1998_PRIMARIES = np.array(
[[0.6400, 0.3300],
[0.2100, 0.7100],
- [0.1500, 0.0600]])
+ [0.1500, 0.0600]]) # yapf: disable
"""
*Adobe RGB (1998)* colourspace primaries.
@@ -61,8 +59,8 @@
"""
ADOBE_RGB_1998_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- ADOBE_RGB_1998_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [ADOBE_RGB_1998_ILLUMINANT]) # yapf: disable
"""
*Adobe RGB (1998)* colourspace whitepoint.
@@ -72,7 +70,7 @@
ADOBE_RGB_1998_TO_XYZ_MATRIX = np.array(
[[0.57667, 0.18556, 0.18823],
[0.29734, 0.62736, 0.07529],
- [0.02703, 0.07069, 0.99134]])
+ [0.02703, 0.07069, 0.99134]]) # yapf: disable
"""
*Adobe RGB (1998)* colourspace to *CIE XYZ* tristimulus values matrix defined
as per [1].
@@ -83,7 +81,7 @@
XYZ_TO_ADOBE_RGB_1998_MATRIX = np.array(
[[2.04159, -0.56501, -0.34473],
[-0.96924, 1.87597, 0.04156],
- [0.01344, -0.11836, 1.01517]])
+ [0.01344, -0.11836, 1.01517]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *Adobe RGB (1998)* colourspace matrix.
@@ -97,8 +95,8 @@
ADOBE_RGB_1998_ILLUMINANT,
ADOBE_RGB_1998_TO_XYZ_MATRIX,
XYZ_TO_ADOBE_RGB_1998_MATRIX,
- partial(gamma_function, exponent=1 / (563 / 256)),
- partial(gamma_function, exponent=563 / 256))
+ partial(function_gamma, exponent=1 / (563 / 256)),
+ partial(function_gamma, exponent=563 / 256)) # yapf: disable
"""
*Adobe RGB (1998)* colourspace.
diff --git a/colour/models/rgb/dataset/adobe_wide_gamut_rgb.py b/colour/models/rgb/dataset/adobe_wide_gamut_rgb.py
index 60ad3b7b81..1761707740 100644
--- a/colour/models/rgb/dataset/adobe_wide_gamut_rgb.py
+++ b/colour/models/rgb/dataset/adobe_wide_gamut_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Adobe Wide Gamut RGB Colourspace
================================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ADOBE_WIDE_GAMUT_RGB_PRIMARIES',
- 'ADOBE_WIDE_GAMUT_RGB_ILLUMINANT',
- 'ADOBE_WIDE_GAMUT_RGB_WHITEPOINT',
- 'ADOBE_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_ADOBE_WIDE_GAMUT_RGB_MATRIX',
- 'ADOBE_WIDE_GAMUT_RGB_COLOURSPACE']
+__all__ = [
+ 'ADOBE_WIDE_GAMUT_RGB_PRIMARIES', 'ADOBE_WIDE_GAMUT_RGB_ILLUMINANT',
+ 'ADOBE_WIDE_GAMUT_RGB_WHITEPOINT', 'ADOBE_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_ADOBE_WIDE_GAMUT_RGB_MATRIX', 'ADOBE_WIDE_GAMUT_RGB_COLOURSPACE'
+]
ADOBE_WIDE_GAMUT_RGB_PRIMARIES = np.array(
[[0.7347, 0.2653],
[0.1152, 0.8264],
- [0.1566, 0.0177]])
+ [0.1566, 0.0177]]) # yapf: disable
"""
*Adobe Wide Gamut RGB* colourspace primaries.
@@ -64,8 +60,8 @@
"""
ADOBE_WIDE_GAMUT_RGB_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- ADOBE_WIDE_GAMUT_RGB_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [ADOBE_WIDE_GAMUT_RGB_ILLUMINANT]) # yapf: disable
"""
*Adobe Wide Gamut RGB* colourspace whitepoint.
@@ -95,8 +91,8 @@
ADOBE_WIDE_GAMUT_RGB_ILLUMINANT,
ADOBE_WIDE_GAMUT_RGB_TO_XYZ_MATRIX,
XYZ_TO_ADOBE_WIDE_GAMUT_RGB_MATRIX,
- partial(gamma_function, exponent=1 / (563 / 256)),
- partial(gamma_function, exponent=563 / 256))
+ partial(function_gamma, exponent=1 / (563 / 256)),
+ partial(function_gamma, exponent=563 / 256)) # yapf: disable
"""
*Adobe Wide Gamut RGB* colourspace.
diff --git a/colour/models/rgb/dataset/alexa_wide_gamut_rgb.py b/colour/models/rgb/dataset/alexa_wide_gamut_rgb.py
index cedbdb696f..34e3a8ff65 100644
--- a/colour/models/rgb/dataset/alexa_wide_gamut_rgb.py
+++ b/colour/models/rgb/dataset/alexa_wide_gamut_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ALEXA Wide Gamut RGB Colourspace
================================
@@ -26,10 +25,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- log_encoding_ALEXALogC,
- log_decoding_ALEXALogC)
+from colour.models.rgb import (RGB_Colourspace, log_encoding_ALEXALogC,
+ log_decoding_ALEXALogC)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -38,17 +35,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ALEXA_WIDE_GAMUT_RGB_PRIMARIES',
- 'ALEXA_WIDE_GAMUT_RGB_ILLUMINANT',
- 'ALEXA_WIDE_GAMUT_RGB_WHITEPOINT',
- 'ALEXA_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_ALEXA_WIDE_GAMUT_RGB_MATRIX',
- 'ALEXA_WIDE_GAMUT_RGB_COLOURSPACE']
+__all__ = [
+ 'ALEXA_WIDE_GAMUT_RGB_PRIMARIES', 'ALEXA_WIDE_GAMUT_RGB_ILLUMINANT',
+ 'ALEXA_WIDE_GAMUT_RGB_WHITEPOINT', 'ALEXA_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_ALEXA_WIDE_GAMUT_RGB_MATRIX', 'ALEXA_WIDE_GAMUT_RGB_COLOURSPACE'
+]
ALEXA_WIDE_GAMUT_RGB_PRIMARIES = np.array(
[[0.6840, 0.3130],
[0.2210, 0.8480],
- [0.0861, -0.1020]])
+ [0.0861, -0.1020]]) # yapf: disable
"""
*ALEXA Wide Gamut RGB* colourspace primaries.
@@ -63,8 +59,8 @@
"""
ALEXA_WIDE_GAMUT_RGB_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- ALEXA_WIDE_GAMUT_RGB_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [ALEXA_WIDE_GAMUT_RGB_ILLUMINANT]) # yapf: disable
"""
*ALEXA Wide Gamut RGB* colourspace whitepoint.
@@ -74,7 +70,7 @@
ALEXA_WIDE_GAMUT_RGB_TO_XYZ_MATRIX = np.array(
[[0.638008, 0.214704, 0.097744],
[0.291954, 0.823841, -0.115795],
- [0.002798, -0.067034, 1.153294]])
+ [0.002798, -0.067034, 1.153294]]) # yapf: disable
"""
*ALEXA Wide Gamut RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -84,7 +80,7 @@
XYZ_TO_ALEXA_WIDE_GAMUT_RGB_MATRIX = np.array(
[[1.789066, -0.482534, -0.200076],
[-0.639849, 1.396400, 0.194432],
- [-0.041532, 0.082335, 0.878868]])
+ [-0.041532, 0.082335, 0.878868]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *ALEXA Wide Gamut RGB* colourspace matrix.
@@ -99,7 +95,7 @@
ALEXA_WIDE_GAMUT_RGB_TO_XYZ_MATRIX,
XYZ_TO_ALEXA_WIDE_GAMUT_RGB_MATRIX,
log_encoding_ALEXALogC,
- log_decoding_ALEXALogC)
+ log_decoding_ALEXALogC) # yapf: disable
"""
*ALEXA Wide Gamut RGB* colourspace.
diff --git a/colour/models/rgb/dataset/apple_rgb.py b/colour/models/rgb/dataset/apple_rgb.py
index d1e8cc7f41..e606feef67 100644
--- a/colour/models/rgb/dataset/apple_rgb.py
+++ b/colour/models/rgb/dataset/apple_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Apple RGB Colourspace
=====================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['APPLE_RGB_PRIMARIES',
- 'APPLE_RGB_ILLUMINANT',
- 'APPLE_RGB_WHITEPOINT',
- 'APPLE_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_APPLE_RGB_MATRIX',
- 'APPLE_RGB_COLOURSPACE']
+__all__ = [
+ 'APPLE_RGB_PRIMARIES', 'APPLE_RGB_ILLUMINANT', 'APPLE_RGB_WHITEPOINT',
+ 'APPLE_RGB_TO_XYZ_MATRIX', 'XYZ_TO_APPLE_RGB_MATRIX',
+ 'APPLE_RGB_COLOURSPACE'
+]
APPLE_RGB_PRIMARIES = np.array(
[[0.6250, 0.3400],
[0.2800, 0.5950],
- [0.1550, 0.0700]])
+ [0.1550, 0.0700]]) # yapf: disable
"""
*Apple RGB* colourspace primaries.
@@ -71,8 +67,8 @@
APPLE_RGB_WHITEPOINT : ndarray
"""
-APPLE_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- APPLE_RGB_PRIMARIES, APPLE_RGB_WHITEPOINT)
+APPLE_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(APPLE_RGB_PRIMARIES,
+ APPLE_RGB_WHITEPOINT)
"""
*Apple RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +89,8 @@
APPLE_RGB_ILLUMINANT,
APPLE_RGB_TO_XYZ_MATRIX,
XYZ_TO_APPLE_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 1.8),
- partial(gamma_function, exponent=1.8))
+ partial(function_gamma, exponent=1 / 1.8),
+ partial(function_gamma, exponent=1.8)) # yapf: disable
"""
*Apple RGB* colourspace.
diff --git a/colour/models/rgb/dataset/best_rgb.py b/colour/models/rgb/dataset/best_rgb.py
index db2b60345f..2cfca89c80 100644
--- a/colour/models/rgb/dataset/best_rgb.py
+++ b/colour/models/rgb/dataset/best_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Best RGB Colourspace
====================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['BEST_RGB_PRIMARIES',
- 'BEST_RGB_ILLUMINANT',
- 'BEST_RGB_WHITEPOINT',
- 'BEST_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_BEST_RGB_MATRIX',
- 'BEST_RGB_COLOURSPACE']
+__all__ = [
+ 'BEST_RGB_PRIMARIES', 'BEST_RGB_ILLUMINANT', 'BEST_RGB_WHITEPOINT',
+ 'BEST_RGB_TO_XYZ_MATRIX', 'XYZ_TO_BEST_RGB_MATRIX', 'BEST_RGB_COLOURSPACE'
+]
BEST_RGB_PRIMARIES = np.array(
[[0.735191637630662, 0.264808362369338],
[0.215336134453781, 0.774159663865546],
- [0.130122950819672, 0.034836065573770]])
+ [0.130122950819672, 0.034836065573770]]) # yapf: disable
"""
*Best RGB* colourspace primaries.
@@ -71,8 +66,8 @@
BEST_RGB_WHITEPOINT : ndarray
"""
-BEST_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- BEST_RGB_PRIMARIES, BEST_RGB_WHITEPOINT)
+BEST_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(BEST_RGB_PRIMARIES,
+ BEST_RGB_WHITEPOINT)
"""
*Best RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +88,8 @@
BEST_RGB_ILLUMINANT,
BEST_RGB_TO_XYZ_MATRIX,
XYZ_TO_BEST_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Best RGB* colourspace.
diff --git a/colour/models/rgb/dataset/beta_rgb.py b/colour/models/rgb/dataset/beta_rgb.py
index 7753791cc9..38f9ab60df 100644
--- a/colour/models/rgb/dataset/beta_rgb.py
+++ b/colour/models/rgb/dataset/beta_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Beta RGB Colourspace
====================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['BETA_RGB_PRIMARIES',
- 'BETA_RGB_ILLUMINANT',
- 'BETA_RGB_WHITEPOINT',
- 'BETA_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_BETA_RGB_MATRIX',
- 'BETA_RGB_COLOURSPACE']
+__all__ = [
+ 'BETA_RGB_PRIMARIES', 'BETA_RGB_ILLUMINANT', 'BETA_RGB_WHITEPOINT',
+ 'BETA_RGB_TO_XYZ_MATRIX', 'XYZ_TO_BETA_RGB_MATRIX', 'BETA_RGB_COLOURSPACE'
+]
BETA_RGB_PRIMARIES = np.array(
[[0.6888, 0.3112],
[0.1986, 0.7551],
- [0.1265, 0.0352]])
+ [0.1265, 0.0352]]) # yapf: disable
"""
*Beta RGB* colourspace primaries.
@@ -71,8 +66,8 @@
BETA_RGB_WHITEPOINT : ndarray
"""
-BETA_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- BETA_RGB_PRIMARIES, BETA_RGB_WHITEPOINT)
+BETA_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(BETA_RGB_PRIMARIES,
+ BETA_RGB_WHITEPOINT)
"""
*Beta RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +88,8 @@
BETA_RGB_ILLUMINANT,
BETA_RGB_TO_XYZ_MATRIX,
XYZ_TO_BETA_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Beta RGB* colourspace.
diff --git a/colour/models/rgb/dataset/cie_rgb.py b/colour/models/rgb/dataset/cie_rgb.py
index 85804d3065..190cf6b87f 100644
--- a/colour/models/rgb/dataset/cie_rgb.py
+++ b/colour/models/rgb/dataset/cie_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE RGB Colourspace
===================
@@ -30,7 +29,7 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import RGB_Colourspace, gamma_function
+from colour.models.rgb import RGB_Colourspace, function_gamma
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +38,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CIE_RGB_PRIMARIES',
- 'CIE_RGB_ILLUMINANT',
- 'CIE_RGB_WHITEPOINT',
- 'CIE_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_CIE_RGB_MATRIX',
- 'CIE_RGB_COLOURSPACE']
+__all__ = [
+ 'CIE_RGB_PRIMARIES', 'CIE_RGB_ILLUMINANT', 'CIE_RGB_WHITEPOINT',
+ 'CIE_RGB_TO_XYZ_MATRIX', 'XYZ_TO_CIE_RGB_MATRIX', 'CIE_RGB_COLOURSPACE'
+]
CIE_RGB_PRIMARIES = np.array(
[[0.734742840005998, 0.265257159994002],
[0.273779033824958, 0.717477700256116],
- [0.166555629580280, 0.008910726182545]])
+ [0.166555629580280, 0.008910726182545]]) # yapf: disable
"""
*CIE RGB* colourspace primaries.
@@ -80,7 +77,7 @@
CIE_RGB_TO_XYZ_MATRIX = np.array(
[[0.4900, 0.3100, 0.2000],
[0.1769, 0.8124, 0.0107],
- [0.0000, 0.0099, 0.9901]])
+ [0.0000, 0.0099, 0.9901]]) # yapf: disable
"""
*CIE RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -101,8 +98,8 @@
CIE_RGB_ILLUMINANT,
CIE_RGB_TO_XYZ_MATRIX,
XYZ_TO_CIE_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*CIE RGB* colourspace.
diff --git a/colour/models/rgb/dataset/cinema_gamut.py b/colour/models/rgb/dataset/cinema_gamut.py
index e9276a4441..2a63e5bce0 100644
--- a/colour/models/rgb/dataset/cinema_gamut.py
+++ b/colour/models/rgb/dataset/cinema_gamut.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Cinema Gamut Colourspace
========================
@@ -27,10 +26,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- normalised_primary_matrix,
- linear_function)
+from colour.models.rgb import (RGB_Colourspace, function_linear,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CINEMA_GAMUT_PRIMARIES',
- 'CINEMA_GAMUT_ILLUMINANT',
- 'CINEMA_GAMUT_WHITEPOINT',
- 'CINEMA_GAMUT_TO_XYZ_MATRIX',
- 'XYZ_TO_CINEMA_GAMUT_MATRIX',
- 'CINEMA_GAMUT_COLOURSPACE']
+__all__ = [
+ 'CINEMA_GAMUT_PRIMARIES', 'CINEMA_GAMUT_ILLUMINANT',
+ 'CINEMA_GAMUT_WHITEPOINT', 'CINEMA_GAMUT_TO_XYZ_MATRIX',
+ 'XYZ_TO_CINEMA_GAMUT_MATRIX', 'CINEMA_GAMUT_COLOURSPACE'
+]
CINEMA_GAMUT_PRIMARIES = np.array(
[[0.7400, 0.2700],
[0.1700, 1.1400],
- [0.0800, -0.1000]])
+ [0.0800, -0.1000]]) # yapf: disable
"""
*Cinema Gamut* colourspace primaries.
@@ -64,16 +60,16 @@
"""
CINEMA_GAMUT_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- CINEMA_GAMUT_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [CINEMA_GAMUT_ILLUMINANT]) # yapf: disable
"""
*Cinema Gamut* colourspace whitepoint.
CINEMA_GAMUT_WHITEPOINT : ndarray
"""
-CINEMA_GAMUT_TO_XYZ_MATRIX = normalised_primary_matrix(
- CINEMA_GAMUT_PRIMARIES, CINEMA_GAMUT_WHITEPOINT)
+CINEMA_GAMUT_TO_XYZ_MATRIX = normalised_primary_matrix(CINEMA_GAMUT_PRIMARIES,
+ CINEMA_GAMUT_WHITEPOINT)
"""
*Cinema Gamut* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -94,8 +90,8 @@
CINEMA_GAMUT_ILLUMINANT,
CINEMA_GAMUT_TO_XYZ_MATRIX,
XYZ_TO_CINEMA_GAMUT_MATRIX,
- linear_function,
- linear_function)
+ function_linear,
+ function_linear) # yapf: disable
"""
*Cinema Gamut* colourspace.
diff --git a/colour/models/rgb/dataset/color_match_rgb.py b/colour/models/rgb/dataset/color_match_rgb.py
index 36d3429a33..bff11d1071 100644
--- a/colour/models/rgb/dataset/color_match_rgb.py
+++ b/colour/models/rgb/dataset/color_match_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ColorMatch RGB Colourspace
==========================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['COLOR_MATCH_RGB_PRIMARIES',
- 'COLOR_MATCH_RGB_ILLUMINANT',
- 'COLOR_MATCH_RGB_WHITEPOINT',
- 'COLOR_MATCH_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_COLOR_MATCH_RGB_MATRIX',
- 'COLOR_MATCH_RGB_COLOURSPACE']
+__all__ = [
+ 'COLOR_MATCH_RGB_PRIMARIES', 'COLOR_MATCH_RGB_ILLUMINANT',
+ 'COLOR_MATCH_RGB_WHITEPOINT', 'COLOR_MATCH_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_COLOR_MATCH_RGB_MATRIX', 'COLOR_MATCH_RGB_COLOURSPACE'
+]
COLOR_MATCH_RGB_PRIMARIES = np.array(
[[0.6300, 0.3400],
[0.2950, 0.6050],
- [0.1500, 0.0750]])
+ [0.1500, 0.0750]]) # yapf: disable
"""
*ColorMatch RGB* colourspace primaries.
@@ -64,8 +60,8 @@
"""
COLOR_MATCH_RGB_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- COLOR_MATCH_RGB_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [COLOR_MATCH_RGB_ILLUMINANT]) # yapf: disable
"""
*ColorMatch RGB* colourspace whitepoint.
@@ -94,8 +90,8 @@
COLOR_MATCH_RGB_ILLUMINANT,
COLOR_MATCH_RGB_TO_XYZ_MATRIX,
XYZ_TO_COLOR_MATCH_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 1.8),
- partial(gamma_function, exponent=1.8))
+ partial(function_gamma, exponent=1 / 1.8),
+ partial(function_gamma, exponent=1.8)) # yapf: disable
"""
*ColorMatch RGB* colourspace.
diff --git a/colour/models/rgb/dataset/dci_p3.py b/colour/models/rgb/dataset/dci_p3.py
index ea9aed0e87..81e9d919ad 100644
--- a/colour/models/rgb/dataset/dci_p3.py
+++ b/colour/models/rgb/dataset/dci_p3.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
DCI-P3 & DCI-P3+ Colourspaces
=============================
@@ -36,11 +35,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- normalised_primary_matrix,
- oetf_DCIP3,
- eotf_DCIP3)
+from colour.models.rgb import (RGB_Colourspace, normalised_primary_matrix,
+ oetf_DCIP3, eotf_DCIP3)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -49,21 +45,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['DCI_P3_PRIMARIES',
- 'DCI_P3_P_PRIMARIES',
- 'DCI_P3_ILLUMINANT',
- 'DCI_P3_WHITEPOINT',
- 'DCI_P3_TO_XYZ_MATRIX',
- 'XYZ_TO_DCI_P3_MATRIX',
- 'DCI_P3_P_TO_XYZ_MATRIX',
- 'XYZ_TO_DCI_P3_P_MATRIX',
- 'DCI_P3_COLOURSPACE',
- 'DCI_P3_P_COLOURSPACE']
+__all__ = [
+ 'DCI_P3_PRIMARIES', 'DCI_P3_P_PRIMARIES', 'DCI_P3_ILLUMINANT',
+ 'DCI_P3_WHITEPOINT', 'DCI_P3_TO_XYZ_MATRIX', 'XYZ_TO_DCI_P3_MATRIX',
+ 'DCI_P3_P_TO_XYZ_MATRIX', 'XYZ_TO_DCI_P3_P_MATRIX', 'DCI_P3_COLOURSPACE',
+ 'DCI_P3_P_COLOURSPACE'
+]
DCI_P3_PRIMARIES = np.array(
[[0.6800, 0.3200],
[0.2650, 0.6900],
- [0.1500, 0.0600]])
+ [0.1500, 0.0600]]) # yapf: disable
"""
*DCI-P3* colourspace primaries.
@@ -73,7 +65,7 @@
DCI_P3_P_PRIMARIES = np.array(
[[0.7400, 0.2700],
[0.2200, 0.7800],
- [0.0900, -0.0900]])
+ [0.0900, -0.0900]]) # yapf: disable
"""
*DCI-P3+* colourspace primaries.
@@ -101,8 +93,8 @@
DCI_P3_WHITEPOINT : ndarray
"""
-DCI_P3_TO_XYZ_MATRIX = normalised_primary_matrix(
- DCI_P3_PRIMARIES, DCI_P3_WHITEPOINT)
+DCI_P3_TO_XYZ_MATRIX = normalised_primary_matrix(DCI_P3_PRIMARIES,
+ DCI_P3_WHITEPOINT)
"""
*DCI-P3* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -116,8 +108,8 @@
XYZ_TO_DCI_P3_MATRIX : array_like, (3, 3)
"""
-DCI_P3_P_TO_XYZ_MATRIX = normalised_primary_matrix(
- DCI_P3_P_PRIMARIES, DCI_P3_WHITEPOINT)
+DCI_P3_P_TO_XYZ_MATRIX = normalised_primary_matrix(DCI_P3_P_PRIMARIES,
+ DCI_P3_WHITEPOINT)
"""
*DCI-P3+* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -139,7 +131,7 @@
DCI_P3_TO_XYZ_MATRIX,
XYZ_TO_DCI_P3_MATRIX,
oetf_DCIP3,
- eotf_DCIP3)
+ eotf_DCIP3) # yapf: disable
"""
*DCI-P3* colourspace.
@@ -154,7 +146,7 @@
DCI_P3_P_TO_XYZ_MATRIX,
XYZ_TO_DCI_P3_P_MATRIX,
oetf_DCIP3,
- eotf_DCIP3)
+ eotf_DCIP3) # yapf: disable
"""
*DCI-P3+* colourspace.
diff --git a/colour/models/rgb/dataset/don_rgb_4.py b/colour/models/rgb/dataset/don_rgb_4.py
index 8c42067e39..98cf5146f9 100644
--- a/colour/models/rgb/dataset/don_rgb_4.py
+++ b/colour/models/rgb/dataset/don_rgb_4.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Don RGB 4 Colourspace
=====================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['DON_RGB_4_PRIMARIES',
- 'DON_RGB_4_ILLUMINANT',
- 'DON_RGB_4_WHITEPOINT',
- 'DON_RGB_4_TO_XYZ_MATRIX',
- 'XYZ_TO_DON_RGB_4_MATRIX',
- 'DON_RGB_4_COLOURSPACE']
+__all__ = [
+ 'DON_RGB_4_PRIMARIES', 'DON_RGB_4_ILLUMINANT', 'DON_RGB_4_WHITEPOINT',
+ 'DON_RGB_4_TO_XYZ_MATRIX', 'XYZ_TO_DON_RGB_4_MATRIX',
+ 'DON_RGB_4_COLOURSPACE'
+]
DON_RGB_4_PRIMARIES = np.array(
[[0.696120689655172, 0.299568965517241],
[0.214682981090100, 0.765294771968854],
- [0.129937629937630, 0.035343035343035]])
+ [0.129937629937630, 0.035343035343035]]) # yapf: disable
"""
*Don RGB 4* colourspace primaries.
@@ -71,8 +67,8 @@
DON_RGB_4_WHITEPOINT : ndarray
"""
-DON_RGB_4_TO_XYZ_MATRIX = normalised_primary_matrix(
- DON_RGB_4_PRIMARIES, DON_RGB_4_WHITEPOINT)
+DON_RGB_4_TO_XYZ_MATRIX = normalised_primary_matrix(DON_RGB_4_PRIMARIES,
+ DON_RGB_4_WHITEPOINT)
"""
*Don RGB 4* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +89,8 @@
DON_RGB_4_ILLUMINANT,
DON_RGB_4_TO_XYZ_MATRIX,
XYZ_TO_DON_RGB_4_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Don RGB 4* colourspace.
diff --git a/colour/models/rgb/dataset/eci_rgb_v2.py b/colour/models/rgb/dataset/eci_rgb_v2.py
index 78febf3c83..cf7bf6fab7 100644
--- a/colour/models/rgb/dataset/eci_rgb_v2.py
+++ b/colour/models/rgb/dataset/eci_rgb_v2.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ECI RGB v2 Colourspace
======================
@@ -26,10 +25,8 @@
import numpy as np
from functools import partial
-from colour.colorimetry import (
- ILLUMINANTS,
- lightness_CIE1976,
- luminance_CIE1976)
+from colour.colorimetry import (ILLUMINANTS, lightness_CIE1976,
+ luminance_CIE1976)
from colour.models.rgb import RGB_Colourspace, normalised_primary_matrix
__author__ = 'Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ECI_RGB_V2_PRIMARIES',
- 'ECI_RGB_V_ILLUMINANT',
- 'ECI_RGB_V2_WHITEPOINT',
- 'ECI_RGB_V2_TO_XYZ_MATRIX',
- 'XYZ_TO_ECI_RGB_V2_MATRIX',
- 'ECI_RGB_V2_COLOURSPACE']
+__all__ = [
+ 'ECI_RGB_V2_PRIMARIES', 'ECI_RGB_V_ILLUMINANT', 'ECI_RGB_V2_WHITEPOINT',
+ 'ECI_RGB_V2_TO_XYZ_MATRIX', 'XYZ_TO_ECI_RGB_V2_MATRIX',
+ 'ECI_RGB_V2_COLOURSPACE'
+]
ECI_RGB_V2_PRIMARIES = np.array(
[[0.670103092783505, 0.329896907216495],
[0.209905660377358, 0.709905660377358],
- [0.140061791967044, 0.080329557157570]])
+ [0.140061791967044, 0.080329557157570]]) # yapf: disable
"""
*ECI RGB v2* colourspace primaries.
@@ -71,8 +67,8 @@
ECI_RGB_V2_WHITEPOINT : ndarray
"""
-ECI_RGB_V2_TO_XYZ_MATRIX = normalised_primary_matrix(
- ECI_RGB_V2_PRIMARIES, ECI_RGB_V2_WHITEPOINT)
+ECI_RGB_V2_TO_XYZ_MATRIX = normalised_primary_matrix(ECI_RGB_V2_PRIMARIES,
+ ECI_RGB_V2_WHITEPOINT)
"""
*ECI RGB v2* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -121,8 +117,12 @@ def _scale_domain_0_100_range_0_1(a, callable_):
ECI_RGB_V_ILLUMINANT,
ECI_RGB_V2_TO_XYZ_MATRIX,
XYZ_TO_ECI_RGB_V2_MATRIX,
- partial(_scale_domain_0_100_range_0_1, callable_=lightness_CIE1976),
- partial(_scale_domain_0_100_range_0_1, callable_=luminance_CIE1976))
+ partial(
+ _scale_domain_0_100_range_0_1,
+ callable_=lightness_CIE1976),
+ partial(
+ _scale_domain_0_100_range_0_1,
+ callable_=luminance_CIE1976)) # yapf: disable
"""
*ECI RGB v2* colourspace.
diff --git a/colour/models/rgb/dataset/ekta_space_ps5.py b/colour/models/rgb/dataset/ekta_space_ps5.py
index 195e2924e0..4b12efd99e 100644
--- a/colour/models/rgb/dataset/ekta_space_ps5.py
+++ b/colour/models/rgb/dataset/ekta_space_ps5.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Ekta Space PS 5 Colourspace
===========================
@@ -26,10 +25,8 @@
import numpy as np
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -38,17 +35,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['EKTA_SPACE_PS_5_PRIMARIES',
- 'EKTA_SPACE_PS_5_V_ILLUMINANT',
- 'EKTA_SPACE_PS_5_WHITEPOINT',
- 'EKTA_SPACE_PS_5_TO_XYZ_MATRIX',
- 'XYZ_TO_EKTA_SPACE_PS_5_MATRIX',
- 'EKTA_SPACE_PS_5_COLOURSPACE']
+__all__ = [
+ 'EKTA_SPACE_PS_5_PRIMARIES', 'EKTA_SPACE_PS_5_V_ILLUMINANT',
+ 'EKTA_SPACE_PS_5_WHITEPOINT', 'EKTA_SPACE_PS_5_TO_XYZ_MATRIX',
+ 'XYZ_TO_EKTA_SPACE_PS_5_MATRIX', 'EKTA_SPACE_PS_5_COLOURSPACE'
+]
EKTA_SPACE_PS_5_PRIMARIES = np.array(
[[0.694736842105263, 0.305263157894737],
[0.260000000000000, 0.700000000000000],
- [0.109728506787330, 0.004524886877828]])
+ [0.109728506787330, 0.004524886877828]]) # yapf: disable
"""
*Ekta Space PS 5* colourspace primaries.
@@ -63,8 +59,8 @@
"""
EKTA_SPACE_PS_5_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- EKTA_SPACE_PS_5_V_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [EKTA_SPACE_PS_5_V_ILLUMINANT]) # yapf: disable
"""
*Ekta Space PS 5* colourspace whitepoint.
@@ -94,8 +90,8 @@
EKTA_SPACE_PS_5_V_ILLUMINANT,
EKTA_SPACE_PS_5_TO_XYZ_MATRIX,
XYZ_TO_EKTA_SPACE_PS_5_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Ekta Space PS 5* colourspace.
diff --git a/colour/models/rgb/dataset/gopro.py b/colour/models/rgb/dataset/gopro.py
new file mode 100644
index 0000000000..dcab24cd86
--- /dev/null
+++ b/colour/models/rgb/dataset/gopro.py
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+GoPro Colourspaces
+==================
+
+Defines the *GoPro* colourspaces:
+
+- :attr:`PROTUNE_NATIVE_COLOURSPACE`.
+
+See Also
+--------
+`RGB Colourspaces Jupyter Notebook
+`_
+
+Notes
+-----
+- The *Protune Native* colourspace primaries were derived using the method
+ outlined in [2]_ followed with a chromatic adaptation step to
+ *CIE Standard Illuminant D Series D65* using
+ :func:`colour.chromatically_adapted_primaries` definition.
+
+References
+----------
+.. [1] GoPro, Duiker, H.-P., & Mansencal, T. (2016). gopro.py. Retrieved
+ April 12, 2017, from https://github.com/hpd/OpenColorIO-Configs/blob/\
+master/aces_1.0.3/python/aces_ocio/colorspaces/gopro.py
+.. [2] Mansencal, T. (2015). RED Colourspaces Derivation. Retrieved May 20,
+ 2015, from http://colour-science.org/posts/red-colourspaces-derivation
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.colorimetry import ILLUMINANTS
+from colour.models.rgb import (RGB_Colourspace, log_decoding_Protune,
+ log_encoding_Protune, normalised_primary_matrix)
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = [
+ 'PROTUNE_NATIVE_PRIMARIES', 'PROTUNE_NATIVE_ILLUMINANT',
+ 'PROTUNE_NATIVE_WHITEPOINT', 'PROTUNE_NATIVE_TO_XYZ_MATRIX',
+ 'XYZ_TO_PROTUNE_NATIVE_MATRIX', 'PROTUNE_NATIVE_COLOURSPACE'
+]
+
+PROTUNE_NATIVE_PRIMARIES = np.array(
+ [[0.698480461493841, 0.193026445370121],
+ [0.329555378387345, 1.024596624134644],
+ [0.108442631407675, -0.034678569754016]]) # yapf: disable
+"""
+*Protune Native* colourspace primaries.
+
+PROTUNE_NATIVE_PRIMARIES : ndarray, (3, 2)
+"""
+
+PROTUNE_NATIVE_ILLUMINANT = 'D65'
+"""
+*Protune Native* colourspace whitepoint name as illuminant.
+
+PROTUNE_NATIVE_ILLUMINANT : unicode
+"""
+
+PROTUNE_NATIVE_WHITEPOINT = (ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [PROTUNE_NATIVE_ILLUMINANT])
+"""
+*Protune Native* colourspace whitepoint.
+
+PROTUNE_NATIVE_WHITEPOINT : ndarray
+"""
+
+PROTUNE_NATIVE_TO_XYZ_MATRIX = normalised_primary_matrix(
+ PROTUNE_NATIVE_PRIMARIES, PROTUNE_NATIVE_WHITEPOINT)
+"""
+*Protune Native* colourspace to *CIE XYZ* tristimulus values matrix.
+
+PROTUNE_NATIVE_TO_XYZ_MATRIX : array_like, (3, 3)
+"""
+
+XYZ_TO_PROTUNE_NATIVE_MATRIX = np.linalg.inv(PROTUNE_NATIVE_TO_XYZ_MATRIX)
+"""
+*CIE XYZ* tristimulus values to *Protune Native* colourspace matrix.
+
+XYZ_TO_PROTUNE_NATIVE_MATRIX : array_like, (3, 3)
+"""
+
+PROTUNE_NATIVE_COLOURSPACE = RGB_Colourspace(
+ 'Protune Native',
+ PROTUNE_NATIVE_PRIMARIES,
+ PROTUNE_NATIVE_WHITEPOINT,
+ PROTUNE_NATIVE_ILLUMINANT,
+ PROTUNE_NATIVE_TO_XYZ_MATRIX,
+ XYZ_TO_PROTUNE_NATIVE_MATRIX,
+ log_encoding_Protune,
+ log_decoding_Protune) # yapf: disable
+"""
+*Protune Native* colourspace.
+
+PROTUNE_NATIVE_COLOURSPACE : RGB_Colourspace
+"""
diff --git a/colour/models/rgb/dataset/max_rgb.py b/colour/models/rgb/dataset/max_rgb.py
index 5f850e7288..a9b131605d 100644
--- a/colour/models/rgb/dataset/max_rgb.py
+++ b/colour/models/rgb/dataset/max_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Max RGB Colourspace
===================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['MAX_RGB_PRIMARIES',
- 'MAX_RGB_ILLUMINANT',
- 'MAX_RGB_WHITEPOINT',
- 'MAX_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_MAX_RGB_MATRIX',
- 'MAX_RGB_COLOURSPACE']
+__all__ = [
+ 'MAX_RGB_PRIMARIES', 'MAX_RGB_ILLUMINANT', 'MAX_RGB_WHITEPOINT',
+ 'MAX_RGB_TO_XYZ_MATRIX', 'XYZ_TO_MAX_RGB_MATRIX', 'MAX_RGB_COLOURSPACE'
+]
MAX_RGB_PRIMARIES = np.array(
[[0.73413379, 0.26586621],
[0.10039113, 0.89960887],
- [0.03621495, 0.00000000]])
+ [0.03621495, 0.00000000]]) # yapf: disable
"""
*Max RGB* colourspace primaries.
@@ -71,8 +66,8 @@
MAX_RGB_WHITEPOINT : ndarray
"""
-MAX_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- MAX_RGB_PRIMARIES, MAX_RGB_WHITEPOINT)
+MAX_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(MAX_RGB_PRIMARIES,
+ MAX_RGB_WHITEPOINT)
"""
*Max RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +88,8 @@
MAX_RGB_ILLUMINANT,
MAX_RGB_TO_XYZ_MATRIX,
XYZ_TO_MAX_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Max RGB* colourspace.
diff --git a/colour/models/rgb/dataset/ntsc_rgb.py b/colour/models/rgb/dataset/ntsc_rgb.py
index 947d6ae0ad..4155c63181 100644
--- a/colour/models/rgb/dataset/ntsc_rgb.py
+++ b/colour/models/rgb/dataset/ntsc_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
NTSC RGB Colourspace
====================
@@ -29,10 +28,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -41,17 +38,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['NTSC_RGB_PRIMARIES',
- 'NTSC_RGB_ILLUMINANT',
- 'NTSC_RGB_WHITEPOINT',
- 'NTSC_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_NTSC_RGB_MATRIX',
- 'NTSC_RGB_COLOURSPACE']
+__all__ = [
+ 'NTSC_RGB_PRIMARIES', 'NTSC_RGB_ILLUMINANT', 'NTSC_RGB_WHITEPOINT',
+ 'NTSC_RGB_TO_XYZ_MATRIX', 'XYZ_TO_NTSC_RGB_MATRIX', 'NTSC_RGB_COLOURSPACE'
+]
NTSC_RGB_PRIMARIES = np.array(
[[0.67, 0.33],
[0.21, 0.71],
- [0.14, 0.08]])
+ [0.14, 0.08]]) # yapf: disable
"""
*NTSC RGB* colourspace primaries.
@@ -73,8 +68,8 @@
NTSC_RGB_WHITEPOINT : ndarray
"""
-NTSC_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- NTSC_RGB_PRIMARIES, NTSC_RGB_WHITEPOINT)
+NTSC_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(NTSC_RGB_PRIMARIES,
+ NTSC_RGB_WHITEPOINT)
"""
*NTSC RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -95,8 +90,8 @@
NTSC_RGB_ILLUMINANT,
NTSC_RGB_TO_XYZ_MATRIX,
XYZ_TO_NTSC_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*NTSC RGB* colourspace.
diff --git a/colour/models/rgb/dataset/pal_secam_rgb.py b/colour/models/rgb/dataset/pal_secam_rgb.py
index dad1f43780..be7a334523 100644
--- a/colour/models/rgb/dataset/pal_secam_rgb.py
+++ b/colour/models/rgb/dataset/pal_secam_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Pal/Secam RGB Colourspace
=========================
@@ -29,10 +28,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -41,17 +38,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['PAL_SECAM_RGB_PRIMARIES',
- 'PAL_SECAM_RGB_ILLUMINANT',
- 'PAL_SECAM_RGB_WHITEPOINT',
- 'PAL_SECAM_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_PAL_SECAM_RGB_MATRIX',
- 'PAL_SECAM_RGB_COLOURSPACE']
+__all__ = [
+ 'PAL_SECAM_RGB_PRIMARIES', 'PAL_SECAM_RGB_ILLUMINANT',
+ 'PAL_SECAM_RGB_WHITEPOINT', 'PAL_SECAM_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_PAL_SECAM_RGB_MATRIX', 'PAL_SECAM_RGB_COLOURSPACE'
+]
PAL_SECAM_RGB_PRIMARIES = np.array(
[[0.64, 0.33],
[0.29, 0.60],
- [0.15, 0.06]])
+ [0.15, 0.06]]) # yapf: disable
"""
*Pal/Secam RGB* colourspace primaries.
@@ -66,8 +62,8 @@
"""
PAL_SECAM_RGB_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- PAL_SECAM_RGB_ILLUMINANT])
+ ILLUMINANTS['CIE 1931 2 Degree Standard Observer']
+ [PAL_SECAM_RGB_ILLUMINANT]) # yapf: disable
"""
*Pal/Secam RGB* colourspace whitepoint.
@@ -96,8 +92,8 @@
PAL_SECAM_RGB_ILLUMINANT,
PAL_SECAM_RGB_TO_XYZ_MATRIX,
XYZ_TO_PAL_SECAM_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.8),
- partial(gamma_function, exponent=2.8))
+ partial(function_gamma, exponent=1 / 2.8),
+ partial(function_gamma, exponent=2.8)) # yapf: disable
"""
*Pal/Secam RGB* colourspace.
diff --git a/colour/models/rgb/dataset/rec_2020.py b/colour/models/rgb/dataset/rec_2020.py
index 3f47ab33fd..8e5ad8379c 100644
--- a/colour/models/rgb/dataset/rec_2020.py
+++ b/colour/models/rgb/dataset/rec_2020.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Rec. 2020 Colourspace
=====================
@@ -29,11 +28,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- normalised_primary_matrix,
- oetf_BT2020,
- eotf_BT2020)
+from colour.models.rgb import (RGB_Colourspace, normalised_primary_matrix,
+ oetf_BT2020, eotf_BT2020)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -42,17 +38,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['REC_2020_PRIMARIES',
- 'REC_2020_ILLUMINANT',
- 'REC_2020_WHITEPOINT',
- 'REC_2020_TO_XYZ_MATRIX',
- 'XYZ_TO_REC_2020_MATRIX',
- 'REC_2020_COLOURSPACE']
+__all__ = [
+ 'REC_2020_PRIMARIES', 'REC_2020_ILLUMINANT', 'REC_2020_WHITEPOINT',
+ 'REC_2020_TO_XYZ_MATRIX', 'XYZ_TO_REC_2020_MATRIX', 'REC_2020_COLOURSPACE'
+]
REC_2020_PRIMARIES = np.array(
[[0.708, 0.292],
[0.170, 0.797],
- [0.131, 0.046]])
+ [0.131, 0.046]]) # yapf: disable
"""
*Rec. 2020* colourspace primaries.
@@ -74,8 +68,8 @@
REC_2020_WHITEPOINT : ndarray
"""
-REC_2020_TO_XYZ_MATRIX = normalised_primary_matrix(
- REC_2020_PRIMARIES, REC_2020_WHITEPOINT)
+REC_2020_TO_XYZ_MATRIX = normalised_primary_matrix(REC_2020_PRIMARIES,
+ REC_2020_WHITEPOINT)
"""
*Rec. 2020* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -97,7 +91,7 @@
REC_2020_TO_XYZ_MATRIX,
XYZ_TO_REC_2020_MATRIX,
oetf_BT2020,
- eotf_BT2020)
+ eotf_BT2020) # yapf: disable
"""
*Rec. 2020* colourspace.
diff --git a/colour/models/rgb/dataset/rec_709.py b/colour/models/rgb/dataset/rec_709.py
index 9150206261..ef6d715065 100644
--- a/colour/models/rgb/dataset/rec_709.py
+++ b/colour/models/rgb/dataset/rec_709.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Rec. 709 Colourspace
====================
@@ -29,11 +28,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- oetf_BT709,
- eotf_BT709,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, oetf_BT709, eotf_BT709,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -42,17 +38,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['REC_709_PRIMARIES',
- 'REC_709_WHITEPOINT',
- 'REC_709_ILLUMINANT',
- 'REC_709_TO_XYZ_MATRIX',
- 'XYZ_TO_REC_709_MATRIX',
- 'REC_709_COLOURSPACE']
+__all__ = [
+ 'REC_709_PRIMARIES', 'REC_709_WHITEPOINT', 'REC_709_ILLUMINANT',
+ 'REC_709_TO_XYZ_MATRIX', 'XYZ_TO_REC_709_MATRIX', 'REC_709_COLOURSPACE'
+]
REC_709_PRIMARIES = np.array(
[[0.6400, 0.3300],
[0.3000, 0.6000],
- [0.1500, 0.0600]])
+ [0.1500, 0.0600]]) # yapf: disable
"""
*Rec. 709* colourspace primaries.
@@ -74,8 +68,8 @@
REC_709_WHITEPOINT : ndarray
"""
-REC_709_TO_XYZ_MATRIX = normalised_primary_matrix(
- REC_709_PRIMARIES, REC_709_WHITEPOINT)
+REC_709_TO_XYZ_MATRIX = normalised_primary_matrix(REC_709_PRIMARIES,
+ REC_709_WHITEPOINT)
"""
*Rec. 709* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -97,7 +91,7 @@
REC_709_TO_XYZ_MATRIX,
XYZ_TO_REC_709_MATRIX,
oetf_BT709,
- eotf_BT709)
+ eotf_BT709) # yapf: disable
"""
*Rec. 709* colourspace.
diff --git a/colour/models/rgb/dataset/red.py b/colour/models/rgb/dataset/red.py
index a1ccfd53ef..d3e0dfa64a 100644
--- a/colour/models/rgb/dataset/red.py
+++ b/colour/models/rgb/dataset/red.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RED Colourspaces
================
@@ -37,12 +36,8 @@
from colour.colorimetry import ILLUMINANTS
from colour.models.rgb import (
- RGB_Colourspace,
- normalised_primary_matrix,
- log_encoding_REDLogFilm,
- log_decoding_REDLogFilm,
- log_encoding_Log3G10,
- log_decoding_Log3G10)
+ RGB_Colourspace, normalised_primary_matrix, log_encoding_REDLogFilm,
+ log_decoding_REDLogFilm, log_encoding_Log3G10, log_decoding_Log3G10)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -51,53 +46,33 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RED_COLOR_PRIMARIES',
- 'RED_COLOR_ILLUMINANT',
- 'RED_COLOR_WHITEPOINT',
- 'RED_COLOR_TO_XYZ_MATRIX',
- 'XYZ_TO_RED_COLOR_MATRIX',
- 'RED_COLOR_COLOURSPACE',
- 'RED_COLOR_2_PRIMARIES',
- 'RED_COLOR_2_ILLUMINANT',
- 'RED_COLOR_2_WHITEPOINT',
- 'RED_COLOR_2_TO_XYZ_MATRIX',
- 'XYZ_TO_RED_COLOR_2_MATRIX',
- 'RED_COLOR_2_COLOURSPACE',
- 'RED_COLOR_3_PRIMARIES',
- 'RED_COLOR_3_ILLUMINANT',
- 'RED_COLOR_3_WHITEPOINT',
- 'RED_COLOR_3_TO_XYZ_MATRIX',
- 'XYZ_TO_RED_COLOR_3_MATRIX',
- 'RED_COLOR_3_COLOURSPACE',
- 'RED_COLOR_4_PRIMARIES',
- 'RED_COLOR_4_ILLUMINANT',
- 'RED_COLOR_4_WHITEPOINT',
- 'RED_COLOR_4_TO_XYZ_MATRIX',
- 'XYZ_TO_RED_COLOR_4_MATRIX',
- 'RED_COLOR_4_COLOURSPACE',
- 'DRAGON_COLOR_PRIMARIES',
- 'DRAGON_COLOR_ILLUMINANT',
- 'DRAGON_COLOR_WHITEPOINT',
- 'DRAGON_COLOR_TO_XYZ_MATRIX',
- 'XYZ_TO_DRAGON_COLOR_MATRIX',
- 'DRAGON_COLOR_COLOURSPACE',
- 'DRAGON_COLOR_2_PRIMARIES',
- 'DRAGON_COLOR_2_ILLUMINANT',
- 'DRAGON_COLOR_2_WHITEPOINT',
- 'DRAGON_COLOR_2_TO_XYZ_MATRIX',
- 'XYZ_TO_DRAGON_COLOR_2_MATRIX',
- 'DRAGON_COLOR_2_COLOURSPACE',
- 'RED_WIDE_GAMUT_RGB_PRIMARIES',
- 'RED_WIDE_GAMUT_RGB_ILLUMINANT',
- 'RED_WIDE_GAMUT_RGB_WHITEPOINT',
- 'RED_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_RED_WIDE_GAMUT_RGB_MATRIX',
- 'RED_WIDE_GAMUT_RGB_COLOURSPACE']
+__all__ = [
+ 'RED_COLOR_PRIMARIES', 'RED_COLOR_ILLUMINANT', 'RED_COLOR_WHITEPOINT',
+ 'RED_COLOR_TO_XYZ_MATRIX', 'XYZ_TO_RED_COLOR_MATRIX',
+ 'RED_COLOR_COLOURSPACE', 'RED_COLOR_2_PRIMARIES', 'RED_COLOR_2_ILLUMINANT',
+ 'RED_COLOR_2_WHITEPOINT', 'RED_COLOR_2_TO_XYZ_MATRIX',
+ 'XYZ_TO_RED_COLOR_2_MATRIX', 'RED_COLOR_2_COLOURSPACE',
+ 'RED_COLOR_3_PRIMARIES', 'RED_COLOR_3_ILLUMINANT',
+ 'RED_COLOR_3_WHITEPOINT', 'RED_COLOR_3_TO_XYZ_MATRIX',
+ 'XYZ_TO_RED_COLOR_3_MATRIX', 'RED_COLOR_3_COLOURSPACE',
+ 'RED_COLOR_4_PRIMARIES', 'RED_COLOR_4_ILLUMINANT',
+ 'RED_COLOR_4_WHITEPOINT', 'RED_COLOR_4_TO_XYZ_MATRIX',
+ 'XYZ_TO_RED_COLOR_4_MATRIX', 'RED_COLOR_4_COLOURSPACE',
+ 'DRAGON_COLOR_PRIMARIES', 'DRAGON_COLOR_ILLUMINANT',
+ 'DRAGON_COLOR_WHITEPOINT', 'DRAGON_COLOR_TO_XYZ_MATRIX',
+ 'XYZ_TO_DRAGON_COLOR_MATRIX', 'DRAGON_COLOR_COLOURSPACE',
+ 'DRAGON_COLOR_2_PRIMARIES', 'DRAGON_COLOR_2_ILLUMINANT',
+ 'DRAGON_COLOR_2_WHITEPOINT', 'DRAGON_COLOR_2_TO_XYZ_MATRIX',
+ 'XYZ_TO_DRAGON_COLOR_2_MATRIX', 'DRAGON_COLOR_2_COLOURSPACE',
+ 'RED_WIDE_GAMUT_RGB_PRIMARIES', 'RED_WIDE_GAMUT_RGB_ILLUMINANT',
+ 'RED_WIDE_GAMUT_RGB_WHITEPOINT', 'RED_WIDE_GAMUT_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_RED_WIDE_GAMUT_RGB_MATRIX', 'RED_WIDE_GAMUT_RGB_COLOURSPACE'
+]
RED_COLOR_PRIMARIES = np.array(
[[0.699747001290731, 0.329046930312637],
[0.304264039023547, 0.623641145129115],
- [0.134913961296487, 0.034717441281345]])
+ [0.134913961296487, 0.034717441281345]]) # yapf: disable
"""
*REDcolor* colourspace primaries.
@@ -119,8 +94,8 @@
RED_COLOR_WHITEPOINT : ndarray
"""
-RED_COLOR_TO_XYZ_MATRIX = normalised_primary_matrix(
- RED_COLOR_PRIMARIES, RED_COLOR_WHITEPOINT)
+RED_COLOR_TO_XYZ_MATRIX = normalised_primary_matrix(RED_COLOR_PRIMARIES,
+ RED_COLOR_WHITEPOINT)
"""
*REDcolor* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -142,7 +117,7 @@
RED_COLOR_TO_XYZ_MATRIX,
XYZ_TO_RED_COLOR_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*REDcolor* colourspace.
@@ -152,7 +127,7 @@
RED_COLOR_2_PRIMARIES = np.array(
[[0.878682510476129, 0.324964007409910],
[0.300888714367432, 0.679054755790568],
- [0.095398694605615, -0.029379326834327]])
+ [0.095398694605615, -0.029379326834327]]) # yapf: disable
"""
*REDcolor2* colourspace primaries.
@@ -173,8 +148,8 @@
RED_COLOR_2_WHITEPOINT : ndarray
"""
-RED_COLOR_2_TO_XYZ_MATRIX = normalised_primary_matrix(
- RED_COLOR_2_PRIMARIES, RED_COLOR_2_WHITEPOINT)
+RED_COLOR_2_TO_XYZ_MATRIX = normalised_primary_matrix(RED_COLOR_2_PRIMARIES,
+ RED_COLOR_2_WHITEPOINT)
"""
*REDcolor2* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -196,7 +171,7 @@
RED_COLOR_2_TO_XYZ_MATRIX,
XYZ_TO_RED_COLOR_2_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*REDcolor2* colourspace.
@@ -206,7 +181,7 @@
RED_COLOR_3_PRIMARIES = np.array(
[[0.701181035906413, 0.329014155583010],
[0.300600304651563, 0.683788834268552],
- [0.108154455624011, -0.008688175786660]])
+ [0.108154455624011, -0.008688175786660]]) # yapf: disable
"""
*REDcolor3* colourspace primaries.
@@ -227,8 +202,8 @@
RED_COLOR_3_WHITEPOINT : ndarray
"""
-RED_COLOR_3_TO_XYZ_MATRIX = normalised_primary_matrix(
- RED_COLOR_3_PRIMARIES, RED_COLOR_3_WHITEPOINT)
+RED_COLOR_3_TO_XYZ_MATRIX = normalised_primary_matrix(RED_COLOR_3_PRIMARIES,
+ RED_COLOR_3_WHITEPOINT)
"""
*REDcolor3* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -250,7 +225,7 @@
RED_COLOR_3_TO_XYZ_MATRIX,
XYZ_TO_RED_COLOR_3_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*REDcolor3* colourspace.
@@ -260,7 +235,7 @@
RED_COLOR_4_PRIMARIES = np.array(
[[0.701180591891983, 0.329013699115539],
[0.300600395529389, 0.683788824257266],
- [0.145331946228869, 0.051616803622619]])
+ [0.145331946228869, 0.051616803622619]]) # yapf: disable
"""
*REDcolor4* colourspace primaries.
@@ -281,8 +256,8 @@
RED_COLOR_4_WHITEPOINT : ndarray
"""
-RED_COLOR_4_TO_XYZ_MATRIX = normalised_primary_matrix(
- RED_COLOR_4_PRIMARIES, RED_COLOR_4_WHITEPOINT)
+RED_COLOR_4_TO_XYZ_MATRIX = normalised_primary_matrix(RED_COLOR_4_PRIMARIES,
+ RED_COLOR_4_WHITEPOINT)
"""
*REDcolor4* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -304,7 +279,7 @@
RED_COLOR_4_TO_XYZ_MATRIX,
XYZ_TO_RED_COLOR_4_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*REDcolor4* colourspace.
@@ -314,7 +289,7 @@
DRAGON_COLOR_PRIMARIES = np.array(
[[0.753044222784747, 0.327830576681599],
[0.299570228480719, 0.700699321955751],
- [0.079642066734959, -0.054937951088786]])
+ [0.079642066734959, -0.054937951088786]]) # yapf: disable
"""
*DRAGONcolor* colourspace primaries.
@@ -335,8 +310,8 @@
DRAGON_COLOR_WHITEPOINT : ndarray
"""
-DRAGON_COLOR_TO_XYZ_MATRIX = normalised_primary_matrix(
- DRAGON_COLOR_PRIMARIES, DRAGON_COLOR_WHITEPOINT)
+DRAGON_COLOR_TO_XYZ_MATRIX = normalised_primary_matrix(DRAGON_COLOR_PRIMARIES,
+ DRAGON_COLOR_WHITEPOINT)
"""
*DRAGONcolor* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -358,7 +333,7 @@
DRAGON_COLOR_TO_XYZ_MATRIX,
XYZ_TO_DRAGON_COLOR_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*DRAGONcolor* colourspace.
@@ -368,7 +343,7 @@
DRAGON_COLOR_2_PRIMARIES = np.array(
[[0.753044491143000, 0.327831029513214],
[0.299570490451307, 0.700699415613996],
- [0.145011584277975, 0.051097125087887]])
+ [0.145011584277975, 0.051097125087887]]) # yapf: disable
"""
*DRAGONcolor2* colourspace primaries.
@@ -412,7 +387,7 @@
DRAGON_COLOR_2_TO_XYZ_MATRIX,
XYZ_TO_DRAGON_COLOR_2_MATRIX,
log_encoding_REDLogFilm,
- log_decoding_REDLogFilm)
+ log_decoding_REDLogFilm) # yapf: disable
"""
*DRAGONcolor2* colourspace.
@@ -422,7 +397,7 @@
RED_WIDE_GAMUT_RGB_PRIMARIES = np.array(
[[0.780308, 0.304253],
[0.121595, 1.493994],
- [0.095612, -0.084589]])
+ [0.095612, -0.084589]]) # yapf: disable
"""
*REDWideGamutRGB* colourspace primaries.
@@ -436,9 +411,8 @@
RED_WIDE_GAMUT_RGB_ILLUMINANT : unicode
"""
-RED_WIDE_GAMUT_RGB_WHITEPOINT = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- RED_WIDE_GAMUT_RGB_ILLUMINANT])
+RED_WIDE_GAMUT_RGB_WHITEPOINT = (ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer'][RED_WIDE_GAMUT_RGB_ILLUMINANT])
"""
*REDWideGamutRGB* colourspace whitepoint.
@@ -448,7 +422,7 @@
RED_WIDE_GAMUT_RGB_TO_XYZ_MATRIX = np.array(
[[0.735275, 0.068609, 0.146571],
[0.286694, 0.842979, -0.129673],
- [-0.079681, -0.347343, 1.516082]])
+ [-0.079681, -0.347343, 1.516082]]) # yapf: disable
"""
*REDWideGamutRGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -471,7 +445,7 @@
RED_WIDE_GAMUT_RGB_TO_XYZ_MATRIX,
XYZ_TO_RED_WIDE_GAMUT_RGB_MATRIX,
log_encoding_Log3G10,
- log_decoding_Log3G10)
+ log_decoding_Log3G10) # yapf: disable
"""
*REDWideGamutRGB* colourspace.
diff --git a/colour/models/rgb/dataset/rimm_romm_rgb.py b/colour/models/rgb/dataset/rimm_romm_rgb.py
index 8d7018cbfb..5630ff8a89 100644
--- a/colour/models/rgb/dataset/rimm_romm_rgb.py
+++ b/colour/models/rgb/dataset/rimm_romm_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RIMM, ROMM and ERIMM Encodings
==============================
@@ -32,16 +31,10 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- oetf_ROMMRGB,
- eotf_ROMMRGB,
- oetf_RIMMRGB,
- eotf_RIMMRGB,
- log_encoding_ERIMMRGB,
- log_decoding_ERIMMRGB,
- oetf_ProPhotoRGB,
- eotf_ProPhotoRGB)
+from colour.models.rgb import (RGB_Colourspace, oetf_ROMMRGB, eotf_ROMMRGB,
+ oetf_RIMMRGB, eotf_RIMMRGB,
+ log_encoding_ERIMMRGB, log_decoding_ERIMMRGB,
+ oetf_ProPhotoRGB, eotf_ProPhotoRGB)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -50,35 +43,23 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ROMM_RGB_PRIMARIES',
- 'ROMM_RGB_ILLUMINANT',
- 'ROMM_RGB_WHITEPOINT',
- 'ROMM_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_ROMM_RGB_MATRIX',
- 'ROMM_RGB_COLOURSPACE',
- 'RIMM_RGB_PRIMARIES',
- 'RIMM_RGB_ILLUMINANT',
- 'RIMM_RGB_WHITEPOINT',
- 'RIMM_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_RIMM_RGB_MATRIX',
- 'RIMM_RGB_COLOURSPACE',
- 'ERIMM_RGB_PRIMARIES',
- 'ERIMM_RGB_ILLUMINANT',
- 'ERIMM_RGB_WHITEPOINT',
- 'ERIMM_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_ERIMM_RGB_MATRIX',
- 'ERIMM_RGB_COLOURSPACE',
- 'PROPHOTO_RGB_PRIMARIES',
- 'PROPHOTO_RGB_ILLUMINANT',
- 'PROPHOTO_RGB_WHITEPOINT',
- 'PROPHOTO_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_PROPHOTO_RGB_MATRIX',
- 'PROPHOTO_RGB_COLOURSPACE']
+__all__ = [
+ 'ROMM_RGB_PRIMARIES', 'ROMM_RGB_ILLUMINANT', 'ROMM_RGB_WHITEPOINT',
+ 'ROMM_RGB_TO_XYZ_MATRIX', 'XYZ_TO_ROMM_RGB_MATRIX', 'ROMM_RGB_COLOURSPACE',
+ 'RIMM_RGB_PRIMARIES', 'RIMM_RGB_ILLUMINANT', 'RIMM_RGB_WHITEPOINT',
+ 'RIMM_RGB_TO_XYZ_MATRIX', 'XYZ_TO_RIMM_RGB_MATRIX', 'RIMM_RGB_COLOURSPACE',
+ 'ERIMM_RGB_PRIMARIES', 'ERIMM_RGB_ILLUMINANT', 'ERIMM_RGB_WHITEPOINT',
+ 'ERIMM_RGB_TO_XYZ_MATRIX', 'XYZ_TO_ERIMM_RGB_MATRIX',
+ 'ERIMM_RGB_COLOURSPACE', 'PROPHOTO_RGB_PRIMARIES',
+ 'PROPHOTO_RGB_ILLUMINANT', 'PROPHOTO_RGB_WHITEPOINT',
+ 'PROPHOTO_RGB_TO_XYZ_MATRIX', 'XYZ_TO_PROPHOTO_RGB_MATRIX',
+ 'PROPHOTO_RGB_COLOURSPACE'
+]
ROMM_RGB_PRIMARIES = np.array(
[[0.7347, 0.2653],
[0.1596, 0.8404],
- [0.0366, 0.0001]])
+ [0.0366, 0.0001]]) # yapf: disable
"""
*ROMM RGB* colourspace primaries.
@@ -103,7 +84,7 @@
ROMM_RGB_TO_XYZ_MATRIX = np.array(
[[0.7977, 0.1352, 0.0313],
[0.2880, 0.7119, 0.0001],
- [0.0000, 0.0000, 0.8249]])
+ [0.0000, 0.0000, 0.8249]]) # yapf: disable
"""
*ROMM RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -113,7 +94,7 @@
XYZ_TO_ROMM_RGB_MATRIX = np.array(
[[1.3460, -0.2556, -0.0511],
[-0.5446, 1.5082, 0.0205],
- [0.0000, 0.0000, 1.2123]])
+ [0.0000, 0.0000, 1.2123]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *ROMM RGB* colourspace matrix.
@@ -129,7 +110,7 @@
ROMM_RGB_TO_XYZ_MATRIX,
XYZ_TO_ROMM_RGB_MATRIX,
oetf_ROMMRGB,
- eotf_ROMMRGB)
+ eotf_ROMMRGB) # yapf: disable
"""
*ROMM RGB* colourspace.
@@ -179,7 +160,7 @@
RIMM_RGB_TO_XYZ_MATRIX,
XYZ_TO_RIMM_RGB_MATRIX,
oetf_RIMMRGB,
- eotf_RIMMRGB)
+ eotf_RIMMRGB) # yapf: disable
"""
*RIMM RGB* colourspace. In cases in which it is necessary to identify a
specific precision level, the notation *RIMM8 RGB*, *RIMM12 RGB* and
@@ -231,7 +212,7 @@
ERIMM_RGB_TO_XYZ_MATRIX,
XYZ_TO_ERIMM_RGB_MATRIX,
log_encoding_ERIMMRGB,
- log_decoding_ERIMMRGB)
+ log_decoding_ERIMMRGB) # yapf: disable
"""
*ERIMM RGB* colourspace.
@@ -281,7 +262,7 @@
PROPHOTO_RGB_TO_XYZ_MATRIX,
XYZ_TO_PROPHOTO_RGB_MATRIX,
oetf_ProPhotoRGB,
- eotf_ProPhotoRGB)
+ eotf_ProPhotoRGB) # yapf: disable
"""
*ProPhoto RGB* colourspace, an alias colourspace for *ROMM RGB*.
diff --git a/colour/models/rgb/dataset/russell_rgb.py b/colour/models/rgb/dataset/russell_rgb.py
index 3141ba6b44..02fac3d23e 100644
--- a/colour/models/rgb/dataset/russell_rgb.py
+++ b/colour/models/rgb/dataset/russell_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Russell RGB Colourspace
=======================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry.dataset import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RUSSELL_RGB_PRIMARIES',
- 'RUSSELL_RGB_ILLUMINANT',
- 'RUSSELL_RGB_WHITEPOINT',
- 'RUSSELL_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_RUSSELL_RGB_MATRIX',
- 'RUSSELL_RGB_COLOURSPACE']
+__all__ = [
+ 'RUSSELL_RGB_PRIMARIES', 'RUSSELL_RGB_ILLUMINANT',
+ 'RUSSELL_RGB_WHITEPOINT', 'RUSSELL_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_RUSSELL_RGB_MATRIX', 'RUSSELL_RGB_COLOURSPACE'
+]
RUSSELL_RGB_PRIMARIES = np.array(
[[0.6900, 0.3100],
[0.1800, 0.7700],
- [0.1000, 0.0200]])
+ [0.1000, 0.0200]]) # yapf: disable
"""
*Russell RGB* colourspace primaries.
@@ -71,8 +67,8 @@
RUSSELL_RGB_WHITEPOINT : ndarray
"""
-RUSSELL_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- RUSSELL_RGB_PRIMARIES, RUSSELL_RGB_WHITEPOINT)
+RUSSELL_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(RUSSELL_RGB_PRIMARIES,
+ RUSSELL_RGB_WHITEPOINT)
"""
*Russell RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +89,8 @@
RUSSELL_RGB_ILLUMINANT,
RUSSELL_RGB_TO_XYZ_MATRIX,
XYZ_TO_RUSSELL_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Russell RGB* colourspace.
diff --git a/colour/models/rgb/dataset/smptec_rgb.py b/colour/models/rgb/dataset/smptec_rgb.py
index 1030b6b9e9..3b9c958fa6 100644
--- a/colour/models/rgb/dataset/smptec_rgb.py
+++ b/colour/models/rgb/dataset/smptec_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
SMPTE-C RGB Colourspace
=======================
@@ -28,10 +27,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -40,17 +37,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SMPTE_C_RGB_PRIMARIES',
- 'SMPTE_C_RGB_ILLUMINANT',
- 'SMPTE_C_RGB_WHITEPOINT',
- 'SMPTE_C_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_SMPTE_C_RGB_MATRIX',
- 'SMPTE_C_RGB_COLOURSPACE']
+__all__ = [
+ 'SMPTE_C_RGB_PRIMARIES', 'SMPTE_C_RGB_ILLUMINANT',
+ 'SMPTE_C_RGB_WHITEPOINT', 'SMPTE_C_RGB_TO_XYZ_MATRIX',
+ 'XYZ_TO_SMPTE_C_RGB_MATRIX', 'SMPTE_C_RGB_COLOURSPACE'
+]
SMPTE_C_RGB_PRIMARIES = np.array(
[[0.630, 0.340],
[0.310, 0.595],
- [0.155, 0.070]])
+ [0.155, 0.070]]) # yapf: disable
"""
*SMPTE-C RGB* colourspace primaries.
@@ -72,8 +68,8 @@
SMPTE_C_RGB_WHITEPOINT : ndarray
"""
-SMPTE_C_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- SMPTE_C_RGB_PRIMARIES, SMPTE_C_RGB_WHITEPOINT)
+SMPTE_C_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(SMPTE_C_RGB_PRIMARIES,
+ SMPTE_C_RGB_WHITEPOINT)
"""
*SMPTE-C RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -94,8 +90,8 @@
SMPTE_C_RGB_ILLUMINANT,
SMPTE_C_RGB_TO_XYZ_MATRIX,
XYZ_TO_SMPTE_C_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*SMPTE-C RGB* colourspace.
diff --git a/colour/models/rgb/dataset/sony.py b/colour/models/rgb/dataset/sony.py
index bdefbe9c4d..a9a3c26456 100644
--- a/colour/models/rgb/dataset/sony.py
+++ b/colour/models/rgb/dataset/sony.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Sony Colourspaces
=================
@@ -42,12 +41,9 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- log_encoding_SLog2,
- log_decoding_SLog2,
- log_encoding_SLog3,
- log_decoding_SLog3)
+from colour.models.rgb import (RGB_Colourspace, log_encoding_SLog2,
+ log_decoding_SLog2, log_encoding_SLog3,
+ log_decoding_SLog3)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -56,24 +52,19 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['S_GAMUT_PRIMARIES',
- 'S_GAMUT_ILLUMINANT',
- 'S_GAMUT_WHITEPOINT',
- 'S_GAMUT_TO_XYZ_MATRIX',
- 'XYZ_TO_S_GAMUT_MATRIX',
- 'S_GAMUT_COLOURSPACE',
- 'S_GAMUT3_COLOURSPACE',
- 'S_GAMUT3_CINE_PRIMARIES',
- 'S_GAMUT3_CINE_ILLUMINANT',
- 'S_GAMUT3_CINE_WHITEPOINT',
- 'S_GAMUT3_CINE_TO_XYZ_MATRIX',
- 'XYZ_TO_S_GAMUT3_CINE_MATRIX',
- 'S_GAMUT3_CINE_COLOURSPACE']
+__all__ = [
+ 'S_GAMUT_PRIMARIES', 'S_GAMUT_ILLUMINANT', 'S_GAMUT_WHITEPOINT',
+ 'S_GAMUT_TO_XYZ_MATRIX', 'XYZ_TO_S_GAMUT_MATRIX', 'S_GAMUT_COLOURSPACE',
+ 'S_GAMUT3_COLOURSPACE', 'S_GAMUT3_CINE_PRIMARIES',
+ 'S_GAMUT3_CINE_ILLUMINANT', 'S_GAMUT3_CINE_WHITEPOINT',
+ 'S_GAMUT3_CINE_TO_XYZ_MATRIX', 'XYZ_TO_S_GAMUT3_CINE_MATRIX',
+ 'S_GAMUT3_CINE_COLOURSPACE'
+]
S_GAMUT_PRIMARIES = np.array(
[[0.730, 0.280],
[0.140, 0.855],
- [0.100, -0.050]])
+ [0.100, -0.050]]) # yapf: disable
"""
*S-Gamut* colourspace primaries.
@@ -98,7 +89,7 @@
S_GAMUT_TO_XYZ_MATRIX = np.array(
[[0.7064827132, 0.1288010498, 0.1151721641],
[0.2709796708, 0.7866064112, -0.0575860820],
- [-0.0096778454, 0.0046000375, 1.0941355587]])
+ [-0.0096778454, 0.0046000375, 1.0941355587]]) # yapf: disable
"""
*S-Gamut* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -108,7 +99,7 @@
XYZ_TO_S_GAMUT_MATRIX = np.array(
[[1.5073998991, -0.2458221374, -0.1716116808],
[-0.5181517271, 1.3553912409, 0.1258786682],
- [0.0155116982, -0.0078727714, 0.9119163656]])
+ [0.0155116982, -0.0078727714, 0.9119163656]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *S-Gamut* colourspace matrix.
@@ -123,7 +114,7 @@
S_GAMUT_TO_XYZ_MATRIX,
XYZ_TO_S_GAMUT_MATRIX,
log_encoding_SLog2,
- log_decoding_SLog2)
+ log_decoding_SLog2) # yapf: disable
"""
*S-Gamut* colourspace.
@@ -138,7 +129,7 @@
S_GAMUT_TO_XYZ_MATRIX,
XYZ_TO_S_GAMUT_MATRIX,
log_encoding_SLog3,
- log_decoding_SLog3)
+ log_decoding_SLog3) # yapf: disable
"""
*S-Gamut3* colourspace.
@@ -148,7 +139,7 @@
S_GAMUT3_CINE_PRIMARIES = np.array(
[[0.76600, 0.27500],
[0.22500, 0.80000],
- [0.08900, -0.08700]])
+ [0.08900, -0.08700]]) # yapf: disable
"""
*S-Gamut3.Cine* colourspace primaries.
@@ -172,7 +163,7 @@
S_GAMUT3_CINE_TO_XYZ_MATRIX = np.array(
[[0.5990839208, 0.2489255161, 0.1024464902],
[0.2150758201, 0.8850685017, -0.1001443219],
- [-0.0320658495, -0.0276583907, 1.1487819910]])
+ [-0.0320658495, -0.0276583907, 1.1487819910]]) # yapf: disable
"""
*S-Gamut3.Cine* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -182,7 +173,7 @@
XYZ_TO_S_GAMUT3_CINE_MATRIX = np.array(
[[1.8467789693, -0.5259861230, -0.2105452114],
[-0.4441532629, 1.2594429028, 0.1493999729],
- [0.0408554212, 0.0156408893, 0.8682072487]])
+ [0.0408554212, 0.0156408893, 0.8682072487]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *S-Gamut3.Cine* colourspace matrix.
@@ -197,7 +188,7 @@
S_GAMUT3_CINE_TO_XYZ_MATRIX,
XYZ_TO_S_GAMUT3_CINE_MATRIX,
log_encoding_SLog3,
- log_decoding_SLog3)
+ log_decoding_SLog3) # yapf: disable
"""
*S-Gamut3.Cine* colourspace.
diff --git a/colour/models/rgb/dataset/srgb.py b/colour/models/rgb/dataset/srgb.py
index fcb343c78e..fb15b2289c 100644
--- a/colour/models/rgb/dataset/srgb.py
+++ b/colour/models/rgb/dataset/srgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
sRGB Colourspace
================
@@ -33,10 +32,7 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- oetf_sRGB,
- eotf_sRGB)
+from colour.models.rgb import (RGB_Colourspace, oetf_sRGB, eotf_sRGB)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -45,17 +41,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['sRGB_PRIMARIES',
- 'sRGB_ILLUMINANT',
- 'sRGB_WHITEPOINT',
- 'sRGB_TO_XYZ_MATRIX',
- 'XYZ_TO_sRGB_MATRIX',
- 'sRGB_COLOURSPACE']
+__all__ = [
+ 'sRGB_PRIMARIES', 'sRGB_ILLUMINANT', 'sRGB_WHITEPOINT',
+ 'sRGB_TO_XYZ_MATRIX', 'XYZ_TO_sRGB_MATRIX', 'sRGB_COLOURSPACE'
+]
sRGB_PRIMARIES = np.array(
[[0.6400, 0.3300],
[0.3000, 0.6000],
- [0.1500, 0.0600]])
+ [0.1500, 0.0600]]) # yapf: disable
"""
*sRGB* colourspace primaries.
@@ -80,7 +74,7 @@
sRGB_TO_XYZ_MATRIX = np.array(
[[0.4124, 0.3576, 0.1805],
[0.2126, 0.7152, 0.0722],
- [0.0193, 0.1192, 0.9505]])
+ [0.0193, 0.1192, 0.9505]]) # yapf: disable
"""
*sRGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -90,7 +84,7 @@
XYZ_TO_sRGB_MATRIX = np.array(
[[3.2406, -1.5372, -0.4986],
[-0.9689, 1.8758, 0.0415],
- [0.0557, -0.2040, 1.0570]])
+ [0.0557, -0.2040, 1.0570]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *sRGB* colourspace matrix.
@@ -105,7 +99,7 @@
sRGB_TO_XYZ_MATRIX,
XYZ_TO_sRGB_MATRIX,
oetf_sRGB,
- eotf_sRGB)
+ eotf_sRGB) # yapf: disable
"""
*sRGB* colourspace.
diff --git a/colour/models/rgb/dataset/v_gamut.py b/colour/models/rgb/dataset/v_gamut.py
index 70d306852d..7da164565f 100644
--- a/colour/models/rgb/dataset/v_gamut.py
+++ b/colour/models/rgb/dataset/v_gamut.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
V-Gamut Colourspace
===================
@@ -27,10 +26,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- log_encoding_VLog,
- log_decoding_VLog)
+from colour.models.rgb import (RGB_Colourspace, log_encoding_VLog,
+ log_decoding_VLog)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,15 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['V_GAMUT_PRIMARIES',
- 'V_GAMUT_ILLUMINANT',
- 'V_GAMUT_WHITEPOINT',
- 'V_GAMUT_TO_XYZ_MATRIX',
- 'XYZ_TO_V_GAMUT_MATRIX',
- 'V_GAMUT_COLOURSPACE']
+__all__ = [
+ 'V_GAMUT_PRIMARIES', 'V_GAMUT_ILLUMINANT', 'V_GAMUT_WHITEPOINT',
+ 'V_GAMUT_TO_XYZ_MATRIX', 'XYZ_TO_V_GAMUT_MATRIX', 'V_GAMUT_COLOURSPACE'
+]
V_GAMUT_PRIMARIES = np.array(
[[0.730, 0.280],
[0.165, 0.840],
- [0.100, -0.030]])
+ [0.100, -0.030]]) # yapf: disable
"""
*V-Gamut* colourspace primaries.
@@ -74,7 +69,7 @@
V_GAMUT_TO_XYZ_MATRIX = np.array(
[[0.679644, 0.152211, 0.118600],
[0.260686, 0.774894, -0.035580],
- [-0.009310, -0.004612, 1.102980]])
+ [-0.009310, -0.004612, 1.102980]]) # yapf: disable
"""
*V-Gamut* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -84,7 +79,7 @@
XYZ_TO_V_GAMUT_MATRIX = np.array(
[[1.589012, -0.313204, -0.180965],
[-0.534053, 1.396011, 0.102458],
- [0.011179, 0.003194, 0.905535]])
+ [0.011179, 0.003194, 0.905535]]) # yapf: disable
"""
*CIE XYZ* tristimulus values to *V-Gamut* colourspace matrix.
@@ -99,7 +94,7 @@
V_GAMUT_TO_XYZ_MATRIX,
XYZ_TO_V_GAMUT_MATRIX,
log_encoding_VLog,
- log_decoding_VLog)
+ log_decoding_VLog) # yapf: disable
"""
*V-Gamut* colourspace.
diff --git a/colour/models/rgb/dataset/xtreme_rgb.py b/colour/models/rgb/dataset/xtreme_rgb.py
index 88a179b5f1..52cbe12f26 100644
--- a/colour/models/rgb/dataset/xtreme_rgb.py
+++ b/colour/models/rgb/dataset/xtreme_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Xtreme RGB Colourspace
======================
@@ -27,10 +26,8 @@
from functools import partial
from colour.colorimetry import ILLUMINANTS
-from colour.models.rgb import (
- RGB_Colourspace,
- gamma_function,
- normalised_primary_matrix)
+from colour.models.rgb import (RGB_Colourspace, function_gamma,
+ normalised_primary_matrix)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -39,17 +36,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['XTREME_RGB_PRIMARIES',
- 'XTREME_RGB_ILLUMINANT',
- 'XTREME_RGB_WHITEPOINT',
- 'XTREME_RGB_TO_XYZ_MATRIX',
- 'XYZ_TO_XTREME_RGB_MATRIX',
- 'XTREME_RGB_COLOURSPACE']
+__all__ = [
+ 'XTREME_RGB_PRIMARIES', 'XTREME_RGB_ILLUMINANT', 'XTREME_RGB_WHITEPOINT',
+ 'XTREME_RGB_TO_XYZ_MATRIX', 'XYZ_TO_XTREME_RGB_MATRIX',
+ 'XTREME_RGB_COLOURSPACE'
+]
XTREME_RGB_PRIMARIES = np.array(
[[1.0, 0.0],
[0.0, 1.0],
- [0.0, 0.0]])
+ [0.0, 0.0]]) # yapf: disable
"""
*Xtreme RGB* colourspace primaries.
@@ -71,8 +67,8 @@
XTREME_RGB_WHITEPOINT : ndarray
"""
-XTREME_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(
- XTREME_RGB_PRIMARIES, XTREME_RGB_WHITEPOINT)
+XTREME_RGB_TO_XYZ_MATRIX = normalised_primary_matrix(XTREME_RGB_PRIMARIES,
+ XTREME_RGB_WHITEPOINT)
"""
*Xtreme RGB* colourspace to *CIE XYZ* tristimulus values matrix.
@@ -93,8 +89,8 @@
XTREME_RGB_ILLUMINANT,
XTREME_RGB_TO_XYZ_MATRIX,
XYZ_TO_XTREME_RGB_MATRIX,
- partial(gamma_function, exponent=1 / 2.2),
- partial(gamma_function, exponent=2.2))
+ partial(function_gamma, exponent=1 / 2.2),
+ partial(function_gamma, exponent=2.2)) # yapf: disable
"""
*Xtreme RGB* colourspace.
diff --git a/colour/models/rgb/deprecated.py b/colour/models/rgb/deprecated.py
index d12315bde1..7505569bf9 100644
--- a/colour/models/rgb/deprecated.py
+++ b/colour/models/rgb/deprecated.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Deprecated Colour Models Transformations
========================================
@@ -50,14 +49,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RGB_to_HSV',
- 'HSV_to_RGB',
- 'RGB_to_HSL',
- 'HSL_to_RGB',
- 'RGB_to_CMY',
- 'CMY_to_RGB',
- 'CMY_to_CMYK',
- 'CMYK_to_CMY']
+__all__ = [
+ 'RGB_to_HSV', 'HSV_to_RGB', 'RGB_to_HSL', 'HSL_to_RGB', 'RGB_to_CMY',
+ 'CMY_to_RGB', 'CMY_to_CMYK', 'CMYK_to_CMY'
+]
def RGB_to_HSV(RGB):
@@ -160,14 +155,15 @@ def HSV_to_RGB(HSV):
i = tstack((i, i, i)).astype(np.uint8)
- RGB = np.choose(i,
- (tstack((V, l, j)),
- tstack((k, V, j)),
- tstack((j, V, l)),
- tstack((j, k, V)),
- tstack((l, j, V)),
- tstack((V, j, k))),
- mode='clip')
+ RGB = np.choose(
+ i,
+ (tstack((V, l, j)),
+ tstack((k, V, j)),
+ tstack((j, V, l)),
+ tstack((j, k, V)),
+ tstack((l, j, V)),
+ tstack((V, j, k))),
+ mode='clip') # yapf: disable
return RGB
@@ -211,8 +207,7 @@ def RGB_to_HSL(RGB):
L = (maximum + minimum) / 2
- S = np.where(L < 0.5,
- delta / (maximum + minimum),
+ S = np.where(L < 0.5, delta / (maximum + minimum),
delta / (2 - maximum - minimum))
S[np.asarray(delta == 0)] = 0
@@ -277,15 +272,13 @@ def H_to_RGB(vi, vj, vH):
v = np.full(vi.shape, np.nan)
- v = np.where(np.logical_and(6 * vH < 1, np.isnan(v)),
- vi + (vj - vi) * 6 * vH,
- v)
- v = np.where(np.logical_and(2 * vH < 1, np.isnan(v)),
- vj,
- v)
- v = np.where(np.logical_and(3 * vH < 2, np.isnan(v)),
- vi + (vj - vi) * ((2 / 3) - vH) * 6,
- v)
+ v = np.where(
+ np.logical_and(6 * vH < 1, np.isnan(v)),
+ vi + (vj - vi) * 6 * vH, v) # yapf: disable
+ v = np.where(np.logical_and(2 * vH < 1, np.isnan(v)), vj, v)
+ v = np.where(
+ np.logical_and(3 * vH < 2, np.isnan(v)),
+ vi + (vj - vi) * ((2 / 3) - vH) * 6, v)
v = np.where(np.isnan(v), vi, v)
return v
@@ -462,8 +455,6 @@ def CMYK_to_CMY(CMYK):
C, M, Y, K = tsplit(CMYK)
- CMY = tstack((C * (1 - K) + K,
- M * (1 - K) + K,
- Y * (1 - K) + K))
+ CMY = tstack((C * (1 - K) + K, M * (1 - K) + K, Y * (1 - K) + K))
return CMY
diff --git a/colour/models/rgb/derivation.py b/colour/models/rgb/derivation.py
index b8acf8f439..06573bfdbd 100644
--- a/colour/models/rgb/derivation.py
+++ b/colour/models/rgb/derivation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RGB Colourspace Derivation
==========================
@@ -43,12 +42,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['xy_to_z',
- 'normalised_primary_matrix',
- 'chromatically_adapted_primaries',
- 'primaries_whitepoint',
- 'RGB_luminance_equation',
- 'RGB_luminance']
+__all__ = [
+ 'xy_to_z', 'normalised_primary_matrix', 'chromatically_adapted_primaries',
+ 'primaries_whitepoint', 'RGB_luminance_equation', 'RGB_luminance'
+]
def xy_to_z(xy):
@@ -169,8 +166,7 @@ def chromatically_adapted_primaries(primaries,
XYZ_a = chromatic_adaptation_VonKries(
xy_to_XYZ(primaries),
xy_to_XYZ(whitepoint_t),
- xy_to_XYZ(whitepoint_r),
- chromatic_adaptation_transform)
+ xy_to_XYZ(whitepoint_r), chromatic_adaptation_transform)
P_a = XYZ_to_xyY(XYZ_a)[..., 0:2]
@@ -212,10 +208,9 @@ def primaries_whitepoint(npm):
npm = npm.reshape((3, 3))
- primaries = XYZ_to_xy(
- np.transpose(np.dot(npm, np.identity(3))))
- whitepoint = np.squeeze(XYZ_to_xy(
- np.transpose(np.dot(npm, np.ones((3, 1))))))
+ primaries = XYZ_to_xy(np.transpose(np.dot(npm, np.identity(3))))
+ whitepoint = np.squeeze(
+ XYZ_to_xy(np.transpose(np.dot(npm, np.ones((3, 1))))))
# TODO: Investigate if we return an ndarray here with primaries and
# whitepoint stacked together.
diff --git a/colour/models/rgb/ictcp.py b/colour/models/rgb/ictcp.py
index c8ba118e24..8ff9348ff5 100644
--- a/colour/models/rgb/ictcp.py
+++ b/colour/models/rgb/ictcp.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
:math:`IC_TC_P` Colour Encoding
===============================
@@ -41,17 +40,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ICTCP_RGB_TO_LMS_MATRIX',
- 'ICTCP_LMS_TO_RGB_MATRIX',
- 'ICTCP_LMS_P_TO_ICTCP_MATRIX',
- 'ICTCP_ICTCP_TO_LMS_P_MATRIX',
- 'RGB_to_ICTCP',
- 'ICTCP_to_RGB']
-
-ICTCP_RGB_TO_LMS_MATRIX = np.array([
- [1688, 2146, 262],
- [683, 2951, 462],
- [99, 309, 3688]]) / 4096
+__all__ = [
+ 'ICTCP_RGB_TO_LMS_MATRIX', 'ICTCP_LMS_TO_RGB_MATRIX',
+ 'ICTCP_LMS_P_TO_ICTCP_MATRIX', 'ICTCP_ICTCP_TO_LMS_P_MATRIX',
+ 'RGB_to_ICTCP', 'ICTCP_to_RGB'
+]
+
+ICTCP_RGB_TO_LMS_MATRIX = np.array(
+ [[1688, 2146, 262],
+ [683, 2951, 462],
+ [99, 309, 3688]]) / 4096 # yapf: disable
"""
*Rec. 2020* colourspace to normalised cone responses matrix.
@@ -66,10 +64,10 @@
ICTCP_LMS_TO_RGB_MATRIX : array_like, (3, 3)
"""
-ICTCP_LMS_P_TO_ICTCP_MATRIX = np.array([
- [2048, 2048, 0],
- [6610, -13613, 7003],
- [17933, -17390, -543]]) / 4096
+ICTCP_LMS_P_TO_ICTCP_MATRIX = np.array(
+ [[2048, 2048, 0],
+ [6610, -13613, 7003],
+ [17933, -17390, -543]]) / 4096 # yapf: disable
"""
:math:`LMS_p` *SMPTE ST 2084:2014* encoded normalised cone responses to
:math:`IC_TC_P` colour encoding matrix.
diff --git a/colour/models/rgb/prismatic.py b/colour/models/rgb/prismatic.py
new file mode 100644
index 0000000000..147f34628d
--- /dev/null
+++ b/colour/models/rgb/prismatic.py
@@ -0,0 +1,112 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Prismatic Colourspace
+=====================
+
+Defines the *Prismatic* colourspace transformations:
+
+- :func:`RGB_to_Prismatic`
+- :func:`Prismatic_to_RGB`
+
+See Also
+--------
+`Prismatic Colourspace Jupyter Notebook
+`_
+
+References
+----------
+.. [1] Shirley, P., & Hart, D. (2015). The prismatic color space for rgb
+ computations, 2–7.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.utilities import tsplit, tstack
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['RGB_to_Prismatic', 'Prismatic_to_RGB']
+
+
+def RGB_to_Prismatic(RGB):
+ """
+ Converts from *RGB* colourspace to *Prismatic* :math:`L\\rho\gamma\\beta`
+ colourspace array.
+
+ Parameters
+ ----------
+ RGB : array_like
+ *RGB* colourspace array.
+
+ Returns
+ -------
+ ndarray
+ *Prismatic* :math:`L\\rho\gamma\\beta` colourspace array.
+
+ Examples
+ --------
+ >>> RGB = np.array([0.25, 0.50, 0.75])
+ >>> RGB_to_Prismatic(RGB) # doctest: +ELLIPSIS
+ array([ 0.75... , 0.1666666..., 0.3333333..., 0.5... ])
+
+ Adjusting saturation of given *RGB* colourspace array:
+ >>> saturation = 0.5
+ >>> Lrgb = RGB_to_Prismatic(RGB)
+ >>> Lrgb[..., 1:] = 1 / 3 + saturation * (Lrgb[..., 1:] - 1 / 3)
+ >>> Prismatic_to_RGB(Lrgb) # doctest: +ELLIPSIS
+ array([ 0.45..., 0.6..., 0.75...])
+ """
+
+ RGB = np.asarray(RGB)
+
+ L = np.max(RGB, axis=-1)
+ s = np.sum(RGB, axis=-1)[..., np.newaxis]
+ one_s = 1 / s
+ # Handling zero-division *NaNs*.
+ one_s[s == 0] = 0
+ r, g, b = tsplit(one_s * RGB)
+
+ return tstack((L, r, g, b))
+
+
+def Prismatic_to_RGB(Lrgb):
+ """
+ Converts from *Prismatic* :math:`L\\rho\gamma\\beta` colourspace array to
+ *RGB* colourspace.
+
+ Parameters
+ ----------
+ Lrgb : array_like
+ *Prismatic* :math:`L\\rho\gamma\\beta` colourspace array.
+
+ Returns
+ -------
+ ndarray
+ *RGB* colourspace array.
+
+ Examples
+ --------
+ >>> Lrgb = np.array([0.75000000, 0.16666667, 0.33333333, 0.50000000])
+ >>> Prismatic_to_RGB(Lrgb) # doctest: +ELLIPSIS
+ array([ 0.25... , 0.4999999..., 0.75... ])
+ """
+
+ Lrgb = np.asarray(Lrgb)
+
+ rgb = Lrgb[..., 1:]
+ m = np.max(rgb, axis=-1)[..., np.newaxis]
+ RGB = Lrgb[..., 0][..., np.newaxis] / m
+ # Handling zero-division *NaNs*.
+ RGB[m == 0] = 0
+ RGB = RGB * rgb
+
+ return RGB
diff --git a/colour/models/rgb/rgb_colourspace.py b/colour/models/rgb/rgb_colourspace.py
index 8d9c9b3273..96cd703511 100644
--- a/colour/models/rgb/rgb_colourspace.py
+++ b/colour/models/rgb/rgb_colourspace.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RGB Colourspace & Transformations
=================================
@@ -25,10 +24,7 @@
import numpy as np
-from colour.models import (
- xy_to_XYZ,
- xy_to_xyY,
- xyY_to_XYZ)
+from colour.models import (xy_to_XYZ, xy_to_xyY, xyY_to_XYZ)
from colour.models.rgb import normalised_primary_matrix
from colour.adaptation import chromatic_adaptation_matrix_VonKries
from colour.utilities import dot_matrix, dot_vector, is_string
@@ -40,11 +36,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RGB_Colourspace',
- 'XYZ_to_RGB',
- 'RGB_to_XYZ',
- 'RGB_to_RGB_matrix',
- 'RGB_to_RGB']
+__all__ = [
+ 'RGB_Colourspace', 'XYZ_to_RGB', 'RGB_to_XYZ', 'RGB_to_RGB_matrix',
+ 'RGB_to_RGB'
+]
class RGB_Colourspace(object):
@@ -272,8 +267,8 @@ def name(self, value):
if value is not None:
assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('name', value))
+ ('"{0}" attribute: "{1}" is not a "string" like object!'
+ ).format('name', value))
self._name = value
@property
@@ -331,9 +326,9 @@ def whitepoint(self, value):
"""
if value is not None:
- assert isinstance(value, (tuple, list, np.ndarray, np.matrix)), (
- ('"{0}" attribute: "{1}" is not a "tuple", "list", "ndarray" '
- 'or "matrix" instance!').format('whitepoint', value))
+ assert isinstance(value, (tuple, list, np.ndarray, np.matrix)), ((
+ '"{0}" attribute: "{1}" is not a "tuple", "list", "ndarray" '
+ 'or "matrix" instance!').format('whitepoint', value))
value = np.asarray(value)
self._whitepoint = value
@@ -364,9 +359,9 @@ def illuminant(self, value):
"""
if value is not None:
- assert is_string(value), (
- ('"{0}" attribute: "{1}" is not a '
- '"string" like object!').format('illuminant', value))
+ assert is_string(value), (('"{0}" attribute: "{1}" is not a '
+ '"string" like object!').format(
+ 'illuminant', value))
self._illuminant = value
@property
@@ -456,8 +451,9 @@ def encoding_cctf(self, value):
"""
if value is not None:
- assert hasattr(value, '__call__'), (
- '"{0}" attribute: "{1}" is not callable!'.format(
+ assert hasattr(
+ value,
+ '__call__'), ('"{0}" attribute: "{1}" is not callable!'.format(
'encoding_cctf', value))
self._encoding_cctf = value
@@ -486,8 +482,9 @@ def decoding_cctf(self, value):
"""
if value is not None:
- assert hasattr(value, '__call__'), (
- '"{0}" attribute: "{1}" is not callable!'.format(
+ assert hasattr(
+ value,
+ '__call__'), ('"{0}" attribute: "{1}" is not callable!'.format(
'decoding_cctf', value))
self._decoding_cctf = value
@@ -553,8 +550,8 @@ def _derive_transformation_matrices(self):
if hasattr(self, '_primaries') and hasattr(self, '_whitepoint'):
if self._primaries is not None and self._whitepoint is not None:
- npm = normalised_primary_matrix(
- self._primaries, self._whitepoint)
+ npm = normalised_primary_matrix(self._primaries,
+ self._whitepoint)
self._derived_RGB_to_XYZ_matrix = npm
self._derived_XYZ_to_RGB_matrix = np.linalg.inv(npm)
@@ -810,10 +807,10 @@ def RGB_to_RGB(RGB,
'Bianco PC'}**,
*Chromatic adaptation* transform.
apply_decoding_cctf : bool, optional
- Apply input colourpace decoding colour component transfer function /
+ Apply input colourspace decoding colour component transfer function /
electro-optical transfer function.
apply_encoding_cctf : bool, optional
- Apply output colourpace encoding colour component transfer function /
+ Apply output colourspace encoding colour component transfer function /
opto-electronic transfer function.
Returns
@@ -841,8 +838,7 @@ def RGB_to_RGB(RGB,
if apply_decoding_cctf:
RGB = input_colourspace.decoding_cctf(RGB)
- M = RGB_to_RGB_matrix(input_colourspace,
- output_colourspace,
+ M = RGB_to_RGB_matrix(input_colourspace, output_colourspace,
chromatic_adaptation_transform)
RGB = dot_vector(M, RGB)
diff --git a/colour/models/rgb/tests/tests_aces_it.py b/colour/models/rgb/tests/tests_aces_it.py
index 4416e1914e..963f761863 100644
--- a/colour/models/rgb/tests/tests_aces_it.py
+++ b/colour/models/rgb/tests/tests_aces_it.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.aces_it` module.
"""
@@ -47,8 +46,7 @@ def test_spectral_to_aces_relative_exposure_values(self):
spectral_to_aces_relative_exposure_values(perfect_reflector),
np.array([0.97783784, 0.97783784, 0.97783784]))
- dark_skin = (
- COLOURCHECKERS_SPDS['ColorChecker N Ohta']['dark skin'])
+ dark_skin = (COLOURCHECKERS_SPDS['ColorChecker N Ohta']['dark skin'])
np.testing.assert_almost_equal(
spectral_to_aces_relative_exposure_values(dark_skin),
np.array([0.11876978, 0.08708666, 0.0589442]))
diff --git a/colour/models/rgb/tests/tests_common.py b/colour/models/rgb/tests/tests_common.py
index 1114470275..bf7f5aedf2 100644
--- a/colour/models/rgb/tests/tests_common.py
+++ b/colour/models/rgb/tests/tests_common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.common` module.
"""
@@ -44,26 +43,30 @@ def test_XYZ_to_sRGB(self):
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_sRGB(np.array([0.00000000, 0.00000000, 0.00000000]),
- np.array([0.44757, 0.40745])),
+ XYZ_to_sRGB(
+ np.array([0.00000000, 0.00000000, 0.00000000]),
+ np.array([0.44757, 0.40745])),
np.array([0.00000000, 0.00000000, 0.00000000]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_sRGB(np.array([0.11805834, 0.10340000, 0.05150892]),
- np.array([0.31270, 0.32900])),
+ XYZ_to_sRGB(
+ np.array([0.11805834, 0.10340000, 0.05150892]),
+ np.array([0.31270, 0.32900])),
np.array([0.48221920, 0.31656152, 0.22070695]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_sRGB(np.array([0.07049534, 0.10080000, 0.09558313]),
- chromatic_adaptation_transform='Bradford'),
+ XYZ_to_sRGB(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ chromatic_adaptation_transform='Bradford'),
np.array([0.17498817, 0.38819472, 0.32160312]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_sRGB(np.array([0.07049534, 0.10080000, 0.09558313]),
- apply_encoding_cctf=False),
+ XYZ_to_sRGB(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ apply_encoding_cctf=False),
np.array([0.02583969, 0.12474440, 0.08439476]),
decimal=7)
@@ -90,26 +93,30 @@ def test_sRGB_to_XYZ(self):
decimal=7)
np.testing.assert_almost_equal(
- sRGB_to_XYZ(np.array([0.00000000, 0.00000000, 0.00000000]),
- np.array([0.44757, 0.40745])),
+ sRGB_to_XYZ(
+ np.array([0.00000000, 0.00000000, 0.00000000]),
+ np.array([0.44757, 0.40745])),
np.array([0.00000000, 0.00000000, 0.00000000]),
decimal=7)
np.testing.assert_almost_equal(
- sRGB_to_XYZ(np.array([0.48222001, 0.31654775, 0.22070353]),
- np.array([0.31270, 0.32900])),
+ sRGB_to_XYZ(
+ np.array([0.48222001, 0.31654775, 0.22070353]),
+ np.array([0.31270, 0.32900])),
np.array([0.11805834, 0.10340000, 0.05150892]),
decimal=7)
np.testing.assert_almost_equal(
- sRGB_to_XYZ(np.array([0.17498172, 0.38818743, 0.32159978]),
- chromatic_adaptation_method='Bradford'),
+ sRGB_to_XYZ(
+ np.array([0.17498172, 0.38818743, 0.32159978]),
+ chromatic_adaptation_method='Bradford'),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- sRGB_to_XYZ(np.array([0.02583795, 0.12473949, 0.08439296]),
- apply_decoding_cctf=False),
+ sRGB_to_XYZ(
+ np.array([0.02583795, 0.12473949, 0.08439296]),
+ apply_decoding_cctf=False),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
diff --git a/colour/models/rgb/tests/tests_deprecated.py b/colour/models/rgb/tests/tests_deprecated.py
index 5ce7e58c0d..bc3c59fd4a 100644
--- a/colour/models/rgb/tests/tests_deprecated.py
+++ b/colour/models/rgb/tests/tests_deprecated.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.deprecated` module.
"""
@@ -11,15 +10,9 @@
import unittest
from itertools import permutations
-from colour.models.rgb.deprecated import (
- RGB_to_HSV,
- HSV_to_RGB,
- RGB_to_HSL,
- HSL_to_RGB,
- RGB_to_CMY,
- CMY_to_RGB,
- CMY_to_CMYK,
- CMYK_to_CMY)
+from colour.models.rgb.deprecated import (RGB_to_HSV, HSV_to_RGB, RGB_to_HSL,
+ HSL_to_RGB, RGB_to_CMY, CMY_to_RGB,
+ CMY_to_CMYK, CMYK_to_CMY)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -29,14 +22,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_to_HSV',
- 'TestHSV_to_RGB',
- 'TestRGB_to_HSL',
- 'TestHSL_to_RGB',
- 'TestRGB_to_CMY',
- 'TestCMY_to_RGB',
- 'TestCMY_to_CMYK',
- 'TestCMYK_to_CMY']
+__all__ = [
+ 'TestRGB_to_HSV', 'TestHSV_to_RGB', 'TestRGB_to_HSL', 'TestHSL_to_RGB',
+ 'TestRGB_to_CMY', 'TestCMY_to_RGB', 'TestCMY_to_CMYK', 'TestCMYK_to_CMY'
+]
class TestRGB_to_HSV(unittest.TestCase):
@@ -73,24 +62,15 @@ def test_n_dimensional_RGB_to_HSV(self):
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
HSV = np.array([0.27272727, 0.91666667, 0.6])
- np.testing.assert_almost_equal(
- RGB_to_HSV(RGB),
- HSV,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSV(RGB), HSV, decimal=7)
RGB = np.tile(RGB, (6, 1))
HSV = np.tile(HSV, (6, 1))
- np.testing.assert_almost_equal(
- RGB_to_HSV(RGB),
- HSV,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSV(RGB), HSV, decimal=7)
RGB = np.reshape(RGB, (2, 3, 3))
HSV = np.reshape(HSV, (2, 3, 3))
- np.testing.assert_almost_equal(
- RGB_to_HSV(RGB),
- HSV,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSV(RGB), HSV, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_HSV(self):
@@ -140,24 +120,15 @@ def test_n_dimensional_HSV_to_RGB(self):
HSV = np.array([0.27272727, 0.91666667, 0.60000000])
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
- np.testing.assert_almost_equal(
- HSV_to_RGB(HSV),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSV_to_RGB(HSV), RGB, decimal=7)
HSV = np.tile(HSV, (6, 1))
RGB = np.tile(RGB, (6, 1))
- np.testing.assert_almost_equal(
- HSV_to_RGB(HSV),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSV_to_RGB(HSV), RGB, decimal=7)
HSV = np.reshape(HSV, (2, 3, 3))
RGB = np.reshape(RGB, (2, 3, 3))
- np.testing.assert_almost_equal(
- HSV_to_RGB(HSV),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSV_to_RGB(HSV), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_HSV_to_RGB(self):
@@ -207,24 +178,15 @@ def test_n_dimensional_RGB_to_HSL(self):
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
HSL = np.array([0.27272727, 0.84615385, 0.325])
- np.testing.assert_almost_equal(
- RGB_to_HSL(RGB),
- HSL,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSL(RGB), HSL, decimal=7)
RGB = np.tile(RGB, (6, 1))
HSL = np.tile(HSL, (6, 1))
- np.testing.assert_almost_equal(
- RGB_to_HSL(RGB),
- HSL,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSL(RGB), HSL, decimal=7)
RGB = np.reshape(RGB, (2, 3, 3))
HSL = np.reshape(HSL, (2, 3, 3))
- np.testing.assert_almost_equal(
- RGB_to_HSL(RGB),
- HSL,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_HSL(RGB), HSL, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_HSL(self):
@@ -274,24 +236,15 @@ def test_n_dimensional_HSL_to_RGB(self):
HSL = np.array([0.27272727, 0.84615385, 0.32500000])
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
- np.testing.assert_almost_equal(
- HSL_to_RGB(HSL),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSL_to_RGB(HSL), RGB, decimal=7)
HSL = np.tile(HSL, (6, 1))
RGB = np.tile(RGB, (6, 1))
- np.testing.assert_almost_equal(
- HSL_to_RGB(HSL),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSL_to_RGB(HSL), RGB, decimal=7)
HSL = np.reshape(HSL, (2, 3, 3))
RGB = np.reshape(RGB, (2, 3, 3))
- np.testing.assert_almost_equal(
- HSL_to_RGB(HSL),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(HSL_to_RGB(HSL), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_HSL_to_RGB(self):
@@ -341,24 +294,15 @@ def test_n_dimensional_RGB_to_CMY(self):
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
CMY = np.array([0.75000000, 0.40000000, 0.95000000])
- np.testing.assert_almost_equal(
- RGB_to_CMY(RGB),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_CMY(RGB), CMY, decimal=7)
RGB = np.tile(RGB, (6, 1))
CMY = np.tile(CMY, (6, 1))
- np.testing.assert_almost_equal(
- RGB_to_CMY(RGB),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_CMY(RGB), CMY, decimal=7)
RGB = np.reshape(RGB, (2, 3, 3))
CMY = np.reshape(CMY, (2, 3, 3))
- np.testing.assert_almost_equal(
- RGB_to_CMY(RGB),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_CMY(RGB), CMY, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_CMY(self):
@@ -408,24 +352,15 @@ def test_n_dimensional_CMY_to_RGB(self):
CMY = np.array([0.75000000, 0.40000000, 0.95000000])
RGB = np.array([0.25000000, 0.60000000, 0.05000000])
- np.testing.assert_almost_equal(
- CMY_to_RGB(CMY),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_RGB(CMY), RGB, decimal=7)
CMY = np.tile(CMY, (6, 1))
RGB = np.tile(RGB, (6, 1))
- np.testing.assert_almost_equal(
- CMY_to_RGB(CMY),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_RGB(CMY), RGB, decimal=7)
CMY = np.reshape(CMY, (2, 3, 3))
RGB = np.reshape(RGB, (2, 3, 3))
- np.testing.assert_almost_equal(
- CMY_to_RGB(CMY),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_RGB(CMY), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_CMY_to_RGB(self):
@@ -475,24 +410,15 @@ def test_n_dimensional_CMY_to_CMYK(self):
CMY = np.array([0.75000000, 0.40000000, 0.95000000])
CMYK = np.array([0.58333333, 0.00000000, 0.91666667, 0.40000000])
- np.testing.assert_almost_equal(
- CMY_to_CMYK(CMY),
- CMYK,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_CMYK(CMY), CMYK, decimal=7)
CMY = np.tile(CMY, (6, 1))
CMYK = np.tile(CMYK, (6, 1))
- np.testing.assert_almost_equal(
- CMY_to_CMYK(CMY),
- CMYK,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_CMYK(CMY), CMYK, decimal=7)
CMY = np.reshape(CMY, (2, 3, 3))
CMYK = np.reshape(CMYK, (2, 3, 4))
- np.testing.assert_almost_equal(
- CMY_to_CMYK(CMY),
- CMYK,
- decimal=7)
+ np.testing.assert_almost_equal(CMY_to_CMYK(CMY), CMYK, decimal=7)
@ignore_numpy_errors
def test_nan_CMY_to_CMYK(self):
@@ -520,26 +446,20 @@ def test_CMYK_to_CMY(self):
"""
np.testing.assert_almost_equal(
- CMYK_to_CMY(np.array([0.58333333,
- 0.00000000,
- 0.91666667,
- 0.40000000])),
+ CMYK_to_CMY(
+ np.array([0.58333333, 0.00000000, 0.91666667, 0.40000000])),
np.array([0.75000000, 0.40000000, 0.95000000]),
decimal=7)
np.testing.assert_almost_equal(
- CMYK_to_CMY(np.array([0.00000000,
- 1.00000000,
- 1.00000000,
- 0.15000000])),
+ CMYK_to_CMY(
+ np.array([0.00000000, 1.00000000, 1.00000000, 0.15000000])),
np.array([0.15000000, 1.00000000, 1.00000000]),
decimal=7)
np.testing.assert_almost_equal(
- CMYK_to_CMY(np.array([0.15000000,
- 0.00000000,
- 0.00000000,
- 0.00000000])),
+ CMYK_to_CMY(
+ np.array([0.15000000, 0.00000000, 0.00000000, 0.00000000])),
np.array([0.15000000, 0.00000000, 0.00000000]),
decimal=7)
@@ -549,29 +469,17 @@ def test_n_dimensional_CMYK_to_CMY(self):
n-dimensional arrays support.
"""
- CMYK = np.array([0.58333333,
- 0.00000000,
- 0.91666667,
- 0.40000000])
+ CMYK = np.array([0.58333333, 0.00000000, 0.91666667, 0.40000000])
CMY = np.array([0.75000000, 0.40000000, 0.95000000])
- np.testing.assert_almost_equal(
- CMYK_to_CMY(CMYK),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(CMYK_to_CMY(CMYK), CMY, decimal=7)
CMYK = np.tile(CMYK, (6, 1))
CMY = np.tile(CMY, (6, 1))
- np.testing.assert_almost_equal(
- CMYK_to_CMY(CMYK),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(CMYK_to_CMY(CMYK), CMY, decimal=7)
CMYK = np.reshape(CMYK, (2, 3, 4))
CMY = np.reshape(CMY, (2, 3, 3))
- np.testing.assert_almost_equal(
- CMYK_to_CMY(CMYK),
- CMY,
- decimal=7)
+ np.testing.assert_almost_equal(CMYK_to_CMY(CMYK), CMY, decimal=7)
@ignore_numpy_errors
def test_nan_CMYK_to_CMY(self):
diff --git a/colour/models/rgb/tests/tests_derivation.py b/colour/models/rgb/tests/tests_derivation.py
index 91f45468b1..0f5dc81f3c 100644
--- a/colour/models/rgb/tests/tests_derivation.py
+++ b/colour/models/rgb/tests/tests_derivation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.derivation` module.
"""
@@ -14,11 +13,8 @@
from six import text_type
from colour.models import (
- normalised_primary_matrix,
- chromatically_adapted_primaries,
- primaries_whitepoint,
- RGB_luminance_equation,
- RGB_luminance)
+ normalised_primary_matrix, chromatically_adapted_primaries,
+ primaries_whitepoint, RGB_luminance_equation, RGB_luminance)
from colour.models.rgb.derivation import xy_to_z
from colour.utilities import ignore_numpy_errors
@@ -29,12 +25,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['Testxy_to_z',
- 'TestNormalisedPrimaryMatrix',
- 'TestChromaticallyAdaptedPrimaries',
- 'TestPrimariesWhitepoint',
- 'TestRGBLuminanceEquation',
- 'TestRGBLuminance']
+__all__ = [
+ 'Testxy_to_z', 'TestNormalisedPrimaryMatrix',
+ 'TestChromaticallyAdaptedPrimaries', 'TestPrimariesWhitepoint',
+ 'TestRGBLuminanceEquation', 'TestRGBLuminance'
+]
class Testxy_to_z(unittest.TestCase):
@@ -49,19 +44,13 @@ def test_xy_to_z(self):
"""
np.testing.assert_almost_equal(
- xy_to_z(np.array([0.2500, 0.2500])),
- 0.50000000,
- decimal=7)
+ xy_to_z(np.array([0.2500, 0.2500])), 0.50000000, decimal=7)
np.testing.assert_almost_equal(
- xy_to_z(np.array([0.0001, -0.0770])),
- 1.07690000,
- decimal=7)
+ xy_to_z(np.array([0.0001, -0.0770])), 1.07690000, decimal=7)
np.testing.assert_almost_equal(
- xy_to_z(np.array([0.0000, 1.0000])),
- 0.00000000,
- decimal=7)
+ xy_to_z(np.array([0.0000, 1.0000])), 0.00000000, decimal=7)
def test_n_dimensional_xy_to_z(self):
"""
@@ -71,24 +60,17 @@ def test_n_dimensional_xy_to_z(self):
xy = np.array([0.25, 0.25])
z = 0.5
- np.testing.assert_almost_equal(
- xy_to_z(xy),
- z,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_z(xy), z, decimal=7)
xy = np.tile(xy, (6, 1))
- z = np.tile(z, 6, )
- np.testing.assert_almost_equal(
- xy_to_z(xy),
+ z = np.tile(
z,
- decimal=7)
+ 6, )
+ np.testing.assert_almost_equal(xy_to_z(xy), z, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
z = np.reshape(z, (2, 3))
- np.testing.assert_almost_equal(
- xy_to_z(xy),
- z,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_z(xy), z, decimal=7)
@ignore_numpy_errors
def test_nan_xy_to_z(self):
@@ -117,25 +99,24 @@ def test_normalised_primary_matrix(self):
np.testing.assert_almost_equal(
normalised_primary_matrix(
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
np.array([0.32168, 0.33767])),
- np.array([[0.95255240, 0.00000000, 0.00009368],
- [0.34396645, 0.72816610, -0.07213255],
- [0.00000000, 0.00000000, 1.00882518]]),
- decimal=7)
+ np.array(
+ [[0.95255240, 0.00000000, 0.00009368],
+ [0.34396645, 0.72816610, -0.07213255],
+ [0.00000000, 0.00000000, 1.00882518]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
normalised_primary_matrix(
- np.array([0.640, 0.330,
- 0.300, 0.600,
- 0.150, 0.060]),
+ np.array([0.640, 0.330, 0.300, 0.600, 0.150, 0.060]),
np.array([0.3127, 0.3290])),
- np.array([[0.41239080, 0.35758434, 0.18048079],
- [0.21263901, 0.71516868, 0.07219232],
- [0.01933082, 0.11919478, 0.95053215]]),
- decimal=7)
+ np.array(
+ [[0.41239080, 0.35758434, 0.18048079],
+ [0.21263901, 0.71516868, 0.07219232],
+ [0.01933082, 0.11919478, 0.95053215]]),
+ decimal=7) # yapf: disable
@ignore_numpy_errors
def test_nan_normalised_primary_matrix(self):
@@ -172,40 +153,35 @@ def test_chromatically_adapted_primaries(self):
np.testing.assert_almost_equal(
chromatically_adapted_primaries(
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
- np.array([0.32168, 0.33767]),
- np.array([0.34570, 0.35850])),
- np.array([[0.73431182, 0.26694964],
- [0.02211963, 0.98038009],
- [-0.05880375, -0.12573056]]),
- decimal=7)
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
+ np.array([0.32168, 0.33767]), np.array([0.34570, 0.35850])),
+ np.array(
+ [[0.73431182, 0.26694964],
+ [0.02211963, 0.98038009],
+ [-0.05880375, -0.12573056]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatically_adapted_primaries(
- np.array([0.640, 0.330,
- 0.300, 0.600,
- 0.150, 0.060]),
- np.array([0.31270, 0.32900]),
- np.array([0.34570, 0.35850])),
- np.array([[0.64922534, 0.33062196],
- [0.32425276, 0.60237128],
- [0.15236177, 0.06118676]]),
- decimal=7)
+ np.array([0.640, 0.330, 0.300, 0.600, 0.150, 0.060]),
+ np.array([0.31270, 0.32900]), np.array([0.34570, 0.35850])),
+ np.array(
+ [[0.64922534, 0.33062196],
+ [0.32425276, 0.60237128],
+ [0.15236177, 0.06118676]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
chromatically_adapted_primaries(
- np.array([0.640, 0.330,
- 0.300, 0.600,
- 0.150, 0.060]),
+ np.array([0.640, 0.330, 0.300, 0.600, 0.150, 0.060]),
np.array([0.31270, 0.32900]),
- np.array([0.34570, 0.35850]),
- 'Bradford'),
- np.array([[0.64844144, 0.33085331],
- [0.32119518, 0.59784434],
- [0.15589322, 0.06604921]]),
- decimal=7)
+ np.array([0.34570, 0.35850]), 'Bradford'),
+ np.array(
+ [[0.64844144, 0.33085331],
+ [0.32119518, 0.59784434],
+ [0.15589322, 0.06604921]]),
+ decimal=7) # yapf: disable
@ignore_numpy_errors
def test_nan_chromatically_adapted_primaries(self):
@@ -234,35 +210,35 @@ def test_primaries_whitepoint(self):
definition.
"""
- P, W = primaries_whitepoint(np.array(
- [[0.95255240, 0.00000000, 0.00009368],
- [0.34396645, 0.72816610, -0.07213255],
- [0.00000000, 0.00000000, 1.00882518]]))
+ P, W = primaries_whitepoint(
+ np.array(
+ [[0.95255240, 0.00000000, 0.00009368],
+ [0.34396645, 0.72816610, -0.07213255],
+ [0.00000000, 0.00000000, 1.00882518]])) # yapf: disable
np.testing.assert_almost_equal(
P,
- np.array([[0.73470, 0.26530],
- [0.00000, 1.00000],
- [0.00010, -0.07700]]),
- decimal=7)
+ np.array(
+ [[0.73470, 0.26530],
+ [0.00000, 1.00000],
+ [0.00010, -0.07700]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
- W,
- np.array([0.32168, 0.33767]),
- decimal=7)
+ W, np.array([0.32168, 0.33767]), decimal=7)
P, W = primaries_whitepoint(
- np.array([[0.41240000, 0.35760000, 0.18050000],
- [0.21260000, 0.71520000, 0.07220000],
- [0.01930000, 0.11920000, 0.95050000]]))
+ np.array(
+ [[0.41240000, 0.35760000, 0.18050000],
+ [0.21260000, 0.71520000, 0.07220000],
+ [0.01930000, 0.11920000, 0.95050000]])) # yapf: disable
np.testing.assert_almost_equal(
P,
- np.array([[0.64007450, 0.32997051],
- [0.30000000, 0.60000000],
- [0.15001662, 0.06000665]]),
- decimal=7)
+ np.array(
+ [[0.64007450, 0.32997051],
+ [0.30000000, 0.60000000],
+ [0.15001662, 0.06000665]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
- W,
- np.array([0.31271591, 0.32900148]),
- decimal=7)
+ W, np.array([0.31271591, 0.32900148]), decimal=7)
@ignore_numpy_errors
def test_nan_primaries_whitepoint(self):
@@ -292,22 +268,19 @@ def test_RGB_luminance_equation(self):
self.assertIsInstance(
RGB_luminance_equation(
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
- np.array([0.32168, 0.33767])),
- text_type)
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
+ np.array([0.32168, 0.33767])), text_type)
- self.assertTrue(re.match(
- # TODO: Simplify that monster.
- ('Y\s?=\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.'
- '\(R\)\s?[+-]\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.'
- '\(G\)\s?[+-]\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.\(B\)'),
- RGB_luminance_equation(
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
- np.array([0.32168, 0.33767]))))
+ # TODO: Simplify that monster.
+ pattern = ('Y\s?=\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.'
+ '\(R\)\s?[+-]\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.'
+ '\(G\)\s?[+-]\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?.'
+ '\(B\)')
+ P = np.array([0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700])
+ self.assertTrue(
+ re.match(pattern,
+ RGB_luminance_equation(P, np.array([0.32168, 0.33767]))))
class TestRGBLuminance(unittest.TestCase):
@@ -325,9 +298,8 @@ def test_RGB_luminance(self):
self.assertAlmostEqual(
RGB_luminance(
np.array([50.0, 50.0, 50.0]),
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
np.array([0.32168, 0.33767])),
50.00000000,
places=7)
@@ -335,9 +307,8 @@ def test_RGB_luminance(self):
self.assertAlmostEqual(
RGB_luminance(
np.array([74.6, 16.1, 100.0]),
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
np.array([0.32168, 0.33767])),
30.17011667,
places=7)
@@ -345,9 +316,8 @@ def test_RGB_luminance(self):
self.assertAlmostEqual(
RGB_luminance(
np.array([40.6, 4.2, 67.4]),
- np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
+ np.array(
+ [0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
np.array([0.32168, 0.33767])),
12.16160184,
places=7)
@@ -359,26 +329,18 @@ def test_n_dimensional_RGB_luminance(self):
"""
RGB = np.array([50.0, 50.0, 50.0]),
- P = np.array([0.73470, 0.26530,
- 0.00000, 1.00000,
- 0.00010, -0.07700]),
+ P = np.array([0.73470, 0.26530, 0.00000, 1.00000, 0.00010, -0.07700]),
W = np.array([0.32168, 0.33767])
Y = 50
- np.testing.assert_almost_equal(
- RGB_luminance(RGB, P, W),
- Y)
+ np.testing.assert_almost_equal(RGB_luminance(RGB, P, W), Y)
RGB = np.tile(RGB, (6, 1))
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- RGB_luminance(RGB, P, W),
- Y)
+ np.testing.assert_almost_equal(RGB_luminance(RGB, P, W), Y)
RGB = np.reshape(RGB, (2, 3, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- RGB_luminance(RGB, P, W),
- Y)
+ np.testing.assert_almost_equal(RGB_luminance(RGB, P, W), Y)
@ignore_numpy_errors
def test_nan_RGB_luminance(self):
diff --git a/colour/models/rgb/tests/tests_ictcp.py b/colour/models/rgb/tests/tests_ictcp.py
index fb7654f009..183c41f26b 100644
--- a/colour/models/rgb/tests/tests_ictcp.py
+++ b/colour/models/rgb/tests/tests_ictcp.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.ictpt` module.
"""
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_to_ICTCP',
- 'TestICTCP_to_RGB']
+__all__ = ['TestRGB_to_ICTCP', 'TestICTCP_to_RGB']
class TestRGB_to_ICTCP(unittest.TestCase):
@@ -42,16 +40,12 @@ def test_RGB_to_ICTCP(self):
decimal=7)
np.testing.assert_almost_equal(
- RGB_to_ICTCP(
- np.array([0.35181454, 0.26934757, 0.21288023]),
- 4000),
+ RGB_to_ICTCP(np.array([0.35181454, 0.26934757, 0.21288023]), 4000),
np.array([0.13385341, -0.01151831, 0.01780776]),
decimal=7)
np.testing.assert_almost_equal(
- RGB_to_ICTCP(
- np.array([0.35181454, 0.26934757, 0.21288023]),
- 1000),
+ RGB_to_ICTCP(np.array([0.35181454, 0.26934757, 0.21288023]), 1000),
np.array([0.21071460, -0.01586417, 0.02421400]),
decimal=7)
@@ -63,24 +57,15 @@ def test_n_dimensional_RGB_to_ICTCP(self):
RGB = np.array([0.35181454, 0.26934757, 0.21288023])
ICTCP = np.array([0.09554079, -0.00890639, 0.01389286])
- np.testing.assert_almost_equal(
- RGB_to_ICTCP(RGB),
- ICTCP,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_ICTCP(RGB), ICTCP, decimal=7)
RGB = np.tile(RGB, (6, 1))
ICTCP = np.tile(ICTCP, (6, 1))
- np.testing.assert_almost_equal(
- RGB_to_ICTCP(RGB),
- ICTCP,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_ICTCP(RGB), ICTCP, decimal=7)
RGB = np.reshape(RGB, (2, 3, 3))
ICTCP = np.reshape(ICTCP, (2, 3, 3))
- np.testing.assert_almost_equal(
- RGB_to_ICTCP(RGB),
- ICTCP,
- decimal=7)
+ np.testing.assert_almost_equal(RGB_to_ICTCP(RGB), ICTCP, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_ICTCP(self):
@@ -114,15 +99,13 @@ def test_ICTCP_to_RGB(self):
np.testing.assert_almost_equal(
ICTCP_to_RGB(
- np.array([0.13385341, -0.01151831, 0.01780776]),
- 4000),
+ np.array([0.13385341, -0.01151831, 0.01780776]), 4000),
np.array([0.35181454, 0.26934757, 0.21288023]),
decimal=7)
np.testing.assert_almost_equal(
ICTCP_to_RGB(
- np.array([0.21071460, -0.01586417, 0.02421400]),
- 1000),
+ np.array([0.21071460, -0.01586417, 0.02421400]), 1000),
np.array([0.35181454, 0.26934757, 0.21288023]),
decimal=7)
@@ -134,24 +117,15 @@ def test_n_dimensional_ICTCP_to_RGB(self):
ICTCP = np.array([0.09554079, -0.00890639, 0.01389286])
RGB = np.array([0.35181454, 0.26934757, 0.21288023])
- np.testing.assert_almost_equal(
- ICTCP_to_RGB(ICTCP),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(ICTCP_to_RGB(ICTCP), RGB, decimal=7)
ICTCP = np.tile(ICTCP, (6, 1))
RGB = np.tile(RGB, (6, 1))
- np.testing.assert_almost_equal(
- ICTCP_to_RGB(ICTCP),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(ICTCP_to_RGB(ICTCP), RGB, decimal=7)
ICTCP = np.reshape(ICTCP, (2, 3, 3))
RGB = np.reshape(RGB, (2, 3, 3))
- np.testing.assert_almost_equal(
- ICTCP_to_RGB(ICTCP),
- RGB,
- decimal=7)
+ np.testing.assert_almost_equal(ICTCP_to_RGB(ICTCP), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_ICTCP_to_RGB(self):
diff --git a/colour/models/rgb/tests/tests_prismatic.py b/colour/models/rgb/tests/tests_prismatic.py
new file mode 100644
index 0000000000..702c0861a5
--- /dev/null
+++ b/colour/models/rgb/tests/tests_prismatic.py
@@ -0,0 +1,134 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.rgb.prismatic` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+from itertools import permutations
+
+from colour.models.rgb import RGB_to_Prismatic, Prismatic_to_RGB
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestRGB_to_Prismatic', 'TestPrismatic_to_RGB']
+
+
+class TestRGB_to_Prismatic(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.prismatic.TestRGB_to_Prismatic` definition
+ unit tests methods.
+ """
+
+ def test_RGB_to_Prismatic(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.RGB_to_Prismatic` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ RGB_to_Prismatic(np.array([0.0, 0.0, 0.0])),
+ np.array([0.0, 0.0, 0.0, 0.0]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ RGB_to_Prismatic(np.array([0.25, 0.50, 0.75])),
+ np.array([0.7500000, 0.1666667, 0.3333333, 0.5000000]),
+ decimal=7)
+
+ def test_n_dimensional_RGB_to_Prismatic(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.RGB_to_Prismatic` definition
+ n-dimensions support.
+ """
+
+ RGB = np.array([0.25, 0.50, 0.75])
+ Lrgb = np.array([0.7500000, 0.1666667, 0.3333333, 0.5000000])
+ np.testing.assert_almost_equal(RGB_to_Prismatic(RGB), Lrgb, decimal=7)
+
+ RGB = np.tile(RGB, (6, 1))
+ Lrgb = np.tile(Lrgb, (6, 1))
+ np.testing.assert_almost_equal(RGB_to_Prismatic(RGB), Lrgb, decimal=7)
+
+ RGB = np.reshape(RGB, (2, 3, 3))
+ Lrgb = np.reshape(Lrgb, (2, 3, 4))
+ np.testing.assert_almost_equal(RGB_to_Prismatic(RGB), Lrgb, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_RGB_to_Prismatic(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.RGB_to_Prismatic` definition
+ nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ RGB = np.array(case)
+ RGB_to_Prismatic(RGB)
+
+
+class TestPrismatic_to_RGB(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.prismatic.Prismatic_to_RGB` definition
+ unit tests methods.
+ """
+
+ def test_Prismatic_to_RGB(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.Prismatic_to_RGB` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ Prismatic_to_RGB(np.array([0.0, 0.0, 0.0, 0.0])),
+ np.array([0.0, 0.0, 0.0]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ Prismatic_to_RGB(
+ np.array([0.7500000, 0.1666667, 0.3333333, 0.5000000])),
+ np.array([0.25, 0.50, 0.75]),
+ decimal=7)
+
+ def test_n_dimensional_Prismatic_to_RGB(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.Prismatic_to_RGB` definition
+ n-dimensions support.
+ """
+
+ Lrgb = np.array([0.7500000, 0.1666667, 0.3333333, 0.5000000])
+ RGB = np.array([0.25, 0.50, 0.75])
+ np.testing.assert_almost_equal(Prismatic_to_RGB(Lrgb), RGB, decimal=7)
+
+ Lrgb = np.tile(Lrgb, (6, 1))
+ RGB = np.tile(RGB, (6, 1))
+ np.testing.assert_almost_equal(Prismatic_to_RGB(Lrgb), RGB, decimal=7)
+
+ Lrgb = np.reshape(Lrgb, (2, 3, 4))
+ RGB = np.reshape(RGB, (2, 3, 3))
+ np.testing.assert_almost_equal(Prismatic_to_RGB(Lrgb), RGB, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_Prismatic_to_RGB(self):
+ """
+ Tests :func:`colour.models.rgb.prismatic.Prismatic_to_RGB` definition
+ nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ Prismatic = np.array(case)
+ Prismatic_to_RGB(Prismatic)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/rgb/tests/tests_rgb_colourspace.py b/colour/models/rgb/tests/tests_rgb_colourspace.py
index 7624c8189b..60e9a55fb1 100644
--- a/colour/models/rgb/tests/tests_rgb_colourspace.py
+++ b/colour/models/rgb/tests/tests_rgb_colourspace.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.rgb_colourspace` module.
"""
@@ -13,16 +12,9 @@
from copy import deepcopy
from itertools import permutations
-from colour.models import (
- RGB_COLOURSPACES,
- RGB_Colourspace,
- XYZ_to_RGB,
- RGB_to_XYZ,
- RGB_to_RGB_matrix,
- RGB_to_RGB,
- normalised_primary_matrix,
- oetf_sRGB,
- eotf_sRGB)
+from colour.models import (RGB_COLOURSPACES, RGB_Colourspace, XYZ_to_RGB,
+ RGB_to_XYZ, RGB_to_RGB_matrix, RGB_to_RGB,
+ normalised_primary_matrix, oetf_sRGB, eotf_sRGB)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -32,12 +24,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_COLOURSPACES',
- 'TestRGB_Colourspace',
- 'TestXYZ_to_RGB',
- 'TestRGB_to_XYZ',
- 'TestRGB_to_RGB_matrix',
- 'TestRGB_to_RGB']
+__all__ = [
+ 'TestRGB_COLOURSPACES', 'TestRGB_Colourspace', 'TestXYZ_to_RGB',
+ 'TestRGB_to_XYZ', 'TestRGB_to_RGB_matrix', 'TestRGB_to_RGB'
+]
class TestRGB_COLOURSPACES(unittest.TestCase):
@@ -56,15 +46,15 @@ def test_transformation_matrices(self):
XYZ_r = np.array([0.5, 0.5, 0.5]).reshape((3, 1))
for colourspace in RGB_COLOURSPACES.values():
# Instantiation transformation matrices.
- if colourspace.name in (
- 'ProPhoto RGB', 'ERIMM RGB', 'RIMM RGB', 'ROMM RGB'):
+ if colourspace.name in ('ProPhoto RGB', 'ERIMM RGB', 'RIMM RGB',
+ 'ROMM RGB'):
tolerance = 1e-3
- elif colourspace.name in ('sRGB',):
+ elif colourspace.name in ('sRGB', ):
tolerance = 1e-4
- elif colourspace.name in ('Adobe RGB (1998)',):
+ elif colourspace.name in ('Adobe RGB (1998)', ):
tolerance = 1e-5
- elif colourspace.name in (
- 'ALEXA Wide Gamut RGB', 'V-Gamut', 'REDWideGamutRGB'):
+ elif colourspace.name in ('ALEXA Wide Gamut RGB', 'V-Gamut',
+ 'REDWideGamutRGB'):
tolerance = 1e-6
else:
tolerance = 1e-7
@@ -72,19 +62,17 @@ def test_transformation_matrices(self):
M = normalised_primary_matrix(colourspace.primaries,
colourspace.whitepoint)
- np.testing.assert_allclose(colourspace.RGB_to_XYZ_matrix,
- M,
- rtol=tolerance,
- atol=tolerance,
- verbose=False)
+ np.testing.assert_allclose(
+ colourspace.RGB_to_XYZ_matrix,
+ M,
+ rtol=tolerance,
+ atol=tolerance,
+ verbose=False)
RGB = np.dot(colourspace.XYZ_to_RGB_matrix, XYZ_r)
XYZ = np.dot(colourspace.RGB_to_XYZ_matrix, RGB)
- np.testing.assert_allclose(XYZ_r,
- XYZ,
- rtol=tolerance,
- atol=tolerance,
- verbose=False)
+ np.testing.assert_allclose(
+ XYZ_r, XYZ, rtol=tolerance, atol=tolerance, verbose=False)
# Derived transformation matrices.
colourspace = deepcopy(colourspace)
@@ -108,9 +96,8 @@ def test_cctf(self):
decoding_cctf_s = colourspace.decoding_cctf(encoding_cctf_s)
if colourspace.name not in aces_proxy_colourspaces:
- np.testing.assert_almost_equal(samples,
- decoding_cctf_s,
- decimal=7)
+ np.testing.assert_almost_equal(
+ samples, decoding_cctf_s, decimal=7)
def test_n_dimensional_cctf(self):
"""
@@ -124,30 +111,22 @@ def test_n_dimensional_cctf(self):
value_decoding_cctf = colourspace.decoding_cctf(
colourspace.encoding_cctf(value_encoding_cctf))
np.testing.assert_almost_equal(
- value_encoding_cctf,
- value_decoding_cctf,
- decimal=7)
+ value_encoding_cctf, value_decoding_cctf, decimal=7)
value_encoding_cctf = np.tile(value_encoding_cctf, 6)
value_decoding_cctf = np.tile(value_decoding_cctf, 6)
np.testing.assert_almost_equal(
- value_encoding_cctf,
- value_decoding_cctf,
- decimal=7)
+ value_encoding_cctf, value_decoding_cctf, decimal=7)
value_encoding_cctf = np.reshape(value_encoding_cctf, (3, 2))
value_decoding_cctf = np.reshape(value_decoding_cctf, (3, 2))
np.testing.assert_almost_equal(
- value_encoding_cctf,
- value_decoding_cctf,
- decimal=7)
+ value_encoding_cctf, value_decoding_cctf, decimal=7)
value_encoding_cctf = np.reshape(value_encoding_cctf, (3, 2, 1))
value_decoding_cctf = np.reshape(value_decoding_cctf, (3, 2, 1))
np.testing.assert_almost_equal(
- value_encoding_cctf,
- value_decoding_cctf,
- decimal=7)
+ value_encoding_cctf, value_decoding_cctf, decimal=7)
@ignore_numpy_errors
def test_nan_cctf(self):
@@ -183,14 +162,9 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('name',
- 'primaries',
- 'whitepoint',
- 'illuminant',
- 'RGB_to_XYZ_matrix',
- 'XYZ_to_RGB_matrix',
- 'encoding_cctf',
- 'decoding_cctf',
+ required_attributes = ('name', 'primaries', 'whitepoint', 'illuminant',
+ 'RGB_to_XYZ_matrix', 'XYZ_to_RGB_matrix',
+ 'encoding_cctf', 'decoding_cctf',
'use_derived_RGB_to_XYZ_matrix',
'use_derived_XYZ_to_RGB_matrix')
@@ -202,7 +176,7 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('use_derived_transformation_matrices',)
+ required_methods = ('use_derived_transformation_matrices', )
for method in required_methods:
self.assertIn(method, dir(RGB_Colourspace))
@@ -217,44 +191,37 @@ def test_use_derived_transformation_matrices(self):
whitepoint = np.array([0.32168, 0.33767])
RGB_to_XYZ_matrix = np.identity(3)
XYZ_to_RGB_matrix = np.identity(3)
- colourspace = RGB_Colourspace(
- 'RGB Colourspace',
- p,
- whitepoint,
- 'D60',
- RGB_to_XYZ_matrix,
- XYZ_to_RGB_matrix)
-
- np.testing.assert_array_equal(
- colourspace.RGB_to_XYZ_matrix,
- np.identity(3))
- np.testing.assert_array_equal(
- colourspace.XYZ_to_RGB_matrix,
- np.identity(3))
+ colourspace = RGB_Colourspace('RGB Colourspace', p, whitepoint, 'D60',
+ RGB_to_XYZ_matrix, XYZ_to_RGB_matrix)
+
+ np.testing.assert_array_equal(colourspace.RGB_to_XYZ_matrix,
+ np.identity(3))
+ np.testing.assert_array_equal(colourspace.XYZ_to_RGB_matrix,
+ np.identity(3))
self.assertTrue(colourspace.use_derived_transformation_matrices())
np.testing.assert_almost_equal(
colourspace.RGB_to_XYZ_matrix,
- np.array([[0.95255240, 0.00000000, 0.00009368],
- [0.34396645, 0.72816610, -0.07213255],
- [0.00000000, 0.00000000, 1.00882518]]),
- decimal=7)
+ np.array(
+ [[0.95255240, 0.00000000, 0.00009368],
+ [0.34396645, 0.72816610, -0.07213255],
+ [0.00000000, 0.00000000, 1.00882518]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
colourspace.XYZ_to_RGB_matrix,
- np.array([[1.04981102, 0.00000000, -0.00009748],
- [-0.49590302, 1.37331305, 0.09824004],
- [0.00000000, 0.00000000, 0.99125202]]),
- decimal=7)
+ np.array(
+ [[1.04981102, 0.00000000, -0.00009748],
+ [-0.49590302, 1.37331305, 0.09824004],
+ [0.00000000, 0.00000000, 0.99125202]]),
+ decimal=7) # yapf: disable
colourspace.use_derived_RGB_to_XYZ_matrix = False
- np.testing.assert_array_equal(
- colourspace.RGB_to_XYZ_matrix,
- np.identity(3))
+ np.testing.assert_array_equal(colourspace.RGB_to_XYZ_matrix,
+ np.identity(3))
colourspace.use_derived_XYZ_to_RGB_matrix = False
- np.testing.assert_array_equal(
- colourspace.XYZ_to_RGB_matrix,
- np.identity(3))
+ np.testing.assert_array_equal(colourspace.XYZ_to_RGB_matrix,
+ np.identity(3))
class TestXYZ_to_RGB(unittest.TestCase):
@@ -273,35 +240,37 @@ def test_XYZ_to_RGB(self):
np.array([0.11518475, 0.10080000, 0.05089373]),
np.array([0.34570, 0.35850]),
np.array([0.31270, 0.32900]),
- np.array([[3.24062548, -1.53720797, -0.49862860],
- [-0.96893071, 1.87575606, 0.04151752],
- [0.05571012, -0.20402105, 1.05699594]]),
- 'Bradford',
+ np.array(
+ [[3.24062548, -1.53720797, -0.49862860],
+ [-0.96893071, 1.87575606, 0.04151752],
+ [0.05571012, -0.20402105, 1.05699594]]), 'Bradford',
oetf_sRGB),
np.array([0.45286611, 0.31735742, 0.26418007]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
XYZ_to_RGB(
np.array([0.11518475, 0.10080000, 0.05089373]),
np.array([0.34570, 0.35850]),
np.array([0.32168, 0.33767]),
- np.array([[1.04981102, 0.00000000, -0.00009748],
- [-0.49590302, 1.37331305, 0.09824004],
- [0.00000000, 0.00000000, 0.99125202]])),
+ np.array(
+ [[1.04981102, 0.00000000, -0.00009748],
+ [-0.49590302, 1.37331305, 0.09824004],
+ [0.00000000, 0.00000000, 0.99125202]])),
np.array([0.11757966, 0.08781514, 0.06185473]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
XYZ_to_RGB(
np.array([0.07049534, 0.10080000, 0.09558313]),
np.array([0.34570, 0.35850]),
np.array([0.31270, 0.32900, 0.10080]),
- np.array([[3.24062548, -1.53720797, -0.49862860],
- [-0.96893071, 1.87575606, 0.04151752],
- [0.05571012, -0.20402105, 1.05699594]])),
+ np.array(
+ [[3.24062548, -1.53720797, -0.49862860],
+ [-0.96893071, 1.87575606, 0.04151752],
+ [0.05571012, -0.20402105, 1.05699594]])),
np.array([0.00109657, 0.01282168, 0.01173596]),
- decimal=7)
+ decimal=7) # yapf: disable
def test_n_dimensional_XYZ_to_RGB(self):
"""
@@ -312,37 +281,30 @@ def test_n_dimensional_XYZ_to_RGB(self):
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
W_R = np.array([0.34570, 0.35850])
W_T = np.array([0.31270, 0.32900])
- M = np.array([[3.24062548, -1.53720797, -0.49862860],
- [-0.96893071, 1.87575606, 0.04151752],
- [0.05571012, -0.20402105, 1.05699594]])
+ M = np.array(
+ [[3.24062548, -1.53720797, -0.49862860],
+ [-0.96893071, 1.87575606, 0.04151752],
+ [0.05571012, -0.20402105, 1.05699594]]) # yapf: disable
RGB = np.array([0.01087863, 0.12719923, 0.11642816])
np.testing.assert_almost_equal(
- XYZ_to_RGB(XYZ, W_R, W_T, M),
- RGB,
- decimal=7)
+ XYZ_to_RGB(XYZ, W_R, W_T, M), RGB, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
RGB = np.tile(RGB, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_RGB(XYZ, W_R, W_T, M),
- RGB,
- decimal=7)
+ XYZ_to_RGB(XYZ, W_R, W_T, M), RGB, decimal=7)
W_R = np.tile(W_R, (6, 1))
W_T = np.tile(W_T, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_RGB(XYZ, W_R, W_T, M),
- RGB,
- decimal=7)
+ XYZ_to_RGB(XYZ, W_R, W_T, M), RGB, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
W_R = np.reshape(W_R, (2, 3, 2))
W_T = np.reshape(W_T, (2, 3, 2))
RGB = np.reshape(RGB, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_RGB(XYZ, W_R, W_T, M),
- RGB,
- decimal=7)
+ XYZ_to_RGB(XYZ, W_R, W_T, M), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_RGB(self):
@@ -377,35 +339,37 @@ def test_RGB_to_XYZ(self):
np.array([0.45286611, 0.31735742, 0.26418007]),
np.array([0.31270, 0.32900]),
np.array([0.34570, 0.35850]),
- np.array([[0.41240000, 0.35760000, 0.18050000],
- [0.21260000, 0.71520000, 0.07220000],
- [0.01930000, 0.11920000, 0.95050000]]),
- 'Bradford',
+ np.array(
+ [[0.41240000, 0.35760000, 0.18050000],
+ [0.21260000, 0.71520000, 0.07220000],
+ [0.01930000, 0.11920000, 0.95050000]]), 'Bradford',
eotf_sRGB),
np.array([0.11518475, 0.10080000, 0.05089373]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
RGB_to_XYZ(
np.array([0.11757966, 0.08781514, 0.06185473]),
np.array([0.32168, 0.33767]),
np.array([0.34570, 0.35850]),
- np.array([[0.95255240, 0.00000000, 0.00009368],
- [0.34396645, 0.72816610, -0.07213255],
- [0.00000000, 0.00000000, 1.00882518]])),
+ np.array(
+ [[0.95255240, 0.00000000, 0.00009368],
+ [0.34396645, 0.72816610, -0.07213255],
+ [0.00000000, 0.00000000, 1.00882518]])),
np.array([0.11518475, 0.10080000, 0.05089373]),
- decimal=7)
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
RGB_to_XYZ(
np.array([0.00109657, 0.01282168, 0.01173596]),
np.array([0.31270, 0.32900, 0.10080]),
np.array([0.34570, 0.35850]),
- np.array([[0.41240000, 0.35760000, 0.18050000],
- [0.21260000, 0.71520000, 0.07220000],
- [0.01930000, 0.11920000, 0.95050000]])),
+ np.array(
+ [[0.41240000, 0.35760000, 0.18050000],
+ [0.21260000, 0.71520000, 0.07220000],
+ [0.01930000, 0.11920000, 0.95050000]])),
np.array([0.07049534, 0.10080000, 0.09558313]),
- decimal=7)
+ decimal=7) # yapf: disable
def test_n_dimensional_RGB_to_XYZ(self):
"""
@@ -416,37 +380,29 @@ def test_n_dimensional_RGB_to_XYZ(self):
RGB = np.array([0.00109657, 0.01282168, 0.01173596])
W_R = np.array([0.31270, 0.32900])
W_T = np.array([0.34570, 0.35850])
- M = np.array([[0.41240000, 0.35760000, 0.18050000],
- [0.21260000, 0.71520000, 0.07220000],
+ M = np.array([[0.41240000, 0.35760000,
+ 0.18050000], [0.21260000, 0.71520000, 0.07220000],
[0.01930000, 0.11920000, 0.95050000]])
- XYZ = np.array([0.00710593, 0.01016064, 0.00963478])
+ XYZ = np.array([0.00710593, 0.01016064, 0.00963478]) # yapf: disable
np.testing.assert_almost_equal(
- RGB_to_XYZ(RGB, W_R, W_T, M),
- XYZ,
- decimal=7)
+ RGB_to_XYZ(RGB, W_R, W_T, M), XYZ, decimal=7)
RGB = np.tile(RGB, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- RGB_to_XYZ(RGB, W_R, W_T, M),
- XYZ,
- decimal=7)
+ RGB_to_XYZ(RGB, W_R, W_T, M), XYZ, decimal=7)
W_R = np.tile(W_R, (6, 1))
W_T = np.tile(W_T, (6, 1))
np.testing.assert_almost_equal(
- RGB_to_XYZ(RGB, W_R, W_T, M),
- XYZ,
- decimal=7)
+ RGB_to_XYZ(RGB, W_R, W_T, M), XYZ, decimal=7)
RGB = np.reshape(RGB, (2, 3, 3))
W_R = np.reshape(W_R, (2, 3, 2))
W_T = np.reshape(W_T, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- RGB_to_XYZ(RGB, W_R, W_T, M),
- XYZ,
- decimal=7)
+ RGB_to_XYZ(RGB, W_R, W_T, M), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_XYZ(self):
@@ -482,29 +438,29 @@ def test_RGB_to_RGB_matrix(self):
sRGB_colourspace = RGB_COLOURSPACES['sRGB']
np.testing.assert_almost_equal(
- RGB_to_RGB_matrix(aces_2065_1_colourspace,
- sRGB_colourspace),
- np.array([[2.52164943, -1.13688855, -0.38491759],
- [-0.27521355, 1.36970515, -0.09439245],
- [-0.01592501, -0.14780637, 1.16380582]]),
- decimal=7)
+ RGB_to_RGB_matrix(aces_2065_1_colourspace, sRGB_colourspace),
+ np.array(
+ [[2.52164943, -1.13688855, -0.38491759],
+ [-0.27521355, 1.36970515, -0.09439245],
+ [-0.01592501, -0.14780637, 1.16380582]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
- RGB_to_RGB_matrix(sRGB_colourspace,
- aces_2065_1_colourspace),
- np.array([[0.43958564, 0.38392940, 0.17653274],
- [0.08953957, 0.81474984, 0.09568361],
- [0.01738718, 0.10873911, 0.87382059]]),
- decimal=7)
+ RGB_to_RGB_matrix(sRGB_colourspace, aces_2065_1_colourspace),
+ np.array(
+ [[0.43958564, 0.38392940, 0.17653274],
+ [0.08953957, 0.81474984, 0.09568361],
+ [0.01738718, 0.10873911, 0.87382059]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
- RGB_to_RGB_matrix(aces_2065_1_colourspace,
- aces_cg_colourspace,
+ RGB_to_RGB_matrix(aces_2065_1_colourspace, aces_cg_colourspace,
'Bradford'),
- np.array([[1.45143932, -0.23651075, -0.21492857],
- [-0.07655377, 1.17622970, -0.09967593],
- [0.00831615, -0.00603245, 0.99771630]]),
- decimal=7)
+ np.array(
+ [[1.45143932, -0.23651075, -0.21492857],
+ [-0.07655377, 1.17622970, -0.09967593],
+ [0.00831615, -0.00603245, 0.99771630]]),
+ decimal=7) # yapf: disable
class TestRGB_to_RGB(unittest.TestCase):
@@ -522,24 +478,23 @@ def test_RGB_to_RGB(self):
sRGB_colourspace = RGB_COLOURSPACES['sRGB']
np.testing.assert_almost_equal(
- RGB_to_RGB(np.array([0.35521588, 0.41000000, 0.24177934]),
- aces_2065_1_colourspace,
- sRGB_colourspace),
+ RGB_to_RGB(
+ np.array([0.35521588, 0.41000000, 0.24177934]),
+ aces_2065_1_colourspace, sRGB_colourspace),
np.array([0.33654049, 0.44099674, 0.21512677]),
decimal=7)
np.testing.assert_almost_equal(
- RGB_to_RGB(np.array([0.33653829, 0.44097338, 0.21512063]),
- sRGB_colourspace,
- aces_2065_1_colourspace),
+ RGB_to_RGB(
+ np.array([0.33653829, 0.44097338, 0.21512063]),
+ sRGB_colourspace, aces_2065_1_colourspace),
np.array([0.35521588, 0.41000000, 0.24177934]),
decimal=7)
np.testing.assert_almost_equal(
- RGB_to_RGB(np.array([0.35521588, 0.41000000, 0.24177934]),
- aces_2065_1_colourspace,
- sRGB_colourspace,
- 'Bradford'),
+ RGB_to_RGB(
+ np.array([0.35521588, 0.41000000, 0.24177934]),
+ aces_2065_1_colourspace, sRGB_colourspace, 'Bradford'),
np.array([0.33699893, 0.44136948, 0.21432296]),
decimal=7)
@@ -547,20 +502,22 @@ def test_RGB_to_RGB(self):
aces_cc_colourspace = RGB_COLOURSPACES['ACEScc']
np.testing.assert_almost_equal(
- RGB_to_RGB(np.array([0.35521588, 0.41000000, 0.24177934]),
- aces_cg_colourspace,
- aces_cc_colourspace,
- apply_decoding_cctf=True,
- apply_encoding_cctf=True),
+ RGB_to_RGB(
+ np.array([0.35521588, 0.41000000, 0.24177934]),
+ aces_cg_colourspace,
+ aces_cc_colourspace,
+ apply_decoding_cctf=True,
+ apply_encoding_cctf=True),
np.array([0.46956438, 0.48137533, 0.43788601]),
decimal=7)
np.testing.assert_almost_equal(
- RGB_to_RGB(np.array([0.46956438, 0.48137533, 0.43788601]),
- aces_cc_colourspace,
- sRGB_colourspace,
- apply_decoding_cctf=True,
- apply_encoding_cctf=True),
+ RGB_to_RGB(
+ np.array([0.46956438, 0.48137533, 0.43788601]),
+ aces_cc_colourspace,
+ sRGB_colourspace,
+ apply_decoding_cctf=True,
+ apply_encoding_cctf=True),
np.array([0.60983062, 0.67896356, 0.50435764]),
decimal=7)
diff --git a/colour/models/rgb/tests/tests_ycbcr.py b/colour/models/rgb/tests/tests_ycbcr.py
index 62bd241eb4..9ff4bc7b25 100644
--- a/colour/models/rgb/tests/tests_ycbcr.py
+++ b/colour/models/rgb/tests/tests_ycbcr.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.ycbcr` module.
"""
@@ -11,12 +10,9 @@
import unittest
from itertools import permutations
-from colour.models.rgb.ycbcr import (
- RGB_to_YCbCr,
- YCbCr_to_RGB,
- RGB_to_YcCbcCrc,
- YcCbcCrc_to_RGB,
- YCBCR_WEIGHTS)
+from colour.models.rgb.ycbcr import (RGB_to_YCbCr, YCbCr_to_RGB,
+ RGB_to_YcCbcCrc, YcCbcCrc_to_RGB,
+ YCBCR_WEIGHTS)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -26,10 +22,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Development'
-__all__ = ['TestRGB_to_YCbCr',
- 'TestYCbCr_to_RGB',
- 'TestRGB_to_YcCbcCrc',
- 'TestYcCbcCrc_to_RGB']
+__all__ = [
+ 'TestRGB_to_YCbCr', 'TestYCbCr_to_RGB', 'TestRGB_to_YcCbcCrc',
+ 'TestYcCbcCrc_to_RGB'
+]
class TestRGB_to_YCbCr(unittest.TestCase):
@@ -83,33 +79,25 @@ def test_n_dimensional_RGB_to_YCbCr(self):
RGB = np.array([0.75, 0.5, 0.25])
YCbCr = np.array([0.52230157, 0.36699593, 0.62183309])
- np.testing.assert_almost_equal(
- RGB_to_YCbCr(RGB),
- YCbCr)
+ np.testing.assert_almost_equal(RGB_to_YCbCr(RGB), YCbCr)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 3))
- np.testing.assert_almost_equal(
- RGB_to_YCbCr(RGB),
- YCbCr)
+ np.testing.assert_almost_equal(RGB_to_YCbCr(RGB), YCbCr)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 4, 3))
- np.testing.assert_almost_equal(
- RGB_to_YCbCr(RGB),
- YCbCr)
+ np.testing.assert_almost_equal(RGB_to_YCbCr(RGB), YCbCr)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 4, 4, 3))
- np.testing.assert_almost_equal(
- RGB_to_YCbCr(RGB),
- YCbCr)
+ np.testing.assert_almost_equal(RGB_to_YCbCr(RGB), YCbCr)
@ignore_numpy_errors
def test_nan_RGB_to_YCbCr(self):
@@ -170,33 +158,25 @@ def test_n_dimensional_YCbCr_to_RGB(self):
YCbCr = np.array([0.52230157, 0.36699593, 0.62183309])
RGB = np.array([0.75, 0.5, 0.25])
- np.testing.assert_almost_equal(
- YCbCr_to_RGB(YCbCr),
- RGB)
+ np.testing.assert_almost_equal(YCbCr_to_RGB(YCbCr), RGB)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 3))
- np.testing.assert_almost_equal(
- YCbCr_to_RGB(YCbCr),
- RGB)
+ np.testing.assert_almost_equal(YCbCr_to_RGB(YCbCr), RGB)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 4, 3))
- np.testing.assert_almost_equal(
- YCbCr_to_RGB(YCbCr),
- RGB)
+ np.testing.assert_almost_equal(YCbCr_to_RGB(YCbCr), RGB)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 4, 3))
YCbCr = np.tile(YCbCr, 4)
YCbCr = np.reshape(YCbCr, (4, 4, 4, 3))
- np.testing.assert_almost_equal(
- YCbCr_to_RGB(YCbCr),
- RGB)
+ np.testing.assert_almost_equal(YCbCr_to_RGB(YCbCr), RGB)
@ignore_numpy_errors
def test_nan_YCbCr_to_RGB(self):
@@ -247,36 +227,28 @@ def test_n_dimensional_RGB_to_YcCbcCrc(self):
RGB = np.array([0.75, 0.5, 0.25])
YcCbcCrc = np.array([0.69738693, 0.38700523, 0.61084888])
np.testing.assert_almost_equal(
- RGB_to_YcCbcCrc(RGB),
- YcCbcCrc,
- decimal=7)
+ RGB_to_YcCbcCrc(RGB), YcCbcCrc, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 3))
np.testing.assert_almost_equal(
- RGB_to_YcCbcCrc(RGB),
- YcCbcCrc,
- decimal=7)
+ RGB_to_YcCbcCrc(RGB), YcCbcCrc, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 4, 3))
np.testing.assert_almost_equal(
- RGB_to_YcCbcCrc(RGB),
- YcCbcCrc,
- decimal=7)
+ RGB_to_YcCbcCrc(RGB), YcCbcCrc, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 4, 4, 3))
np.testing.assert_almost_equal(
- RGB_to_YcCbcCrc(RGB),
- YcCbcCrc,
- decimal=7)
+ RGB_to_YcCbcCrc(RGB), YcCbcCrc, decimal=7)
@ignore_numpy_errors
def test_nan_RGB_to_YcCbcCrc(self):
@@ -327,36 +299,28 @@ def test_n_dimensional_YcCbcCrc_to_RGB(self):
YcCbcCrc = np.array([0.69943807, 0.38814348, 0.61264549])
RGB = np.array([0.75767423, 0.50177402, 0.25466201])
np.testing.assert_almost_equal(
- YcCbcCrc_to_RGB(YcCbcCrc),
- RGB,
- decimal=7)
+ YcCbcCrc_to_RGB(YcCbcCrc), RGB, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 3))
np.testing.assert_almost_equal(
- YcCbcCrc_to_RGB(YcCbcCrc),
- RGB,
- decimal=7)
+ YcCbcCrc_to_RGB(YcCbcCrc), RGB, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 4, 3))
np.testing.assert_almost_equal(
- YcCbcCrc_to_RGB(YcCbcCrc),
- RGB,
- decimal=7)
+ YcCbcCrc_to_RGB(YcCbcCrc), RGB, decimal=7)
RGB = np.tile(RGB, 4)
RGB = np.reshape(RGB, (4, 4, 4, 3))
YcCbcCrc = np.tile(YcCbcCrc, 4)
YcCbcCrc = np.reshape(YcCbcCrc, (4, 4, 4, 3))
np.testing.assert_almost_equal(
- YcCbcCrc_to_RGB(YcCbcCrc),
- RGB,
- decimal=7)
+ YcCbcCrc_to_RGB(YcCbcCrc), RGB, decimal=7)
@ignore_numpy_errors
def test_nan_YcCbcCrc_to_RGB(self):
diff --git a/colour/models/rgb/transfer_functions/__init__.py b/colour/models/rgb/transfer_functions/__init__.py
index 95cc8c07b7..987d0e4aad 100644
--- a/colour/models/rgb/transfer_functions/__init__.py
+++ b/colour/models/rgb/transfer_functions/__init__.py
@@ -5,140 +5,112 @@
from colour.utilities import CaseInsensitiveMapping, filter_kwargs
-from .aces import (
- log_encoding_ACESproxy,
- log_decoding_ACESproxy,
- log_encoding_ACEScc,
- log_decoding_ACEScc,
- log_encoding_ACEScct,
- log_decoding_ACEScct)
-from .alexa_log_c import (
- log_encoding_ALEXALogC,
- log_decoding_ALEXALogC)
+from .aces import (log_encoding_ACESproxy, log_decoding_ACESproxy,
+ log_encoding_ACEScc, log_decoding_ACEScc,
+ log_encoding_ACEScct, log_decoding_ACEScct)
+from .alexa_log_c import (log_encoding_ALEXALogC, log_decoding_ALEXALogC)
+from .arib_std_b67 import oetf_ARIBSTDB67, eotf_ARIBSTDB67
from .bt_709 import oetf_BT709, eotf_BT709
from .bt_1886 import oetf_BT1886, eotf_BT1886
from .bt_2020 import oetf_BT2020, eotf_BT2020
-from .canon_log import (
- log_encoding_CanonLog,
- log_decoding_CanonLog,
- log_encoding_CanonLog2,
- log_decoding_CanonLog2,
- log_encoding_CanonLog3,
- log_decoding_CanonLog3)
+from .canon_log import (log_encoding_CanonLog, log_decoding_CanonLog,
+ log_encoding_CanonLog2, log_decoding_CanonLog2,
+ log_encoding_CanonLog3, log_decoding_CanonLog3)
from .cineon import log_encoding_Cineon, log_decoding_Cineon
from .dci_p3 import oetf_DCIP3, eotf_DCIP3
-from .gamma import gamma_function
-from .linear import linear_function
+from .dicom_gsdf import oetf_DICOMGSDF, eotf_DICOMGSDF
+from .gamma import function_gamma
+from .gopro import log_encoding_Protune, log_decoding_Protune
+from .linear import function_linear
from .panalog import log_encoding_Panalog, log_decoding_Panalog
from .panasonic_vlog import log_encoding_VLog, log_decoding_VLog
from .pivoted_log import log_encoding_PivotedLog, log_decoding_PivotedLog
-from .red_log import (
- log_encoding_REDLog,
- log_decoding_REDLog,
- log_encoding_REDLogFilm,
- log_decoding_REDLogFilm,
- log_encoding_Log3G10,
- log_decoding_Log3G10,
- log_encoding_Log3G12,
- log_decoding_Log3G12)
-from .rimm_romm_rgb import (
- oetf_ROMMRGB,
- eotf_ROMMRGB,
- oetf_ProPhotoRGB,
- eotf_ProPhotoRGB,
- oetf_RIMMRGB,
- eotf_RIMMRGB,
- log_encoding_ERIMMRGB,
- log_decoding_ERIMMRGB)
+from .red_log import (log_encoding_REDLog, log_decoding_REDLog,
+ log_encoding_REDLogFilm, log_decoding_REDLogFilm,
+ log_encoding_Log3G10, log_decoding_Log3G10,
+ log_encoding_Log3G12, log_decoding_Log3G12)
+from .rimm_romm_rgb import (oetf_ROMMRGB, eotf_ROMMRGB, oetf_ProPhotoRGB,
+ eotf_ProPhotoRGB, oetf_RIMMRGB, eotf_RIMMRGB,
+ log_encoding_ERIMMRGB, log_decoding_ERIMMRGB)
from .srgb import oetf_sRGB, eotf_sRGB
-from .sony_slog import (
- log_encoding_SLog,
- log_decoding_SLog,
- log_encoding_SLog2,
- log_decoding_SLog2,
- log_encoding_SLog3,
- log_decoding_SLog3)
+from .sony_slog import (log_encoding_SLog, log_decoding_SLog,
+ log_encoding_SLog2, log_decoding_SLog2,
+ log_encoding_SLog3, log_decoding_SLog3)
from .st_2084 import oetf_ST2084, eotf_ST2084
from .viper_log import log_encoding_ViperLog, log_decoding_ViperLog
-__all__ = ['log_encoding_ACESproxy',
- 'log_decoding_ACESproxy',
- 'log_encoding_ACEScc',
- 'log_decoding_ACEScc',
- 'log_encoding_ACEScct',
- 'log_decoding_ACEScct']
+__all__ = [
+ 'log_encoding_ACESproxy', 'log_decoding_ACESproxy', 'log_encoding_ACEScc',
+ 'log_decoding_ACEScc', 'log_encoding_ACEScct', 'log_decoding_ACEScct'
+]
__all__ += ['log_encoding_ALEXALogC', 'log_decoding_ALEXALogC']
+__all__ += ['oetf_ARIBSTDB67', 'eotf_ARIBSTDB67']
__all__ += ['oetf_BT709', 'eotf_BT709']
__all__ += ['oetf_BT1886', 'eotf_BT1886']
__all__ += ['oetf_BT2020', 'eotf_BT2020']
-__all__ += ['log_encoding_CanonLog',
- 'log_decoding_CanonLog',
- 'log_encoding_CanonLog2',
- 'log_decoding_CanonLog2',
- 'log_encoding_CanonLog3',
- 'log_decoding_CanonLog3']
+__all__ += [
+ 'log_encoding_CanonLog', 'log_decoding_CanonLog', 'log_encoding_CanonLog2',
+ 'log_decoding_CanonLog2', 'log_encoding_CanonLog3',
+ 'log_decoding_CanonLog3'
+]
__all__ += ['log_encoding_Cineon', 'log_decoding_Cineon']
__all__ += ['oetf_DCIP3', 'eotf_DCIP3']
-__all__ += ['gamma_function']
-__all__ += ['linear_function']
+__all__ += ['oetf_DICOMGSDF', 'eotf_DICOMGSDF']
+__all__ += ['function_gamma']
+__all__ += ['log_encoding_Protune', 'log_decoding_Protune']
+__all__ += ['function_linear']
__all__ += ['log_encoding_Panalog', 'log_decoding_Panalog']
__all__ += ['log_encoding_VLog', 'log_decoding_VLog']
__all__ += ['log_encoding_PivotedLog', 'log_decoding_PivotedLog']
-__all__ += ['log_encoding_REDLog',
- 'log_decoding_REDLog',
- 'log_encoding_REDLogFilm',
- 'log_decoding_REDLogFilm',
- 'log_encoding_Log3G10',
- 'log_decoding_Log3G10',
- 'log_encoding_Log3G12',
- 'log_decoding_Log3G12']
-__all__ += ['oetf_ROMMRGB',
- 'eotf_ROMMRGB',
- 'oetf_ProPhotoRGB',
- 'eotf_ProPhotoRGB',
- 'oetf_RIMMRGB',
- 'eotf_RIMMRGB',
- 'log_encoding_ERIMMRGB',
- 'log_decoding_ERIMMRGB']
-__all__ += ['log_encoding_SLog',
- 'log_decoding_SLog',
- 'log_encoding_SLog2',
- 'log_decoding_SLog2',
- 'log_encoding_SLog3',
- 'log_decoding_SLog3']
+__all__ += [
+ 'log_encoding_REDLog', 'log_decoding_REDLog', 'log_encoding_REDLogFilm',
+ 'log_decoding_REDLogFilm', 'log_encoding_Log3G10', 'log_decoding_Log3G10',
+ 'log_encoding_Log3G12', 'log_decoding_Log3G12'
+]
+__all__ += [
+ 'oetf_ROMMRGB', 'eotf_ROMMRGB', 'oetf_ProPhotoRGB', 'eotf_ProPhotoRGB',
+ 'oetf_RIMMRGB', 'eotf_RIMMRGB', 'log_encoding_ERIMMRGB',
+ 'log_decoding_ERIMMRGB'
+]
+__all__ += [
+ 'log_encoding_SLog', 'log_decoding_SLog', 'log_encoding_SLog2',
+ 'log_decoding_SLog2', 'log_encoding_SLog3', 'log_decoding_SLog3'
+]
__all__ += ['oetf_sRGB', 'eotf_sRGB']
__all__ += ['oetf_ST2084', 'eotf_ST2084']
__all__ += ['log_decoding_ViperLog', 'log_decoding_ViperLog']
-LOG_ENCODING_CURVES = CaseInsensitiveMapping(
- {'Cineon': log_encoding_Cineon,
- 'Panalog': log_encoding_Panalog,
- 'ViperLog': log_encoding_ViperLog,
- 'PLog': log_encoding_PivotedLog,
- 'Canon Log': log_encoding_CanonLog,
- 'Canon Log 2': log_encoding_CanonLog2,
- 'Canon Log 3': log_encoding_CanonLog3,
- 'ACEScc': log_encoding_ACEScc,
- 'ACEScct': log_encoding_ACEScct,
- 'ACESproxy': log_encoding_ACESproxy,
- 'ALEXA Log C': log_encoding_ALEXALogC,
- 'REDLog': log_encoding_REDLog,
- 'REDLogFilm': log_encoding_REDLogFilm,
- 'Log3G10': log_encoding_Log3G10,
- 'Log3G12': log_encoding_Log3G12,
- 'ERIMM RGB': log_encoding_ERIMMRGB,
- 'S-Log': log_encoding_SLog,
- 'S-Log2': log_encoding_SLog2,
- 'S-Log3': log_encoding_SLog3,
- 'V-Log': log_encoding_VLog})
+LOG_ENCODING_CURVES = CaseInsensitiveMapping({
+ 'ACEScc': log_encoding_ACEScc,
+ 'ACEScct': log_encoding_ACEScct,
+ 'ACESproxy': log_encoding_ACESproxy,
+ 'ALEXA Log C': log_encoding_ALEXALogC,
+ 'Canon Log 2': log_encoding_CanonLog2,
+ 'Canon Log 3': log_encoding_CanonLog3,
+ 'Canon Log': log_encoding_CanonLog,
+ 'Cineon': log_encoding_Cineon,
+ 'ERIMM RGB': log_encoding_ERIMMRGB,
+ 'Log3G10': log_encoding_Log3G10,
+ 'Log3G12': log_encoding_Log3G12,
+ 'Panalog': log_encoding_Panalog,
+ 'PLog': log_encoding_PivotedLog,
+ 'Protune': log_encoding_Protune,
+ 'REDLog': log_encoding_REDLog,
+ 'REDLogFilm': log_encoding_REDLogFilm,
+ 'S-Log': log_encoding_SLog,
+ 'S-Log2': log_encoding_SLog2,
+ 'S-Log3': log_encoding_SLog3,
+ 'V-Log': log_encoding_VLog,
+ 'ViperLog': log_encoding_ViperLog
+})
"""
Supported *log* encoding curves.
LOG_ENCODING_CURVES : CaseInsensitiveMapping
- **{'Cineon', 'Panalog', 'ViperLog', 'PLog', 'Canon Log', 'Canon Log 2',
- 'Canon Log 3', 'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'REDLog',
- 'REDLogFilm', 'Log3G10', 'Log3G12', 'ERIMM RGB, 'S-Log', 'S-Log2',
- 'S-Log3', 'V-Log'}**
+ **{'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'Canon Log 2',
+ 'Canon Log 3', 'Canon Log', 'Cineon', 'ERIMM RGB', 'Log3G10', 'Log3G12',
+ 'Panalog', 'PLog', 'Protune', 'REDLog', 'REDLogFilm', 'S-Log', 'S-Log2',
+ 'S-Log3', 'V-Log', 'ViperLog'}**
"""
@@ -152,54 +124,54 @@ def log_encoding_curve(value, curve='Cineon', **kwargs):
value : numeric or array_like
Value.
curve : unicode, optional
- **{'Cineon', 'Panalog', 'ViperLog', 'PLog', 'Canon Log', 'Canon Log 2',
- 'Canon Log 3', 'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C',
- 'REDLog', 'REDLogFilm', 'Log3G10', 'Log3G12', 'ERIMM RGB, 'S-Log',
- 'S-Log2', 'S-Log3', 'V-Log'}**, Computation curve.
+ **{'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'Canon Log 2',
+ 'Canon Log 3', 'Canon Log', 'Cineon', 'ERIMM RGB', 'Log3G10',
+ 'Log3G12', 'Panalog', 'PLog', 'Protune', 'REDLog', 'REDLogFilm',
+ 'S-Log', 'S-Log2', 'S-Log3', 'V-Log', 'ViperLog'}**, Computation curve.
Other Parameters
----------------
+ EI : int, optional
+ {:func:`log_encoding_ALEXALogC`},
+ Ei.
+ E_clip : numeric, optional
+ {:func:`log_encoding_ERIMMRGB`},
+ Maximum exposure limit.
+ E_min : numeric, optional
+ {:func:`log_encoding_ERIMMRGB`},
+ Minimum exposure limit.
+ I_max : numeric, optional
+ {:func:`log_encoding_ERIMMRGB`},
+ Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
+ 12-bit and 16-bit per channel.
+ bit_depth : unicode, optional
+ {:func:`log_encoding_ACESproxy`},
+ **{'10 Bit', '12 Bit'}**,
+ *ACESproxy* bit depth.
black_offset : numeric or array_like
{:func:`log_encoding_Cineon`, :func:`log_encoding_Panalog`,
:func:`log_encoding_REDLog`, :func:`log_encoding_REDLogFilm`},
Black offset.
- log_reference : numeric or array_like
- {:func:`log_encoding_PivotedLog`},
- Log reference.
- linear_reference : numeric or array_like
- {:func:`log_encoding_PivotedLog`},
- Linear reference.
- negative_gamma : numeric or array_like
- {:func:`log_encoding_PivotedLog`},
- Negative gamma.
density_per_code_value : numeric or array_like
{:func:`log_encoding_PivotedLog`},
Density per code value.
- bit_depth : unicode, optional
- {:func:`log_encoding_ACESproxy`},
- **{'10 Bit', '12 Bit'}**,
- *ACESproxy* bit depth.
firmware : unicode, optional
{:func:`log_encoding_ALEXALogC`},
**{'SUP 3.x', 'SUP 2.x'}**,
Alexa firmware version.
+ linear_reference : numeric or array_like
+ {:func:`log_encoding_PivotedLog`},
+ Linear reference.
+ log_reference : numeric or array_like
+ {:func:`log_encoding_PivotedLog`},
+ Log reference.
+ negative_gamma : numeric or array_like
+ {:func:`log_encoding_PivotedLog`},
+ Negative gamma.
method : unicode, optional
{:func:`log_encoding_ALEXALogC`},
**{'Linear Scene Exposure Factor', 'Normalised Sensor Signal'}**,
Conversion method.
- EI : int, optional
- {:func:`log_encoding_ALEXALogC`},
- Ei.
- I_max : numeric, optional
- {:func:`log_encoding_ERIMMRGB`},
- Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
- 12-bit and 16-bit per channel.
- E_min : numeric, optional
- {:func:`log_encoding_ERIMMRGB`},
- Minimum exposure limit.
- E_clip : numeric, optional
- {:func:`log_encoding_ERIMMRGB`},
- Maximum exposure limit.
Returns
-------
@@ -226,35 +198,37 @@ def log_encoding_curve(value, curve='Cineon', **kwargs):
return function(value, **kwargs)
-LOG_DECODING_CURVES = CaseInsensitiveMapping(
- {'Cineon': log_decoding_Cineon,
- 'Panalog': log_decoding_Panalog,
- 'ViperLog': log_decoding_ViperLog,
- 'PLog': log_decoding_PivotedLog,
- 'Canon Log': log_decoding_CanonLog,
- 'Canon Log 2': log_decoding_CanonLog2,
- 'Canon Log 3': log_decoding_CanonLog3,
- 'ACEScc': log_decoding_ACEScc,
- 'ACEScct': log_decoding_ACEScct,
- 'ACESproxy': log_decoding_ACESproxy,
- 'ALEXA Log C': log_decoding_ALEXALogC,
- 'REDLog': log_decoding_REDLog,
- 'REDLogFilm': log_decoding_REDLogFilm,
- 'Log3G10': log_decoding_Log3G10,
- 'Log3G12': log_decoding_Log3G12,
- 'ERIMM RGB': log_decoding_ERIMMRGB,
- 'S-Log': log_decoding_SLog,
- 'S-Log2': log_decoding_SLog2,
- 'S-Log3': log_decoding_SLog3,
- 'V-Log': log_decoding_VLog})
+LOG_DECODING_CURVES = CaseInsensitiveMapping({
+ 'ACEScc': log_decoding_ACEScc,
+ 'ACEScct': log_decoding_ACEScct,
+ 'ACESproxy': log_decoding_ACESproxy,
+ 'ALEXA Log C': log_decoding_ALEXALogC,
+ 'Canon Log 2': log_decoding_CanonLog2,
+ 'Canon Log 3': log_decoding_CanonLog3,
+ 'Canon Log': log_decoding_CanonLog,
+ 'Cineon': log_decoding_Cineon,
+ 'ERIMM RGB': log_decoding_ERIMMRGB,
+ 'Log3G10': log_decoding_Log3G10,
+ 'Log3G12': log_decoding_Log3G12,
+ 'Panalog': log_decoding_Panalog,
+ 'PLog': log_decoding_PivotedLog,
+ 'Protune': log_decoding_Protune,
+ 'REDLog': log_decoding_REDLog,
+ 'REDLogFilm': log_decoding_REDLogFilm,
+ 'S-Log': log_decoding_SLog,
+ 'S-Log2': log_decoding_SLog2,
+ 'S-Log3': log_decoding_SLog3,
+ 'V-Log': log_decoding_VLog,
+ 'ViperLog': log_decoding_ViperLog
+})
"""
Supported *log* decoding curves.
LOG_DECODING_CURVES : CaseInsensitiveMapping
- **{'Cineon', 'Panalog', 'ViperLog', 'PLog', 'Canon Log', 'Canon Log 2',
- 'Canon Log 3', 'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'REDLog',
- 'REDLogFilm', 'Log3G10', 'Log3G12', 'ERIMM RGB, 'S-Log', 'S-Log2',
- 'S-Log3', 'V-Log'}**
+ **{'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'Canon Log 2',
+ 'Canon Log 3', 'Canon Log', 'Cineon', 'ERIMM RGB', 'Log3G10', 'Log3G12',
+ 'Panalog', 'PLog', 'Protune', 'REDLog', 'REDLogFilm', 'S-Log', 'S-Log2',
+ 'S-Log3', 'V-Log', 'ViperLog'}**
"""
@@ -268,54 +242,54 @@ def log_decoding_curve(value, curve='Cineon', **kwargs):
value : numeric or array_like
Value.
curve : unicode, optional
- **{'Cineon', 'Panalog', 'ViperLog', 'PLog', 'Canon Log', 'Canon Log 2',
- 'Canon Log 3', 'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C',
- 'REDLog', 'REDLogFilm', 'Log3G10', 'Log3G12', 'ERIMM RGB, 'S-Log',
- 'S-Log2', 'S-Log3', 'V-Log'}**, Computation curve.
+ **{'ACEScc', 'ACEScct', 'ACESproxy', 'ALEXA Log C', 'Canon Log 2',
+ 'Canon Log 3', 'Canon Log', 'Cineon', 'ERIMM RGB', 'Log3G10',
+ 'Log3G12', 'Panalog', 'PLog', 'Protune', 'REDLog', 'REDLogFilm',
+ 'S-Log', 'S-Log2', 'S-Log3', 'V-Log', 'ViperLog'}**, Computation curve.
Other Parameters
----------------
+ EI : int, optional
+ {:func:`log_decoding_ALEXALogC`},
+ Ei.
+ E_clip : numeric, optional
+ {:func:`log_decoding_ERIMMRGB`},
+ Maximum exposure limit.
+ E_min : numeric, optional
+ {:func:`log_decoding_ERIMMRGB`},
+ Minimum exposure limit.
+ I_max : numeric, optional
+ {:func:`log_decoding_ERIMMRGB`},
+ Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
+ 12-bit and 16-bit per channel.
+ bit_depth : unicode, optional
+ {:func:`log_decoding_ACESproxy`},
+ **{'10 Bit', '12 Bit'}**,
+ *ACESproxy* bit depth.
black_offset : numeric or array_like
{:func:`log_decoding_Cineon`, :func:`log_decoding_Panalog`,
:func:`log_decoding_REDLog`, :func:`log_decoding_REDLogFilm`},
Black offset.
- log_reference : numeric or array_like
- {:func:`log_decoding_PivotedLog`},
- Log reference.
- linear_reference : numeric or array_like
- {:func:`log_decoding_PivotedLog`},
- Linear reference.
- negative_gamma : numeric or array_like
- {:func:`log_decoding_PivotedLog`},
- Negative gamma.
density_per_code_value : numeric or array_like
{:func:`log_decoding_PivotedLog`},
Density per code value.
- bit_depth : unicode, optional
- {:func:`log_decoding_ACESproxy`},
- **{'10 Bit', '12 Bit'}**,
- *ACESproxy* bit depth.
firmware : unicode, optional
{:func:`log_decoding_ALEXALogC`},
**{'SUP 3.x', 'SUP 2.x'}**,
Alexa firmware version.
+ linear_reference : numeric or array_like
+ {:func:`log_decoding_PivotedLog`},
+ Linear reference.
+ log_reference : numeric or array_like
+ {:func:`log_decoding_PivotedLog`},
+ Log reference.
+ negative_gamma : numeric or array_like
+ {:func:`log_decoding_PivotedLog`},
+ Negative gamma.
method : unicode, optional
{:func:`log_decoding_ALEXALogC`},
**{'Linear Scene Exposure Factor', 'Normalised Sensor Signal'}**,
Conversion method.
- EI : int, optional
- {:func:`log_decoding_ALEXALogC`},
- Ei.
- I_max : numeric, optional
- {:func:`log_decoding_ERIMMRGB`},
- Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
- 12-bit and 16-bit per channel.
- E_min : numeric, optional
- {:func:`log_decoding_ERIMMRGB`},
- Minimum exposure limit.
- E_clip : numeric, optional
- {:func:`log_decoding_ERIMMRGB`},
- Maximum exposure limit.
Returns
-------
@@ -347,22 +321,25 @@ def log_decoding_curve(value, curve='Cineon', **kwargs):
__all__ += ['LOG_ENCODING_CURVES', 'LOG_DECODING_CURVES']
__all__ += ['log_encoding_curve', 'log_decoding_curve']
-OETFS = CaseInsensitiveMapping(
- {'BT.1886': oetf_BT1886,
- 'BT.2020': oetf_BT2020,
- 'BT.709': oetf_BT709,
- 'DCI-P3': oetf_DCIP3,
- 'ROMM RGB': oetf_ROMMRGB,
- 'ProPhoto RGB': oetf_ProPhotoRGB,
- 'RIMM RGB': oetf_RIMMRGB,
- 'ST 2084': oetf_ST2084,
- 'sRGB': oetf_sRGB})
+OETFS = CaseInsensitiveMapping({
+ 'ARIB STD-B67': oetf_ARIBSTDB67,
+ 'BT.1886': oetf_BT1886,
+ 'BT.2020': oetf_BT2020,
+ 'BT.709': oetf_BT709,
+ 'DCI-P3': oetf_DCIP3,
+ 'DICOM GSDF': oetf_DICOMGSDF,
+ 'ProPhoto RGB': oetf_ProPhotoRGB,
+ 'RIMM RGB': oetf_RIMMRGB,
+ 'ROMM RGB': oetf_ROMMRGB,
+ 'sRGB': oetf_sRGB,
+ 'ST 2084': oetf_ST2084
+})
"""
Supported opto-electrical transfer functions (OETF / OECF).
OETFS : CaseInsensitiveMapping
- **{'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3', 'ROMM RGB',
- 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**
+ **{'ARIB STD-B67', 'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3',
+ 'DICOM GSDF', 'ROMM RGB', 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**
"""
@@ -377,31 +354,34 @@ def oetf(value, function='sRGB', **kwargs):
value : numeric or array_like
Value.
function : unicode, optional
- **{'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3', 'ROMM RGB',
- 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**,
+ **{'ARIB STD-B67', 'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3',
+ 'DICOM GSDF', 'ROMM RGB', 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**,
Computation function.
Other Parameters
----------------
+ E_clip : numeric, optional
+ {:func:`oetf_RIMMRGB`},
+ Maximum exposure level.
+ I_max : numeric, optional
+ {:func:`oetf_ROMMRGB`, :func:`oetf_RIMMRGB`},
+ Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
+ 12-bit and 16-bit per channel.
L_B : numeric, optional
{:func:`oetf_BT1886`},
Screen luminance for black.
L_W : numeric, optional
{:func:`oetf_BT1886`},
Screen luminance for white.
- is_12_bits_system : bool
- {:func:`oetf_BT2020`},
- *BT.709* *alpha* and *beta* constants are used if system is not 12-bit.
- I_max : numeric, optional
- {:func:`oetf_ROMMRGB`, :func:`oetf_RIMMRGB`},
- Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
- 12-bit and 16-bit per channel.
- E_clip : numeric, optional
- {:func:`oetf_RIMMRGB`},
- Maximum exposure level.
L_p : numeric, optional
{:func:`oetf_ST2084`},
Display peak luminance :math:`cd/m^2`.
+ is_12_bits_system : bool
+ {:func:`oetf_BT2020`},
+ *BT.709* *alpha* and *beta* constants are used if system is not 12-bit.
+ r : numeric, optional
+ {:func:`oetf_ARIBSTDB67`},
+ Video level corresponding to reference white level.
Returns
-------
@@ -426,22 +406,25 @@ def oetf(value, function='sRGB', **kwargs):
return function(value, **kwargs)
-EOTFS = CaseInsensitiveMapping(
- {'BT.1886': eotf_BT1886,
- 'BT.2020': eotf_BT2020,
- 'BT.709': eotf_BT709,
- 'DCI-P3': eotf_DCIP3,
- 'ROMM RGB': eotf_ROMMRGB,
- 'ProPhoto RGB': eotf_ProPhotoRGB,
- 'RIMM RGB': eotf_RIMMRGB,
- 'ST 2084': eotf_ST2084,
- 'sRGB': eotf_sRGB})
+EOTFS = CaseInsensitiveMapping({
+ 'ARIB STD-B67': eotf_ARIBSTDB67,
+ 'BT.1886': eotf_BT1886,
+ 'BT.2020': eotf_BT2020,
+ 'BT.709': eotf_BT709,
+ 'DCI-P3': eotf_DCIP3,
+ 'DICOM GSDF': eotf_DICOMGSDF,
+ 'ProPhoto RGB': eotf_ProPhotoRGB,
+ 'RIMM RGB': eotf_RIMMRGB,
+ 'ROMM RGB': eotf_ROMMRGB,
+ 'sRGB': eotf_sRGB,
+ 'ST 2084': eotf_ST2084
+})
"""
Supported electro-optical transfer functions (EOTF / EOCF).
EOTFS : CaseInsensitiveMapping
- **{'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3', 'ROMM RGB',
- 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**
+ **{'ARIB STD-B67', 'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3',
+ 'DICOM GSDF', 'ROMM RGB', 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**
"""
@@ -455,31 +438,34 @@ def eotf(value, function='sRGB', **kwargs):
value : numeric or array_like
Value.
function : unicode, optional
- **{'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3', 'ROMM RGB',
- 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**,
+ **{'ARIB STD-B67', 'sRGB', 'BT.1886', 'BT.2020', 'BT.709', 'DCI-P3',
+ 'DICOM GSDF', 'ROMM RGB', 'ProPhoto RGB', 'RIMM RGB', 'ST 2084'}**,
Computation function.
Other Parameters
----------------
+ E_clip : numeric, optional
+ {:func:`eotf_RIMMRGB`},
+ Maximum exposure level.
+ I_max : numeric, optional
+ {:func:`eotf_ROMMRGB`, :func:`eotf_RIMMRGB`},
+ Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
+ 12-bit and 16-bit per channel.
L_B : numeric, optional
{:func:`eotf_BT1886`},
Screen luminance for black.
L_W : numeric, optional
{:func:`eotf_BT1886`},
Screen luminance for white.
- is_12_bits_system : bool
- {:func:`eotf_BT2020`},
- *BT.709* *alpha* and *beta* constants are used if system is not 12-bit.
- I_max : numeric, optional
- {:func:`eotf_ROMMRGB`, :func:`eotf_RIMMRGB`},
- Maximum code value: 255, 4095 and 650535 for respectively 8-bit,
- 12-bit and 16-bit per channel.
- E_clip : numeric, optional
- {:func:`eotf_RIMMRGB`},
- Maximum exposure level.
L_p : numeric, optional
{:func:`eotf_ST2084`},
Display peak luminance :math:`cd/m^2`.
+ is_12_bits_system : bool
+ {:func:`eotf_BT2020`},
+ *BT.709* *alpha* and *beta* constants are used if system is not 12-bit.
+ r : numeric, optional
+ {:func:`eotf_ARIBSTDB67`},
+ Video level corresponding to reference white level.
Returns
-------
diff --git a/colour/models/rgb/transfer_functions/aces.py b/colour/models/rgb/transfer_functions/aces.py
index cb633a9610..9a9b3968ff 100644
--- a/colour/models/rgb/transfer_functions/aces.py
+++ b/colour/models/rgb/transfer_functions/aces.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Academy Color Encoding System - Log Encodings
=============================================
@@ -51,7 +50,6 @@
https://github.com/ampas/aces-dev/tree/v1.0.3/documents
"""
-
from __future__ import division, unicode_literals
import numpy as np
@@ -65,16 +63,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ACES_PROXY_10_CONSTANTS',
- 'ACES_PROXY_12_CONSTANTS',
- 'ACES_PROXY_CONSTANTS',
- 'ACES_CCT_CONSTANTS',
- 'log_encoding_ACESproxy',
- 'log_decoding_ACESproxy',
- 'log_encoding_ACEScc',
- 'log_decoding_ACEScc',
- 'log_encoding_ACEScct',
- 'log_decoding_ACEScct']
+__all__ = [
+ 'ACES_PROXY_10_CONSTANTS', 'ACES_PROXY_12_CONSTANTS',
+ 'ACES_PROXY_CONSTANTS', 'ACES_CCT_CONSTANTS', 'log_encoding_ACESproxy',
+ 'log_decoding_ACESproxy', 'log_encoding_ACEScc', 'log_decoding_ACEScc',
+ 'log_encoding_ACEScct', 'log_decoding_ACEScct'
+]
ACES_PROXY_10_CONSTANTS = Structure(
CV_min=64,
@@ -100,9 +94,10 @@
ACES_PROXY_12_CONSTANTS : Structure
"""
-ACES_PROXY_CONSTANTS = CaseInsensitiveMapping(
- {'10 Bit': ACES_PROXY_10_CONSTANTS,
- '12 Bit': ACES_PROXY_12_CONSTANTS})
+ACES_PROXY_CONSTANTS = CaseInsensitiveMapping({
+ '10 Bit': ACES_PROXY_10_CONSTANTS,
+ '12 Bit': ACES_PROXY_12_CONSTANTS
+})
"""
Aggregated *ACESproxy* colourspace constants.
@@ -160,12 +155,11 @@ def float_2_cv(x):
return np.maximum(CV_min, np.minimum(CV_max, np.round(x)))
- output = np.where(lin_AP1 > 2 ** -9.72,
- float_2_cv((np.log2(lin_AP1) +
- constants.mid_log_offset) *
- constants.steps_per_stop +
- constants.mid_CV_offset),
- np.resize(CV_min, lin_AP1.shape))
+ output = np.where(
+ lin_AP1 > 2 ** -9.72,
+ float_2_cv((np.log2(lin_AP1) + constants.mid_log_offset) *
+ constants.steps_per_stop + constants.mid_CV_offset),
+ np.resize(CV_min, lin_AP1.shape))
return as_numeric(output, int)
@@ -198,8 +192,9 @@ def log_decoding_ACESproxy(ACESproxy, bit_depth='10 Bit'):
constants = ACES_PROXY_CONSTANTS[bit_depth]
- return (2 ** (((ACESproxy - constants.mid_CV_offset) /
- constants.steps_per_stop - constants.mid_log_offset)))
+ return (2 **
+ (((ACESproxy - constants.mid_CV_offset) / constants.steps_per_stop
+ - constants.mid_log_offset)))
def log_encoding_ACEScc(lin_AP1):
@@ -225,11 +220,9 @@ def log_encoding_ACEScc(lin_AP1):
lin_AP1 = np.asarray(lin_AP1)
- output = np.where(lin_AP1 < 0,
- (np.log2(2 ** -15 * 0.5) + 9.72) / 17.52,
+ output = np.where(lin_AP1 < 0, (np.log2(2 ** -15 * 0.5) + 9.72) / 17.52,
(np.log2(2 ** -16 + lin_AP1 * 0.5) + 9.72) / 17.52)
- output = np.where(lin_AP1 >= 2 ** -15,
- (np.log2(lin_AP1) + 9.72) / 17.52,
+ output = np.where(lin_AP1 >= 2 ** -15, (np.log2(lin_AP1) + 9.72) / 17.52,
output)
return as_numeric(output)
@@ -259,11 +252,9 @@ def log_decoding_ACEScc(ACEScc):
ACEScc = np.asarray(ACEScc)
output = np.where(ACEScc < (9.72 - 15) / 17.52,
- (2 ** (ACEScc * 17.52 - 9.72) - 2 ** -16) * 2,
- 2 ** (ACEScc * 17.52 - 9.72))
- output = np.where(ACEScc >= (np.log2(65504) + 9.72) / 17.52,
- 65504,
- output)
+ (2 ** (ACEScc * 17.52 - 9.72) - 2 ** -16) * 2, 2
+ ** (ACEScc * 17.52 - 9.72))
+ output = np.where(ACEScc >= (np.log2(65504) + 9.72) / 17.52, 65504, output)
return as_numeric(output)
@@ -325,8 +316,7 @@ def log_decoding_ACEScct(ACEScct):
ACEScct = np.asarray(ACEScct)
- output = np.where(ACEScct > constants.Y_BRK,
- 2 ** (ACEScct * 17.52 - 9.72),
+ output = np.where(ACEScct > constants.Y_BRK, 2 ** (ACEScct * 17.52 - 9.72),
(ACEScct - constants.B) / constants.A)
return as_numeric(output)
diff --git a/colour/models/rgb/transfer_functions/alexa_log_c.py b/colour/models/rgb/transfer_functions/alexa_log_c.py
index 37f63ef519..05f027d735 100644
--- a/colour/models/rgb/transfer_functions/alexa_log_c.py
+++ b/colour/models/rgb/transfer_functions/alexa_log_c.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ALEXA Log C Log Encoding
========================
@@ -35,10 +34,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ALEXA_LOG_C_CURVE_BCL_DATA',
- 'ALEXA_LOG_C_CURVE_CONVERSION_DATA',
- 'log_encoding_ALEXALogC',
- 'log_decoding_ALEXALogC']
+__all__ = [
+ 'ALEXA_LOG_C_CURVE_BCL_DATA', 'ALEXA_LOG_C_CURVE_CONVERSION_DATA',
+ 'log_encoding_ALEXALogC', 'log_decoding_ALEXALogC'
+]
ALEXA_LOG_C_CURVE_BCL_DATA = CaseInsensitiveMapping({
'SUP 3.x': {
@@ -55,7 +54,8 @@
1600: (0.0928, 1.0000),
2000: (0.0928, 1.0000),
2560: (0.0928, 1.0000),
- 3200: (0.0928, 1.0000)},
+ 3200: (0.0928, 1.0000)
+ },
'SUP 2.x': {
160: (0.1083, 0.8110),
200: (0.1115, 0.8320),
@@ -67,7 +67,9 @@
800: (0.1311, 0.9494),
1000: (0.1343, 0.9662),
1280: (0.1378, 0.9841),
- 1600: (0.1409, 0.9997)}})
+ 1600: (0.1409, 0.9997)
+ }
+})
"""
*ALEXA Log C* curve *Ei, Black, Clipping Level* data.
@@ -99,7 +101,8 @@
1280: (0.004120, 320.0, -1.207168, 0.240810,
0.386590, 301.197380, -1.084020, 0.156799),
1600: (0.004088, 400.0, -1.524256, 0.237781,
- 0.387093, 371.761171, -1.359723, 0.160192)},
+ 0.387093, 371.761171, -1.359723, 0.160192)
+ },
'Linear Scene Exposure Factor': {
160: (0.005561, 5.555556, 0.080216, 0.269036,
0.381991, 5.842037, 0.092778, 0.125266),
@@ -122,7 +125,9 @@
1280: (0.012235, 5.555556, 0.043137, 0.240810,
0.386590, 5.229121, 0.092819, 0.156799),
1600: (0.013047, 5.555556, 0.038625, 0.237781,
- 0.387093, 5.163350, 0.092824, 0.16019)}}),
+ 0.387093, 5.163350, 0.092824, 0.16019)
+ }
+ }),
'SUP 2.x': CaseInsensitiveMapping({
'Normalised Sensor Signal': {
160: (0.003907, 36.439829, -0.053366, 0.269035,
@@ -146,7 +151,8 @@
1280: (0.003907, 291.518630, -1.049959, 0.240810,
0.391007, 251.689459, -0.845336, 0.13801),
1600: (0.003907, 364.398287, -1.334700, 0.237781,
- 0.391007, 293.073575, -1.003841, 0.14119)},
+ 0.391007, 293.073575, -1.003841, 0.14119)
+ },
'Linear Scene Exposure Factor': {
160: (0.000000, 5.061087, 0.089004, 0.269035,
0.391007, 6.332427, 0.108361, 0.108361),
@@ -169,7 +175,9 @@
1280: (0.000000, 5.061087, 0.089004, 0.240810,
0.391007, 4.369609, 0.138015, 0.138015),
1600: (0.000000, 5.061087, 0.089004, 0.237781,
- 0.391007, 4.070466, 0.141197, 0.14119)}})})
+ 0.391007, 4.070466, 0.141197, 0.14119)}
+ })
+}) # yapf: disable
"""
*ALEXA Log C* curve conversion data between signal and linear scene exposure
factor for *SUP 3.x* and signal and normalized sensor signal for *SUP 2.x*.
@@ -216,9 +224,8 @@ def log_encoding_ALEXALogC(x,
cut, a, b, c, d, e, f, _e_cut_f = (
ALEXA_LOG_C_CURVE_CONVERSION_DATA[firmware][method][EI])
- return as_numeric(np.where(x > cut,
- c * np.log10(a * x + b) + d,
- e * x + f))
+ return as_numeric(
+ np.where(x > cut, c * np.log10(a * x + b) + d, e * x + f))
def log_decoding_ALEXALogC(t,
@@ -258,6 +265,6 @@ def log_decoding_ALEXALogC(t,
cut, a, b, c, d, e, f, _e_cut_f = (
ALEXA_LOG_C_CURVE_CONVERSION_DATA[firmware][method][EI])
- return as_numeric(np.where(t > e * cut + f,
- (np.power(10, (t - d) / c) - b) / a,
- (t - f) / e))
+ return as_numeric(
+ np.where(t > e * cut + f, (np.power(10, (t - d) / c) - b) / a, (t - f)
+ / e))
diff --git a/colour/models/rgb/transfer_functions/arib_std_b67.py b/colour/models/rgb/transfer_functions/arib_std_b67.py
new file mode 100644
index 0000000000..dc72a780ce
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/arib_std_b67.py
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ARIB STD-B67 (Hybrid Log-Gamma)
+===============================
+
+Defines *ARIB STD-B67 (Hybrid Log-Gamma)* opto-electrical transfer function
+(OETF / OECF) and electro-optical transfer function (EOTF / EOCF):
+
+- :func:`oetf_ARIBSTDB67`
+- :func:`eotf_ARIBSTDB67`
+
+See Also
+--------
+`RGB Colourspaces Jupyter Notebook
+`_
+
+References
+----------
+.. [1] Association of Radio Industries and Businesses. (2015). Essential
+ Parameter Values for the Extended Image Dynamic Range Television
+ (EIDRTV) System for Programme Production. Arib Std-B67. Retrieved from
+ http://www.arib.or.jp/english/html/overview/std-b67.html
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.utilities import Structure, as_numeric, warning
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['ARIBSTDB67_CONSTANTS', 'oetf_ARIBSTDB67', 'eotf_ARIBSTDB67']
+
+ARIBSTDB67_CONSTANTS = Structure(a=0.17883277, b=0.28466892, c=0.55991073)
+"""
+*ARIB STD-B67 (Hybrid Log-Gamma)* constants.
+
+ARIBSTDB67_CONSTANTS : Structure
+"""
+
+
+def oetf_ARIBSTDB67(E, r=0.5):
+ """
+ Defines *ARIB STD-B67 (Hybrid Log-Gamma)* opto-electrical transfer
+ function (OETF / OECF).
+
+ Parameters
+ ----------
+ E : numeric or array_like
+ Voltage normalized by the reference white level and proportional to
+ the implicit light intensity that would be detected with a reference
+ camera color channel R, G, B.
+ r : numeric, optional
+ Video level corresponding to reference white level.
+
+ Returns
+ -------
+ numeric or ndarray
+ Resulting non-linear signal :math:`E'`.
+
+ Examples
+ --------
+ >>> oetf_ARIBSTDB67(0.18) # doctest: +ELLIPSIS
+ 0.2121320...
+ """
+
+ E = np.asarray(E)
+
+ a = ARIBSTDB67_CONSTANTS.a
+ b = ARIBSTDB67_CONSTANTS.b
+ c = ARIBSTDB67_CONSTANTS.c
+
+ E_p = np.where(E <= 1, r * np.sqrt(E), a * np.log(E - b) + c)
+
+ return as_numeric(E_p)
+
+
+def eotf_ARIBSTDB67(E_p, r=0.5):
+ """
+ Defines *ARIB STD-B67 (Hybrid Log-Gamma)* electro-optical transfer
+ function (EOTF / EOCF).
+
+ Parameters
+ ----------
+ E_p : numeric or array_like
+ Non-linear signal :math:`E'`.
+ r : numeric, optional
+ Video level corresponding to reference white level.
+
+ Returns
+ -------
+ numeric or ndarray
+ Voltage :math:`E` normalized by the reference white level and
+ proportional to the implicit light intensity that would be detected
+ with a reference camera color channel R, G, B.
+
+ Warning
+ -------
+ *ARIB STD-B67 (Hybrid Log-Gamma)* doesn't specify an electro-optical
+ transfer function. This definition is used for symmetry in unit tests and
+ other computations but should not be used as an *EOTF*.
+
+ Examples
+ --------
+ >>> eotf_ARIBSTDB67(0.212132034355964) # doctest: +ELLIPSIS
+ 0.1799999...
+ """
+
+ warning(('*ARIB STD-B67 (Hybrid Log-Gamma)* doesn\'t specify an '
+ 'electro-optical transfer function. This definition is used '
+ 'for symmetry in unit tests and others computations but should '
+ 'not be used as an *EOTF*!'))
+
+ E_p = np.asarray(E_p)
+
+ a = ARIBSTDB67_CONSTANTS.a
+ b = ARIBSTDB67_CONSTANTS.b
+ c = ARIBSTDB67_CONSTANTS.c
+
+ E = np.where(E_p <= oetf_ARIBSTDB67(1), (E_p / r) ** 2,
+ np.exp((E_p - c) / a) + b)
+
+ return as_numeric(E)
diff --git a/colour/models/rgb/transfer_functions/bt_1886.py b/colour/models/rgb/transfer_functions/bt_1886.py
index 73fb873e9f..2802aa0457 100644
--- a/colour/models/rgb/transfer_functions/bt_1886.py
+++ b/colour/models/rgb/transfer_functions/bt_1886.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ITU-R BT.1886
=============
@@ -37,11 +36,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['oetf_BT1886',
- 'eotf_BT1886']
+__all__ = ['oetf_BT1886', 'eotf_BT1886']
-def oetf_BT1886(L, L_B=64, L_W=940):
+def oetf_BT1886(L, L_B=0, L_W=1):
"""
Defines *Recommendation ITU-R BT.1886* opto-electrical transfer function
(OETF / OECF).
@@ -69,7 +67,7 @@ def oetf_BT1886(L, L_B=64, L_W=940):
Examples
--------
- >>> oetf_BT1886(277.98159179331145) # doctest: +ELLIPSIS
+ >>> oetf_BT1886(0.11699185725296059) # doctest: +ELLIPSIS
0.4090077...
"""
@@ -92,7 +90,7 @@ def oetf_BT1886(L, L_B=64, L_W=940):
return V
-def eotf_BT1886(V, L_B=64, L_W=940):
+def eotf_BT1886(V, L_B=0, L_W=1):
"""
Defines *Recommendation ITU-R BT.1886* electro-optical transfer function
(EOTF / EOCF).
@@ -118,7 +116,7 @@ def eotf_BT1886(V, L_B=64, L_W=940):
Examples
--------
>>> eotf_BT1886(0.409007728864150) # doctest: +ELLIPSIS
- 277.9815917...
+ 0.1169918...
"""
V = np.asarray(V)
diff --git a/colour/models/rgb/transfer_functions/bt_2020.py b/colour/models/rgb/transfer_functions/bt_2020.py
index f009262473..c789babc10 100644
--- a/colour/models/rgb/transfer_functions/bt_2020.py
+++ b/colour/models/rgb/transfer_functions/bt_2020.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ITU-R BT.2020
=============
@@ -39,12 +38,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['BT2020_CONSTANTS',
- 'oetf_BT2020',
- 'eotf_BT2020']
+__all__ = ['BT2020_CONSTANTS', 'oetf_BT2020', 'eotf_BT2020']
-BT2020_CONSTANTS = Structure(alpha=lambda x: 1.0993 if x else 1.099,
- beta=lambda x: 0.0181 if x else 0.018)
+BT2020_CONSTANTS = Structure(
+ alpha=lambda x: 1.0993 if x else 1.099,
+ beta=lambda x: 0.0181 if x else 0.018)
"""
*BT.2020* colourspace constants.
@@ -82,9 +80,7 @@ def oetf_BT2020(E, is_12_bits_system=False):
a = BT2020_CONSTANTS.alpha(is_12_bits_system)
b = BT2020_CONSTANTS.beta(is_12_bits_system)
- return as_numeric(np.where(E < b,
- E * 4.5,
- a * (E ** 0.45) - (a - 1)))
+ return as_numeric(np.where(E < b, E * 4.5, a * (E ** 0.45) - (a - 1)))
def eotf_BT2020(E_p, is_12_bits_system=False):
@@ -115,6 +111,6 @@ def eotf_BT2020(E_p, is_12_bits_system=False):
a = BT2020_CONSTANTS.alpha(is_12_bits_system)
b = BT2020_CONSTANTS.beta(is_12_bits_system)
- return as_numeric(np.where(E_p < oetf_BT2020(b),
- E_p / 4.5,
- ((E_p + (a - 1)) / a) ** (1 / 0.45)))
+ return as_numeric(
+ np.where(E_p < oetf_BT2020(b), E_p / 4.5, ((E_p + (a - 1)) / a) ** (
+ 1 / 0.45)))
diff --git a/colour/models/rgb/transfer_functions/bt_709.py b/colour/models/rgb/transfer_functions/bt_709.py
index e2194a52ad..516c2e5b2b 100644
--- a/colour/models/rgb/transfer_functions/bt_709.py
+++ b/colour/models/rgb/transfer_functions/bt_709.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ITU-R BT.709-6
==============
@@ -39,8 +38,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['oetf_BT709',
- 'eotf_BT709']
+__all__ = ['oetf_BT709', 'eotf_BT709']
def oetf_BT709(L):
@@ -66,9 +64,8 @@ def oetf_BT709(L):
L = np.asarray(L)
- return as_numeric(np.where(L < 0.018,
- L * 4.5,
- 1.099 * (L ** 0.45) - 0.099))
+ return as_numeric(
+ np.where(L < 0.018, L * 4.5, 1.099 * (L ** 0.45) - 0.099))
def eotf_BT709(V):
@@ -105,6 +102,6 @@ def eotf_BT709(V):
V = np.asarray(V)
- return as_numeric(np.where(V < oetf_BT709(0.018),
- V / 4.5,
- ((V + 0.099) / 1.099) ** (1 / 0.45)))
+ return as_numeric(
+ np.where(V < oetf_BT709(0.018), V / 4.5, ((V + 0.099) / 1.099) ** (
+ 1 / 0.45)))
diff --git a/colour/models/rgb/transfer_functions/canon_log.py b/colour/models/rgb/transfer_functions/canon_log.py
index e951694c38..c652680754 100644
--- a/colour/models/rgb/transfer_functions/canon_log.py
+++ b/colour/models/rgb/transfer_functions/canon_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Canon Log Encodings
===================
@@ -49,12 +48,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_CanonLog',
- 'log_decoding_CanonLog',
- 'log_encoding_CanonLog2',
- 'log_decoding_CanonLog2',
- 'log_encoding_CanonLog3',
- 'log_decoding_CanonLog3']
+__all__ = [
+ 'log_encoding_CanonLog', 'log_decoding_CanonLog', 'log_encoding_CanonLog2',
+ 'log_decoding_CanonLog2', 'log_encoding_CanonLog3',
+ 'log_decoding_CanonLog3'
+]
def log_encoding_CanonLog(x):
@@ -84,10 +82,9 @@ def log_encoding_CanonLog(x):
x = np.asarray(x)
- clog_ire = np.where(
- x < log_decoding_CanonLog(0.0730597),
- -(0.529136 * (np.log10(-x * 10.1596 + 1)) - 0.0730597),
- 0.529136 * np.log10(10.1596 * x + 1) + 0.0730597)
+ clog_ire = np.where(x < log_decoding_CanonLog(0.0730597),
+ -(0.529136 * (np.log10(-x * 10.1596 + 1)) - 0.0730597),
+ 0.529136 * np.log10(10.1596 * x + 1) + 0.0730597)
return as_numeric(clog_ire)
@@ -120,10 +117,9 @@ def log_decoding_CanonLog(clog_ire):
clog_ire = np.asarray(clog_ire)
- x = np.where(
- clog_ire < 0.0730597,
- -(10 ** ((0.0730597 - clog_ire) / 0.529136) - 1) / 10.1596,
- (10 ** ((clog_ire - 0.0730597) / 0.529136) - 1) / 10.1596)
+ x = np.where(clog_ire < 0.0730597,
+ -(10 ** ((0.0730597 - clog_ire) / 0.529136) - 1) / 10.1596,
+ (10 ** ((clog_ire - 0.0730597) / 0.529136) - 1) / 10.1596)
return as_numeric(x)
@@ -266,8 +262,7 @@ def log_decoding_CanonLog3(clog3_ire):
clog3_ire = np.asarray(clog3_ire)
x = np.select(
- (clog3_ire < 0.04076162,
- clog3_ire <= 0.105357102,
+ (clog3_ire < 0.04076162, clog3_ire <= 0.105357102,
clog3_ire > 0.105357102),
(-(10 ** ((0.069886632 - clog3_ire) / 0.42889912) - 1) / 14.98325,
(clog3_ire - 0.073059361) / 2.3069815,
diff --git a/colour/models/rgb/transfer_functions/cineon.py b/colour/models/rgb/transfer_functions/cineon.py
index 604d538b8f..7fe9cc5803 100644
--- a/colour/models/rgb/transfer_functions/cineon.py
+++ b/colour/models/rgb/transfer_functions/cineon.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Kodak Cineon Encoding
=====================
@@ -34,12 +33,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_Cineon',
- 'log_decoding_Cineon']
+__all__ = ['log_encoding_Cineon', 'log_decoding_Cineon']
-def log_encoding_Cineon(x,
- black_offset=10 ** ((95 - 685) / 300)):
+def log_encoding_Cineon(x, black_offset=10 ** ((95 - 685) / 300)):
"""
Defines the *Cineon* log encoding curve / opto-electronic transfer
function.
@@ -64,12 +61,11 @@ def log_encoding_Cineon(x,
x = np.asarray(x)
- return ((685 + 300 *
- np.log10(x * (1 - black_offset) + black_offset)) / 1023)
+ return ((
+ 685 + 300 * np.log10(x * (1 - black_offset) + black_offset)) / 1023)
-def log_decoding_Cineon(y,
- black_offset=10 ** ((95 - 685) / 300)):
+def log_decoding_Cineon(y, black_offset=10 ** ((95 - 685) / 300)):
"""
Defines the *Cineon* log decoding curve / electro-optical transfer
function.
diff --git a/colour/models/rgb/transfer_functions/dci_p3.py b/colour/models/rgb/transfer_functions/dci_p3.py
index 6a367cc0e6..901994a331 100644
--- a/colour/models/rgb/transfer_functions/dci_p3.py
+++ b/colour/models/rgb/transfer_functions/dci_p3.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
DCI-P3 Colourspace
==================
@@ -36,8 +35,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['oetf_DCIP3',
- 'eotf_DCIP3']
+__all__ = ['oetf_DCIP3', 'eotf_DCIP3']
def oetf_DCIP3(XYZ):
diff --git a/colour/models/rgb/transfer_functions/dicom_gsdf.py b/colour/models/rgb/transfer_functions/dicom_gsdf.py
new file mode 100644
index 0000000000..811ad68c5f
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/dicom_gsdf.py
@@ -0,0 +1,162 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+DICOM - Grayscale Standard Display Function
+===========================================
+
+Defines the *DICOM - Grayscale Standard Display Function* opto-electrical
+transfer function (OETF / OECF) and electro-optical transfer function
+(EOTF / EOCF):
+
+- :func:`oetf_DICOMGSDF`
+- :func:`eotf_DICOMGSDF`
+
+The Grayscale Standard Display Function is defined for the Luminance Range
+from :math:`0.05` to :math:`4000 cd/m^2`. The minimum Luminance corresponds
+to the lowest practically useful Luminance of cathode-ray-tube (CRT) monitors
+and the maximum exceeds the unattenuated Luminance of very bright light-boxes
+used for interpreting X-Ray mammography. The Grayscale Standard Display
+Function explicitly includes the effects of the diffused ambient Illuminance.
+
+See Also
+--------
+`RGB Colourspaces Jupyter Notebook
+`_
+
+References
+----------
+.. [1] National Electrical Manufacturers Association. (2004). Digital Imaging
+ and Communications in Medicine ( DICOM ) Part 14 :
+ Grayscale Standard Display Function. Medicine, 10(S1), 3–4.
+ doi:10.1007/BF03168637
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+from colour.utilities import Structure, as_numeric
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['DICOMGSDF_CONSTANTS', 'oetf_DICOMGSDF', 'eotf_DICOMGSDF']
+
+DICOMGSDF_CONSTANTS = Structure(
+ a=-1.3011877,
+ b=-2.5840191e-2,
+ c=8.0242636e-2,
+ d=-1.0320229e-1,
+ e=1.3646699e-1,
+ f=2.8745620e-2,
+ g=-2.5468404e-2,
+ h=-3.1978977e-3,
+ k=1.2992634e-4,
+ m=1.3635334e-3,
+ A=71.498068,
+ B=94.593053,
+ C=41.912053,
+ D=9.8247004,
+ E=0.28175407,
+ F=-1.1878455,
+ G=-0.18014349,
+ H=0.14710899,
+ I=-0.017046845)
+"""
+*DICOM Grayscale Standard Display Function* constants.
+
+DICOMGSDF_CONSTANTS : Structure
+"""
+
+
+def oetf_DICOMGSDF(L):
+ """
+ Defines the *DICOM - Grayscale Standard Display Function* opto-electronic
+ transfer function (OETF / OECF).
+
+ Parameters
+ ----------
+ L : numeric or array_like
+ *Luminance* :math:`L`.
+
+ Returns
+ -------
+ numeric or ndarray
+ Just-Noticeable Difference (JND) Index, :math:`j` in domain 1 to 1023.
+
+ Examples
+ --------
+ >>> oetf_DICOMGSDF(130.065284012159790) # doctest: +ELLIPSIS
+ 511.9964806...
+ """
+
+ L = np.asarray(L)
+
+ L_lg = np.log10(L)
+
+ A = DICOMGSDF_CONSTANTS.A
+ B = DICOMGSDF_CONSTANTS.B
+ C = DICOMGSDF_CONSTANTS.C
+ D = DICOMGSDF_CONSTANTS.D
+ E = DICOMGSDF_CONSTANTS.E
+ F = DICOMGSDF_CONSTANTS.F
+ G = DICOMGSDF_CONSTANTS.G
+ H = DICOMGSDF_CONSTANTS.H
+ I = DICOMGSDF_CONSTANTS.I
+
+ L = (A + B * L_lg + C * L_lg ** 2 + D * L_lg ** 3 + E * L_lg ** 4 +
+ F * L_lg ** 5 + G * L_lg ** 6 + H * L_lg ** 7 + I * L_lg ** 8)
+
+ return as_numeric(L)
+
+
+def eotf_DICOMGSDF(J):
+ """
+ Defines the *DICOM - Grayscale Standard Display Function* electro-optical
+ transfer function (EOTF / EOCF).
+
+ Parameters
+ ----------
+ J : numeric or array_like
+ Just-Noticeable Difference (JND) Index, :math:`j` in range 1 to 1023.
+
+ Returns
+ -------
+ numeric or ndarray
+ Corresponding *luminance* :math:`L`.
+
+ Examples
+ --------
+ >>> eotf_DICOMGSDF(512) # doctest: +ELLIPSIS
+ 130.0652840...
+ """
+
+ J = np.asarray(J)
+
+ a = DICOMGSDF_CONSTANTS.a
+ b = DICOMGSDF_CONSTANTS.b
+ c = DICOMGSDF_CONSTANTS.c
+ d = DICOMGSDF_CONSTANTS.d
+ e = DICOMGSDF_CONSTANTS.e
+ f = DICOMGSDF_CONSTANTS.f
+ g = DICOMGSDF_CONSTANTS.g
+ h = DICOMGSDF_CONSTANTS.h
+ k = DICOMGSDF_CONSTANTS.k
+ m = DICOMGSDF_CONSTANTS.m
+
+ J_ln = np.log(J)
+ J_ln2 = J_ln ** 2
+ J_ln3 = J_ln ** 3
+ J_ln4 = J_ln ** 4
+ J_ln5 = J_ln ** 5
+
+ L = ((a + c * J_ln + e * J_ln2 + g * J_ln3 + m * J_ln4) /
+ (1 + b * J_ln + d * J_ln2 + f * J_ln3 + h * J_ln4 + k * J_ln5))
+ L = 10 ** L
+
+ return as_numeric(L)
diff --git a/colour/models/rgb/transfer_functions/gamma.py b/colour/models/rgb/transfer_functions/gamma.py
index 0f8fcaf9eb..82e0696715 100644
--- a/colour/models/rgb/transfer_functions/gamma.py
+++ b/colour/models/rgb/transfer_functions/gamma.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Gamma Colour Component Transfer Function
========================================
@@ -8,7 +7,7 @@
Defines gamma encoding / decoding colour component transfer function related
objects:
-- :func:`gamma_function`
+- :func:`function_gamma`
See Also
--------
@@ -30,12 +29,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['gamma_function']
+__all__ = ['function_gamma']
-def gamma_function(a,
- exponent=1,
- negative_number_handling='indeterminate'):
+def function_gamma(a, exponent=1, negative_number_handling='indeterminate'):
"""
Defines a typical gamma encoding / decoding function.
@@ -71,17 +68,17 @@ def gamma_function(a,
Examples
--------
- >>> gamma_function(0.18, 2.2) # doctest: +ELLIPSIS
+ >>> function_gamma(0.18, 2.2) # doctest: +ELLIPSIS
0.0229932...
- >>> gamma_function(-0.18, 2.0) # doctest: +ELLIPSIS
+ >>> function_gamma(-0.18, 2.0) # doctest: +ELLIPSIS
0.0323999...
- >>> gamma_function(-0.18, 2.2)
+ >>> function_gamma(-0.18, 2.2)
nan
- >>> gamma_function(-0.18, 2.2, 'Mirror') # doctest: +ELLIPSIS
+ >>> function_gamma(-0.18, 2.2, 'Mirror') # doctest: +ELLIPSIS
-0.0229932...
- >>> gamma_function(-0.18, 2.2, 'Preserve') # doctest: +ELLIPSIS
+ >>> function_gamma(-0.18, 2.2, 'Preserve') # doctest: +ELLIPSIS
-0.1...
- >>> gamma_function(-0.18, 2.2, 'Clamp') # doctest: +ELLIPSIS
+ >>> function_gamma(-0.18, 2.2, 'Clamp') # doctest: +ELLIPSIS
0.0
"""
@@ -98,6 +95,5 @@ def gamma_function(a,
elif negative_number_handling == 'clamp':
return as_numeric(np.where(a < 0, 0, a ** exponent))
else:
- raise ValueError(
- 'Undefined negative number handling method: "{0}".'.format(
- negative_number_handling))
+ raise ValueError('Undefined negative number handling method: "{0}".'.
+ format(negative_number_handling))
diff --git a/colour/models/rgb/transfer_functions/gopro.py b/colour/models/rgb/transfer_functions/gopro.py
new file mode 100644
index 0000000000..7b877fa37c
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/gopro.py
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+GoPro Encodings
+===============
+
+Defines the *GoPro* encodings:
+
+- :func:`log_encoding_Protune`
+- :func:`log_decoding_Protune`
+
+See Also
+--------
+`RGB Colourspaces Jupyter Notebook
+`_
+
+References
+----------
+.. [1] GoPro, Duiker, H.-P., & Mansencal, T. (2016). gopro.py. Retrieved
+ April 12, 2017, from https://github.com/hpd/OpenColorIO-Configs/blob/\
+master/aces_1.0.3/python/aces_ocio/colorspaces/gopro.py
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['log_encoding_Protune', 'log_decoding_Protune']
+
+
+def log_encoding_Protune(x):
+ """
+ Defines the *Protune* log encoding curve / opto-electronic transfer
+ function.
+
+ Parameters
+ ----------
+ x : numeric or array_like
+ Linear data :math:`x`.
+
+ Returns
+ -------
+ numeric or ndarray
+ Non-linear data :math:`y`.
+
+ Examples
+ --------
+ >>> log_encoding_Protune(0.18) # doctest: +ELLIPSIS
+ 0.6456234...
+ """
+
+ x = np.asarray(x)
+
+ return np.log(x * 112 + 1) / np.log(113)
+
+
+def log_decoding_Protune(y):
+ """
+ Defines the *Protune* log decoding curve / electro-optical transfer
+ function.
+
+ Parameters
+ ----------
+ y : numeric or array_like
+ Non-linear data :math:`y`.
+
+ Returns
+ -------
+ numeric or ndarray
+ Linear data :math:`x`.
+
+ Examples
+ --------
+ >>> log_decoding_Protune(0.645623486803636) # doctest: +ELLIPSIS
+ 0.1...
+ """
+
+ y = np.asarray(y)
+
+ return (113 ** y - 1) / 112
diff --git a/colour/models/rgb/transfer_functions/linear.py b/colour/models/rgb/transfer_functions/linear.py
index e4058e7185..ea8d3e0d97 100644
--- a/colour/models/rgb/transfer_functions/linear.py
+++ b/colour/models/rgb/transfer_functions/linear.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Linear Colour Component Transfer Function
=========================================
@@ -8,7 +7,7 @@
Defines linear encoding / decoding colour component transfer function related
objects:
-- :func:`linear_function`
+- :func:`function_linear`
See Also
--------
@@ -26,10 +25,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['linear_function']
+__all__ = ['function_linear']
-def linear_function(a):
+def function_linear(a):
"""
Defines a typical linear encoding / decoding function, essentially a
pass-through function.
@@ -46,7 +45,7 @@ def linear_function(a):
Examples
--------
- >>> linear_function(0.18)
+ >>> function_linear(0.18)
0.18
"""
diff --git a/colour/models/rgb/transfer_functions/panalog.py b/colour/models/rgb/transfer_functions/panalog.py
index ec8ab03d66..0aa7ea9952 100644
--- a/colour/models/rgb/transfer_functions/panalog.py
+++ b/colour/models/rgb/transfer_functions/panalog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Panalog Encoding
================
@@ -34,12 +33,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_Panalog',
- 'log_decoding_Panalog']
+__all__ = ['log_encoding_Panalog', 'log_decoding_Panalog']
-def log_encoding_Panalog(x,
- black_offset=10 ** ((64 - 681) / 444)):
+def log_encoding_Panalog(x, black_offset=10 ** ((64 - 681) / 444)):
"""
Defines the *Panalog* log encoding curve / opto-electronic transfer
function.
@@ -69,12 +66,11 @@ def log_encoding_Panalog(x,
x = np.asarray(x)
- return ((681 + 444 *
- np.log10(x * (1 - black_offset) + black_offset)) / 1023)
+ return ((
+ 681 + 444 * np.log10(x * (1 - black_offset) + black_offset)) / 1023)
-def log_decoding_Panalog(y,
- black_offset=10 ** ((64 - 681) / 444)):
+def log_decoding_Panalog(y, black_offset=10 ** ((64 - 681) / 444)):
"""
Defines the *Panalog* log decoding curve / electro-optical transfer
function.
diff --git a/colour/models/rgb/transfer_functions/panasonic_vlog.py b/colour/models/rgb/transfer_functions/panasonic_vlog.py
index 04ce602bcc..8351b20e3e 100644
--- a/colour/models/rgb/transfer_functions/panasonic_vlog.py
+++ b/colour/models/rgb/transfer_functions/panasonic_vlog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Panasonic V-Log Log Encoding
============================
@@ -36,15 +35,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['VLOG_CONSTANTS',
- 'log_encoding_VLog',
- 'log_decoding_VLog']
+__all__ = ['VLOG_CONSTANTS', 'log_encoding_VLog', 'log_decoding_VLog']
-VLOG_CONSTANTS = Structure(cut1=0.01,
- cut2=0.181,
- b=0.00873,
- c=0.241514,
- d=0.598206)
+VLOG_CONSTANTS = Structure(
+ cut1=0.01, cut2=0.181, b=0.00873, c=0.241514, d=0.598206)
"""
*Panasonic V-Log* colourspace constants.
@@ -80,8 +74,7 @@ def log_encoding_VLog(L_in):
c = VLOG_CONSTANTS.c
d = VLOG_CONSTANTS.d
- L_in = np.where(L_in < cut1,
- 5.6 * L_in + 0.125,
+ L_in = np.where(L_in < cut1, 5.6 * L_in + 0.125,
c * np.log10(L_in + b) + d)
return as_numeric(L_in)
@@ -115,8 +108,7 @@ def log_decoding_VLog(V_out):
c = VLOG_CONSTANTS.c
d = VLOG_CONSTANTS.d
- V_out = np.where(V_out < cut2,
- (V_out - 0.125) / 5.6,
+ V_out = np.where(V_out < cut2, (V_out - 0.125) / 5.6,
np.power(10, ((V_out - d) / c)) - b)
return as_numeric(V_out)
diff --git a/colour/models/rgb/transfer_functions/pivoted_log.py b/colour/models/rgb/transfer_functions/pivoted_log.py
index cc0a2905af..ba94f8d432 100644
--- a/colour/models/rgb/transfer_functions/pivoted_log.py
+++ b/colour/models/rgb/transfer_functions/pivoted_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Pivoted Log Encoding
====================
@@ -34,8 +33,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_PivotedLog',
- 'log_decoding_PivotedLog']
+__all__ = ['log_encoding_PivotedLog', 'log_decoding_PivotedLog']
def log_encoding_PivotedLog(x,
@@ -112,6 +110,6 @@ def log_decoding_PivotedLog(y,
y = np.asarray(y)
- return (10 ** ((y * 1023 - log_reference) *
- (density_per_code_value / negative_gamma)) *
- linear_reference)
+ return (10 **
+ ((y * 1023 - log_reference) *
+ (density_per_code_value / negative_gamma)) * linear_reference)
diff --git a/colour/models/rgb/transfer_functions/red_log.py b/colour/models/rgb/transfer_functions/red_log.py
index dda780088b..7a512f3f38 100644
--- a/colour/models/rgb/transfer_functions/red_log.py
+++ b/colour/models/rgb/transfer_functions/red_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RED Log Encodings
=================
@@ -34,9 +33,8 @@
import numpy as np
-from colour.models.rgb.transfer_functions import (
- log_encoding_Cineon,
- log_decoding_Cineon)
+from colour.models.rgb.transfer_functions import (log_encoding_Cineon,
+ log_decoding_Cineon)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -45,18 +43,14 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_REDLog',
- 'log_decoding_REDLog',
- 'log_encoding_REDLogFilm',
- 'log_decoding_REDLogFilm',
- 'log_encoding_Log3G10',
- 'log_decoding_Log3G10',
- 'log_encoding_Log3G12',
- 'log_decoding_Log3G12']
+__all__ = [
+ 'log_encoding_REDLog', 'log_decoding_REDLog', 'log_encoding_REDLogFilm',
+ 'log_decoding_REDLogFilm', 'log_encoding_Log3G10', 'log_decoding_Log3G10',
+ 'log_encoding_Log3G12', 'log_decoding_Log3G12'
+]
-def log_encoding_REDLog(x,
- black_offset=10 ** ((0 - 1023) / 511)):
+def log_encoding_REDLog(x, black_offset=10 ** ((0 - 1023) / 511)):
"""
Defines the *REDLog* log encoding curve / opto-electronic transfer
function.
@@ -81,12 +75,11 @@ def log_encoding_REDLog(x,
x = np.asarray(x)
- return ((1023 +
- 511 * np.log10(x * (1 - black_offset) + black_offset)) / 1023)
+ return ((
+ 1023 + 511 * np.log10(x * (1 - black_offset) + black_offset)) / 1023)
-def log_decoding_REDLog(y,
- black_offset=10 ** ((0 - 1023) / 511)):
+def log_decoding_REDLog(y, black_offset=10 ** ((0 - 1023) / 511)):
"""
Defines the *REDLog* log decoding curve / electro-optical transfer
function.
@@ -111,13 +104,11 @@ def log_decoding_REDLog(y,
y = np.asarray(y)
- return (((10 **
- ((1023 * y - 1023) / 511)) - black_offset) /
+ return (((10 ** ((1023 * y - 1023) / 511)) - black_offset) /
(1 - black_offset))
-def log_encoding_REDLogFilm(x,
- black_offset=10 ** ((95 - 685) / 300)):
+def log_encoding_REDLogFilm(x, black_offset=10 ** ((95 - 685) / 300)):
"""
Defines the *REDLogFilm* log encoding curve / opto-electronic transfer
function.
@@ -143,8 +134,7 @@ def log_encoding_REDLogFilm(x,
return log_encoding_Cineon(x, black_offset)
-def log_decoding_REDLogFilm(y,
- black_offset=10 ** ((95 - 685) / 300)):
+def log_decoding_REDLogFilm(y, black_offset=10 ** ((95 - 685) / 300)):
"""
Defines the *REDLogFilm* log decoding curve / electro-optical transfer
function.
@@ -234,8 +224,8 @@ def log_encoding_Log3G10(x, legacy_curve=False):
if legacy_curve:
return np.sign(x) * 0.222497 * np.log10((np.abs(x) * 169.379333) + 1)
else:
- return (np.sign(x + 0.01) *
- 0.224282 * np.log10((np.abs(x + 0.01) * 155.975327) + 1))
+ return (np.sign(x + 0.01) * 0.224282 *
+ np.log10((np.abs(x + 0.01) * 155.975327) + 1))
def log_decoding_Log3G10(y, legacy_curve=False):
@@ -269,8 +259,8 @@ def log_decoding_Log3G10(y, legacy_curve=False):
return (np.sign(y) *
(np.power(10.0, np.abs(y) / 0.222497) - 1) / 169.379333)
else:
- return (np.sign(y) * (np.power(10.0, np.abs(y) / 0.224282) - 1) /
- 155.975327) - 0.01
+ return (np.sign(y) *
+ (np.power(10.0, np.abs(y) / 0.224282) - 1) / 155.975327) - 0.01
def log_encoding_Log3G12(x):
diff --git a/colour/models/rgb/transfer_functions/rimm_romm_rgb.py b/colour/models/rgb/transfer_functions/rimm_romm_rgb.py
index d793ed9b6f..aa8cb72239 100644
--- a/colour/models/rgb/transfer_functions/rimm_romm_rgb.py
+++ b/colour/models/rgb/transfer_functions/rimm_romm_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RIMM, ROMM and ERIMM Encodings
==============================
@@ -45,14 +44,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['oetf_ROMMRGB',
- 'eotf_ROMMRGB',
- 'oetf_ProPhotoRGB',
- 'eotf_ProPhotoRGB',
- 'oetf_RIMMRGB',
- 'eotf_RIMMRGB',
- 'log_encoding_ERIMMRGB',
- 'log_decoding_ERIMMRGB']
+__all__ = [
+ 'oetf_ROMMRGB', 'eotf_ROMMRGB', 'oetf_ProPhotoRGB', 'eotf_ProPhotoRGB',
+ 'oetf_RIMMRGB', 'eotf_RIMMRGB', 'log_encoding_ERIMMRGB',
+ 'log_decoding_ERIMMRGB'
+]
def oetf_ROMMRGB(X, I_max=255):
@@ -83,10 +79,10 @@ def oetf_ROMMRGB(X, I_max=255):
E_t = 16 ** (1.8 / (1 - 1.8))
- return as_numeric(np.clip(
- np.where(X < E_t,
- X * 16 * I_max,
- X ** (1 / 1.8) * I_max), 0, I_max))
+ return as_numeric(
+ np.clip(
+ np.where(X < E_t, X * 16 * I_max, X ** (1 / 1.8) * I_max), 0,
+ I_max))
def eotf_ROMMRGB(X_p, I_max=255):
@@ -117,10 +113,9 @@ def eotf_ROMMRGB(X_p, I_max=255):
E_t = 16 ** (1.8 / (1 - 1.8))
- return as_numeric(np.where(
- X_p < 16 * E_t * I_max,
- X_p / (16 * I_max),
- (X_p / I_max) ** 1.8))
+ return as_numeric(
+ np.where(X_p < 16 * E_t * I_max, X_p / (16 * I_max), (X_p / I_max) **
+ 1.8))
oetf_ProPhotoRGB = oetf_ROMMRGB
@@ -161,11 +156,8 @@ def oetf_RIMMRGB(X, I_max=255, E_clip=2.0):
V_clip = 1.099 * E_clip ** 0.45 - 0.099
q = I_max / V_clip
- X_p_RIMM = np.select(
- [X < 0.0,
- X < 0.018, X >= 0.018,
- X > E_clip],
- [0, 4.5 * X, 1.099 * (X ** 0.45) - 0.099, I_max])
+ X_p_RIMM = np.select([X < 0.0, X < 0.018, X >= 0.018, X > E_clip],
+ [0, 4.5 * X, 1.099 * (X ** 0.45) - 0.099, I_max])
return as_numeric(q * X_p_RIMM)
@@ -202,17 +194,13 @@ def eotf_RIMMRGB(X_p, I_max=255, E_clip=2.0):
m = V_clip * X_p / I_max
- X_RIMM = np.where(
- X_p < oetf_RIMMRGB(0.018),
- m / 4.5, ((m + 0.099) / 1.099) ** (1 / 0.45))
+ X_RIMM = np.where(X_p < oetf_RIMMRGB(0.018), m / 4.5, ((m + 0.099) / 1.099)
+ ** (1 / 0.45))
return as_numeric(X_RIMM)
-def log_encoding_ERIMMRGB(X,
- I_max=255,
- E_min=0.001,
- E_clip=316.2):
+def log_encoding_ERIMMRGB(X, I_max=255, E_min=0.001, E_clip=316.2):
"""
Defines the *ERIMM RGB* log encoding curve / opto-electronic transfer
function (OETF / OECF).
@@ -244,24 +232,16 @@ def log_encoding_ERIMMRGB(X,
E_t = np.exp(1) * E_min
- X_p = np.select(
- [X < 0.0,
- X <= E_t, X > E_t,
- X > E_clip],
- [0,
- I_max * ((np.log(E_t) - np.log(E_min)) /
- (np.log(E_clip) - np.log(E_min))) * (X / E_t),
- I_max * ((np.log(X) - np.log(E_min)) /
- (np.log(E_clip) - np.log(E_min))),
- I_max])
+ X_p = np.select([X < 0.0, X <= E_t, X > E_t, X > E_clip], [
+ 0, I_max * ((np.log(E_t) - np.log(E_min)) /
+ (np.log(E_clip) - np.log(E_min))) * (X / E_t), I_max *
+ ((np.log(X) - np.log(E_min)) / (np.log(E_clip) - np.log(E_min))), I_max
+ ])
return as_numeric(X_p)
-def log_decoding_ERIMMRGB(X_p,
- I_max=255,
- E_min=0.001,
- E_clip=316.2):
+def log_decoding_ERIMMRGB(X_p, I_max=255, E_min=0.001, E_clip=316.2):
"""
Defines the *ERIMM RGB* log decoding curve / electro-optical transfer
function (EOTF / EOCF).
@@ -293,12 +273,11 @@ def log_decoding_ERIMMRGB(X_p,
E_t = np.exp(1) * E_min
- X = np.where(
- X_p <= I_max * ((np.log(E_t) - np.log(E_min)) /
- (np.log(E_clip) - np.log(E_min))),
- (((np.log(E_clip) - np.log(E_min)) / (np.log(E_t) - np.log(E_min))) *
- ((X_p * E_t) / I_max)),
- np.exp((X_p / I_max) *
- (np.log(E_clip) - np.log(E_min)) + np.log(E_min)))
+ X = np.where(X_p <= I_max * ((np.log(E_t) - np.log(E_min)) /
+ (np.log(E_clip) - np.log(E_min))),
+ (((np.log(E_clip) - np.log(E_min)) /
+ (np.log(E_t) - np.log(E_min))) * ((X_p * E_t) / I_max)),
+ np.exp((X_p / I_max) * (np.log(E_clip) - np.log(E_min)) +
+ np.log(E_min)))
return as_numeric(X)
diff --git a/colour/models/rgb/transfer_functions/sony_slog.py b/colour/models/rgb/transfer_functions/sony_slog.py
index d6754f51cc..146a6ceca4 100644
--- a/colour/models/rgb/transfer_functions/sony_slog.py
+++ b/colour/models/rgb/transfer_functions/sony_slog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Sony S-Log Encodings
====================
@@ -48,12 +47,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_SLog',
- 'log_decoding_SLog',
- 'log_encoding_SLog2',
- 'log_decoding_SLog2',
- 'log_encoding_SLog3',
- 'log_decoding_SLog3']
+__all__ = [
+ 'log_encoding_SLog', 'log_decoding_SLog', 'log_encoding_SLog2',
+ 'log_decoding_SLog2', 'log_encoding_SLog3', 'log_decoding_SLog3'
+]
def log_encoding_SLog(t):
@@ -158,8 +155,9 @@ def log_decoding_SLog2(y):
y = np.asarray(y)
- return ((10 ** (((((y * 1023 / 4 - 16) / 219) - 0.616596 - 0.03) /
- 0.432699)) - 0.037584) * 0.9)
+ return ((10 ** ((((
+ (y * 1023 / 4 - 16) / 219) - 0.616596 - 0.03) / 0.432699)) - 0.037584)
+ * 0.9)
def log_encoding_SLog3(t):
@@ -186,10 +184,9 @@ def log_encoding_SLog3(t):
t = np.asarray(t)
return as_numeric(
- np.where(t >= 0.01125000,
- (420 + np.log10((t + 0.01) /
- (0.18 + 0.01)) * 261.5) / 1023,
- (t * (171.2102946929 - 95) / 0.01125000 + 95) / 1023))
+ np.where(t >= 0.01125000, (420 + np.log10(
+ (t + 0.01) / (0.18 + 0.01)) * 261.5) / 1023, (
+ t * (171.2102946929 - 95) / 0.01125000 + 95) / 1023))
def log_decoding_SLog3(y):
@@ -217,6 +214,5 @@ def log_decoding_SLog3(y):
return as_numeric(
np.where(y >= 171.2102946929 / 1023,
- ((10 ** ((y * 1023 - 420) / 261.5)) *
- (0.18 + 0.01) - 0.01),
- (y * 1023 - 95) * 0.01125000 / (171.2102946929 - 95)))
+ ((10 ** ((y * 1023 - 420) / 261.5)) * (0.18 + 0.01) - 0.01), (
+ y * 1023 - 95) * 0.01125000 / (171.2102946929 - 95)))
diff --git a/colour/models/rgb/transfer_functions/srgb.py b/colour/models/rgb/transfer_functions/srgb.py
index aad7ffac3c..a7e747e7ef 100644
--- a/colour/models/rgb/transfer_functions/srgb.py
+++ b/colour/models/rgb/transfer_functions/srgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
sRGB Colourspace
================
@@ -43,8 +42,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['oetf_sRGB',
- 'eotf_sRGB']
+__all__ = ['oetf_sRGB', 'eotf_sRGB']
def oetf_sRGB(L):
@@ -70,9 +68,8 @@ def oetf_sRGB(L):
L = np.asarray(L)
- return as_numeric(np.where(L <= 0.0031308,
- L * 12.92,
- 1.055 * (L ** (1 / 2.4)) - 0.055))
+ return as_numeric(
+ np.where(L <= 0.0031308, L * 12.92, 1.055 * (L ** (1 / 2.4)) - 0.055))
def eotf_sRGB(V):
@@ -106,6 +103,6 @@ def eotf_sRGB(V):
V = np.asarray(V)
- return as_numeric(np.where(V <= oetf_sRGB(0.0031308),
- V / 12.92,
- ((V + 0.055) / 1.055) ** 2.4))
+ return as_numeric(
+ np.where(V <= oetf_sRGB(0.0031308), V / 12.92, ((V + 0.055) / 1.055) **
+ 2.4))
diff --git a/colour/models/rgb/transfer_functions/st_2084.py b/colour/models/rgb/transfer_functions/st_2084.py
index e292078bea..af00433314 100644
--- a/colour/models/rgb/transfer_functions/st_2084.py
+++ b/colour/models/rgb/transfer_functions/st_2084.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
SMPTE ST 2084:2014
==================
@@ -41,15 +40,14 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ST2084_CONSTANTS',
- 'oetf_ST2084',
- 'eotf_ST2084']
+__all__ = ['ST2084_CONSTANTS', 'oetf_ST2084', 'eotf_ST2084']
-ST2084_CONSTANTS = Structure(m_1=2610 / 4096 * (1 / 4),
- m_2=2523 / 4096 * 128,
- c_1=3424 / 4096,
- c_2=2413 / 4096 * 32,
- c_3=2392 / 4096 * 32)
+ST2084_CONSTANTS = Structure(
+ m_1=2610 / 4096 * (1 / 4),
+ m_2=2523 / 4096 * 128,
+ c_1=3424 / 4096,
+ c_2=2413 / 4096 * 32,
+ c_3=2392 / 4096 * 32)
"""
*SMPTE ST 2084:2014* opto-electrical transfer function (OETF / OECF) and
electro-optical transfer function (EOTF / EOCF) constants.
diff --git a/colour/models/rgb/transfer_functions/tests/tests_aces.py b/colour/models/rgb/transfer_functions/tests/tests_aces.py
index a2c969d52d..4cf37c6f8d 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_aces.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_aces.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.aces`
module.
@@ -12,12 +11,8 @@
import unittest
from colour.models.rgb.transfer_functions import (
- log_encoding_ACESproxy,
- log_decoding_ACESproxy,
- log_encoding_ACEScc,
- log_decoding_ACEScc,
- log_encoding_ACEScct,
- log_decoding_ACEScct)
+ log_encoding_ACESproxy, log_decoding_ACESproxy, log_encoding_ACEScc,
+ log_decoding_ACEScc, log_encoding_ACEScct, log_decoding_ACEScct)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -27,11 +22,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_ACESproxy',
- 'TestLogDecoding_ACESproxy',
- 'TestLogEncoding_ACEScc',
- 'TestLogDecoding_ACEScc',
- 'TestLogDecoding_ACEScct']
+__all__ = [
+ 'TestLogEncoding_ACESproxy', 'TestLogDecoding_ACESproxy',
+ 'TestLogEncoding_ACEScc', 'TestLogDecoding_ACEScc',
+ 'TestLogDecoding_ACEScct'
+]
class TestLogEncoding_ACESproxy(unittest.TestCase):
@@ -61,27 +56,19 @@ def test_n_dimensional_log_encoding_ACESproxy(self):
linear = 0.18
log = 426
- np.testing.assert_equal(
- log_encoding_ACESproxy(linear),
- log)
+ np.testing.assert_equal(log_encoding_ACESproxy(linear), log)
linear = np.tile(linear, 6)
log = np.tile(log, 6)
- np.testing.assert_equal(
- log_encoding_ACESproxy(linear),
- log)
+ np.testing.assert_equal(log_encoding_ACESproxy(linear), log)
linear = np.reshape(linear, (2, 3))
log = np.reshape(log, (2, 3))
- np.testing.assert_equal(
- log_encoding_ACESproxy(linear),
- log)
+ np.testing.assert_equal(log_encoding_ACESproxy(linear), log)
linear = np.reshape(linear, (2, 3, 1))
log = np.reshape(log, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_ACESproxy(linear),
- log)
+ np.testing.assert_almost_equal(log_encoding_ACESproxy(linear), log)
@ignore_numpy_errors
def test_nan_log_encoding_ACESproxy(self):
@@ -108,19 +95,12 @@ def test_log_decoding_ACESproxy(self):
"""
self.assertAlmostEqual(
- log_decoding_ACESproxy(64),
- 0.001185737191792,
- places=7)
+ log_decoding_ACESproxy(64), 0.001185737191792, places=7)
self.assertAlmostEqual(
- log_decoding_ACESproxy(426),
- 0.179244406001978,
- places=7)
+ log_decoding_ACESproxy(426), 0.179244406001978, places=7)
- self.assertAlmostEqual(
- log_decoding_ACESproxy(550),
- 1.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_ACESproxy(550), 1.0, places=7)
def test_n_dimensional_log_decoding_ACESproxy(self):
"""
@@ -131,30 +111,22 @@ def test_n_dimensional_log_decoding_ACESproxy(self):
log = 426.0
linear = 0.179244406001978
np.testing.assert_almost_equal(
- log_decoding_ACESproxy(log),
- linear,
- decimal=7)
+ log_decoding_ACESproxy(log), linear, decimal=7)
log = np.tile(log, 6)
linear = np.tile(linear, 6)
np.testing.assert_almost_equal(
- log_decoding_ACESproxy(log),
- linear,
- decimal=7)
+ log_decoding_ACESproxy(log), linear, decimal=7)
log = np.reshape(log, (2, 3))
linear = np.reshape(linear, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_ACESproxy(log),
- linear,
- decimal=7)
+ log_decoding_ACESproxy(log), linear, decimal=7)
log = np.reshape(log, (2, 3, 1))
linear = np.reshape(linear, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_ACESproxy(log),
- linear,
- decimal=7)
+ log_decoding_ACESproxy(log), linear, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ACESproxy(self):
@@ -180,19 +152,13 @@ def test_log_encoding_ACEScc(self):
"""
self.assertAlmostEqual(
- log_encoding_ACEScc(0.0),
- -0.358447488584475,
- places=7)
+ log_encoding_ACEScc(0.0), -0.358447488584475, places=7)
self.assertAlmostEqual(
- log_encoding_ACEScc(0.18),
- 0.413588402492442,
- places=7)
+ log_encoding_ACEScc(0.18), 0.413588402492442, places=7)
self.assertAlmostEqual(
- log_encoding_ACEScc(1.0),
- 0.554794520547945,
- places=7)
+ log_encoding_ACEScc(1.0), 0.554794520547945, places=7)
def test_n_dimensional_log_encoding_ACEScc(self):
"""
@@ -203,30 +169,22 @@ def test_n_dimensional_log_encoding_ACEScc(self):
linear = 0.18
log = 0.413588402492442
np.testing.assert_almost_equal(
- log_encoding_ACEScc(linear),
- log,
- decimal=7)
+ log_encoding_ACEScc(linear), log, decimal=7)
linear = np.tile(linear, 6)
log = np.tile(log, 6)
np.testing.assert_almost_equal(
- log_encoding_ACEScc(linear),
- log,
- decimal=7)
+ log_encoding_ACEScc(linear), log, decimal=7)
linear = np.reshape(linear, (2, 3))
log = np.reshape(log, (2, 3))
np.testing.assert_almost_equal(
- log_encoding_ACEScc(linear),
- log,
- decimal=7)
+ log_encoding_ACEScc(linear), log, decimal=7)
linear = np.reshape(linear, (2, 3, 1))
log = np.reshape(log, (2, 3, 1))
np.testing.assert_almost_equal(
- log_encoding_ACEScc(linear),
- log,
- decimal=7)
+ log_encoding_ACEScc(linear), log, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_ACEScc(self):
@@ -252,19 +210,13 @@ def test_log_decoding_ACEScc(self):
"""
self.assertAlmostEqual(
- log_decoding_ACEScc(-0.358447488584475),
- 0.0,
- places=7)
+ log_decoding_ACEScc(-0.358447488584475), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_ACEScc(0.413588402492442),
- 0.18,
- places=7)
+ log_decoding_ACEScc(0.413588402492442), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_ACEScc(0.554794520547945),
- 1.0,
- places=7)
+ log_decoding_ACEScc(0.554794520547945), 1.0, places=7)
def test_n_dimensional_log_decoding_ACEScc(self):
"""
@@ -275,30 +227,22 @@ def test_n_dimensional_log_decoding_ACEScc(self):
log = 0.413588402492442
linear = 0.18
np.testing.assert_almost_equal(
- log_decoding_ACEScc(log),
- linear,
- decimal=7)
+ log_decoding_ACEScc(log), linear, decimal=7)
log = np.tile(log, 6)
linear = np.tile(linear, 6)
np.testing.assert_almost_equal(
- log_decoding_ACEScc(log),
- linear,
- decimal=7)
+ log_decoding_ACEScc(log), linear, decimal=7)
log = np.reshape(log, (2, 3))
linear = np.reshape(linear, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_ACEScc(log),
- linear,
- decimal=7)
+ log_decoding_ACEScc(log), linear, decimal=7)
log = np.reshape(log, (2, 3, 1))
linear = np.reshape(linear, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_ACEScc(log),
- linear,
- decimal=7)
+ log_decoding_ACEScc(log), linear, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ACEScc(self):
@@ -324,19 +268,13 @@ def test_log_encoding_ACEScct(self):
"""
self.assertAlmostEqual(
- log_encoding_ACEScct(0.0),
- 0.072905534195835495,
- places=7)
+ log_encoding_ACEScct(0.0), 0.072905534195835495, places=7)
self.assertAlmostEqual(
- log_encoding_ACEScct(0.18),
- 0.413588402492442,
- places=7)
+ log_encoding_ACEScct(0.18), 0.413588402492442, places=7)
self.assertAlmostEqual(
- log_encoding_ACEScct(1.0),
- 0.554794520547945,
- places=7)
+ log_encoding_ACEScct(1.0), 0.554794520547945, places=7)
def test_n_dimensional_log_encoding_ACEScct(self):
"""
@@ -347,30 +285,22 @@ def test_n_dimensional_log_encoding_ACEScct(self):
linear = 0.18
log = 0.413588402492442
np.testing.assert_almost_equal(
- log_encoding_ACEScct(linear),
- log,
- decimal=7)
+ log_encoding_ACEScct(linear), log, decimal=7)
linear = np.tile(linear, 6)
log = np.tile(log, 6)
np.testing.assert_almost_equal(
- log_encoding_ACEScct(linear),
- log,
- decimal=7)
+ log_encoding_ACEScct(linear), log, decimal=7)
linear = np.reshape(linear, (2, 3))
log = np.reshape(log, (2, 3))
np.testing.assert_almost_equal(
- log_encoding_ACEScct(linear),
- log,
- decimal=7)
+ log_encoding_ACEScct(linear), log, decimal=7)
linear = np.reshape(linear, (2, 3, 1))
log = np.reshape(log, (2, 3, 1))
np.testing.assert_almost_equal(
- log_encoding_ACEScct(linear),
- log,
- decimal=7)
+ log_encoding_ACEScct(linear), log, decimal=7)
def test_ACEScc_equivalency_log_encoding_ACEScct(self):
"""
@@ -382,9 +312,7 @@ def test_ACEScc_equivalency_log_encoding_ACEScct(self):
equiv = np.linspace(0.0078125, 222.86094420380761, 100)
np.testing.assert_almost_equal(
- log_encoding_ACEScct(equiv),
- log_encoding_ACEScc(equiv),
- decimal=7)
+ log_encoding_ACEScct(equiv), log_encoding_ACEScc(equiv), decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_ACEScct(self):
@@ -410,19 +338,13 @@ def test_log_decoding_ACEScct(self):
"""
self.assertAlmostEqual(
- log_decoding_ACEScct(0.072905534195835495),
- 0.0,
- places=7)
+ log_decoding_ACEScct(0.072905534195835495), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_ACEScct(0.41358840249244228),
- 0.18,
- places=7)
+ log_decoding_ACEScct(0.41358840249244228), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_ACEScct(0.554794520547945),
- 1.0,
- places=7)
+ log_decoding_ACEScct(0.554794520547945), 1.0, places=7)
def test_n_dimensional_log_decoding_ACEScct(self):
"""
@@ -433,30 +355,22 @@ def test_n_dimensional_log_decoding_ACEScct(self):
log = 0.413588402492442
linear = 0.18
np.testing.assert_almost_equal(
- log_decoding_ACEScct(log),
- linear,
- decimal=7)
+ log_decoding_ACEScct(log), linear, decimal=7)
log = np.tile(log, 6)
linear = np.tile(linear, 6)
np.testing.assert_almost_equal(
- log_decoding_ACEScct(log),
- linear,
- decimal=7)
+ log_decoding_ACEScct(log), linear, decimal=7)
log = np.reshape(log, (2, 3))
linear = np.reshape(linear, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_ACEScct(log),
- linear,
- decimal=7)
+ log_decoding_ACEScct(log), linear, decimal=7)
log = np.reshape(log, (2, 3, 1))
linear = np.reshape(linear, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_ACEScct(log),
- linear,
- decimal=7)
+ log_decoding_ACEScct(log), linear, decimal=7)
def test_ACEScc_equivalency_log_decoding_ACEScct(self):
"""
@@ -468,9 +382,7 @@ def test_ACEScc_equivalency_log_decoding_ACEScct(self):
equiv = np.linspace(0.15525114155251146, 1.0, 100)
np.testing.assert_almost_equal(
- log_decoding_ACEScct(equiv),
- log_decoding_ACEScc(equiv),
- decimal=7)
+ log_decoding_ACEScct(equiv), log_decoding_ACEScc(equiv), decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ACEScct(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_alexa_log_c.py b/colour/models/rgb/transfer_functions/tests/tests_alexa_log_c.py
index 97e118dca7..9f95c2fe66 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_alexa_log_c.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_alexa_log_c.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for
:mod:`colour.models.rgb.transfer_functions.alexa_log_c` module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_ALEXALogC,
- log_decoding_ALEXALogC)
+from colour.models.rgb.transfer_functions import (log_encoding_ALEXALogC,
+ log_decoding_ALEXALogC)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_ALEXALogC',
- 'TestLogDecoding_ALEXALogC']
+__all__ = ['TestLogEncoding_ALEXALogC', 'TestLogDecoding_ALEXALogC']
class TestLogEncoding_ALEXALogC(unittest.TestCase):
@@ -40,19 +37,13 @@ def test_log_encoding_ALEXALogC(self):
"""
self.assertAlmostEqual(
- log_encoding_ALEXALogC(0.0),
- 0.092809000000000,
- places=7)
+ log_encoding_ALEXALogC(0.0), 0.092809000000000, places=7)
self.assertAlmostEqual(
- log_encoding_ALEXALogC(0.18),
- 0.391006832034084,
- places=7)
+ log_encoding_ALEXALogC(0.18), 0.391006832034084, places=7)
self.assertAlmostEqual(
- log_encoding_ALEXALogC(1.0),
- 0.570631558120417,
- places=7)
+ log_encoding_ALEXALogC(1.0), 0.570631558120417, places=7)
def test_n_dimensional_log_encoding_ALEXALogC(self):
"""
@@ -62,31 +53,19 @@ def test_n_dimensional_log_encoding_ALEXALogC(self):
L = 0.18
V = 0.391006832034084
- np.testing.assert_almost_equal(
- log_encoding_ALEXALogC(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ALEXALogC(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_ALEXALogC(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ALEXALogC(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_ALEXALogC(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ALEXALogC(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_ALEXALogC(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ALEXALogC(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_ALEXALogC(self):
@@ -111,20 +90,13 @@ def test_log_decoding_ALEXALogC(self):
log_decoding_ALEXALogC` definition.
"""
- self.assertAlmostEqual(
- log_decoding_ALEXALogC(0.092809),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_ALEXALogC(0.092809), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_ALEXALogC(0.391006832034084),
- 0.18,
- places=7)
+ log_decoding_ALEXALogC(0.391006832034084), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_ALEXALogC(0.570631558120417),
- 1.0,
- places=7)
+ log_decoding_ALEXALogC(0.570631558120417), 1.0, places=7)
def test_n_dimensional_log_decoding_ALEXALogC(self):
"""
@@ -134,31 +106,19 @@ def test_n_dimensional_log_decoding_ALEXALogC(self):
V = 0.391006832034084
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_ALEXALogC(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ALEXALogC(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_ALEXALogC(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ALEXALogC(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_ALEXALogC(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ALEXALogC(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_ALEXALogC(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ALEXALogC(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ALEXALogC(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_arib_std_b67.py b/colour/models/rgb/transfer_functions/tests/tests_arib_std_b67.py
new file mode 100644
index 0000000000..324432230d
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/tests/tests_arib_std_b67.py
@@ -0,0 +1,136 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.rgb.transfer_functions.arib_std_b67`
+module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+
+from colour.models.rgb.transfer_functions import (oetf_ARIBSTDB67,
+ eotf_ARIBSTDB67)
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestOetf_ARIBSTDB67', 'TestEotf_ARIBSTDB67']
+
+
+class TestOetf_ARIBSTDB67(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+oetf_ARIBSTDB67` definition unit tests methods.
+ """
+
+ def test_oetf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+oetf_ARIBSTDB67` definition.
+ """
+
+ self.assertAlmostEqual(oetf_ARIBSTDB67(0.0), 0.0, places=7)
+
+ self.assertAlmostEqual(
+ oetf_ARIBSTDB67(0.18), 0.212132034355964, places=7)
+
+ self.assertAlmostEqual(oetf_ARIBSTDB67(1.0), 0.5, places=7)
+
+ self.assertAlmostEqual(
+ oetf_ARIBSTDB67(64.0), 1.302858098046995, places=7)
+
+ def test_n_dimensional_oetf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+oetf_ARIBSTDB67` definition n-dimensional arrays support.
+ """
+
+ E = 0.18
+ E_p = 0.212132034355964
+ np.testing.assert_almost_equal(oetf_ARIBSTDB67(E), E_p, decimal=7)
+
+ E = np.tile(E, 6)
+ E_p = np.tile(E_p, 6)
+ np.testing.assert_almost_equal(oetf_ARIBSTDB67(E), E_p, decimal=7)
+
+ E = np.reshape(E, (2, 3))
+ E_p = np.reshape(E_p, (2, 3))
+ np.testing.assert_almost_equal(oetf_ARIBSTDB67(E), E_p, decimal=7)
+
+ E = np.reshape(E, (2, 3, 1))
+ E_p = np.reshape(E_p, (2, 3, 1))
+ np.testing.assert_almost_equal(oetf_ARIBSTDB67(E), E_p, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_oetf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+oetf_ARIBSTDB67` definition nan support.
+ """
+
+ oetf_ARIBSTDB67(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+class TestEotf_ARIBSTDB67(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+eotf_ARIBSTDB67` definition unit tests methods.
+ """
+
+ def test_eotf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+eotf_ARIBSTDB67` definition.
+ """
+
+ self.assertAlmostEqual(eotf_ARIBSTDB67(0.0), 0.0, places=7)
+
+ self.assertAlmostEqual(
+ eotf_ARIBSTDB67(0.212132034355964), 0.18, places=7)
+
+ self.assertAlmostEqual(eotf_ARIBSTDB67(0.5), 1.0, places=7)
+
+ self.assertAlmostEqual(
+ eotf_ARIBSTDB67(1.302858098046995), 64.0, places=7)
+
+ def test_n_dimensional_eotf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+eotf_ARIBSTDB67` definition n-dimensional arrays support.
+ """
+
+ E_p = 0.212132034355964
+ E = 0.18
+ np.testing.assert_almost_equal(eotf_ARIBSTDB67(E_p), E, decimal=7)
+
+ E_p = np.tile(E_p, 6)
+ E = np.tile(E, 6)
+ np.testing.assert_almost_equal(eotf_ARIBSTDB67(E_p), E, decimal=7)
+
+ E_p = np.reshape(E_p, (2, 3))
+ E = np.reshape(E, (2, 3))
+ np.testing.assert_almost_equal(eotf_ARIBSTDB67(E_p), E, decimal=7)
+
+ E_p = np.reshape(E_p, (2, 3, 1))
+ E = np.reshape(E, (2, 3, 1))
+ np.testing.assert_almost_equal(eotf_ARIBSTDB67(E_p), E, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_eotf_ARIBSTDB67(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
+eotf_ARIBSTDB67` definition nan support.
+ """
+
+ eotf_ARIBSTDB67(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/rgb/transfer_functions/tests/tests_bt_1886.py b/colour/models/rgb/transfer_functions/tests/tests_bt_1886.py
index b9254dd3af..097b0e7ff5 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_bt_1886.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_bt_1886.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.bt_1886`
module.
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_BT1886',
- 'TestEotf_BT1886']
+__all__ = ['TestOetf_BT1886', 'TestEotf_BT1886']
class TestOetf_BT1886(unittest.TestCase):
@@ -37,20 +35,11 @@ def test_oetf_BT1886(self):
oetf_BT1886` definition.
"""
- self.assertAlmostEqual(
- oetf_BT1886(64.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_BT1886(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- oetf_BT1886(184.32),
- 0.268401363726554,
- places=7)
+ self.assertAlmostEqual(oetf_BT1886(0.016317514686316), 0.18, places=7)
- self.assertAlmostEqual(
- oetf_BT1886(940),
- 1.000000000000000,
- places=7)
+ self.assertAlmostEqual(oetf_BT1886(1.0), 1.0, places=7)
def test_n_dimensional_oetf_BT1886(self):
"""
@@ -58,33 +47,21 @@ def test_n_dimensional_oetf_BT1886(self):
oetf_BT1886` definition n-dimensional arrays support.
"""
- L = 184.32
- V = 0.268401363726554
- np.testing.assert_almost_equal(
- oetf_BT1886(L),
- V,
- decimal=7)
+ L = 0.016317514686316
+ V = 0.18
+ np.testing.assert_almost_equal(oetf_BT1886(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_BT1886(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT1886(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_BT1886(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT1886(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_BT1886(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT1886(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_BT1886(self):
@@ -93,8 +70,7 @@ def test_nan_oetf_BT1886(self):
oetf_BT1886` definition nan support.
"""
- oetf_BT1886(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_BT1886(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_BT1886(unittest.TestCase):
@@ -109,20 +85,11 @@ def test_eotf_BT1886(self):
eotf_BT1886` definition.
"""
- self.assertAlmostEqual(
- eotf_BT1886(0.0),
- 64.0,
- places=7)
+ self.assertAlmostEqual(eotf_BT1886(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_BT1886(0.18),
- 136.58617957,
- places=7)
+ self.assertAlmostEqual(eotf_BT1886(0.18), 0.016317514686316, places=7)
- self.assertAlmostEqual(
- eotf_BT1886(1.0),
- 940.00000000,
- places=7)
+ self.assertAlmostEqual(eotf_BT1886(1.0), 1.0, places=7)
def test_n_dimensional_eotf_BT1886(self):
"""
@@ -131,32 +98,20 @@ def test_n_dimensional_eotf_BT1886(self):
"""
V = 0.18
- L = 136.58617957
- np.testing.assert_almost_equal(
- eotf_BT1886(V),
- L,
- decimal=7)
+ L = 0.016317514686316
+ np.testing.assert_almost_equal(eotf_BT1886(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- eotf_BT1886(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT1886(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- eotf_BT1886(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT1886(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_BT1886(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT1886(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_BT1886(self):
@@ -165,8 +120,7 @@ def test_nan_eotf_BT1886(self):
eotf_BT1886` definition nan support.
"""
- eotf_BT1886(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_BT1886(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_bt_2020.py b/colour/models/rgb/transfer_functions/tests/tests_bt_2020.py
index f2f6c209a2..fc209cc8c6 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_bt_2020.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_bt_2020.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.bt_2020`
module.
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_BT2020',
- 'TestEotf_BT2020']
+__all__ = ['TestOetf_BT2020', 'TestEotf_BT2020']
class TestOetf_BT2020(unittest.TestCase):
@@ -37,20 +35,11 @@ def test_oetf_BT2020(self):
oetf_BT2020` definition.
"""
- self.assertAlmostEqual(
- oetf_BT2020(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_BT2020(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- oetf_BT2020(0.18),
- 0.409007728864150,
- places=7)
+ self.assertAlmostEqual(oetf_BT2020(0.18), 0.409007728864150, places=7)
- self.assertAlmostEqual(
- oetf_BT2020(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(oetf_BT2020(1.0), 1.0, places=7)
def test_n_dimensional_oetf_BT2020(self):
"""
@@ -60,31 +49,19 @@ def test_n_dimensional_oetf_BT2020(self):
L = 0.18
V = 0.409007728864150
- np.testing.assert_almost_equal(
- oetf_BT2020(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT2020(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_BT2020(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT2020(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_BT2020(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT2020(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_BT2020(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT2020(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_BT2020(self):
@@ -93,8 +70,7 @@ def test_nan_oetf_BT2020(self):
oetf_BT2020` definition nan support.
"""
- oetf_BT2020(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_BT2020(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_BT2020(unittest.TestCase):
@@ -109,20 +85,11 @@ def test_eotf_BT2020(self):
eotf_BT2020` definition.
"""
- self.assertAlmostEqual(
- eotf_BT2020(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_BT2020(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_BT2020(0.409007728864150),
- 0.18,
- places=7)
+ self.assertAlmostEqual(eotf_BT2020(0.409007728864150), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_BT2020(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_BT2020(1.0), 1.0, places=7)
def test_n_dimensional_eotf_BT2020(self):
"""
@@ -132,31 +99,19 @@ def test_n_dimensional_eotf_BT2020(self):
V = 0.409007728864150
L = 0.18
- np.testing.assert_almost_equal(
- eotf_BT2020(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT2020(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- eotf_BT2020(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT2020(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- eotf_BT2020(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT2020(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_BT2020(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT2020(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_BT2020(self):
@@ -165,8 +120,7 @@ def test_nan_eotf_BT2020(self):
eotf_BT2020` definition nan support.
"""
- eotf_BT2020(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_BT2020(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_bt_709.py b/colour/models/rgb/transfer_functions/tests/tests_bt_709.py
index d2662db0bb..21b2b4a31a 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_bt_709.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_bt_709.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.bt_709`
module.
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_BT709',
- 'TestEotf_BT709']
+__all__ = ['TestOetf_BT709', 'TestEotf_BT709']
class TestOetf_BT709(unittest.TestCase):
@@ -37,20 +35,11 @@ def test_oetf_BT709(self):
oetf_BT709` definition.
"""
- self.assertAlmostEqual(
- oetf_BT709(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_BT709(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- oetf_BT709(0.18),
- 0.409007728864150,
- places=7)
+ self.assertAlmostEqual(oetf_BT709(0.18), 0.409007728864150, places=7)
- self.assertAlmostEqual(
- oetf_BT709(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(oetf_BT709(1.0), 1.0, places=7)
def test_n_dimensional_oetf_BT709(self):
"""
@@ -60,31 +49,19 @@ def test_n_dimensional_oetf_BT709(self):
L = 0.18
V = 0.409007728864150
- np.testing.assert_almost_equal(
- oetf_BT709(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT709(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_BT709(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT709(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_BT709(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT709(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_BT709(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_BT709(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_BT709(self):
@@ -93,8 +70,7 @@ def test_nan_oetf_BT709(self):
oetf_BT709` definition nan support.
"""
- oetf_BT709(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_BT709(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_BT709(unittest.TestCase):
@@ -109,20 +85,11 @@ def test_eotf_BT709(self):
eotf_BT709` definition.
"""
- self.assertAlmostEqual(
- eotf_BT709(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_BT709(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_BT709(0.409007728864150),
- 0.18,
- places=7)
+ self.assertAlmostEqual(eotf_BT709(0.409007728864150), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_BT709(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_BT709(1.0), 1.0, places=7)
def test_n_dimensional_eotf_BT709(self):
"""
@@ -132,31 +99,19 @@ def test_n_dimensional_eotf_BT709(self):
V = 0.409007728864150
L = 0.18
- np.testing.assert_almost_equal(
- eotf_BT709(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT709(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- eotf_BT709(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT709(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- eotf_BT709(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT709(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_BT709(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_BT709(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_BT709(self):
@@ -165,8 +120,7 @@ def test_nan_eotf_BT709(self):
eotf_BT709` definition nan support.
"""
- eotf_BT709(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_BT709(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_canon_log.py b/colour/models/rgb/transfer_functions/tests/tests_canon_log.py
index 22c4b4942e..a02ed5c1fe 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_canon_log.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_canon_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.canon_log`
module.
@@ -12,12 +11,8 @@
import unittest
from colour.models.rgb.transfer_functions import (
- log_encoding_CanonLog,
- log_decoding_CanonLog,
- log_encoding_CanonLog2,
- log_decoding_CanonLog2,
- log_encoding_CanonLog3,
- log_decoding_CanonLog3)
+ log_encoding_CanonLog, log_decoding_CanonLog, log_encoding_CanonLog2,
+ log_decoding_CanonLog2, log_encoding_CanonLog3, log_decoding_CanonLog3)
from colour.utilities import ignore_numpy_errors
@@ -28,8 +23,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_CanonLog',
- 'TestLogDecoding_CanonLog']
+__all__ = ['TestLogEncoding_CanonLog', 'TestLogDecoding_CanonLog']
class TestLogEncoding_CanonLog(unittest.TestCase):
@@ -45,24 +39,16 @@ def test_log_encoding_CanonLog(self):
"""
self.assertAlmostEqual(
- log_encoding_CanonLog(-0.1),
- -0.088052640318143,
- places=7)
+ log_encoding_CanonLog(-0.1), -0.088052640318143, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog(0.0),
- 0.073059700000000,
- places=7)
+ log_encoding_CanonLog(0.0), 0.073059700000000, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog(0.18),
- 0.312012855550395,
- places=7)
+ log_encoding_CanonLog(0.18), 0.312012855550395, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog(1.0),
- 0.627408304537653,
- places=7)
+ log_encoding_CanonLog(1.0), 0.627408304537653, places=7)
def test_n_dimensional_log_encoding_CanonLog(self):
"""
@@ -72,31 +58,19 @@ def test_n_dimensional_log_encoding_CanonLog(self):
L = 0.18
V = 0.312012855550395
- np.testing.assert_almost_equal(
- log_encoding_CanonLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_CanonLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_CanonLog(self):
@@ -122,24 +96,16 @@ def test_log_decoding_CanonLog(self):
"""
self.assertAlmostEqual(
- log_decoding_CanonLog(-0.088052640318143),
- -0.1,
- places=7)
+ log_decoding_CanonLog(-0.088052640318143), -0.1, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog(0.073059700000000),
- 0.0,
- places=7)
+ log_decoding_CanonLog(0.073059700000000), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog(0.312012855550395),
- 0.18,
- places=7)
+ log_decoding_CanonLog(0.312012855550395), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog(0.627408304537653),
- 1.0,
- places=7)
+ log_decoding_CanonLog(0.627408304537653), 1.0, places=7)
def test_n_dimensional_log_decoding_CanonLog(self):
"""
@@ -149,31 +115,19 @@ def test_n_dimensional_log_decoding_CanonLog(self):
V = 0.312012855550395
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_CanonLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_CanonLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_CanonLog(self):
@@ -199,24 +153,16 @@ def test_log_encoding_CanonLog2(self):
"""
self.assertAlmostEqual(
- log_encoding_CanonLog2(-0.1),
- -0.242871750266172,
- places=7)
+ log_encoding_CanonLog2(-0.1), -0.242871750266172, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog2(0.0),
- 0.035388127999999,
- places=7)
+ log_encoding_CanonLog2(0.0), 0.035388127999999, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog2(0.18),
- 0.379864582222983,
- places=7)
+ log_encoding_CanonLog2(0.18), 0.379864582222983, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog2(1.0),
- 0.583604185577946,
- places=7)
+ log_encoding_CanonLog2(1.0), 0.583604185577946, places=7)
def test_n_dimensional_log_encoding_CanonLog2(self):
"""
@@ -226,31 +172,19 @@ def test_n_dimensional_log_encoding_CanonLog2(self):
L = 0.18
V = 0.379864582222983
- np.testing.assert_almost_equal(
- log_encoding_CanonLog2(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog2(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_CanonLog2(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog2(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog2(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog2(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog2(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog2(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_CanonLog2(self):
@@ -276,24 +210,16 @@ def test_log_decoding_CanonLog2(self):
"""
self.assertAlmostEqual(
- log_decoding_CanonLog2(-0.242871750266172),
- -0.1,
- places=7)
+ log_decoding_CanonLog2(-0.242871750266172), -0.1, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog2(0.035388127999999),
- 0.0,
- places=7)
+ log_decoding_CanonLog2(0.035388127999999), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog2(0.379864582222983),
- 0.18,
- places=7)
+ log_decoding_CanonLog2(0.379864582222983), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog2(0.583604185577946),
- 1.0,
- places=7)
+ log_decoding_CanonLog2(0.583604185577946), 1.0, places=7)
def test_n_dimensional_log_decoding_CanonLog2(self):
"""
@@ -303,31 +229,19 @@ def test_n_dimensional_log_decoding_CanonLog2(self):
V = 0.379864582222983
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_CanonLog2(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog2(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_CanonLog2(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog2(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog2(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog2(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog2(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog2(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_CanonLog2(self):
@@ -353,24 +267,16 @@ def test_log_encoding_CanonLog3(self):
"""
self.assertAlmostEqual(
- log_encoding_CanonLog3(-0.1),
- -0.100664645796433,
- places=7)
+ log_encoding_CanonLog3(-0.1), -0.100664645796433, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog3(0.0),
- 0.073059361000000,
- places=7)
+ log_encoding_CanonLog3(0.0), 0.073059361000000, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog3(0.18),
- 0.313436005886328,
- places=7)
+ log_encoding_CanonLog3(0.18), 0.313436005886328, places=7)
self.assertAlmostEqual(
- log_encoding_CanonLog3(1.0),
- 0.586137530935974,
- places=7)
+ log_encoding_CanonLog3(1.0), 0.586137530935974, places=7)
def test_n_dimensional_log_encoding_CanonLog3(self):
"""
@@ -380,31 +286,19 @@ def test_n_dimensional_log_encoding_CanonLog3(self):
L = 0.18
V = 0.313436005886328
- np.testing.assert_almost_equal(
- log_encoding_CanonLog3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog3(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_CanonLog3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog3(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog3(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_CanonLog3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_CanonLog3(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_CanonLog3(self):
@@ -430,24 +324,16 @@ def test_log_decoding_CanonLog3(self):
"""
self.assertAlmostEqual(
- log_decoding_CanonLog3(-0.100664645796433),
- -0.1,
- places=7)
+ log_decoding_CanonLog3(-0.100664645796433), -0.1, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog3(0.073059361000000),
- 0.0,
- places=7)
+ log_decoding_CanonLog3(0.073059361000000), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog3(0.313436005886328),
- 0.18,
- places=7)
+ log_decoding_CanonLog3(0.313436005886328), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_CanonLog3(0.586137530935974),
- 1.0,
- places=7)
+ log_decoding_CanonLog3(0.586137530935974), 1.0, places=7)
def test_n_dimensional_log_decoding_CanonLog3(self):
"""
@@ -457,31 +343,19 @@ def test_n_dimensional_log_decoding_CanonLog3(self):
V = 0.313436005886328
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_CanonLog3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog3(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_CanonLog3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog3(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog3(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_CanonLog3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_CanonLog3(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_CanonLog3(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_cineon.py b/colour/models/rgb/transfer_functions/tests/tests_cineon.py
index 6cbc02616f..2e7989d280 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_cineon.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_cineon.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.cineon`
module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_Cineon,
- log_decoding_Cineon)
+from colour.models.rgb.transfer_functions import (log_encoding_Cineon,
+ log_decoding_Cineon)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_Cineon',
- 'TestLogDecoding_Cineon']
+__all__ = ['TestLogEncoding_Cineon', 'TestLogDecoding_Cineon']
class TestLogEncoding_Cineon(unittest.TestCase):
@@ -40,19 +37,13 @@ def test_log_encoding_Cineon(self):
"""
self.assertAlmostEqual(
- log_encoding_Cineon(0.0),
- 0.092864125122190,
- places=7)
+ log_encoding_Cineon(0.0), 0.092864125122190, places=7)
self.assertAlmostEqual(
- log_encoding_Cineon(0.18),
- 0.457319613085418,
- places=7)
+ log_encoding_Cineon(0.18), 0.457319613085418, places=7)
self.assertAlmostEqual(
- log_encoding_Cineon(1.0),
- 0.669599217986315,
- places=7)
+ log_encoding_Cineon(1.0), 0.669599217986315, places=7)
def test_n_dimensional_log_encoding_Cineon(self):
"""
@@ -62,31 +53,19 @@ def test_n_dimensional_log_encoding_Cineon(self):
L = 0.18
V = 0.457319613085418
- np.testing.assert_almost_equal(
- log_encoding_Cineon(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Cineon(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_Cineon(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Cineon(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_Cineon(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Cineon(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_Cineon(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Cineon(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_Cineon(self):
@@ -112,19 +91,13 @@ def test_log_decoding_Cineon(self):
"""
self.assertAlmostEqual(
- log_decoding_Cineon(0.092864125122190),
- 0.0,
- places=7)
+ log_decoding_Cineon(0.092864125122190), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_Cineon(0.457319613085418),
- 0.18,
- places=7)
+ log_decoding_Cineon(0.457319613085418), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_Cineon(0.669599217986315),
- 1.0,
- places=7)
+ log_decoding_Cineon(0.669599217986315), 1.0, places=7)
def test_n_dimensional_log_decoding_Cineon(self):
"""
@@ -134,31 +107,19 @@ def test_n_dimensional_log_decoding_Cineon(self):
V = 0.457319613085418
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_Cineon(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Cineon(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_Cineon(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Cineon(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_Cineon(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Cineon(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_Cineon(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Cineon(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_Cineon(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_dci_p3.py b/colour/models/rgb/transfer_functions/tests/tests_dci_p3.py
index 4cdedd546f..4b3bbb7cd5 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_dci_p3.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_dci_p3.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.dci_p3`
module.
@@ -11,9 +10,7 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- oetf_DCIP3,
- eotf_DCIP3)
+from colour.models.rgb.transfer_functions import (oetf_DCIP3, eotf_DCIP3)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_DCIP3',
- 'TestEotf_DCIP3']
+__all__ = ['TestOetf_DCIP3', 'TestEotf_DCIP3']
class TestOetf_DCIP3(unittest.TestCase):
@@ -39,20 +35,11 @@ def test_oetf_DCIP3(self):
oetf_DCIP3` definition.
"""
- self.assertAlmostEqual(
- oetf_DCIP3(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_DCIP3(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- oetf_DCIP3(0.18),
- 461.99220597,
- places=7)
+ self.assertAlmostEqual(oetf_DCIP3(0.18), 461.99220597, places=7)
- self.assertAlmostEqual(
- oetf_DCIP3(1.0),
- 893.44598341,
- places=7)
+ self.assertAlmostEqual(oetf_DCIP3(1.0), 893.44598341, places=7)
def test_n_dimensional_oetf_DCIP3(self):
"""
@@ -62,31 +49,19 @@ def test_n_dimensional_oetf_DCIP3(self):
L = 0.18
V = 461.99220597
- np.testing.assert_almost_equal(
- oetf_DCIP3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_DCIP3(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_DCIP3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_DCIP3(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_DCIP3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_DCIP3(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_DCIP3(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_DCIP3(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_DCIP3(self):
@@ -95,8 +70,7 @@ def test_nan_oetf_DCIP3(self):
oetf_DCIP3` definition nan support.
"""
- oetf_DCIP3(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_DCIP3(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_DCIP3(unittest.TestCase):
@@ -111,20 +85,11 @@ def test_eotf_DCIP3(self):
eotf_DCIP3` definition.
"""
- self.assertAlmostEqual(
- eotf_DCIP3(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_DCIP3(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_DCIP3(461.99220597),
- 0.18,
- places=7)
+ self.assertAlmostEqual(eotf_DCIP3(461.99220597), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_DCIP3(893.44598341),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_DCIP3(893.44598341), 1.0, places=7)
def test_n_dimensional_eotf_DCIP3(self):
"""
@@ -134,31 +99,19 @@ def test_n_dimensional_eotf_DCIP3(self):
V = 461.99220597
L = 0.18
- np.testing.assert_almost_equal(
- eotf_DCIP3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_DCIP3(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- eotf_DCIP3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_DCIP3(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- eotf_DCIP3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_DCIP3(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_DCIP3(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_DCIP3(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_DCIP3(self):
@@ -167,8 +120,7 @@ def test_nan_eotf_DCIP3(self):
eotf_DCIP3` definition nan support.
"""
- eotf_DCIP3(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_DCIP3(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_dicom_gsdf.py b/colour/models/rgb/transfer_functions/tests/tests_dicom_gsdf.py
new file mode 100644
index 0000000000..d3c863bde7
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/tests/tests_dicom_gsdf.py
@@ -0,0 +1,137 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.rgb.transfer_functions.dicom_gsdf`
+module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+
+from colour.models.rgb.transfer_functions import (oetf_DICOMGSDF,
+ eotf_DICOMGSDF)
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestOetf_DICOMGSDF', 'TestEotf_DICOMGSDF']
+
+
+class TestOetf_DICOMGSDF(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+oetf_DICOMGSDF` definition unit tests methods.
+ """
+
+ def test_oetf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+oetf_DICOMGSDF` definition.
+ """
+
+ self.assertAlmostEqual(
+ round(oetf_DICOMGSDF(0.049981846913482)), 1, places=7)
+
+ self.assertAlmostEqual(
+ round(oetf_DICOMGSDF(130.065284012159790)), 512, places=7)
+
+ self.assertAlmostEqual(
+ round(oetf_DICOMGSDF(3993.329585887327100)), 1023, places=7)
+
+ def test_n_dimensional_oetf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+oetf_DICOMGSDF` definition n-dimensional arrays support.
+ """
+
+ L = 130.065284012159790
+ J = 512
+ np.testing.assert_almost_equal(
+ np.around(oetf_DICOMGSDF(L)), J, decimal=7)
+
+ L = np.tile(L, 6)
+ J = np.tile(J, 6)
+ np.testing.assert_almost_equal(
+ np.around(oetf_DICOMGSDF(L)), J, decimal=7)
+
+ L = np.reshape(L, (2, 3))
+ J = np.reshape(J, (2, 3))
+ np.testing.assert_almost_equal(
+ np.around(oetf_DICOMGSDF(L)), J, decimal=7)
+
+ L = np.reshape(L, (2, 3, 1))
+ J = np.reshape(J, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ np.around(oetf_DICOMGSDF(L)), J, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_oetf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+oetf_DICOMGSDF` definition nan support.
+ """
+
+ oetf_DICOMGSDF(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+class TestEotf_DICOMGSDF(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.dicom_gsdf.
+eotf_DICOMGSDF` definition unit tests methods.
+ """
+
+ def test_eotf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+eotf_DICOMGSDF` definition.
+ """
+
+ self.assertAlmostEqual(eotf_DICOMGSDF(1), 0.049981846913482, places=7)
+
+ self.assertAlmostEqual(
+ eotf_DICOMGSDF(512), 130.065284012159790, places=7)
+
+ self.assertAlmostEqual(
+ eotf_DICOMGSDF(1023), 3993.329585887327100, places=7)
+
+ def test_n_dimensional_eotf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+eotf_DICOMGSDF` definition n-dimensional arrays support.
+ """
+
+ J = 512
+ L = 130.065284012159790
+ np.testing.assert_almost_equal(eotf_DICOMGSDF(J), L, decimal=7)
+
+ J = np.tile(J, 6)
+ L = np.tile(L, 6)
+ np.testing.assert_almost_equal(eotf_DICOMGSDF(J), L, decimal=7)
+
+ J = np.reshape(J, (2, 3))
+ L = np.reshape(L, (2, 3))
+ np.testing.assert_almost_equal(eotf_DICOMGSDF(J), L, decimal=7)
+
+ J = np.reshape(J, (2, 3, 1))
+ L = np.reshape(L, (2, 3, 1))
+ np.testing.assert_almost_equal(eotf_DICOMGSDF(J), L, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_eotf_DICOMGSDF(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.dicom_gsdf.\
+eotf_DICOMGSDF` definition nan support.
+ """
+
+ eotf_DICOMGSDF(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/rgb/transfer_functions/tests/tests_gamma.py b/colour/models/rgb/transfer_functions/tests/tests_gamma.py
index 044cfa5e0d..b9d6416a5d 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_gamma.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_gamma.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.gamma`
module.
@@ -11,7 +10,7 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import gamma_function
+from colour.models.rgb.transfer_functions import function_gamma
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -21,105 +20,76 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestGammaFunction']
+__all__ = ['TestFunctionGamma']
-class TestGammaFunction(unittest.TestCase):
+class TestFunctionGamma(unittest.TestCase):
"""
- Defines :func:`colour.models.rgb.transfer_functions.gamma.gamma_function`
+ Defines :func:`colour.models.rgb.transfer_functions.gamma.function_gamma`
definition unit tests methods.
"""
- def test_gamma_function(self):
+ def test_function_gamma(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.gamma.\
-gamma_function` definition.
+function_gamma` definition.
"""
- self.assertAlmostEqual(
- gamma_function(0.0, 2.2),
- 0.0,
- places=7)
+ self.assertAlmostEqual(function_gamma(0.0, 2.2), 0.0, places=7)
self.assertAlmostEqual(
- gamma_function(0.18, 2.2),
- 0.022993204992707,
- places=7)
+ function_gamma(0.18, 2.2), 0.022993204992707, places=7)
self.assertAlmostEqual(
- gamma_function(0.022993204992707, 1.0 / 2.2),
- 0.18,
- places=7)
+ function_gamma(0.022993204992707, 1.0 / 2.2), 0.18, places=7)
self.assertAlmostEqual(
- gamma_function(-0.18, 2.0),
- 0.0323999999999998,
- places=7)
+ function_gamma(-0.18, 2.0), 0.0323999999999998, places=7)
- np.testing.assert_array_equal(
- gamma_function(-0.18, 2.2),
- np.nan)
+ np.testing.assert_array_equal(function_gamma(-0.18, 2.2), np.nan)
self.assertAlmostEqual(
- gamma_function(-0.18, 2.2, 'Mirror'),
- -0.022993204992707,
- places=7)
+ function_gamma(-0.18, 2.2, 'Mirror'), -0.022993204992707, places=7)
self.assertAlmostEqual(
- gamma_function(-0.18, 2.2, 'Preserve'),
- -0.18,
- places=7)
+ function_gamma(-0.18, 2.2, 'Preserve'), -0.18, places=7)
self.assertAlmostEqual(
- gamma_function(-0.18, 2.2, 'Clamp'),
- 0,
- places=7)
+ function_gamma(-0.18, 2.2, 'Clamp'), 0, places=7)
- def test_n_dimensional_gamma_function(self):
+ def test_n_dimensional_function_gamma(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.gamma.\
-gamma_function` definition n-dimensional arrays support.
+function_gamma` definition n-dimensional arrays support.
"""
a = 0.18
a_p = 0.022993204992707
- np.testing.assert_almost_equal(
- gamma_function(a, 2.2),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_gamma(a, 2.2), a_p, decimal=7)
a = np.tile(a, 6)
a_p = np.tile(a_p, 6)
- np.testing.assert_almost_equal(
- gamma_function(a, 2.2),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_gamma(a, 2.2), a_p, decimal=7)
a = np.reshape(a, (2, 3))
a_p = np.reshape(a_p, (2, 3))
- np.testing.assert_almost_equal(
- gamma_function(a, 2.2),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_gamma(a, 2.2), a_p, decimal=7)
a = np.reshape(a, (2, 3, 1))
a_p = np.reshape(a_p, (2, 3, 1))
- np.testing.assert_almost_equal(
- gamma_function(a, 2.2),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_gamma(a, 2.2), a_p, decimal=7)
@ignore_numpy_errors
- def test_nan_gamma_function(self):
+ def test_nan_function_gamma(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.gamma.\
-gamma_function` definition nan support.
+function_gamma` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
for case in cases:
- gamma_function(case, case)
+ function_gamma(case, case)
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_gopro.py b/colour/models/rgb/transfer_functions/tests/tests_gopro.py
new file mode 100644
index 0000000000..cea7286dd5
--- /dev/null
+++ b/colour/models/rgb/transfer_functions/tests/tests_gopro.py
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.rgb.transfer_functions.gopro`
+module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+
+from colour.models.rgb.transfer_functions import (log_encoding_Protune,
+ log_decoding_Protune)
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestLogEncoding_Protune', 'TestLogDecoding_Protune']
+
+
+class TestLogEncoding_Protune(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.gopro.\
+log_encoding_Protune` definition unit tests methods.
+ """
+
+ def test_log_encoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_encoding_Protune` definition.
+ """
+
+ self.assertAlmostEqual(log_encoding_Protune(0.0), 0.0, places=7)
+
+ self.assertAlmostEqual(
+ log_encoding_Protune(0.18), 0.645623486803636, places=7)
+
+ self.assertAlmostEqual(log_encoding_Protune(1.0), 1.0, places=7)
+
+ def test_n_dimensional_log_encoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_encoding_Protune` definition n-dimensional arrays support.
+ """
+
+ L = 0.18
+ V = 0.645623486803636
+ np.testing.assert_almost_equal(log_encoding_Protune(L), V, decimal=7)
+
+ L = np.tile(L, 6)
+ V = np.tile(V, 6)
+ np.testing.assert_almost_equal(log_encoding_Protune(L), V, decimal=7)
+
+ L = np.reshape(L, (2, 3))
+ V = np.reshape(V, (2, 3))
+ np.testing.assert_almost_equal(log_encoding_Protune(L), V, decimal=7)
+
+ L = np.reshape(L, (2, 3, 1))
+ V = np.reshape(V, (2, 3, 1))
+ np.testing.assert_almost_equal(log_encoding_Protune(L), V, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_log_encoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_encoding_Protune` definition nan support.
+ """
+
+ log_encoding_Protune(
+ np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+class TestLogDecoding_Protune(unittest.TestCase):
+ """
+ Defines :func:`colour.models.rgb.transfer_functions.gopro.\
+log_decoding_Protune` definition unit tests methods.
+ """
+
+ def test_log_decoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_decoding_Protune` definition.
+ """
+
+ self.assertAlmostEqual(log_decoding_Protune(0.0), 0.0, places=7)
+
+ self.assertAlmostEqual(
+ log_decoding_Protune(0.645623486803636), 0.18, places=7)
+
+ self.assertAlmostEqual(log_decoding_Protune(1.0), 1.0, places=7)
+
+ def test_n_dimensional_log_decoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_decoding_Protune` definition n-dimensional arrays support.
+ """
+
+ V = 0.645623486803636
+ L = 0.18
+ np.testing.assert_almost_equal(log_decoding_Protune(V), L, decimal=7)
+
+ V = np.tile(V, 6)
+ L = np.tile(L, 6)
+ np.testing.assert_almost_equal(log_decoding_Protune(V), L, decimal=7)
+
+ V = np.reshape(V, (2, 3))
+ L = np.reshape(L, (2, 3))
+ np.testing.assert_almost_equal(log_decoding_Protune(V), L, decimal=7)
+
+ V = np.reshape(V, (2, 3, 1))
+ L = np.reshape(L, (2, 3, 1))
+ np.testing.assert_almost_equal(log_decoding_Protune(V), L, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_log_decoding_Protune(self):
+ """
+ Tests :func:`colour.models.rgb.transfer_functions.gopro.\
+log_decoding_Protune` definition nan support.
+ """
+
+ log_decoding_Protune(
+ np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/rgb/transfer_functions/tests/tests_linear.py b/colour/models/rgb/transfer_functions/tests/tests_linear.py
index bb5dc5ac87..8b53cd04b5 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_linear.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_linear.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.linear`
module.
@@ -11,7 +10,7 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import linear_function
+from colour.models.rgb.transfer_functions import function_linear
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -21,72 +20,60 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLinearFunction']
+__all__ = ['TestFunctionLinear']
-class TestLinearFunction(unittest.TestCase):
+class TestFunctionLinear(unittest.TestCase):
"""
Defines :func:`colour.models.rgb.transfer_functions.linear.\
-linear_function` definition unit tests methods.
+function_linear` definition unit tests methods.
"""
- def test_linear_function(self):
+ def test_function_linear(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.linear.\
-linear_function` definition.
+function_linear` definition.
"""
- self.assertEqual(linear_function(0.0), 0.0)
+ self.assertEqual(function_linear(0.0), 0.0)
- self.assertEqual(linear_function(0.18), 0.18)
+ self.assertEqual(function_linear(0.18), 0.18)
- self.assertEqual(linear_function(1.0), 1.0)
+ self.assertEqual(function_linear(1.0), 1.0)
- def test_n_dimensional_linear_function(self):
+ def test_n_dimensional_function_linear(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.linear.\
-linear_function` definition n-dimensional arrays support.
+function_linear` definition n-dimensional arrays support.
"""
a = 0.18
a_p = 0.18
- np.testing.assert_almost_equal(
- linear_function(a),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_linear(a), a_p, decimal=7)
a = np.tile(a, 6)
a_p = np.tile(a_p, 6)
- np.testing.assert_almost_equal(
- linear_function(a),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_linear(a), a_p, decimal=7)
a = np.reshape(a, (2, 3))
a_p = np.reshape(a_p, (2, 3))
- np.testing.assert_almost_equal(
- linear_function(a),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_linear(a), a_p, decimal=7)
a = np.reshape(a, (2, 3, 1))
a_p = np.reshape(a_p, (2, 3, 1))
- np.testing.assert_almost_equal(
- linear_function(a),
- a_p,
- decimal=7)
+ np.testing.assert_almost_equal(function_linear(a), a_p, decimal=7)
@ignore_numpy_errors
- def test_nan_linear_function(self):
+ def test_nan_function_linear(self):
"""
Tests :func:`colour.models.rgb.transfer_functions.linear.\
-linear_function` definition nan support.
+function_linear` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
for case in cases:
- linear_function(case)
+ function_linear(case)
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_panalog.py b/colour/models/rgb/transfer_functions/tests/tests_panalog.py
index 68b7718b5c..568ef0007e 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_panalog.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_panalog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.panalog`
module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_Panalog,
- log_decoding_Panalog)
+from colour.models.rgb.transfer_functions import (log_encoding_Panalog,
+ log_decoding_Panalog)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_Panalog',
- 'TestLogDecoding_Panalog']
+__all__ = ['TestLogEncoding_Panalog', 'TestLogDecoding_Panalog']
class TestLogEncoding_Panalog(unittest.TestCase):
@@ -40,19 +37,13 @@ def test_log_encoding_Panalog(self):
"""
self.assertAlmostEqual(
- log_encoding_Panalog(0.0),
- 0.062561094819159,
- places=7)
+ log_encoding_Panalog(0.0), 0.062561094819159, places=7)
self.assertAlmostEqual(
- log_encoding_Panalog(0.18),
- 0.374576791382298,
- places=7)
+ log_encoding_Panalog(0.18), 0.374576791382298, places=7)
self.assertAlmostEqual(
- log_encoding_Panalog(1.0),
- 0.665689149560117,
- places=7)
+ log_encoding_Panalog(1.0), 0.665689149560117, places=7)
def test_n_dimensional_log_encoding_Panalog(self):
"""
@@ -62,31 +53,19 @@ def test_n_dimensional_log_encoding_Panalog(self):
L = 0.18
V = 0.374576791382298
- np.testing.assert_almost_equal(
- log_encoding_Panalog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Panalog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_Panalog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Panalog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_Panalog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Panalog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_Panalog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Panalog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_Panalog(self):
@@ -112,19 +91,13 @@ def test_log_decoding_Panalog(self):
"""
self.assertAlmostEqual(
- log_decoding_Panalog(0.062561094819159),
- 0.0,
- places=7)
+ log_decoding_Panalog(0.062561094819159), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_Panalog(0.374576791382298),
- 0.18,
- places=7)
+ log_decoding_Panalog(0.374576791382298), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_Panalog(0.665689149560117),
- 1.0,
- places=7)
+ log_decoding_Panalog(0.665689149560117), 1.0, places=7)
def test_n_dimensional_log_decoding_Panalog(self):
"""
@@ -134,31 +107,19 @@ def test_n_dimensional_log_decoding_Panalog(self):
V = 0.374576791382298
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_Panalog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Panalog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_Panalog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Panalog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_Panalog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Panalog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_Panalog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Panalog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_Panalog(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_panasonic_vlog.py b/colour/models/rgb/transfer_functions/tests/tests_panasonic_vlog.py
index 5e74f86027..df3d0e2e60 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_panasonic_vlog.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_panasonic_vlog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.\
panasonic_vlog` module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_VLog,
- log_decoding_VLog)
+from colour.models.rgb.transfer_functions import (log_encoding_VLog,
+ log_decoding_VLog)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_VLog',
- 'TestLogDecoding_VLog']
+__all__ = ['TestLogEncoding_VLog', 'TestLogDecoding_VLog']
class TestLogEncoding_VLog(unittest.TestCase):
@@ -39,20 +36,13 @@ def test_log_encoding_VLog(self):
log_encoding_VLog` definition.
"""
- self.assertAlmostEqual(
- log_encoding_VLog(0.0),
- 0.125,
- places=7)
+ self.assertAlmostEqual(log_encoding_VLog(0.0), 0.125, places=7)
self.assertAlmostEqual(
- log_encoding_VLog(0.18),
- 0.423311448760136,
- places=7)
+ log_encoding_VLog(0.18), 0.423311448760136, places=7)
self.assertAlmostEqual(
- log_encoding_VLog(1.0),
- 0.599117700158146,
- places=7)
+ log_encoding_VLog(1.0), 0.599117700158146, places=7)
def test_n_dimensional_log_encoding_VLog(self):
"""
@@ -62,31 +52,19 @@ def test_n_dimensional_log_encoding_VLog(self):
L = 0.18
V = 0.423311448760136
- np.testing.assert_almost_equal(
- log_encoding_VLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_VLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_VLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_VLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_VLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_VLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_VLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_VLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_VLog(self):
@@ -95,8 +73,7 @@ def test_nan_log_encoding_VLog(self):
log_encoding_VLog` definition nan support.
"""
- log_encoding_VLog(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ log_encoding_VLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestLogDecoding_VLog(unittest.TestCase):
@@ -111,20 +88,13 @@ def test_log_decoding_VLog(self):
log_decoding_VLog` definition.
"""
- self.assertAlmostEqual(
- log_decoding_VLog(0.125),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_VLog(0.125), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_VLog(0.423311448760136),
- 0.18,
- places=7)
+ log_decoding_VLog(0.423311448760136), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_VLog(0.599117700158146),
- 1.0,
- places=7)
+ log_decoding_VLog(0.599117700158146), 1.0, places=7)
def test_n_dimensional_log_decoding_VLog(self):
"""
@@ -134,31 +104,19 @@ def test_n_dimensional_log_decoding_VLog(self):
V = 0.423311448760136
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_VLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_VLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_VLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_VLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_VLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_VLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_VLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_VLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_VLog(self):
@@ -167,8 +125,7 @@ def test_nan_log_decoding_VLog(self):
log_decoding_VLog` definition nan support.
"""
- log_decoding_VLog(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ log_decoding_VLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_pivoted_log.py b/colour/models/rgb/transfer_functions/tests/tests_pivoted_log.py
index 695af9c35d..beec12024c 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_pivoted_log.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_pivoted_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.\
pivoted_log` module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_PivotedLog,
- log_decoding_PivotedLog)
+from colour.models.rgb.transfer_functions import (log_encoding_PivotedLog,
+ log_decoding_PivotedLog)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_PivotedLog',
- 'TestLogDecoding_PivotedLog']
+__all__ = ['TestLogEncoding_PivotedLog', 'TestLogDecoding_PivotedLog']
class TestLogEncoding_PivotedLog(unittest.TestCase):
@@ -39,20 +36,13 @@ def test_log_encoding_PivotedLog(self):
log_encoding_PivotedLog` definition.
"""
- self.assertAlmostEqual(
- log_encoding_PivotedLog(0.0),
- -np.inf,
- places=7)
+ self.assertAlmostEqual(log_encoding_PivotedLog(0.0), -np.inf, places=7)
self.assertAlmostEqual(
- log_encoding_PivotedLog(0.18),
- 0.434995112414467,
- places=7)
+ log_encoding_PivotedLog(0.18), 0.434995112414467, places=7)
self.assertAlmostEqual(
- log_encoding_PivotedLog(1.0),
- 0.653390272208219,
- places=7)
+ log_encoding_PivotedLog(1.0), 0.653390272208219, places=7)
def test_n_dimensional_log_encoding_PivotedLog(self):
"""
@@ -63,30 +53,22 @@ def test_n_dimensional_log_encoding_PivotedLog(self):
L = 0.18
V = 0.434995112414467
np.testing.assert_almost_equal(
- log_encoding_PivotedLog(L),
- V,
- decimal=7)
+ log_encoding_PivotedLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
np.testing.assert_almost_equal(
- log_encoding_PivotedLog(L),
- V,
- decimal=7)
+ log_encoding_PivotedLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
np.testing.assert_almost_equal(
- log_encoding_PivotedLog(L),
- V,
- decimal=7)
+ log_encoding_PivotedLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
np.testing.assert_almost_equal(
- log_encoding_PivotedLog(L),
- V,
- decimal=7)
+ log_encoding_PivotedLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_PivotedLog(self):
@@ -111,20 +93,13 @@ def test_log_decoding_PivotedLog(self):
log_decoding_PivotedLog` definition.
"""
- self.assertAlmostEqual(
- log_decoding_PivotedLog(-np.inf),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_PivotedLog(-np.inf), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_PivotedLog(0.434995112414467),
- 0.18,
- places=7)
+ log_decoding_PivotedLog(0.434995112414467), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_PivotedLog(0.653390272208219),
- 1.0,
- places=7)
+ log_decoding_PivotedLog(0.653390272208219), 1.0, places=7)
def test_n_dimensional_log_decoding_PivotedLog(self):
"""
@@ -135,30 +110,22 @@ def test_n_dimensional_log_decoding_PivotedLog(self):
V = 0.434995112414467
L = 0.18
np.testing.assert_almost_equal(
- log_decoding_PivotedLog(V),
- L,
- decimal=7)
+ log_decoding_PivotedLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
np.testing.assert_almost_equal(
- log_decoding_PivotedLog(V),
- L,
- decimal=7)
+ log_decoding_PivotedLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_PivotedLog(V),
- L,
- decimal=7)
+ log_decoding_PivotedLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_PivotedLog(V),
- L,
- decimal=7)
+ log_decoding_PivotedLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_PivotedLog(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_red_log.py b/colour/models/rgb/transfer_functions/tests/tests_red_log.py
index 04457ee789..6f858ed9e4 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_red_log.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_red_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.red_log`
module.
@@ -12,14 +11,9 @@
import unittest
from colour.models.rgb.transfer_functions import (
- log_encoding_REDLog,
- log_decoding_REDLog,
- log_encoding_REDLogFilm,
- log_decoding_REDLogFilm,
- log_encoding_Log3G10,
- log_decoding_Log3G10,
- log_encoding_Log3G12,
- log_decoding_Log3G12)
+ log_encoding_REDLog, log_decoding_REDLog, log_encoding_REDLogFilm,
+ log_decoding_REDLogFilm, log_encoding_Log3G10, log_decoding_Log3G10,
+ log_encoding_Log3G12, log_decoding_Log3G12)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -29,14 +23,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Development'
-__all__ = ['TestLogEncoding_REDLog',
- 'TestLogDecoding_REDLog',
- 'TestLogDecoding_REDLogFilm',
- 'TestLogDecoding_REDLogFilm',
- 'TestLogDecoding_Log3G10',
- 'TestLogDecoding_Log3G10',
- 'TestLogDecoding_Log3G12',
- 'TestLogDecoding_Log3G12']
+__all__ = [
+ 'TestLogEncoding_REDLog', 'TestLogDecoding_REDLog',
+ 'TestLogDecoding_REDLogFilm', 'TestLogDecoding_REDLogFilm',
+ 'TestLogDecoding_Log3G10', 'TestLogDecoding_Log3G10',
+ 'TestLogDecoding_Log3G12', 'TestLogDecoding_Log3G12'
+]
class TestLogEncoding_REDLog(unittest.TestCase):
@@ -51,20 +43,12 @@ def test_log_encoding_REDLog(self):
log_encoding_REDLog` definition.
"""
- self.assertAlmostEqual(
- log_encoding_REDLog(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_encoding_REDLog(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_encoding_REDLog(0.18),
- 0.637621845988175,
- places=7)
+ log_encoding_REDLog(0.18), 0.637621845988175, places=7)
- self.assertAlmostEqual(
- log_encoding_REDLog(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(log_encoding_REDLog(1.0), 1.0, places=7)
def test_n_dimensional_log_encoding_REDLog(self):
"""
@@ -74,31 +58,19 @@ def test_n_dimensional_log_encoding_REDLog(self):
L = 0.18
V = 0.637621845988175
- np.testing.assert_almost_equal(
- log_encoding_REDLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_REDLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_REDLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_REDLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_REDLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_REDLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_REDLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_REDLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_REDLog(self):
@@ -123,20 +95,12 @@ def test_log_decoding_REDLog(self):
log_decoding_REDLog` definition.
"""
- self.assertAlmostEqual(
- log_decoding_REDLog(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_REDLog(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_REDLog(0.637621845988175),
- 0.18,
- places=7)
+ log_decoding_REDLog(0.637621845988175), 0.18, places=7)
- self.assertAlmostEqual(
- log_decoding_REDLog(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_REDLog(1.0), 1.0, places=7)
def test_n_dimensional_log_decoding_REDLog(self):
"""
@@ -146,31 +110,19 @@ def test_n_dimensional_log_decoding_REDLog(self):
V = 0.637621845988175
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_REDLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_REDLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_REDLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_REDLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_REDLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_REDLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_REDLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_REDLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_REDLog(self):
@@ -196,19 +148,13 @@ def test_log_encoding_REDLogFilm(self):
"""
self.assertAlmostEqual(
- log_encoding_REDLogFilm(0.0),
- 0.092864125122190,
- places=7)
+ log_encoding_REDLogFilm(0.0), 0.092864125122190, places=7)
self.assertAlmostEqual(
- log_encoding_REDLogFilm(0.18),
- 0.457319613085418,
- places=7)
+ log_encoding_REDLogFilm(0.18), 0.457319613085418, places=7)
self.assertAlmostEqual(
- log_encoding_REDLogFilm(1.0),
- 0.669599217986315,
- places=7)
+ log_encoding_REDLogFilm(1.0), 0.669599217986315, places=7)
def test_n_dimensional_log_encoding_REDLogFilm(self):
"""
@@ -219,30 +165,22 @@ def test_n_dimensional_log_encoding_REDLogFilm(self):
L = 0.18
V = 0.457319613085418
np.testing.assert_almost_equal(
- log_encoding_REDLogFilm(L),
- V,
- decimal=7)
+ log_encoding_REDLogFilm(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
np.testing.assert_almost_equal(
- log_encoding_REDLogFilm(L),
- V,
- decimal=7)
+ log_encoding_REDLogFilm(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
np.testing.assert_almost_equal(
- log_encoding_REDLogFilm(L),
- V,
- decimal=7)
+ log_encoding_REDLogFilm(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
np.testing.assert_almost_equal(
- log_encoding_REDLogFilm(L),
- V,
- decimal=7)
+ log_encoding_REDLogFilm(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_REDLogFilm(self):
@@ -268,19 +206,13 @@ def test_log_decoding_REDLogFilm(self):
"""
self.assertAlmostEqual(
- log_decoding_REDLogFilm(0.092864125122190),
- 0.0,
- places=7)
+ log_decoding_REDLogFilm(0.092864125122190), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_REDLogFilm(0.457319613085418),
- 0.18,
- places=7)
+ log_decoding_REDLogFilm(0.457319613085418), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_REDLogFilm(0.669599217986315),
- 1.0,
- places=7)
+ log_decoding_REDLogFilm(0.669599217986315), 1.0, places=7)
def test_n_dimensional_log_decoding_REDLogFilm(self):
"""
@@ -291,30 +223,22 @@ def test_n_dimensional_log_decoding_REDLogFilm(self):
V = 0.457319613085418
L = 0.18
np.testing.assert_almost_equal(
- log_decoding_REDLogFilm(V),
- L,
- decimal=7)
+ log_decoding_REDLogFilm(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
np.testing.assert_almost_equal(
- log_decoding_REDLogFilm(V),
- L,
- decimal=7)
+ log_decoding_REDLogFilm(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_REDLogFilm(V),
- L,
- decimal=7)
+ log_decoding_REDLogFilm(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_REDLogFilm(V),
- L,
- decimal=7)
+ log_decoding_REDLogFilm(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_REDLogFilm(self):
@@ -345,9 +269,7 @@ def test_log_encoding_Log3G10(self):
places=7)
self.assertAlmostEqual(
- log_encoding_Log3G10(0.0, legacy_curve=True),
- 0.0,
- places=7)
+ log_encoding_Log3G10(0.0, legacy_curve=True), 0.0, places=7)
self.assertAlmostEqual(
log_encoding_Log3G10(0.18, legacy_curve=True),
@@ -379,49 +301,33 @@ def test_n_dimensional_log_encoding_Log3G10(self):
V1 = 0.333333644207707
V2 = 0.333332912025992
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=True),
- V1,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=True), V1, decimal=7)
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=False),
- V2,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=False), V2, decimal=7)
L = np.tile(L, 6)
V1 = np.tile(V1, 6)
V2 = np.tile(V2, 6)
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=True),
- V1,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=True), V1, decimal=7)
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=False),
- V2,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=False), V2, decimal=7)
L = np.reshape(L, (2, 3))
V1 = np.reshape(V1, (2, 3))
V2 = np.reshape(V2, (2, 3))
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=True),
- V1,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=True), V1, decimal=7)
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=False),
- V2,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=False), V2, decimal=7)
L = np.reshape(L, (2, 3, 1))
V1 = np.reshape(V1, (2, 3, 1))
V2 = np.reshape(V2, (2, 3, 1))
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=True),
- V1,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=True), V1, decimal=7)
np.testing.assert_almost_equal(
- log_encoding_Log3G10(L, legacy_curve=False),
- V2,
- decimal=7)
+ log_encoding_Log3G10(L, legacy_curve=False), V2, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_Log3G10(self):
@@ -456,9 +362,7 @@ def test_log_decoding_Log3G10(self):
places=7)
self.assertAlmostEqual(
- log_decoding_Log3G10(0.0, legacy_curve=True),
- 0.0,
- places=7)
+ log_decoding_Log3G10(0.0, legacy_curve=True), 0.0, places=7)
self.assertAlmostEqual(
log_decoding_Log3G10(0.333333644207707, legacy_curve=True),
@@ -490,49 +394,33 @@ def test_n_dimensional_log_decoding_Log3G10(self):
V2 = 0.333332912025992
L = 0.18
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V1, legacy_curve=True),
- L,
- decimal=7)
+ log_decoding_Log3G10(V1, legacy_curve=True), L, decimal=7)
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V2, legacy_curve=False),
- L,
- decimal=7)
+ log_decoding_Log3G10(V2, legacy_curve=False), L, decimal=7)
V1 = np.tile(V1, 6)
V2 = np.tile(V2, 6)
L = np.tile(L, 6)
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V1, legacy_curve=True),
- L,
- decimal=7)
+ log_decoding_Log3G10(V1, legacy_curve=True), L, decimal=7)
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V2, legacy_curve=False),
- L,
- decimal=7)
+ log_decoding_Log3G10(V2, legacy_curve=False), L, decimal=7)
V1 = np.reshape(V1, (2, 3))
V2 = np.reshape(V2, (2, 3))
L = np.reshape(L, (2, 3))
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V1, legacy_curve=True),
- L,
- decimal=7)
+ log_decoding_Log3G10(V1, legacy_curve=True), L, decimal=7)
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V2, legacy_curve=False),
- L,
- decimal=7)
+ log_decoding_Log3G10(V2, legacy_curve=False), L, decimal=7)
V1 = np.reshape(V1, (2, 3, 1))
V2 = np.reshape(V2, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V1, legacy_curve=True),
- L,
- decimal=7)
+ log_decoding_Log3G10(V1, legacy_curve=True), L, decimal=7)
np.testing.assert_almost_equal(
- log_decoding_Log3G10(V2, legacy_curve=False),
- L,
- decimal=7)
+ log_decoding_Log3G10(V2, legacy_curve=False), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_Log3G10(self):
@@ -561,25 +449,16 @@ def test_log_encoding_Log3G12(self):
log_encoding_Log3G12` definition.
"""
- self.assertAlmostEqual(
- log_encoding_Log3G12(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_encoding_Log3G12(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_encoding_Log3G12(0.18),
- 0.333332662015923,
- places=7)
+ log_encoding_Log3G12(0.18), 0.333332662015923, places=7)
self.assertAlmostEqual(
- log_encoding_Log3G12(1.0),
- 0.469991923234319,
- places=7)
+ log_encoding_Log3G12(1.0), 0.469991923234319, places=7)
self.assertAlmostEqual(
- log_encoding_Log3G12(0.18 * 2 ** 12),
- 0.999997986792394,
- places=7)
+ log_encoding_Log3G12(0.18 * 2 ** 12), 0.999997986792394, places=7)
def test_n_dimensional_log_encoding_Log3G12(self):
"""
@@ -589,31 +468,19 @@ def test_n_dimensional_log_encoding_Log3G12(self):
L = 0.18
V = 0.333332662015923
- np.testing.assert_almost_equal(
- log_encoding_Log3G12(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Log3G12(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_Log3G12(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Log3G12(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_Log3G12(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Log3G12(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_Log3G12(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_Log3G12(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_Log3G12(self):
@@ -638,25 +505,16 @@ def test_log_decoding_Log3G12(self):
log_decoding_Log3G12` definition.
"""
- self.assertAlmostEqual(
- log_decoding_Log3G12(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_Log3G12(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_Log3G12(0.333332662015923),
- 0.18,
- places=7)
+ log_decoding_Log3G12(0.333332662015923), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_Log3G12(0.469991923234319),
- 1.0,
- places=7)
+ log_decoding_Log3G12(0.469991923234319), 1.0, places=7)
self.assertAlmostEqual(
- log_decoding_Log3G12(1.0),
- 737.29848406719,
- places=7)
+ log_decoding_Log3G12(1.0), 737.29848406719, places=7)
def test_n_dimensional_log_decoding_Log3G12(self):
"""
@@ -666,31 +524,19 @@ def test_n_dimensional_log_decoding_Log3G12(self):
V = 0.333332662015923
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_Log3G12(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Log3G12(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_Log3G12(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Log3G12(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_Log3G12(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Log3G12(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_Log3G12(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_Log3G12(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_Log3G12(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_rimm_romm_rgb.py b/colour/models/rgb/transfer_functions/tests/tests_rimm_romm_rgb.py
index cb132ec7a0..6e039df110 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_rimm_romm_rgb.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_rimm_romm_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for
:mod:`colour.models.rgb.transfer_functions.rimm_romm_rgb` module.
@@ -12,12 +11,8 @@
import unittest
from colour.models.rgb.transfer_functions import (
- oetf_ROMMRGB,
- eotf_ROMMRGB,
- oetf_RIMMRGB,
- eotf_RIMMRGB,
- log_encoding_ERIMMRGB,
- log_decoding_ERIMMRGB)
+ oetf_ROMMRGB, eotf_ROMMRGB, oetf_RIMMRGB, eotf_RIMMRGB,
+ log_encoding_ERIMMRGB, log_decoding_ERIMMRGB)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -27,12 +22,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_ROMMRGB',
- 'TestEotf_ROMMRGB',
- 'TestOetf_RIMMRGB',
- 'TestEotf_RIMMRGB',
- 'TestLog_encoding_ERIMMRGB',
- 'TestLog_decoding_ERIMMRGB']
+__all__ = [
+ 'TestOetf_ROMMRGB', 'TestEotf_ROMMRGB', 'TestOetf_RIMMRGB',
+ 'TestEotf_RIMMRGB', 'TestLog_encoding_ERIMMRGB',
+ 'TestLog_decoding_ERIMMRGB'
+]
class TestOetf_ROMMRGB(unittest.TestCase):
@@ -47,20 +41,12 @@ def test_oetf_ROMMRGB(self):
oetf_ROMMRGB` definition.
"""
- self.assertAlmostEqual(
- oetf_ROMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_ROMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- oetf_ROMMRGB(0.18),
- 98.356413311540095,
- places=7)
+ oetf_ROMMRGB(0.18), 98.356413311540095, places=7)
- self.assertAlmostEqual(
- oetf_ROMMRGB(1.0),
- 255.0,
- places=7)
+ self.assertAlmostEqual(oetf_ROMMRGB(1.0), 255.0, places=7)
def test_n_dimensional_oetf_ROMMRGB(self):
"""
@@ -70,31 +56,19 @@ def test_n_dimensional_oetf_ROMMRGB(self):
L = 0.18
V = 98.356413311540095
- np.testing.assert_almost_equal(
- oetf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ROMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ROMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ROMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ROMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_ROMMRGB(self):
@@ -103,8 +77,7 @@ def test_nan_oetf_ROMMRGB(self):
oetf_ROMMRGB` definition nan support.
"""
- oetf_ROMMRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_ROMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_ROMMRGB(unittest.TestCase):
@@ -119,20 +92,12 @@ def test_eotf_ROMMRGB(self):
eotf_ROMMRGB` definition.
"""
- self.assertAlmostEqual(
- eotf_ROMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_ROMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- eotf_ROMMRGB(98.356413311540095),
- 0.18,
- places=7)
+ eotf_ROMMRGB(98.356413311540095), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_ROMMRGB(255.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_ROMMRGB(255.0), 1.0, places=7)
def test_n_dimensional_eotf_ROMMRGB(self):
"""
@@ -142,31 +107,19 @@ def test_n_dimensional_eotf_ROMMRGB(self):
L = 98.356413311540095
V = 0.18
- np.testing.assert_almost_equal(
- eotf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- eotf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- eotf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_ROMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_ROMMRGB(self):
@@ -175,8 +128,7 @@ def test_nan_eotf_ROMMRGB(self):
eotf_ROMMRGB` definition nan support.
"""
- eotf_ROMMRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_ROMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestOetf_RIMMRGB(unittest.TestCase):
@@ -191,20 +143,13 @@ def test_oetf_RIMMRGB(self):
oetf_RIMMRGB` definition.
"""
- self.assertAlmostEqual(
- oetf_RIMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_RIMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- oetf_RIMMRGB(0.18),
- 74.376801781315210,
- places=7)
+ oetf_RIMMRGB(0.18), 74.376801781315210, places=7)
self.assertAlmostEqual(
- oetf_RIMMRGB(1.0),
- 181.846934745868940,
- places=7)
+ oetf_RIMMRGB(1.0), 181.846934745868940, places=7)
def test_n_dimensional_oetf_RIMMRGB(self):
"""
@@ -214,31 +159,19 @@ def test_n_dimensional_oetf_RIMMRGB(self):
L = 0.18
V = 74.376801781315210
- np.testing.assert_almost_equal(
- oetf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_RIMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_RIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_RIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_RIMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_RIMMRGB(self):
@@ -247,8 +180,7 @@ def test_nan_oetf_RIMMRGB(self):
oetf_RIMMRGB` definition nan support.
"""
- oetf_RIMMRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_RIMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_RIMMRGB(unittest.TestCase):
@@ -263,20 +195,13 @@ def test_eotf_RIMMRGB(self):
eotf_RIMMRGB` definition.
"""
- self.assertAlmostEqual(
- eotf_RIMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_RIMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- eotf_RIMMRGB(74.376801781315210),
- 0.18,
- places=7)
+ eotf_RIMMRGB(74.376801781315210), 0.18, places=7)
self.assertAlmostEqual(
- eotf_RIMMRGB(181.846934745868940),
- 1.0,
- places=7)
+ eotf_RIMMRGB(181.846934745868940), 1.0, places=7)
def test_n_dimensional_eotf_RIMMRGB(self):
"""
@@ -286,31 +211,19 @@ def test_n_dimensional_eotf_RIMMRGB(self):
L = 74.376801781315210
V = 0.18
- np.testing.assert_almost_equal(
- eotf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- eotf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- eotf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_RIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_RIMMRGB(self):
@@ -319,8 +232,7 @@ def test_nan_eotf_RIMMRGB(self):
eotf_RIMMRGB` definition nan support.
"""
- eotf_RIMMRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_RIMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestLog_encoding_ERIMMRGB(unittest.TestCase):
@@ -335,20 +247,13 @@ def test_log_encoding_ERIMMRGB(self):
log_encoding_ERIMMRGB` definition.
"""
- self.assertAlmostEqual(
- log_encoding_ERIMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_encoding_ERIMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_encoding_ERIMMRGB(0.18),
- 104.563359320492940,
- places=7)
+ log_encoding_ERIMMRGB(0.18), 104.563359320492940, places=7)
self.assertAlmostEqual(
- log_encoding_ERIMMRGB(1.0),
- 139.09187348830370,
- places=7)
+ log_encoding_ERIMMRGB(1.0), 139.09187348830370, places=7)
def test_n_dimensional_log_encoding_ERIMMRGB(self):
"""
@@ -358,31 +263,19 @@ def test_n_dimensional_log_encoding_ERIMMRGB(self):
L = 0.18
V = 104.563359320492940
- np.testing.assert_almost_equal(
- log_encoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ERIMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ERIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ERIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ERIMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_ERIMMRGB(self):
@@ -407,20 +300,13 @@ def test_log_decoding_ERIMMRGB(self):
log_decoding_ERIMMRGB` definition.
"""
- self.assertAlmostEqual(
- log_decoding_ERIMMRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_ERIMMRGB(0.0), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_ERIMMRGB(104.563359320492940),
- 0.18,
- places=7)
+ log_decoding_ERIMMRGB(104.563359320492940), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_ERIMMRGB(139.09187348830370),
- 1.0,
- places=7)
+ log_decoding_ERIMMRGB(139.09187348830370), 1.0, places=7)
def test_n_dimensional_log_decoding_ERIMMRGB(self):
"""
@@ -430,31 +316,19 @@ def test_n_dimensional_log_decoding_ERIMMRGB(self):
L = 104.563359320492940
V = 0.18
- np.testing.assert_almost_equal(
- log_decoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ERIMMRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_decoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ERIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ERIMMRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_ERIMMRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ERIMMRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ERIMMRGB(self):
diff --git a/colour/models/rgb/transfer_functions/tests/tests_sony_slog.py b/colour/models/rgb/transfer_functions/tests/tests_sony_slog.py
index fa8a07683e..97d95bfc6e 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_sony_slog.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_sony_slog.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.sony_slog`
module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_SLog,
- log_decoding_SLog)
+from colour.models.rgb.transfer_functions import (log_encoding_SLog,
+ log_decoding_SLog)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_SLog',
- 'TestLogDecoding_SLog']
+__all__ = ['TestLogEncoding_SLog', 'TestLogDecoding_SLog']
class TestLogEncoding_SLog(unittest.TestCase):
@@ -40,19 +37,13 @@ def test_log_encoding_SLog(self):
"""
self.assertAlmostEqual(
- log_encoding_SLog(0.0),
- 0.030001222851889,
- places=7)
+ log_encoding_SLog(0.0), 0.030001222851889, places=7)
self.assertAlmostEqual(
- log_encoding_SLog(0.18),
- 0.359987846422154,
- places=7)
+ log_encoding_SLog(0.18), 0.359987846422154, places=7)
self.assertAlmostEqual(
- log_encoding_SLog(1.0),
- 0.653529251225308,
- places=7)
+ log_encoding_SLog(1.0), 0.653529251225308, places=7)
def test_n_dimensional_log_encoding_SLog(self):
"""
@@ -62,31 +53,19 @@ def test_n_dimensional_log_encoding_SLog(self):
L = 0.18
V = 0.359987846422154
- np.testing.assert_almost_equal(
- log_encoding_SLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_SLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_SLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_SLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_SLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_SLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_SLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_SLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_SLog(self):
@@ -95,8 +74,7 @@ def test_nan_log_encoding_SLog(self):
log_encoding_SLog` definition nan support.
"""
- log_encoding_SLog(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ log_encoding_SLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestLogDecoding_SLog(unittest.TestCase):
@@ -112,19 +90,13 @@ def test_log_decoding_SLog(self):
"""
self.assertAlmostEqual(
- log_decoding_SLog(0.0),
- -0.005545814446077,
- places=7)
+ log_decoding_SLog(0.0), -0.005545814446077, places=7)
self.assertAlmostEqual(
- log_decoding_SLog(0.359987846422154),
- 0.18,
- places=7)
+ log_decoding_SLog(0.359987846422154), 0.18, places=7)
self.assertAlmostEqual(
- log_decoding_SLog(0.653529251225308),
- 1.0,
- places=7)
+ log_decoding_SLog(0.653529251225308), 1.0, places=7)
def test_n_dimensional_log_decoding_SLog(self):
"""
@@ -134,31 +106,19 @@ def test_n_dimensional_log_decoding_SLog(self):
V = 0.359987846422154
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_SLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_SLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_SLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_SLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_SLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_SLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_SLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_SLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_SLog(self):
@@ -167,8 +127,7 @@ def test_nan_log_decoding_SLog(self):
log_decoding_SLog` definition nan support.
"""
- log_decoding_SLog(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ log_decoding_SLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_srgb.py b/colour/models/rgb/transfer_functions/tests/tests_srgb.py
index ae48305bda..e241829798 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_srgb.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_srgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.sRGB`
module.
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_sRGB',
- 'TestEotf_sRGB']
+__all__ = ['TestOetf_sRGB', 'TestEotf_sRGB']
class TestOetf_sRGB(unittest.TestCase):
@@ -37,20 +35,11 @@ def test_oetf_sRGB(self):
oetf_sRGB` definition.
"""
- self.assertAlmostEqual(
- oetf_sRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(oetf_sRGB(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- oetf_sRGB(0.18),
- 0.461356129500442,
- places=7)
+ self.assertAlmostEqual(oetf_sRGB(0.18), 0.461356129500442, places=7)
- self.assertAlmostEqual(
- oetf_sRGB(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(oetf_sRGB(1.0), 1.0, places=7)
def test_n_dimensional_oetf_sRGB(self):
"""
@@ -60,31 +49,19 @@ def test_n_dimensional_oetf_sRGB(self):
L = 0.18
V = 0.461356129500442
- np.testing.assert_almost_equal(
- oetf_sRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_sRGB(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- oetf_sRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_sRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- oetf_sRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_sRGB(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_sRGB(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_sRGB(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_sRGB(self):
@@ -93,8 +70,7 @@ def test_nan_oetf_sRGB(self):
oetf_sRGB` definition nan support.
"""
- oetf_sRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_sRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_sRGB(unittest.TestCase):
@@ -109,20 +85,11 @@ def test_eotf_sRGB(self):
eotf_sRGB` definition.
"""
- self.assertAlmostEqual(
- eotf_sRGB(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_sRGB(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_sRGB(0.461356129500442),
- 0.18,
- places=7)
+ self.assertAlmostEqual(eotf_sRGB(0.461356129500442), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_sRGB(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_sRGB(1.0), 1.0, places=7)
def test_n_dimensional_eotf_sRGB(self):
"""
@@ -132,31 +99,19 @@ def test_n_dimensional_eotf_sRGB(self):
V = 0.461356129500442
L = 0.18
- np.testing.assert_almost_equal(
- eotf_sRGB(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_sRGB(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- eotf_sRGB(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_sRGB(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- eotf_sRGB(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_sRGB(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_sRGB(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_sRGB(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_sRGB(self):
@@ -165,8 +120,7 @@ def test_nan_eotf_sRGB(self):
eotf_sRGB` definition nan support.
"""
- eotf_sRGB(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_sRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_st_2084.py b/colour/models/rgb/transfer_functions/tests/tests_st_2084.py
index 28f44d1dc4..453bfa712f 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_st_2084.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_st_2084.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.st_2084`
module.
@@ -21,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestOetf_ST2084',
- 'TestEotf_ST2084']
+__all__ = ['TestOetf_ST2084', 'TestEotf_ST2084']
class TestOetf_ST2084(unittest.TestCase):
@@ -37,25 +35,13 @@ def test_oetf_ST2084(self):
oetf_ST2084` definition.
"""
- self.assertAlmostEqual(
- oetf_ST2084(0.0),
- 0.000000730955903,
- places=7)
+ self.assertAlmostEqual(oetf_ST2084(0.0), 0.000000730955903, places=7)
- self.assertAlmostEqual(
- oetf_ST2084(0.18),
- 0.079420969944927,
- places=7)
+ self.assertAlmostEqual(oetf_ST2084(0.18), 0.079420969944927, places=7)
- self.assertAlmostEqual(
- oetf_ST2084(1),
- 0.149945732100180,
- places=7)
+ self.assertAlmostEqual(oetf_ST2084(1), 0.149945732100180, places=7)
- self.assertAlmostEqual(
- oetf_ST2084(5000, 5000),
- 1.0,
- places=7)
+ self.assertAlmostEqual(oetf_ST2084(5000, 5000), 1.0, places=7)
def test_n_dimensional_oetf_ST2084(self):
"""
@@ -65,31 +51,19 @@ def test_n_dimensional_oetf_ST2084(self):
C = 0.18
N = 0.079420969944927
- np.testing.assert_almost_equal(
- oetf_ST2084(C),
- N,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ST2084(C), N, decimal=7)
C = np.tile(C, 6)
N = np.tile(N, 6)
- np.testing.assert_almost_equal(
- oetf_ST2084(C),
- N,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ST2084(C), N, decimal=7)
C = np.reshape(C, (2, 3))
N = np.reshape(N, (2, 3))
- np.testing.assert_almost_equal(
- oetf_ST2084(C),
- N,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ST2084(C), N, decimal=7)
C = np.reshape(C, (2, 3, 1))
N = np.reshape(N, (2, 3, 1))
- np.testing.assert_almost_equal(
- oetf_ST2084(C),
- N,
- decimal=7)
+ np.testing.assert_almost_equal(oetf_ST2084(C), N, decimal=7)
@ignore_numpy_errors
def test_nan_oetf_ST2084(self):
@@ -98,8 +72,7 @@ def test_nan_oetf_ST2084(self):
oetf_ST2084` definition nan support.
"""
- oetf_ST2084(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ oetf_ST2084(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestEotf_ST2084(unittest.TestCase):
@@ -114,25 +87,13 @@ def test_eotf_ST2084(self):
eotf_ST2084` definition.
"""
- self.assertAlmostEqual(
- eotf_ST2084(0.0),
- 0.0,
- places=7)
+ self.assertAlmostEqual(eotf_ST2084(0.0), 0.0, places=7)
- self.assertAlmostEqual(
- eotf_ST2084(0.079420969944927),
- 0.18,
- places=7)
+ self.assertAlmostEqual(eotf_ST2084(0.079420969944927), 0.18, places=7)
- self.assertAlmostEqual(
- eotf_ST2084(0.149945732100180),
- 1.0,
- places=7)
+ self.assertAlmostEqual(eotf_ST2084(0.149945732100180), 1.0, places=7)
- self.assertAlmostEqual(
- eotf_ST2084(1.0, 5000),
- 5000.0,
- places=7)
+ self.assertAlmostEqual(eotf_ST2084(1.0, 5000), 5000.0, places=7)
def test_n_dimensional_eotf_ST2084(self):
"""
@@ -142,31 +103,19 @@ def test_n_dimensional_eotf_ST2084(self):
N = 0.18
C = 1.738580491084806
- np.testing.assert_almost_equal(
- eotf_ST2084(N),
- C,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ST2084(N), C, decimal=7)
N = np.tile(N, 6)
C = np.tile(C, 6)
- np.testing.assert_almost_equal(
- eotf_ST2084(N),
- C,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ST2084(N), C, decimal=7)
N = np.reshape(N, (2, 3))
C = np.reshape(C, (2, 3))
- np.testing.assert_almost_equal(
- eotf_ST2084(N),
- C,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ST2084(N), C, decimal=7)
N = np.reshape(N, (2, 3, 1))
C = np.reshape(C, (2, 3, 1))
- np.testing.assert_almost_equal(
- eotf_ST2084(N),
- C,
- decimal=7)
+ np.testing.assert_almost_equal(eotf_ST2084(N), C, decimal=7)
@ignore_numpy_errors
def test_nan_eotf_ST2084(self):
@@ -175,8 +124,7 @@ def test_nan_eotf_ST2084(self):
eotf_ST2084` definition nan support.
"""
- eotf_ST2084(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ eotf_ST2084(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
if __name__ == '__main__':
diff --git a/colour/models/rgb/transfer_functions/tests/tests_viper_log.py b/colour/models/rgb/transfer_functions/tests/tests_viper_log.py
index fcf078cd7b..0b270961ac 100644
--- a/colour/models/rgb/transfer_functions/tests/tests_viper_log.py
+++ b/colour/models/rgb/transfer_functions/tests/tests_viper_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.viper_log`
module.
@@ -11,9 +10,8 @@
import numpy as np
import unittest
-from colour.models.rgb.transfer_functions import (
- log_encoding_ViperLog,
- log_decoding_ViperLog)
+from colour.models.rgb.transfer_functions import (log_encoding_ViperLog,
+ log_decoding_ViperLog)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestLogEncoding_ViperLog',
- 'TestLogDecoding_ViperLog']
+__all__ = ['TestLogEncoding_ViperLog', 'TestLogDecoding_ViperLog']
class TestLogEncoding_ViperLog(unittest.TestCase):
@@ -39,20 +36,12 @@ def test_log_encoding_ViperLog(self):
log_encoding_ViperLog` definition.
"""
- self.assertAlmostEqual(
- log_encoding_ViperLog(0.0),
- -np.inf,
- places=7)
+ self.assertAlmostEqual(log_encoding_ViperLog(0.0), -np.inf, places=7)
self.assertAlmostEqual(
- log_encoding_ViperLog(0.18),
- 0.636008067010413,
- places=7)
+ log_encoding_ViperLog(0.18), 0.636008067010413, places=7)
- self.assertAlmostEqual(
- log_encoding_ViperLog(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(log_encoding_ViperLog(1.0), 1.0, places=7)
def test_n_dimensional_log_encoding_ViperLog(self):
"""
@@ -62,31 +51,19 @@ def test_n_dimensional_log_encoding_ViperLog(self):
L = 0.18
V = 0.636008067010413
- np.testing.assert_almost_equal(
- log_encoding_ViperLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ViperLog(L), V, decimal=7)
L = np.tile(L, 6)
V = np.tile(V, 6)
- np.testing.assert_almost_equal(
- log_encoding_ViperLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ViperLog(L), V, decimal=7)
L = np.reshape(L, (2, 3))
V = np.reshape(V, (2, 3))
- np.testing.assert_almost_equal(
- log_encoding_ViperLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ViperLog(L), V, decimal=7)
L = np.reshape(L, (2, 3, 1))
V = np.reshape(V, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_encoding_ViperLog(L),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(log_encoding_ViperLog(L), V, decimal=7)
@ignore_numpy_errors
def test_nan_log_encoding_ViperLog(self):
@@ -111,20 +88,12 @@ def test_log_decoding_ViperLog(self):
log_decoding_ViperLog` definition.
"""
- self.assertAlmostEqual(
- log_decoding_ViperLog(-np.inf),
- 0.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_ViperLog(-np.inf), 0.0, places=7)
self.assertAlmostEqual(
- log_decoding_ViperLog(0.636008067010413),
- 0.18,
- places=7)
+ log_decoding_ViperLog(0.636008067010413), 0.18, places=7)
- self.assertAlmostEqual(
- log_decoding_ViperLog(1.0),
- 1.0,
- places=7)
+ self.assertAlmostEqual(log_decoding_ViperLog(1.0), 1.0, places=7)
def test_n_dimensional_log_decoding_ViperLog(self):
"""
@@ -134,31 +103,19 @@ def test_n_dimensional_log_decoding_ViperLog(self):
V = 0.636008067010413
L = 0.18
- np.testing.assert_almost_equal(
- log_decoding_ViperLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ViperLog(V), L, decimal=7)
V = np.tile(V, 6)
L = np.tile(L, 6)
- np.testing.assert_almost_equal(
- log_decoding_ViperLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ViperLog(V), L, decimal=7)
V = np.reshape(V, (2, 3))
L = np.reshape(L, (2, 3))
- np.testing.assert_almost_equal(
- log_decoding_ViperLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ViperLog(V), L, decimal=7)
V = np.reshape(V, (2, 3, 1))
L = np.reshape(L, (2, 3, 1))
- np.testing.assert_almost_equal(
- log_decoding_ViperLog(V),
- L,
- decimal=7)
+ np.testing.assert_almost_equal(log_decoding_ViperLog(V), L, decimal=7)
@ignore_numpy_errors
def test_nan_log_decoding_ViperLog(self):
diff --git a/colour/models/rgb/transfer_functions/viper_log.py b/colour/models/rgb/transfer_functions/viper_log.py
index d34dc6864f..13cf24ae6e 100644
--- a/colour/models/rgb/transfer_functions/viper_log.py
+++ b/colour/models/rgb/transfer_functions/viper_log.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Viper Log Encodings
===================
@@ -34,8 +33,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['log_encoding_ViperLog',
- 'log_decoding_ViperLog']
+__all__ = ['log_encoding_ViperLog', 'log_decoding_ViperLog']
def log_encoding_ViperLog(x):
diff --git a/colour/models/rgb/ycbcr.py b/colour/models/rgb/ycbcr.py
index 1c57f9b2bf..51a2e26312 100644
--- a/colour/models/rgb/ycbcr.py
+++ b/colour/models/rgb/ycbcr.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Y'CbCr Colour Encoding
======================
@@ -62,19 +61,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Development'
-__all__ = ['YCBCR_WEIGHTS',
- 'RGB_range',
- 'YCbCr_ranges',
- 'RGB_to_YCbCr',
- 'YCbCr_to_RGB',
- 'RGB_to_YcCbcCrc',
- 'YcCbcCrc_to_RGB']
-
-YCBCR_WEIGHTS = CaseInsensitiveMapping(
- {'Rec. 601': np.array([0.2990, 0.1140]),
- 'Rec. 709': np.array([0.2126, 0.0722]),
- 'Rec. 2020': np.array([0.2627, 0.0593]),
- 'SMPTE-240M': np.array([0.2122, 0.0865])})
+__all__ = [
+ 'YCBCR_WEIGHTS', 'RGB_range', 'YCbCr_ranges', 'RGB_to_YCbCr',
+ 'YCbCr_to_RGB', 'RGB_to_YcCbcCrc', 'YcCbcCrc_to_RGB'
+]
+
+YCBCR_WEIGHTS = CaseInsensitiveMapping({
+ 'Rec. 601': np.array([0.2990, 0.1140]),
+ 'Rec. 709': np.array([0.2126, 0.0722]),
+ 'Rec. 2020': np.array([0.2627, 0.0593]),
+ 'SMPTE-240M': np.array([0.2122, 0.0865])
+})
"""
Luma weightings presets.
@@ -308,10 +305,11 @@ def RGB_to_YCbCr(RGB,
RGB = np.asarray(RGB)
Kr, Kb = K
- RGB_min, RGB_max = kwargs.get(
- 'in_range', RGB_range(in_bits, in_legal, in_int))
- Y_min, Y_max, C_min, C_max = kwargs.get(
- 'out_range', YCbCr_ranges(out_bits, out_legal, out_int))
+ RGB_min, RGB_max = kwargs.get('in_range',
+ RGB_range(in_bits, in_legal, in_int))
+ Y_min, Y_max, C_min, C_max = kwargs.get('out_range',
+ YCbCr_ranges(
+ out_bits, out_legal, out_int))
RGB_float = RGB.astype(np.float_) - RGB_min
RGB_float *= 1 / (RGB_max - RGB_min)
@@ -413,10 +411,11 @@ def YCbCr_to_RGB(YCbCr,
YCbCr = np.asarray(YCbCr)
Y, Cb, Cr = tsplit(YCbCr.astype(np.float_))
Kr, Kb = K
- Y_min, Y_max, C_min, C_max = kwargs.get(
- 'in_range', YCbCr_ranges(in_bits, in_legal, in_int))
- RGB_min, RGB_max = kwargs.get(
- 'out_range', RGB_range(out_bits, out_legal, out_int))
+ Y_min, Y_max, C_min, C_max = kwargs.get('in_range',
+ YCbCr_ranges(
+ in_bits, in_legal, in_int))
+ RGB_min, RGB_max = kwargs.get('out_range',
+ RGB_range(out_bits, out_legal, out_int))
Y -= Y_min
Cb -= (C_max + C_min) / 2
@@ -497,8 +496,9 @@ def RGB_to_YcCbcCrc(RGB,
RGB = np.asarray(RGB)
R, G, B = tsplit(RGB)
- Y_min, Y_max, C_min, C_max = kwargs.get(
- 'out_range', YCbCr_ranges(out_bits, out_legal, out_int))
+ Y_min, Y_max, C_min, C_max = kwargs.get('out_range',
+ YCbCr_ranges(
+ out_bits, out_legal, out_int))
Yc = 0.2627 * R + 0.6780 * G + 0.0593 * B
Yc = oetf_BT2020(Yc, is_12_bits_system=is_12_bits_system)
@@ -579,8 +579,9 @@ def YcCbcCrc_to_RGB(YcCbcCrc,
YcCbcCrc = np.asarray(YcCbcCrc)
Yc, Cbc, Crc = tsplit(YcCbcCrc.astype(np.float_))
- Y_min, Y_max, C_min, C_max = kwargs.get(
- 'in_range', YCbCr_ranges(in_bits, in_legal, in_int))
+ Y_min, Y_max, C_min, C_max = kwargs.get('in_range',
+ YCbCr_ranges(
+ in_bits, in_legal, in_int))
Yc -= Y_min
Cbc -= (C_max + C_min) / 2
diff --git a/colour/models/tests/tests_cie_lab.py b/colour/models/tests/tests_cie_lab.py
index 3884ad1eaf..455b8cc503 100644
--- a/colour/models/tests/tests_cie_lab.py
+++ b/colour/models/tests/tests_cie_lab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.cie_lab` module.
"""
@@ -21,10 +20,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_Lab',
- 'TestLab_to_XYZ',
- 'TestLab_to_LCHab',
- 'TestLCHab_to_Lab']
+__all__ = [
+ 'TestXYZ_to_Lab', 'TestLab_to_XYZ', 'TestLab_to_LCHab', 'TestLCHab_to_Lab'
+]
class TestXYZ_to_Lab(unittest.TestCase):
@@ -54,26 +52,30 @@ def test_XYZ_to_Lab(self):
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Lab(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.44757, 0.40745])),
+ XYZ_to_Lab(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.44757, 0.40745])),
np.array([37.98562910, -32.51333979, -35.96770745]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Lab(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.31270, 0.32900])),
+ XYZ_to_Lab(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.31270, 0.32900])),
np.array([37.98562910, -22.61920654, 4.19811236]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Lab(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.37208, 0.37529])),
+ XYZ_to_Lab(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.37208, 0.37529])),
np.array([37.98562910, -25.55521883, -11.26139386]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Lab(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.37208, 0.37529, 0.10080])),
+ XYZ_to_Lab(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([100.00000000, -54.91100935, -24.19758201]),
decimal=7)
@@ -87,30 +89,22 @@ def test_n_dimensional_XYZ_to_Lab(self):
illuminant = np.array([0.34570, 0.35850])
Lab = np.array([37.98562910, -23.62907688, -4.41746615])
np.testing.assert_almost_equal(
- XYZ_to_Lab(XYZ, illuminant),
- Lab,
- decimal=7)
+ XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
Lab = np.tile(Lab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Lab(XYZ, illuminant),
- Lab,
- decimal=7)
+ XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Lab(XYZ, illuminant),
- Lab,
- decimal=7)
+ XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
Lab = np.reshape(Lab, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_Lab(XYZ, illuminant),
- Lab,
- decimal=7)
+ XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_Lab(self):
@@ -153,26 +147,30 @@ def test_Lab_to_XYZ(self):
decimal=7)
np.testing.assert_almost_equal(
- Lab_to_XYZ(np.array([37.98562910, -32.51333979, -35.96770745]),
- np.array([0.44757, 0.40745])),
+ Lab_to_XYZ(
+ np.array([37.98562910, -32.51333979, -35.96770745]),
+ np.array([0.44757, 0.40745])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Lab_to_XYZ(np.array([37.98562910, -22.61920654, 4.19811236]),
- np.array([0.31270, 0.32900])),
+ Lab_to_XYZ(
+ np.array([37.98562910, -22.61920654, 4.19811236]),
+ np.array([0.31270, 0.32900])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Lab_to_XYZ(np.array([37.98562910, -25.55521883, -11.26139386]),
- np.array([0.37208, 0.37529])),
+ Lab_to_XYZ(
+ np.array([37.98562910, -25.55521883, -11.26139386]),
+ np.array([0.37208, 0.37529])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Lab_to_XYZ(np.array([37.98562910, -25.55521883, -11.26139386]),
- np.array([0.37208, 0.37529, 0.10080])),
+ Lab_to_XYZ(
+ np.array([37.98562910, -25.55521883, -11.26139386]),
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([0.00710593, 0.01016064, 0.00963478]),
decimal=7)
@@ -186,30 +184,22 @@ def test_n_dimensional_Lab_to_XYZ(self):
illuminant = np.array([0.34570, 0.35850])
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
np.testing.assert_almost_equal(
- Lab_to_XYZ(Lab, illuminant),
- XYZ,
- decimal=7)
+ Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
Lab = np.tile(Lab, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- Lab_to_XYZ(Lab, illuminant),
- XYZ,
- decimal=7)
+ Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- Lab_to_XYZ(Lab, illuminant),
- XYZ,
- decimal=7)
+ Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- Lab_to_XYZ(Lab, illuminant),
- XYZ,
- decimal=7)
+ Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_Lab_to_XYZ(self):
@@ -259,24 +249,15 @@ def test_n_dimensional_Lab_to_LCHab(self):
Lab = np.array([37.98562910, -23.62907688, -4.41746615])
LCHab = np.array([37.98562910, 24.03845422, 190.58923377])
- np.testing.assert_almost_equal(
- Lab_to_LCHab(Lab),
- LCHab,
- decimal=7)
+ np.testing.assert_almost_equal(Lab_to_LCHab(Lab), LCHab, decimal=7)
Lab = np.tile(Lab, (6, 1))
LCHab = np.tile(LCHab, (6, 1))
- np.testing.assert_almost_equal(
- Lab_to_LCHab(Lab),
- LCHab,
- decimal=7)
+ np.testing.assert_almost_equal(Lab_to_LCHab(Lab), LCHab, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
LCHab = np.reshape(LCHab, (2, 3, 3))
- np.testing.assert_almost_equal(
- Lab_to_LCHab(Lab),
- LCHab,
- decimal=7)
+ np.testing.assert_almost_equal(Lab_to_LCHab(Lab), LCHab, decimal=7)
@ignore_numpy_errors
def test_nan_Lab_to_LCHab(self):
@@ -326,24 +307,15 @@ def test_n_dimensional_LCHab_to_Lab(self):
LCHab = np.array([37.98562910, 24.03845422, 190.58923377])
Lab = np.array([37.98562910, -23.62907688, -4.41746615])
- np.testing.assert_almost_equal(
- LCHab_to_Lab(LCHab),
- Lab,
- decimal=7)
+ np.testing.assert_almost_equal(LCHab_to_Lab(LCHab), Lab, decimal=7)
LCHab = np.tile(LCHab, (6, 1))
Lab = np.tile(Lab, (6, 1))
- np.testing.assert_almost_equal(
- LCHab_to_Lab(LCHab),
- Lab,
- decimal=7)
+ np.testing.assert_almost_equal(LCHab_to_Lab(LCHab), Lab, decimal=7)
LCHab = np.reshape(LCHab, (2, 3, 3))
Lab = np.reshape(Lab, (2, 3, 3))
- np.testing.assert_almost_equal(
- LCHab_to_Lab(LCHab),
- Lab,
- decimal=7)
+ np.testing.assert_almost_equal(LCHab_to_Lab(LCHab), Lab, decimal=7)
@ignore_numpy_errors
def test_nan_LCHab_to_Lab(self):
diff --git a/colour/models/tests/tests_cie_luv.py b/colour/models/tests/tests_cie_luv.py
index 4b7f791af8..9eb9b77dfc 100644
--- a/colour/models/tests/tests_cie_luv.py
+++ b/colour/models/tests/tests_cie_luv.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.cie_luv` module.
"""
@@ -11,13 +10,8 @@
import unittest
from itertools import permutations
-from colour.models import (
- XYZ_to_Luv,
- Luv_to_XYZ,
- Luv_to_uv,
- Luv_uv_to_xy,
- Luv_to_LCHuv,
- LCHuv_to_Luv)
+from colour.models import (XYZ_to_Luv, Luv_to_XYZ, Luv_to_uv, Luv_uv_to_xy,
+ Luv_to_LCHuv, LCHuv_to_Luv)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -27,11 +21,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_Luv',
- 'TestLuv_to_XYZ',
- 'TestLuv_to_uv',
- 'TestLuv_to_LCHuv',
- 'TestLCHuv_to_Luv']
+__all__ = [
+ 'TestXYZ_to_Luv', 'TestLuv_to_XYZ', 'TestLuv_to_uv', 'TestLuv_to_LCHuv',
+ 'TestLCHuv_to_Luv'
+]
class TestXYZ_to_Luv(unittest.TestCase):
@@ -61,26 +54,30 @@ def test_XYZ_to_Luv(self):
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Luv(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.44757, 0.40745])),
+ XYZ_to_Luv(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.44757, 0.40745])),
np.array([37.98562910, -51.90523525, -19.24118281]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Luv(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.31270, 0.32900])),
+ XYZ_to_Luv(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.31270, 0.32900])),
np.array([37.98562910, -23.19781615, 8.39962073]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Luv(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.37208, 0.37529])),
+ XYZ_to_Luv(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.37208, 0.37529])),
np.array([37.98562910, -34.23840374, -7.09461715]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_Luv(np.array([0.07049534, 0.10080000, 0.09558313]),
- np.array([0.37208, 0.37529, 0.10080])),
+ XYZ_to_Luv(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([100.00000000, -90.13514992, -18.67710847]),
decimal=7)
@@ -94,30 +91,22 @@ def test_n_dimensional_XYZ_to_Luv(self):
illuminant = np.array([0.34570, 0.35850])
Luv = np.array([37.98562910, -28.80219593, -1.35800706])
np.testing.assert_almost_equal(
- XYZ_to_Luv(XYZ, illuminant),
- Luv,
- decimal=7)
+ XYZ_to_Luv(XYZ, illuminant), Luv, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
Luv = np.tile(Luv, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Luv(XYZ, illuminant),
- Luv,
- decimal=7)
+ XYZ_to_Luv(XYZ, illuminant), Luv, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Luv(XYZ, illuminant),
- Luv,
- decimal=7)
+ XYZ_to_Luv(XYZ, illuminant), Luv, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
Luv = np.reshape(Luv, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_Luv(XYZ, illuminant),
- Luv,
- decimal=7)
+ XYZ_to_Luv(XYZ, illuminant), Luv, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_Luv(self):
@@ -160,26 +149,30 @@ def test_Luv_to_XYZ(self):
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_XYZ(np.array([37.98562910, -51.90523525, -19.24118281]),
- np.array([0.44757, 0.40745])),
+ Luv_to_XYZ(
+ np.array([37.98562910, -51.90523525, -19.24118281]),
+ np.array([0.44757, 0.40745])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_XYZ(np.array([37.98562910, -23.19781615, 8.39962073]),
- np.array([0.31270, 0.32900])),
+ Luv_to_XYZ(
+ np.array([37.98562910, -23.19781615, 8.39962073]),
+ np.array([0.31270, 0.32900])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_XYZ(np.array([37.98562910, -34.23840374, -7.09461715]),
- np.array([0.37208, 0.37529])),
+ Luv_to_XYZ(
+ np.array([37.98562910, -34.23840374, -7.09461715]),
+ np.array([0.37208, 0.37529])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_XYZ(np.array([37.98562910, -34.23840374, -7.09461715]),
- np.array([0.37208, 0.37529, 0.10080])),
+ Luv_to_XYZ(
+ np.array([37.98562910, -34.23840374, -7.09461715]),
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([0.07049534, 0.10080000, 0.09558313]),
decimal=7)
@@ -193,30 +186,22 @@ def test_n_dimensional_Luv_to_XYZ(self):
illuminant = np.array([0.34570, 0.35850])
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
np.testing.assert_almost_equal(
- Luv_to_XYZ(Luv, illuminant),
- XYZ,
- decimal=7)
+ Luv_to_XYZ(Luv, illuminant), XYZ, decimal=7)
Luv = np.tile(Luv, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- Luv_to_XYZ(Luv, illuminant),
- XYZ,
- decimal=7)
+ Luv_to_XYZ(Luv, illuminant), XYZ, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- Luv_to_XYZ(Luv, illuminant),
- XYZ,
- decimal=7)
+ Luv_to_XYZ(Luv, illuminant), XYZ, decimal=7)
Luv = np.reshape(Luv, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- Luv_to_XYZ(Luv, illuminant),
- XYZ,
- decimal=7)
+ Luv_to_XYZ(Luv, illuminant), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_Luv_to_XYZ(self):
@@ -259,26 +244,30 @@ def test_Luv_to_uv(self):
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_uv(np.array([37.98562910, -51.90523525, -19.24118281]),
- np.array([0.44757, 0.40745])),
+ Luv_to_uv(
+ np.array([37.98562910, -51.90523525, -19.24118281]),
+ np.array([0.44757, 0.40745])),
np.array([0.15085310, 0.48532971]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_uv(np.array([37.98562910, -23.19781615, 8.39962073]),
- np.array([0.31270, 0.32900])),
+ Luv_to_uv(
+ np.array([37.98562910, -23.19781615, 8.39962073]),
+ np.array([0.31270, 0.32900])),
np.array([0.15085310, 0.48532971]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_uv(np.array([37.98562910, -34.23840374, -7.09461715]),
- np.array([0.37208, 0.37529])),
+ Luv_to_uv(
+ np.array([37.98562910, -34.23840374, -7.09461715]),
+ np.array([0.37208, 0.37529])),
np.array([0.15085310, 0.48532971]),
decimal=7)
np.testing.assert_almost_equal(
- Luv_to_uv(np.array([37.98562910, -34.23840374, -7.09461715]),
- np.array([0.37208, 0.37529, 0.10080])),
+ Luv_to_uv(
+ np.array([37.98562910, -34.23840374, -7.09461715]),
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([0.15085310, 0.48532971]),
decimal=7)
@@ -292,30 +281,22 @@ def test_n_dimensional_Luv_to_uv(self):
illuminant = np.array([0.34570, 0.35850])
uv = np.array([0.15085310, 0.48532971])
np.testing.assert_almost_equal(
- Luv_to_uv(Luv, illuminant),
- uv,
- decimal=7)
+ Luv_to_uv(Luv, illuminant), uv, decimal=7)
Luv = np.tile(Luv, (6, 1))
uv = np.tile(uv, (6, 1))
np.testing.assert_almost_equal(
- Luv_to_uv(Luv, illuminant),
- uv,
- decimal=7)
+ Luv_to_uv(Luv, illuminant), uv, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- Luv_to_uv(Luv, illuminant),
- uv,
- decimal=7)
+ Luv_to_uv(Luv, illuminant), uv, decimal=7)
Luv = np.reshape(Luv, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
uv = np.reshape(uv, (2, 3, 2))
np.testing.assert_almost_equal(
- Luv_to_uv(Luv, illuminant),
- uv,
- decimal=7)
+ Luv_to_uv(Luv, illuminant), uv, decimal=7)
@ignore_numpy_errors
def test_nan_Luv_to_uv(self):
@@ -365,24 +346,15 @@ def test_n_dimensional_Luv_to_LCHuv(self):
Luv = np.array([37.98562910, -28.80219593, -1.35800706])
LCHuv = np.array([37.98562910, 28.83419279, 182.69946404])
- np.testing.assert_almost_equal(
- Luv_to_LCHuv(Luv),
- LCHuv,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_to_LCHuv(Luv), LCHuv, decimal=7)
Luv = np.tile(Luv, (6, 1))
LCHuv = np.tile(LCHuv, (6, 1))
- np.testing.assert_almost_equal(
- Luv_to_LCHuv(Luv),
- LCHuv,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_to_LCHuv(Luv), LCHuv, decimal=7)
Luv = np.reshape(Luv, (2, 3, 3))
LCHuv = np.reshape(LCHuv, (2, 3, 3))
- np.testing.assert_almost_equal(
- Luv_to_LCHuv(Luv),
- LCHuv,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_to_LCHuv(Luv), LCHuv, decimal=7)
@ignore_numpy_errors
def test_nan_Luv_to_LCHuv(self):
@@ -432,24 +404,15 @@ def test_n_dimensional_LCHuv_to_Luv(self):
LCHuv = np.array([37.98562910, 28.83419279, 182.69946404])
Luv = np.array([37.98562910, -28.80219593, -1.35800706])
- np.testing.assert_almost_equal(
- LCHuv_to_Luv(LCHuv),
- Luv,
- decimal=7)
+ np.testing.assert_almost_equal(LCHuv_to_Luv(LCHuv), Luv, decimal=7)
Luv = np.tile(Luv, (6, 1))
LCHuv = np.tile(LCHuv, (6, 1))
- np.testing.assert_almost_equal(
- LCHuv_to_Luv(LCHuv),
- Luv,
- decimal=7)
+ np.testing.assert_almost_equal(LCHuv_to_Luv(LCHuv), Luv, decimal=7)
Luv = np.reshape(Luv, (2, 3, 3))
LCHuv = np.reshape(LCHuv, (2, 3, 3))
- np.testing.assert_almost_equal(
- LCHuv_to_Luv(LCHuv),
- Luv,
- decimal=7)
+ np.testing.assert_almost_equal(LCHuv_to_Luv(LCHuv), Luv, decimal=7)
@ignore_numpy_errors
def test_nan_LCHuv_to_Luv(self):
@@ -499,24 +462,15 @@ def test_n_dimensional_Luv_uv_to_xy(self):
uv = np.array([0.15085310, 0.48532971])
xy = np.array([0.26414773, 0.37770001])
- np.testing.assert_almost_equal(
- Luv_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_uv_to_xy(uv), xy, decimal=7)
uv = np.tile(uv, (6, 1))
xy = np.tile(xy, (6, 1))
- np.testing.assert_almost_equal(
- Luv_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_uv_to_xy(uv), xy, decimal=7)
uv = np.reshape(uv, (2, 3, 2))
xy = np.reshape(xy, (2, 3, 2))
- np.testing.assert_almost_equal(
- Luv_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(Luv_uv_to_xy(uv), xy, decimal=7)
@ignore_numpy_errors
def test_nan_Luv_uv_to_xy(self):
diff --git a/colour/models/tests/tests_cie_ucs.py b/colour/models/tests/tests_cie_ucs.py
index a08526d4ba..2fcdda1da4 100644
--- a/colour/models/tests/tests_cie_ucs.py
+++ b/colour/models/tests/tests_cie_ucs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.cie_ucs` module.
"""
@@ -21,10 +20,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_UCS',
- 'TestUCS_to_XYZ',
- 'TestUCS_to_uv',
- 'TestUCS_uv_to_xy']
+__all__ = [
+ 'TestXYZ_to_UCS', 'TestUCS_to_XYZ', 'TestUCS_to_uv', 'TestUCS_uv_to_xy'
+]
class TestXYZ_to_UCS(unittest.TestCase):
@@ -61,24 +59,15 @@ def test_n_dimensional_XYZ_to_UCS(self):
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
UCS = np.array([0.04699689, 0.10080000, 0.16374390])
- np.testing.assert_almost_equal(
- XYZ_to_UCS(XYZ),
- UCS,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_UCS(XYZ), UCS, decimal=7)
UCS = np.tile(UCS, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- XYZ_to_UCS(XYZ),
- UCS,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_UCS(XYZ), UCS, decimal=7)
UCS = np.reshape(UCS, (2, 3, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- XYZ_to_UCS(XYZ),
- UCS,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_UCS(XYZ), UCS, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_UCS(self):
@@ -127,24 +116,15 @@ def test_n_dimensional_UCS_to_XYZ(self):
UCS = np.array([0.04699689, 0.10080000, 0.16374390])
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
- np.testing.assert_almost_equal(
- UCS_to_XYZ(UCS),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_XYZ(UCS), XYZ, decimal=7)
UCS = np.tile(UCS, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- UCS_to_XYZ(UCS),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_XYZ(UCS), XYZ, decimal=7)
UCS = np.reshape(UCS, (2, 3, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- UCS_to_XYZ(UCS),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_XYZ(UCS), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_UCS_to_XYZ(self):
@@ -193,24 +173,15 @@ def test_n_dimensional_UCS_to_uv(self):
UCS = np.array([0.04699689, 0.10080000, 0.16374390])
uv = np.array([0.15085309, 0.32355314])
- np.testing.assert_almost_equal(
- UCS_to_uv(UCS),
- uv,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_uv(UCS), uv, decimal=7)
UCS = np.tile(UCS, (6, 1))
uv = np.tile(uv, (6, 1))
- np.testing.assert_almost_equal(
- UCS_to_uv(UCS),
- uv,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_uv(UCS), uv, decimal=7)
UCS = np.reshape(UCS, (2, 3, 3))
uv = np.reshape(uv, (2, 3, 2))
- np.testing.assert_almost_equal(
- UCS_to_uv(UCS),
- uv,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_to_uv(UCS), uv, decimal=7)
@ignore_numpy_errors
def test_nan_UCS_to_uv(self):
@@ -259,24 +230,15 @@ def test_n_dimensional_UCS_uv_to_xy(self):
uv = np.array([0.15085309, 0.32355314])
xy = np.array([0.26414771, 0.37770001])
- np.testing.assert_almost_equal(
- UCS_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_uv_to_xy(uv), xy, decimal=7)
uv = np.tile(uv, (6, 1))
xy = np.tile(xy, (6, 1))
- np.testing.assert_almost_equal(
- UCS_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_uv_to_xy(uv), xy, decimal=7)
uv = np.reshape(uv, (2, 3, 2))
xy = np.reshape(xy, (2, 3, 2))
- np.testing.assert_almost_equal(
- UCS_uv_to_xy(uv),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(UCS_uv_to_xy(uv), xy, decimal=7)
@ignore_numpy_errors
def test_nan_UCS_uv_to_xy(self):
diff --git a/colour/models/tests/tests_cie_uvw.py b/colour/models/tests/tests_cie_uvw.py
index 8e1756a25c..207e176a50 100644
--- a/colour/models/tests/tests_cie_uvw.py
+++ b/colour/models/tests/tests_cie_uvw.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.cie_uvw` module.
"""
@@ -51,26 +50,30 @@ def test_XYZ_to_UVW(self):
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_UVW(np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- np.array([0.44757, 0.40745])),
+ XYZ_to_UVW(
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
+ np.array([0.44757, 0.40745])),
np.array([-50.56405108, -12.49600540, 37.00411491]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_UVW(np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- np.array([0.31270, 0.32900])),
+ XYZ_to_UVW(
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
+ np.array([0.31270, 0.32900])),
np.array([-22.59840563, 5.45505477, 37.00411491]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_UVW(np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- np.array([0.37208, 0.37529])),
+ XYZ_to_UVW(
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
+ np.array([0.37208, 0.37529])),
np.array([-33.35371445, -4.60753245, 37.00411491]),
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_UVW(np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- np.array([0.37208, 0.37529, 0.10080])),
+ XYZ_to_UVW(
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
+ np.array([0.37208, 0.37529, 0.10080])),
np.array([-33.35371445, -4.60753245, 37.00411491]),
decimal=7)
@@ -84,30 +87,22 @@ def test_n_dimensional_XYZ_to_UVW(self):
illuminant = np.array([0.34570, 0.35850])
UVW = np.array([-28.05797333, -0.88194493, 37.00411491])
np.testing.assert_almost_equal(
- XYZ_to_UVW(XYZ, illuminant),
- UVW,
- decimal=7)
+ XYZ_to_UVW(XYZ, illuminant), UVW, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
UVW = np.tile(UVW, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_UVW(XYZ, illuminant),
- UVW,
- decimal=7)
+ XYZ_to_UVW(XYZ, illuminant), UVW, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_UVW(XYZ, illuminant),
- UVW,
- decimal=7)
+ XYZ_to_UVW(XYZ, illuminant), UVW, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
UVW = np.reshape(UVW, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_UVW(XYZ, illuminant),
- UVW,
- decimal=7)
+ XYZ_to_UVW(XYZ, illuminant), UVW, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_UVW(self):
diff --git a/colour/models/tests/tests_cie_xyy.py b/colour/models/tests/tests_cie_xyy.py
index 7610389839..e0eb5433e7 100644
--- a/colour/models/tests/tests_cie_xyy.py
+++ b/colour/models/tests/tests_cie_xyy.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.cie_xyy` module.
"""
@@ -11,13 +10,8 @@
import unittest
from itertools import permutations
-from colour.models import (
- XYZ_to_xyY,
- xyY_to_XYZ,
- xy_to_xyY,
- xyY_to_xy,
- xy_to_XYZ,
- XYZ_to_xy)
+from colour.models import (XYZ_to_xyY, xyY_to_XYZ, xy_to_xyY, xyY_to_xy,
+ xy_to_XYZ, XYZ_to_xy)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -27,12 +21,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_xyY',
- 'TestxyY_to_XYZ',
- 'Testxy_to_xyY',
- 'TestxyY_to_xy',
- 'Testxy_to_XYZ',
- 'TestXYZ_to_xy']
+__all__ = [
+ 'TestXYZ_to_xyY', 'TestxyY_to_XYZ', 'Testxy_to_xyY', 'TestxyY_to_xy',
+ 'Testxy_to_XYZ', 'TestXYZ_to_xy'
+]
class TestXYZ_to_xyY(unittest.TestCase):
@@ -72,13 +64,15 @@ def test_XYZ_to_xyY(self):
decimal=7)
np.testing.assert_almost_equal(
- XYZ_to_xyY(np.array([[0.07049534, 0.10080000, 0.09558313],
- [0.00000000, 0.00000000, 0.00000000],
- [0.00000000, 0.00000000, 1.00000000]])),
+ XYZ_to_xyY(
+ np.array(
+ [[0.07049534, 0.10080000, 0.09558313],
+ [0.00000000, 0.00000000, 0.00000000],
+ [0.00000000, 0.00000000, 1.00000000]])),
np.array([[0.26414772, 0.37770001, 0.10080000],
[0.34570000, 0.35850000, 0.00000000],
[0.00000000, 0.00000000, 0.00000000]]),
- decimal=7)
+ decimal=7) # yapf: disable
def test_n_dimensional_XYZ_to_xyY(self):
"""
@@ -90,30 +84,22 @@ def test_n_dimensional_XYZ_to_xyY(self):
illuminant = np.array([0.34570, 0.35850])
xyY = np.array([0.26414772, 0.37770001, 0.10080000])
np.testing.assert_almost_equal(
- XYZ_to_xyY(XYZ, illuminant),
- xyY,
- decimal=7)
+ XYZ_to_xyY(XYZ, illuminant), xyY, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
xyY = np.tile(xyY, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_xyY(XYZ, illuminant),
- xyY,
- decimal=7)
+ XYZ_to_xyY(XYZ, illuminant), xyY, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_xyY(XYZ, illuminant),
- xyY,
- decimal=7)
+ XYZ_to_xyY(XYZ, illuminant), xyY, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
xyY = np.reshape(xyY, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_xyY(XYZ, illuminant),
- xyY,
- decimal=7)
+ XYZ_to_xyY(XYZ, illuminant), xyY, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_xyY(self):
@@ -168,24 +154,15 @@ def test_n_dimensional_xyY_to_XYZ(self):
xyY = np.array([0.26414772, 0.37770001, 0.10080000])
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
- np.testing.assert_almost_equal(
- xyY_to_XYZ(xyY),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_XYZ(xyY), XYZ, decimal=7)
xyY = np.tile(xyY, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- xyY_to_XYZ(xyY),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_XYZ(xyY), XYZ, decimal=7)
xyY = np.reshape(xyY, (2, 3, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- xyY_to_XYZ(xyY),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_XYZ(xyY), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_xyY_to_XYZ(self):
@@ -239,24 +216,15 @@ def test_n_dimensional_xy_to_XYZ(self):
xy = np.array([0.26414772, 0.37770001])
XYZ = np.array([0.69935852, 1.00000000, 0.94824533])
- np.testing.assert_almost_equal(
- xy_to_XYZ(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_XYZ(xy), XYZ, decimal=7)
xy = np.tile(xy, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- xy_to_XYZ(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_XYZ(xy), XYZ, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- xy_to_XYZ(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_XYZ(xy), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_xy_to_XYZ(self):
@@ -315,24 +283,15 @@ def test_n_dimensional_xy_to_xyY(self):
xy = np.array([0.26414772, 0.37770001])
XYZ = np.array([0.26414772, 0.37770001, 1.00000000])
- np.testing.assert_almost_equal(
- xy_to_xyY(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_xyY(xy), XYZ, decimal=7)
xy = np.tile(xy, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- xy_to_xyY(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_xyY(xy), XYZ, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- xy_to_xyY(xy),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(xy_to_xyY(xy), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_xy_to_xyY(self):
@@ -386,24 +345,15 @@ def test_n_dimensional_xyY_to_xy(self):
xyY = np.array([0.26414772, 0.37770001, 1.00000000])
xy = np.array([0.26414772, 0.37770001])
- np.testing.assert_almost_equal(
- xyY_to_xy(xyY),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_xy(xyY), xy, decimal=7)
xyY = np.tile(xyY, (6, 1))
xy = np.tile(xy, (6, 1))
- np.testing.assert_almost_equal(
- xyY_to_xy(xyY),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_xy(xyY), xy, decimal=7)
xyY = np.reshape(xyY, (2, 3, 3))
xy = np.reshape(xy, (2, 3, 2))
- np.testing.assert_almost_equal(
- xyY_to_xy(xyY),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(xyY_to_xy(xyY), xy, decimal=7)
@ignore_numpy_errors
def test_nan_xyY_to_xy(self):
@@ -459,30 +409,22 @@ def test_n_dimensional_XYZ_to_xy(self):
illuminant = np.array([0.34570, 0.35850])
xy = np.array([0.26414772, 0.37770001])
np.testing.assert_almost_equal(
- XYZ_to_xy(XYZ, illuminant),
- xy,
- decimal=7)
+ XYZ_to_xy(XYZ, illuminant), xy, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
xy = np.tile(xy, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_xy(XYZ, illuminant),
- xy,
- decimal=7)
+ XYZ_to_xy(XYZ, illuminant), xy, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_xy(XYZ, illuminant),
- xy,
- decimal=7)
+ XYZ_to_xy(XYZ, illuminant), xy, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(xy, (2, 3, 2))
xy = np.reshape(xy, (2, 3, 2))
np.testing.assert_almost_equal(
- XYZ_to_xy(XYZ, illuminant),
- xy,
- decimal=7)
+ XYZ_to_xy(XYZ, illuminant), xy, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_xy(self):
diff --git a/colour/models/tests/tests_hdr_cie_lab.py b/colour/models/tests/tests_hdr_cie_lab.py
new file mode 100644
index 0000000000..63e8af7de2
--- /dev/null
+++ b/colour/models/tests/tests_hdr_cie_lab.py
@@ -0,0 +1,264 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.hdr_cie_lab` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+from itertools import permutations
+
+from colour.models import XYZ_to_hdr_CIELab, hdr_CIELab_to_XYZ
+from colour.models.hdr_cie_lab import exponent_hdr_CIELab
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = [
+ 'TestXYZ_to_hdr_CIELab', 'TestHdr_CIELab_to_XYZ', 'TestExponent_hdr_CIELab'
+]
+
+
+class TestXYZ_to_hdr_CIELab(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_cie_lab.XYZ_to_hdr_CIELab` definition unit
+ tests methods.
+ """
+
+ def test_XYZ_to_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.XYZ_to_hdr_CIELab` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(np.array([0.07049534, 0.10080000, 0.09558313])),
+ np.array([24.90206646, -46.83127607, -10.14274843]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ np.array([0.44757, 0.40745])),
+ np.array([24.90206646, -61.24983919, -83.63902870]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(
+ np.array([0.07049534, 0.10080000, 0.09558313]), Y_s=0.5),
+ np.array([34.44227938, -36.51485775, -6.87279617]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(
+ np.array([0.07049534, 0.10080000, 0.09558313]), Y_abs=1000),
+ np.array([32.39463250, -39.77445283, -7.66690737]),
+ decimal=7)
+
+ def test_n_dimensional_XYZ_to_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.XYZ_to_hdr_CIELab` definition
+ n-dimensions support.
+ """
+
+ XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ illuminant = np.array([0.34570, 0.35850])
+ Y_s = 0.2
+ Y_abs = 100
+ Lab_hdr = np.array([24.90206646, -46.83127607, -10.14274843])
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(XYZ, illuminant, Y_s, Y_abs), Lab_hdr, decimal=7)
+
+ XYZ = np.tile(XYZ, (6, 1))
+ Lab_hdr = np.tile(Lab_hdr, (6, 1))
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(XYZ, illuminant, Y_s, Y_abs), Lab_hdr, decimal=7)
+
+ illuminant = np.tile(illuminant, (6, 1))
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(XYZ, illuminant, Y_s, Y_abs), Lab_hdr, decimal=7)
+
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ illuminant = np.reshape(illuminant, (2, 3, 2))
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ Lab_hdr = np.reshape(Lab_hdr, (2, 3, 3))
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_CIELab(XYZ, illuminant, Y_s, Y_abs), Lab_hdr, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_XYZ_to_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.XYZ_to_hdr_CIELab` definition
+ nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ XYZ = np.array(case)
+ illuminant = np.array(case[0:2])
+ Y_s = case[0]
+ Y_abs = case[0]
+ XYZ_to_hdr_CIELab(XYZ, illuminant, Y_s, Y_abs)
+
+
+class TestHdr_CIELab_to_XYZ(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_cie_lab.hdr_CIELab_to_XYZ` definition unit
+ tests methods.
+ """
+
+ def test_hdr_CIELab_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.hdr_CIELab_to_XYZ` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(
+ np.array([24.90206646, -46.83127607, -10.14274843])),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(
+ np.array([24.90206646, -61.24983919, -83.63902870]),
+ np.array([0.44757, 0.40745])),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(
+ np.array([34.44227938, -36.51485775, -6.87279617]), Y_s=0.5),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(
+ np.array([32.39463250, -39.77445283, -7.66690737]),
+ Y_abs=1000),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ def test_n_dimensional_hdr_CIELab_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.hdr_CIELab_to_XYZ` definition
+ n-dimensions support.
+ """
+
+ Lab_hdr = np.array([24.90206646, -46.83127607, -10.14274843])
+ illuminant = np.array([0.34570, 0.35850])
+ Y_s = 0.2
+ Y_abs = 100
+ XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(Lab_hdr, illuminant, Y_s, Y_abs), XYZ, decimal=7)
+
+ Lab_hdr = np.tile(Lab_hdr, (6, 1))
+ XYZ = np.tile(XYZ, (6, 1))
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(Lab_hdr, illuminant, Y_s, Y_abs), XYZ, decimal=7)
+
+ illuminant = np.tile(illuminant, (6, 1))
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(Lab_hdr, illuminant, Y_s, Y_abs), XYZ, decimal=7)
+
+ Lab_hdr = np.reshape(Lab_hdr, (2, 3, 3))
+ illuminant = np.reshape(illuminant, (2, 3, 2))
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ np.testing.assert_almost_equal(
+ hdr_CIELab_to_XYZ(Lab_hdr, illuminant, Y_s, Y_abs), XYZ, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_hdr_CIELab_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.hdr_CIELab_to_XYZ` definition
+ nan support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ Lab_hdr = np.array(case)
+ illuminant = np.array(case[0:2])
+ Y_s = case[0]
+ Y_abs = case[0]
+ hdr_CIELab_to_XYZ(Lab_hdr, illuminant, Y_s, Y_abs)
+
+
+class TestExponent_hdr_CIELab(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_cie_lab.exponent_hdr_CIELab`
+ definition unit tests methods.
+ """
+
+ def test_exponent_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.exponent_hdr_CIELab`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ exponent_hdr_CIELab(0.2, 100), 1.836019897814665, places=7)
+
+ self.assertAlmostEqual(
+ exponent_hdr_CIELab(0.4, 100), 1.326014370643925, places=7)
+
+ self.assertAlmostEqual(
+ exponent_hdr_CIELab(0.2, 1000), 1.224013265209777, places=7)
+
+ def test_n_dimensional_exponent_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.exponent_hdr_CIELab`
+ definition n-dimensional arrays support.
+ """
+
+ Y_s = 0.2
+ Y_abs = 100
+ e = 1.836019897814665
+ np.testing.assert_almost_equal(
+ exponent_hdr_CIELab(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ e = np.tile(e, 6)
+ np.testing.assert_almost_equal(
+ exponent_hdr_CIELab(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ e = np.reshape(e, (2, 3))
+ np.testing.assert_almost_equal(
+ exponent_hdr_CIELab(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.reshape(Y_s, (2, 3, 1))
+ Y_abs = np.reshape(Y_abs, (2, 3, 1))
+ e = np.reshape(e, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ exponent_hdr_CIELab(Y_s, Y_abs), e, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_exponent_hdr_CIELab(self):
+ """
+ Tests :func:`colour.models.hdr_cie_lab.exponent_hdr_CIELab`
+ definition nan support.
+ """
+
+ cases = np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan])
+ exponent_hdr_CIELab(cases, cases)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/tests/tests_hdr_ipt.py b/colour/models/tests/tests_hdr_ipt.py
new file mode 100644
index 0000000000..334fbf8398
--- /dev/null
+++ b/colour/models/tests/tests_hdr_ipt.py
@@ -0,0 +1,238 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.models.hdr_ipt` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+from itertools import permutations
+
+from colour.models import XYZ_to_hdr_IPT, hdr_IPT_to_XYZ
+from colour.models.hdr_ipt import exponent_hdr_IPT
+from colour.utilities import ignore_numpy_errors
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestXYZ_to_hdr_IPT', 'TestHdr_IPT_to_XYZ', 'TestExponent_hdr_IPT']
+
+
+class TestXYZ_to_hdr_IPT(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_ipt.TestXYZ_to_hdr_IPT` definition unit
+ tests methods.
+ """
+
+ def test_XYZ_to_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.XYZ_to_hdr_IPT` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(np.array([0.07049534, 0.10080000, 0.09558313])),
+ np.array([25.18261761, -22.62111297, 3.18511729]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(
+ np.array([0.07049534, 0.10080000, 0.09558313]), Y_s=0.5),
+ np.array([34.60312115, -15.70974390, 2.26601353]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(
+ np.array([0.25506814, 0.19150000, 0.08849752]), Y_abs=1000),
+ np.array([47.18074546, 32.38073691, 29.13827648]),
+ decimal=7)
+
+ def test_n_dimensional_XYZ_to_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.XYZ_to_hdr_IPT` definition
+ n-dimensions support.
+ """
+
+ XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ Y_s = 0.2
+ Y_abs = 100
+ IPT_hdr = np.array([25.18261761, -22.62111297, 3.18511729])
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(XYZ, Y_s, Y_abs), IPT_hdr, decimal=7)
+
+ XYZ = np.tile(XYZ, (6, 1))
+ IPT_hdr = np.tile(IPT_hdr, (6, 1))
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(XYZ, Y_s, Y_abs), IPT_hdr, decimal=7)
+
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(XYZ, Y_s, Y_abs), IPT_hdr, decimal=7)
+
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ IPT_hdr = np.reshape(IPT_hdr, (2, 3, 3))
+ np.testing.assert_almost_equal(
+ XYZ_to_hdr_IPT(XYZ, Y_s, Y_abs), IPT_hdr, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_XYZ_to_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.XYZ_to_hdr_IPT` definition nan
+ support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ XYZ = np.array(case)
+ Y_s = case[0]
+ Y_abs = case[0]
+ XYZ_to_hdr_IPT(XYZ, Y_s, Y_abs)
+
+
+class TestHdr_IPT_to_XYZ(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_ipt.hdr_IPT_to_XYZ` definition unit tests
+ methods.
+ """
+
+ def test_hdr_IPT_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.hdr_IPT_to_XYZ` definition.
+ """
+
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(np.array([25.18261761, -22.62111297, 3.18511729])),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(
+ np.array([34.60312115, -15.70974390, 2.26601353]), Y_s=0.5),
+ np.array([0.07049534, 0.10080000, 0.09558313]),
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(
+ np.array([47.18074546, 32.38073691, 29.13827648]), Y_abs=1000),
+ np.array([0.25506814, 0.19150000, 0.08849752]),
+ decimal=7)
+
+ def test_n_dimensional_hdr_IPT_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.hdr_IPT_to_XYZ` definition
+ n-dimensions support.
+ """
+
+ IPT_hdr = np.array([25.18261761, -22.62111297, 3.18511729])
+ Y_s = 0.2
+ Y_abs = 100
+ XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(IPT_hdr, Y_s, Y_abs), XYZ, decimal=7)
+
+ IPT_hdr = np.tile(IPT_hdr, (6, 1))
+ XYZ = np.tile(XYZ, (6, 1))
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(IPT_hdr, Y_s, Y_abs), XYZ, decimal=7)
+
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(IPT_hdr, Y_s, Y_abs), XYZ, decimal=7)
+
+ IPT_hdr = np.reshape(IPT_hdr, (2, 3, 3))
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ XYZ = np.reshape(XYZ, (2, 3, 3))
+ np.testing.assert_almost_equal(
+ hdr_IPT_to_XYZ(IPT_hdr, Y_s, Y_abs), XYZ, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_hdr_IPT_to_XYZ(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.hdr_IPT_to_XYZ` definition nan
+ support.
+ """
+
+ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
+ cases = set(permutations(cases * 3, r=3))
+ for case in cases:
+ IPT_hdr = np.array(case)
+ Y_s = case[0]
+ Y_abs = case[0]
+ hdr_IPT_to_XYZ(IPT_hdr, Y_s, Y_abs)
+
+
+class TestExponent_hdr_IPT(unittest.TestCase):
+ """
+ Defines :func:`colour.models.hdr_ipt.exponent_hdr_IPT`
+ definition unit tests methods.
+ """
+
+ def test_exponent_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.exponent_hdr_IPT`
+ definition.
+ """
+
+ self.assertAlmostEqual(
+ exponent_hdr_IPT(0.2, 100), 1.689138305989492, places=7)
+
+ self.assertAlmostEqual(
+ exponent_hdr_IPT(0.4, 100), 1.219933220992410, places=7)
+
+ self.assertAlmostEqual(
+ exponent_hdr_IPT(0.2, 1000), 1.126092203992995, places=7)
+
+ def test_n_dimensional_exponent_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.exponent_hdr_IPT`
+ definition n-dimensional arrays support.
+ """
+
+ Y_s = 0.2
+ Y_abs = 100
+ e = 1.689138305989492
+ np.testing.assert_almost_equal(
+ exponent_hdr_IPT(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.tile(Y_s, 6)
+ Y_abs = np.tile(Y_abs, 6)
+ e = np.tile(e, 6)
+ np.testing.assert_almost_equal(
+ exponent_hdr_IPT(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.reshape(Y_s, (2, 3))
+ Y_abs = np.reshape(Y_abs, (2, 3))
+ e = np.reshape(e, (2, 3))
+ np.testing.assert_almost_equal(
+ exponent_hdr_IPT(Y_s, Y_abs), e, decimal=7)
+
+ Y_s = np.reshape(Y_s, (2, 3, 1))
+ Y_abs = np.reshape(Y_abs, (2, 3, 1))
+ e = np.reshape(e, (2, 3, 1))
+ np.testing.assert_almost_equal(
+ exponent_hdr_IPT(Y_s, Y_abs), e, decimal=7)
+
+ @ignore_numpy_errors
+ def test_nan_exponent_hdr_IPT(self):
+ """
+ Tests :func:`colour.models.hdr_ipt.exponent_hdr_IPT`
+ definition nan support.
+ """
+
+ cases = np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan])
+ exponent_hdr_IPT(cases, cases)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/models/tests/tests_hunter_lab.py b/colour/models/tests/tests_hunter_lab.py
index 0eb8cb8163..031e74d110 100644
--- a/colour/models/tests/tests_hunter_lab.py
+++ b/colour/models/tests/tests_hunter_lab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.hunter_lab` module.
"""
@@ -12,10 +11,8 @@
from itertools import permutations
from colour.colorimetry import HUNTERLAB_ILLUMINANTS
-from colour.models import (
- XYZ_to_K_ab_HunterLab1966,
- XYZ_to_Hunter_Lab,
- Hunter_Lab_to_XYZ)
+from colour.models import (XYZ_to_K_ab_HunterLab1966, XYZ_to_Hunter_Lab,
+ Hunter_Lab_to_XYZ)
from colour.utilities import ignore_numpy_errors
@@ -26,9 +23,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_K_ab_HunterLab1966',
- 'TestXYZ_to_Hunter_Lab',
- 'TestHunter_Lab_to_XYZ']
+__all__ = [
+ 'TestXYZ_to_K_ab_HunterLab1966', 'TestXYZ_to_Hunter_Lab',
+ 'TestHunter_Lab_to_XYZ'
+]
class TestXYZ_to_K_ab_HunterLab1966(unittest.TestCase):
@@ -70,23 +68,17 @@ def test_n_dimensional_XYZ_to_K_ab_HunterLab1966(self):
XYZ = np.array([0.07049534, 0.10080000, 0.09558313]) * 100
K_ab = 46.9256133, 19.9129745
np.testing.assert_almost_equal(
- XYZ_to_K_ab_HunterLab1966(XYZ),
- K_ab,
- decimal=7)
+ XYZ_to_K_ab_HunterLab1966(XYZ), K_ab, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
K_ab = np.tile(K_ab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_K_ab_HunterLab1966(XYZ),
- K_ab,
- decimal=7)
+ XYZ_to_K_ab_HunterLab1966(XYZ), K_ab, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
K_ab = np.reshape(K_ab, (2, 3, 2))
np.testing.assert_almost_equal(
- XYZ_to_K_ab_HunterLab1966(XYZ),
- K_ab,
- decimal=7)
+ XYZ_to_K_ab_HunterLab1966(XYZ), K_ab, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_K_ab_HunterLab1966(self):
@@ -134,8 +126,7 @@ def test_XYZ_to_Hunter_Lab(self):
A = h_i['A']
np.testing.assert_almost_equal(
XYZ_to_Hunter_Lab(
- np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- A.XYZ_n,
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100, A.XYZ_n,
A.K_ab),
np.array([31.74901573, -21.35794415, -20.32778374]),
decimal=7)
@@ -144,8 +135,7 @@ def test_XYZ_to_Hunter_Lab(self):
np.testing.assert_almost_equal(
XYZ_to_Hunter_Lab(
np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- D65.XYZ_n,
- D65.K_ab),
+ D65.XYZ_n, D65.K_ab),
np.array([31.74901573, -14.44108591, 2.74396261]),
decimal=7)
@@ -171,32 +161,24 @@ def test_n_dimensional_XYZ_to_Hunter_Lab(self):
K_ab = D50.K_ab
Lab = np.array([31.74901573, -15.11462629, -2.78660758])
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab),
- Lab,
- decimal=7)
+ XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab), Lab, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
Lab = np.tile(Lab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab),
- Lab,
- decimal=7)
+ XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab), Lab, decimal=7)
XYZ_n = np.tile(XYZ_n, (6, 1))
K_ab = np.tile(K_ab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab),
- Lab,
- decimal=7)
+ XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab), Lab, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
XYZ_n = np.reshape(XYZ_n, (2, 3, 3))
K_ab = np.reshape(K_ab, (2, 3, 2))
Lab = np.reshape(Lab, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab),
- Lab,
- decimal=7)
+ XYZ_to_Hunter_Lab(XYZ, XYZ_n, K_ab), Lab, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_Hunter_Lab(self):
@@ -247,8 +229,7 @@ def test_Hunter_Lab_to_XYZ(self):
A = h_i['A']
np.testing.assert_almost_equal(
Hunter_Lab_to_XYZ(
- np.array([31.74901573, -21.35794415, -20.32778374]),
- A.XYZ_n,
+ np.array([31.74901573, -21.35794415, -20.32778374]), A.XYZ_n,
A.K_ab),
np.array([7.04953400, 10.08000000, 9.55831300]),
decimal=7)
@@ -256,8 +237,7 @@ def test_Hunter_Lab_to_XYZ(self):
D65 = h_i['D65']
np.testing.assert_almost_equal(
Hunter_Lab_to_XYZ(
- np.array([31.7490157, -14.4410859, 2.7439626]),
- D65.XYZ_n,
+ np.array([31.7490157, -14.4410859, 2.7439626]), D65.XYZ_n,
D65.K_ab),
np.array([7.04953400, 10.08000000, 9.55831300]),
decimal=7)
@@ -284,32 +264,24 @@ def test_n_dimensional_Hunter_Lab_to_XYZ(self):
K_ab = D50.K_ab
XYZ = np.array([0.07049534, 0.10080000, 0.09558313]) * 100
np.testing.assert_almost_equal(
- Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab),
- XYZ,
- decimal=7)
+ Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab), XYZ, decimal=7)
Lab = np.tile(Lab, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
- Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab),
- XYZ,
- decimal=7)
+ Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab), XYZ, decimal=7)
K_ab = np.tile(K_ab, (6, 1))
XYZ_n = np.tile(XYZ_n, (6, 1))
np.testing.assert_almost_equal(
- Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab),
- XYZ,
- decimal=7)
+ Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab), XYZ, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
XYZ_n = np.reshape(XYZ_n, (2, 3, 3))
K_ab = np.reshape(K_ab, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
- Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab),
- XYZ,
- decimal=7)
+ Hunter_Lab_to_XYZ(Lab, XYZ_n, K_ab), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_Hunter_Lab_to_XYZ(self):
diff --git a/colour/models/tests/tests_hunter_rdab.py b/colour/models/tests/tests_hunter_rdab.py
index cce5752241..e5f8c2cd59 100644
--- a/colour/models/tests/tests_hunter_rdab.py
+++ b/colour/models/tests/tests_hunter_rdab.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.hunter_rdab` module.
"""
@@ -59,8 +58,7 @@ def test_XYZ_to_Hunter_Rdab(self):
A = h_i['A']
np.testing.assert_almost_equal(
XYZ_to_Hunter_Rdab(
- np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- A.XYZ_n,
+ np.array([0.07049534, 0.10080000, 0.09558313]) * 100, A.XYZ_n,
A.K_ab),
np.array([10.08000000, -26.39115518, -25.11822727]),
decimal=7)
@@ -69,8 +67,7 @@ def test_XYZ_to_Hunter_Rdab(self):
np.testing.assert_almost_equal(
XYZ_to_Hunter_Rdab(
np.array([0.07049534, 0.10080000, 0.09558313]) * 100,
- D65.XYZ_n,
- D65.K_ab),
+ D65.XYZ_n, D65.K_ab),
np.array([10.08000000, -17.84427080, 3.39060457]),
decimal=7)
@@ -96,32 +93,24 @@ def test_n_dimensional_XYZ_to_Hunter_Rdab(self):
K_ab = D50.K_ab
R_d_ab = np.array([10.08000000, -18.67653764, -3.44329925])
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab),
- R_d_ab,
- decimal=7)
+ XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab), R_d_ab, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
R_d_ab = np.tile(R_d_ab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab),
- R_d_ab,
- decimal=7)
+ XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab), R_d_ab, decimal=7)
XYZ_n = np.tile(XYZ_n, (6, 1))
K_ab = np.tile(K_ab, (6, 1))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab),
- R_d_ab,
- decimal=7)
+ XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab), R_d_ab, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
XYZ_n = np.reshape(XYZ_n, (2, 3, 3))
K_ab = np.reshape(K_ab, (2, 3, 2))
R_d_ab = np.reshape(R_d_ab, (2, 3, 3))
np.testing.assert_almost_equal(
- XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab),
- R_d_ab,
- decimal=7)
+ XYZ_to_Hunter_Rdab(XYZ, XYZ_n, K_ab), R_d_ab, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_Hunter_Rdab(self):
diff --git a/colour/models/tests/tests_ipt.py b/colour/models/tests/tests_ipt.py
index f8460365d4..e9763d81a3 100644
--- a/colour/models/tests/tests_ipt.py
+++ b/colour/models/tests/tests_ipt.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.ipt` module.
"""
@@ -21,9 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestXYZ_to_IPT',
- 'TestIPT_to_XYZ',
- 'TestIPTHueAngle']
+__all__ = ['TestXYZ_to_IPT', 'TestIPT_to_XYZ', 'TestIPTHueAngle']
class TestXYZ_to_IPT(unittest.TestCase):
@@ -60,24 +57,15 @@ def test_n_dimensional_XYZ_to_IPT(self):
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
IPT = np.array([0.36571124, -0.11114798, 0.01594746])
- np.testing.assert_almost_equal(
- XYZ_to_IPT(XYZ),
- IPT,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_IPT(XYZ), IPT, decimal=7)
XYZ = np.tile(XYZ, (6, 1))
IPT = np.tile(IPT, (6, 1))
- np.testing.assert_almost_equal(
- XYZ_to_IPT(XYZ),
- IPT,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_IPT(XYZ), IPT, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
IPT = np.reshape(IPT, (2, 3, 3))
- np.testing.assert_almost_equal(
- XYZ_to_IPT(XYZ),
- IPT,
- decimal=7)
+ np.testing.assert_almost_equal(XYZ_to_IPT(XYZ), IPT, decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_IPT(self):
@@ -126,24 +114,15 @@ def test_n_dimensional_IPT_to_XYZ(self):
IPT = np.array([0.36571124, -0.11114798, 0.01594746])
XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
- np.testing.assert_almost_equal(
- IPT_to_XYZ(IPT),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_to_XYZ(IPT), XYZ, decimal=7)
IPT = np.tile(IPT, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
- np.testing.assert_almost_equal(
- IPT_to_XYZ(IPT),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_to_XYZ(IPT), XYZ, decimal=7)
IPT = np.reshape(IPT, (2, 3, 3))
XYZ = np.reshape(XYZ, (2, 3, 3))
- np.testing.assert_almost_equal(
- IPT_to_XYZ(IPT),
- XYZ,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_to_XYZ(IPT), XYZ, decimal=7)
@ignore_numpy_errors
def test_nan_IPT_to_XYZ(self):
@@ -192,24 +171,15 @@ def test_n_dimensional_IPT_hue_angle(self):
IPT = np.array([0.07049534, 0.10080000, 0.09558313])
hue = 43.478309455309819
- np.testing.assert_almost_equal(
- IPT_hue_angle(IPT),
- hue,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_hue_angle(IPT), hue, decimal=7)
IPT = np.tile(IPT, (6, 1))
hue = np.tile(hue, 6)
- np.testing.assert_almost_equal(
- IPT_hue_angle(IPT),
- hue,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_hue_angle(IPT), hue, decimal=7)
IPT = np.reshape(IPT, (2, 3, 3))
hue = np.reshape(hue, (2, 3))
- np.testing.assert_almost_equal(
- IPT_hue_angle(IPT),
- hue,
- decimal=7)
+ np.testing.assert_almost_equal(IPT_hue_angle(IPT), hue, decimal=7)
@ignore_numpy_errors
def test_nan_IPT_hue_angle(self):
diff --git a/colour/models/tests/tests_ucs_luo2006.py b/colour/models/tests/tests_ucs_luo2006.py
index ccfef1a9fb..fcc0f12943 100644
--- a/colour/models/tests/tests_ucs_luo2006.py
+++ b/colour/models/tests/tests_ucs_luo2006.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.models.ucs_luo2006` module.
"""
@@ -11,20 +10,13 @@
import unittest
from itertools import permutations
-from colour.appearance import (
- CIECAM02_VIEWING_CONDITIONS,
- XYZ_to_CIECAM02)
-from colour.models.ucs_luo2006 import (
- COEFFICIENTS_UCS_LUO2006,
- JMh_CIECAM02_to_UCS_Luo2006,
- UCS_Luo2006_to_JMh_CIECAM02)
-from colour.models import (
- JMh_CIECAM02_to_CAM02LCD,
- CAM02LCD_to_JMh_CIECAM02,
- JMh_CIECAM02_to_CAM02SCD,
- CAM02SCD_to_JMh_CIECAM02,
- JMh_CIECAM02_to_CAM02UCS,
- CAM02UCS_to_JMh_CIECAM02)
+from colour.appearance import (CIECAM02_VIEWING_CONDITIONS, XYZ_to_CIECAM02)
+from colour.models.ucs_luo2006 import (COEFFICIENTS_UCS_LUO2006,
+ JMh_CIECAM02_to_UCS_Luo2006,
+ UCS_Luo2006_to_JMh_CIECAM02)
+from colour.models import (JMh_CIECAM02_to_CAM02LCD, CAM02LCD_to_JMh_CIECAM02,
+ JMh_CIECAM02_to_CAM02SCD, CAM02SCD_to_JMh_CIECAM02,
+ JMh_CIECAM02_to_CAM02UCS, CAM02UCS_to_JMh_CIECAM02)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -34,8 +26,9 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestJMh_CIECAM02_to_UCS_Luo2006',
- 'TestUCS_Luo2006_to_JMh_CIECAM02']
+__all__ = [
+ 'TestJMh_CIECAM02_to_UCS_Luo2006', 'TestUCS_Luo2006_to_JMh_CIECAM02'
+]
class TestJMh_CIECAM02_to_UCS_Luo2006(unittest.TestCase):
@@ -54,8 +47,7 @@ def setUp(self):
L_A = 318.31
Y_b = 20.0
surround = CIECAM02_VIEWING_CONDITIONS['Average']
- specification = XYZ_to_CIECAM02(
- XYZ, XYZ_w, L_A, Y_b, surround)
+ specification = XYZ_to_CIECAM02(XYZ, XYZ_w, L_A, Y_b, surround)
self._JMh = (specification.J, specification.M, specification.h)
@@ -66,38 +58,38 @@ def test_JMh_CIECAM02_to_UCS_Luo2006(self):
"""
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
np.array([54.90433134, -0.08450395, -0.06854831]),
decimal=7)
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
JMh_CIECAM02_to_CAM02LCD(self._JMh),
decimal=7)
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-SCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-SCD']),
np.array([54.90433134, -0.08436178, -0.06843298]),
decimal=7)
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-SCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-SCD']),
JMh_CIECAM02_to_CAM02SCD(self._JMh),
decimal=7)
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-UCS']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-UCS']),
np.array([54.90433134, -0.08442362, -0.06848314]),
decimal=7)
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- self._JMh, COEFFICIENTS_UCS_LUO2006['CAM02-UCS']),
+ JMh_CIECAM02_to_UCS_Luo2006(self._JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-UCS']),
JMh_CIECAM02_to_CAM02UCS(self._JMh),
decimal=7)
@@ -110,24 +102,24 @@ def test_n_dimensional_JMh_CIECAM02_to_UCS_Luo2006(self):
JMh = self._JMh
Jpapbp = np.array([54.90433134, -0.08450395, -0.06854831])
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
Jpapbp,
decimal=7)
JMh = np.tile(JMh, (6, 1))
Jpapbp = np.tile(Jpapbp, (6, 1))
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
Jpapbp,
decimal=7)
JMh = np.reshape(JMh, (2, 3, 3))
Jpapbp = np.reshape(Jpapbp, (2, 3, 3))
np.testing.assert_almost_equal(
- JMh_CIECAM02_to_UCS_Luo2006(
- JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ JMh_CIECAM02_to_UCS_Luo2006(JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
Jpapbp,
decimal=7)
@@ -142,8 +134,8 @@ def test_nan_JMh_CIECAM02_to_UCS_Luo2006(self):
cases = set(permutations(cases * 3, r=3))
for case in cases:
JMh = np.array(case)
- JMh_CIECAM02_to_UCS_Luo2006(
- JMh, COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
+ JMh_CIECAM02_to_UCS_Luo2006(JMh,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
class TestUCS_Luo2006_to_JMh_CIECAM02(unittest.TestCase):
@@ -212,24 +204,24 @@ def test_n_dimensional_UCS_Luo2006_to_JMh_CIECAM02(self):
Jpapbp = np.array([54.90433134, -0.08442362, -0.06848314])
JMh = np.array([41.73109113, 0.10873867, 219.04843202])
np.testing.assert_almost_equal(
- UCS_Luo2006_to_JMh_CIECAM02(
- Jpapbp, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ UCS_Luo2006_to_JMh_CIECAM02(Jpapbp,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
JMh,
decimal=7)
Jpapbp = np.tile(Jpapbp, (6, 1))
JMh = np.tile(JMh, (6, 1))
np.testing.assert_almost_equal(
- UCS_Luo2006_to_JMh_CIECAM02(
- Jpapbp, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ UCS_Luo2006_to_JMh_CIECAM02(Jpapbp,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
JMh,
decimal=7)
Jpapbp = np.reshape(Jpapbp, (2, 3, 3))
JMh = np.reshape(JMh, (2, 3, 3))
np.testing.assert_almost_equal(
- UCS_Luo2006_to_JMh_CIECAM02(
- Jpapbp, COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
+ UCS_Luo2006_to_JMh_CIECAM02(Jpapbp,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD']),
JMh,
decimal=7)
@@ -244,8 +236,8 @@ def test_nan_UCS_Luo2006_to_JMh_CIECAM02(self):
cases = set(permutations(cases * 3, r=3))
for case in cases:
Jpapbp = np.array(case)
- UCS_Luo2006_to_JMh_CIECAM02(
- Jpapbp, COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
+ UCS_Luo2006_to_JMh_CIECAM02(Jpapbp,
+ COEFFICIENTS_UCS_LUO2006['CAM02-LCD'])
if __name__ == '__main__':
diff --git a/colour/models/ucs_luo2006.py b/colour/models/ucs_luo2006.py
index 47aed6d3e8..e481594681 100644
--- a/colour/models/ucs_luo2006.py
+++ b/colour/models/ucs_luo2006.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CAM02-LCD, CAM02-SCD, and CAM02-UCS Colourspaces - Luo, Cui and Li (2006)
=========================================================================
@@ -44,31 +43,28 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['Coefficients_UCS_Luo2006',
- 'COEFFICIENTS_UCS_LUO2006',
- 'JMh_CIECAM02_to_UCS_Luo2006',
- 'UCS_Luo2006_to_JMh_CIECAM02',
- 'JMh_CIECAM02_to_CAM02LCD',
- 'CAM02LCD_to_JMh_CIECAM02',
- 'JMh_CIECAM02_to_CAM02SCD',
- 'CAM02SCD_to_JMh_CIECAM02',
- 'JMh_CIECAM02_to_CAM02UCS',
- 'CAM02UCS_to_JMh_CIECAM02']
+__all__ = [
+ 'Coefficients_UCS_Luo2006', 'COEFFICIENTS_UCS_LUO2006',
+ 'JMh_CIECAM02_to_UCS_Luo2006', 'UCS_Luo2006_to_JMh_CIECAM02',
+ 'JMh_CIECAM02_to_CAM02LCD', 'CAM02LCD_to_JMh_CIECAM02',
+ 'JMh_CIECAM02_to_CAM02SCD', 'CAM02SCD_to_JMh_CIECAM02',
+ 'JMh_CIECAM02_to_CAM02UCS', 'CAM02UCS_to_JMh_CIECAM02'
+]
class Coefficients_UCS_Luo2006(
- namedtuple('Coefficients_UCS_Luo2006',
- ('K_L', 'c_1', 'c_2'))):
+ namedtuple('Coefficients_UCS_Luo2006', ('K_L', 'c_1', 'c_2'))):
"""
Defines the the class storing *Luo et al. (2006)* fitting coefficients for
the *CAM02-LCD*, *CAM02-SCD*, and *CAM02-UCS* colourspaces.
"""
-COEFFICIENTS_UCS_LUO2006 = CaseInsensitiveMapping(
- {'CAM02-LCD': Coefficients_UCS_Luo2006(0.77, 0.007, 0.0053),
- 'CAM02-SCD': Coefficients_UCS_Luo2006(1.24, 0.007, 0.0363),
- 'CAM02-UCS': Coefficients_UCS_Luo2006(1.00, 0.007, 0.0228)})
+COEFFICIENTS_UCS_LUO2006 = CaseInsensitiveMapping({
+ 'CAM02-LCD': Coefficients_UCS_Luo2006(0.77, 0.007, 0.0053),
+ 'CAM02-SCD': Coefficients_UCS_Luo2006(1.24, 0.007, 0.0363),
+ 'CAM02-UCS': Coefficients_UCS_Luo2006(1.00, 0.007, 0.0228)
+})
"""
*Luo et al. (2006)* fitting coefficients for the *CAM02-LCD*, *CAM02-SCD*, and
*CAM02-UCS* colourspaces.
diff --git a/colour/notation/__init__.py b/colour/notation/__init__.py
index c4476f4df8..d0194216ab 100644
--- a/colour/notation/__init__.py
+++ b/colour/notation/__init__.py
@@ -7,25 +7,20 @@
from . import dataset
from .munsell import MUNSELL_VALUE_METHODS
from .munsell import munsell_value
-from .munsell import (
- munsell_value_Priest1920,
- munsell_value_Munsell1933,
- munsell_value_Moon1943,
- munsell_value_Saunderson1944,
- munsell_value_Ladd1955,
- munsell_value_McCamy1987,
- munsell_value_ASTMD153508)
+from .munsell import (munsell_value_Priest1920, munsell_value_Munsell1933,
+ munsell_value_Moon1943, munsell_value_Saunderson1944,
+ munsell_value_Ladd1955, munsell_value_McCamy1987,
+ munsell_value_ASTMD153508)
from .munsell import munsell_colour_to_xyY, xyY_to_munsell_colour
__all__ = []
__all__ += dataset.__all__
__all__ += ['munsell_value']
__all__ += ['MUNSELL_VALUE_METHODS']
-__all__ += ['munsell_value_Priest1920',
- 'munsell_value_Munsell1933',
- 'munsell_value_Moon1943',
- 'munsell_value_Saunderson1944',
- 'munsell_value_Ladd1955',
- 'munsell_value_McCamy1987',
- 'munsell_value_ASTMD153508']
+__all__ += [
+ 'munsell_value_Priest1920', 'munsell_value_Munsell1933',
+ 'munsell_value_Moon1943', 'munsell_value_Saunderson1944',
+ 'munsell_value_Ladd1955', 'munsell_value_McCamy1987',
+ 'munsell_value_ASTMD153508'
+]
__all__ += ['munsell_colour_to_xyY', 'xyY_to_munsell_colour']
diff --git a/colour/notation/dataset/munsell/__init__.py b/colour/notation/dataset/munsell/__init__.py
index 1d1865c9b0..98f83fefe9 100644
--- a/colour/notation/dataset/munsell/__init__.py
+++ b/colour/notation/dataset/munsell/__init__.py
@@ -15,7 +15,8 @@
MUNSELL_COLOURS = CaseInsensitiveMapping({
'Munsell Colours All': MUNSELL_COLOURS_ALL,
'Munsell Colours 1929': MUNSELL_COLOURS_1929,
- 'Munsell Colours Real': MUNSELL_COLOURS_REAL})
+ 'Munsell Colours Real': MUNSELL_COLOURS_REAL
+})
"""
Aggregated *Munsell* colours.
diff --git a/colour/notation/dataset/munsell/all.py b/colour/notation/dataset/munsell/all.py
index a8d4079096..1066fce2df 100644
--- a/colour/notation/dataset/munsell/all.py
+++ b/colour/notation/dataset/munsell/all.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Munsell Renotation System Dataset - All Munsell Colours
=======================================================
@@ -33,6 +32,7 @@
__all__ = ['MUNSELL_COLOURS_ALL']
+# yapf: disable
MUNSELL_COLOURS_ALL = (
(('2.5GY', 0.2, 2.0), np.array([0.7130, 1.4140, 0.2370])),
(('5GY', 0.2, 2.0), np.array([0.4490, 1.1450, 0.2370])),
@@ -5029,6 +5029,7 @@
(('7.5Y', 10.0, 18.0), np.array([0.4620, 0.5150, 102.5700])),
(('7.5Y', 10.0, 20.0), np.array([0.4670, 0.5210, 102.5700])),
(('7.5Y', 10.0, 22.0), np.array([0.4720, 0.5280, 102.5700])))
+# yapf: enable
"""
*All* published *Munsell* colours, including the extrapolated colors.
diff --git a/colour/notation/dataset/munsell/experimental.py b/colour/notation/dataset/munsell/experimental.py
index 113527e01d..0d8a799c44 100644
--- a/colour/notation/dataset/munsell/experimental.py
+++ b/colour/notation/dataset/munsell/experimental.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Munsell Renotation System Dataset - 1929 Munsell Colours
========================================================
@@ -34,6 +33,7 @@
__all__ = ['MUNSELL_COLOURS_1929']
+# yapf: disable
MUNSELL_COLOURS_1929 = (
(('10RP', 2.0, 2.0), np.array([0.3532, 0.2957, 3.1260])),
(('10RP', 2.0, 4.0), np.array([0.3850, 0.2778, 3.1260])),
@@ -991,6 +991,7 @@
(('7.5RP', 8.0, 2.0), np.array([0.3200, 0.3136, 59.1000])),
(('7.5RP', 8.0, 4.0), np.array([0.3360, 0.3092, 59.1000])),
(('7.5RP', 8.0, 6.0), np.array([0.3521, 0.3042, 59.1000])))
+# yapf: enable
"""
*1929* published *Munsell* colours.
diff --git a/colour/notation/dataset/munsell/real.py b/colour/notation/dataset/munsell/real.py
index a0c1627045..53610ac71e 100644
--- a/colour/notation/dataset/munsell/real.py
+++ b/colour/notation/dataset/munsell/real.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Munsell Renotation System Dataset - Real Munsell Colours
========================================================
@@ -34,6 +33,7 @@
__all__ = ['MUNSELL_COLOURS_REAL']
+# yapf: disable
MUNSELL_COLOURS_REAL = (
(('10RP', 1.0, 2.0), np.array([0.3629, 0.2710, 1.2100])),
(('10RP', 1.0, 4.0), np.array([0.3920, 0.2423, 1.2100])),
@@ -2769,6 +2769,7 @@
(('7.5RP', 9.0, 2.0), np.array([0.3190, 0.3141, 78.6600])),
(('7.5RP', 9.0, 4.0), np.array([0.3350, 0.3099, 78.6600])),
(('7.5RP', 9.0, 6.0), np.array([0.3512, 0.3052, 78.6600])))
+# yapf: enable
"""
*Real*, within MacAdam limits, published *Munsell* colours.
diff --git a/colour/notation/munsell.py b/colour/notation/munsell.py
index 50d73b6ad3..57de4dd658 100644
--- a/colour/notation/munsell.py
+++ b/colour/notation/munsell.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Munsell Renotation System
=========================
@@ -47,25 +46,16 @@
import re
from collections import OrderedDict
-from colour.algebra import (
- Extrapolator,
- LinearInterpolator,
- cartesian_to_cylindrical,
- polar_to_cartesian,
- euclidean_distance)
+from colour.algebra import (Extrapolator, LinearInterpolator,
+ cartesian_to_cylindrical, polar_to_cartesian,
+ euclidean_distance)
from colour.colorimetry import ILLUMINANTS, luminance_ASTMD153508
-from colour.constants import (
- INTEGER_THRESHOLD,
- FLOATING_POINT_NUMBER_PATTERN)
+from colour.constants import (INTEGER_THRESHOLD, FLOATING_POINT_NUMBER_PATTERN)
from colour.models import Lab_to_LCHab, XYZ_to_Lab, XYZ_to_xy, xyY_to_XYZ
from colour.volume import is_within_macadam_limits
from colour.notation import MUNSELL_COLOURS_ALL
-from colour.utilities import (
- CaseInsensitiveMapping,
- Lookup,
- is_integer,
- is_numeric,
- tsplit)
+from colour.utilities import (CaseInsensitiveMapping, Lookup, is_integer,
+ is_numeric, tsplit)
__author__ = 'Colour Developers, Paul Centore'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -74,51 +64,34 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['MUNSELL_GRAY_PATTERN',
- 'MUNSELL_COLOUR_PATTERN',
- 'MUNSELL_GRAY_FORMAT',
- 'MUNSELL_COLOUR_FORMAT',
- 'MUNSELL_GRAY_EXTENDED_FORMAT',
- 'MUNSELL_COLOUR_EXTENDED_FORMAT',
- 'MUNSELL_HUE_LETTER_CODES',
- 'MUNSELL_DEFAULT_ILLUMINANT',
- 'MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES',
- 'munsell_value_Priest1920',
- 'munsell_value_Munsell1933',
- 'munsell_value_Moon1943',
- 'munsell_value_Saunderson1944',
- 'munsell_value_Ladd1955',
- 'munsell_value_McCamy1987',
- 'munsell_value_ASTMD153508',
- 'MUNSELL_VALUE_METHODS',
- 'munsell_value',
- 'munsell_specification_to_xyY',
- 'munsell_colour_to_xyY',
- 'xyY_to_munsell_specification',
- 'xyY_to_munsell_colour',
- 'parse_munsell_colour',
- 'is_grey_munsell_colour',
- 'normalize_munsell_specification',
- 'munsell_colour_to_munsell_specification',
- 'munsell_specification_to_munsell_colour',
- 'xyY_from_renotation',
- 'is_specification_in_renotation',
- 'bounding_hues_from_renotation',
- 'hue_to_hue_angle',
- 'hue_angle_to_hue',
- 'hue_to_ASTM_hue',
- 'interpolation_method_from_renotation_ovoid',
- 'xy_from_renotation_ovoid',
- 'LCHab_to_munsell_specification',
- 'maximum_chroma_from_renotation',
- 'munsell_specification_to_xy']
+__all__ = [
+ 'MUNSELL_GRAY_PATTERN', 'MUNSELL_COLOUR_PATTERN', 'MUNSELL_GRAY_FORMAT',
+ 'MUNSELL_COLOUR_FORMAT', 'MUNSELL_GRAY_EXTENDED_FORMAT',
+ 'MUNSELL_COLOUR_EXTENDED_FORMAT', 'MUNSELL_HUE_LETTER_CODES',
+ 'MUNSELL_DEFAULT_ILLUMINANT',
+ 'MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES',
+ 'munsell_value_Priest1920', 'munsell_value_Munsell1933',
+ 'munsell_value_Moon1943', 'munsell_value_Saunderson1944',
+ 'munsell_value_Ladd1955', 'munsell_value_McCamy1987',
+ 'munsell_value_ASTMD153508', 'MUNSELL_VALUE_METHODS', 'munsell_value',
+ 'munsell_specification_to_xyY', 'munsell_colour_to_xyY',
+ 'xyY_to_munsell_specification', 'xyY_to_munsell_colour',
+ 'parse_munsell_colour', 'is_grey_munsell_colour',
+ 'normalize_munsell_specification',
+ 'munsell_colour_to_munsell_specification',
+ 'munsell_specification_to_munsell_colour', 'xyY_from_renotation',
+ 'is_specification_in_renotation', 'bounding_hues_from_renotation',
+ 'hue_to_hue_angle', 'hue_angle_to_hue', 'hue_to_ASTM_hue',
+ 'interpolation_method_from_renotation_ovoid', 'xy_from_renotation_ovoid',
+ 'LCHab_to_munsell_specification', 'maximum_chroma_from_renotation',
+ 'munsell_specification_to_xy'
+]
MUNSELL_GRAY_PATTERN = 'N(?P{0})'.format(FLOATING_POINT_NUMBER_PATTERN)
-MUNSELL_COLOUR_PATTERN = (
- '(?P{0})\s*'
- '(?PBG|GY|YR|RP|PB|B|G|Y|R|P)\s*'
- '(?P{0})\s*\/\s*(?P[-+]?{0})'.format(
- FLOATING_POINT_NUMBER_PATTERN))
+MUNSELL_COLOUR_PATTERN = ('(?P{0})\s*'
+ '(?PBG|GY|YR|RP|PB|B|G|Y|R|P)\s*'
+ '(?P{0})\s*\/\s*(?P[-+]?{0})'.format(
+ FLOATING_POINT_NUMBER_PATTERN))
MUNSELL_GRAY_FORMAT = 'N{0}'
MUNSELL_COLOUR_FORMAT = '{0} {1}/{2}'
@@ -135,12 +108,12 @@
'G': 3,
'Y': 5,
'R': 7,
- 'P': 9})
+ 'P': 9
+})
MUNSELL_DEFAULT_ILLUMINANT = 'C'
-MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES = (
- ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
- MUNSELL_DEFAULT_ILLUMINANT])
+MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES = (ILLUMINANTS[
+ 'CIE 1931 2 Degree Standard Observer'][MUNSELL_DEFAULT_ILLUMINANT])
_MUNSELL_SPECIFICATIONS_CACHE = None
_MUNSELL_VALUE_ASTM_D1535_08_INTERPOLATOR_CACHE = None
@@ -177,7 +150,8 @@ def _munsell_specifications():
_MUNSELL_SPECIFICATIONS_CACHE = [
munsell_colour_to_munsell_specification(
MUNSELL_COLOUR_FORMAT.format(*colour[0]))
- for colour in MUNSELL_COLOURS_ALL]
+ for colour in MUNSELL_COLOURS_ALL
+ ]
return _MUNSELL_SPECIFICATIONS_CACHE
@@ -197,8 +171,7 @@ def _munsell_value_ASTMD153508_interpolator():
if _MUNSELL_VALUE_ASTM_D1535_08_INTERPOLATOR_CACHE is None:
_MUNSELL_VALUE_ASTM_D1535_08_INTERPOLATOR_CACHE = Extrapolator(
LinearInterpolator(
- luminance_ASTMD153508(munsell_values),
- munsell_values))
+ luminance_ASTMD153508(munsell_values), munsell_values))
return _MUNSELL_VALUE_ASTM_D1535_08_INTERPOLATOR_CACHE
@@ -436,12 +409,11 @@ def munsell_value_McCamy1987(Y):
Y = np.asarray(Y)
- V = np.where(Y <= 0.9,
- 0.87445 * (Y ** 0.9967),
+ V = np.where(Y <= 0.9, 0.87445 * (Y ** 0.9967),
(2.49268 * (Y ** (1 / 3)) - 1.5614 -
(0.985 / (((0.1073 * Y - 3.084) ** 2) + 7.54)) +
- (0.0133 / (Y ** 2.3)) +
- 0.0084 * np.sin(4.1 * (Y ** (1 / 3)) + 1) +
+ (0.0133 /
+ (Y ** 2.3)) + 0.0084 * np.sin(4.1 * (Y ** (1 / 3)) + 1) +
(0.0221 / Y) * np.sin(0.39 * (Y - 2)) -
(0.0037 / (0.44 * Y)) * np.sin(1.28 * (Y - 0.53))))
@@ -481,14 +453,15 @@ def munsell_value_ASTMD153508(Y):
return V
-MUNSELL_VALUE_METHODS = CaseInsensitiveMapping(
- {'Priest 1920': munsell_value_Priest1920,
- 'Munsell 1933': munsell_value_Munsell1933,
- 'Moon 1943': munsell_value_Moon1943,
- 'Saunderson 1944': munsell_value_Saunderson1944,
- 'Ladd 1955': munsell_value_Ladd1955,
- 'McCamy 1987': munsell_value_McCamy1987,
- 'ASTM D1535-08': munsell_value_ASTMD153508})
+MUNSELL_VALUE_METHODS = CaseInsensitiveMapping({
+ 'Priest 1920': munsell_value_Priest1920,
+ 'Munsell 1933': munsell_value_Munsell1933,
+ 'Moon 1943': munsell_value_Moon1943,
+ 'Saunderson 1944': munsell_value_Saunderson1944,
+ 'Ladd 1955': munsell_value_Ladd1955,
+ 'McCamy 1987': munsell_value_McCamy1987,
+ 'ASTM D1535-08': munsell_value_ASTMD153508
+})
"""
Supported *Munsell* value computations methods.
@@ -500,8 +473,7 @@ def munsell_value_ASTMD153508(Y):
- 'astm2008': 'ASTM D1535-08'
"""
-MUNSELL_VALUE_METHODS['astm2008'] = (
- MUNSELL_VALUE_METHODS['ASTM D1535-08'])
+MUNSELL_VALUE_METHODS['astm2008'] = (MUNSELL_VALUE_METHODS['ASTM D1535-08'])
def munsell_value(Y, method='ASTM D1535-08'):
@@ -606,15 +578,14 @@ def munsell_specification_to_xyY(specification):
value_minus = np.floor(value)
value_plus = value_minus + 1
- specification_minus = (value_minus
- if is_grey_munsell_colour(specification) else
- (hue, value_minus, chroma, code))
+ specification_minus = (value_minus if is_grey_munsell_colour(specification)
+ else (hue, value_minus, chroma, code))
x_minus, y_minus = munsell_specification_to_xy(specification_minus)
plus_specification = (value_plus
if (is_grey_munsell_colour(specification) or
- value_plus == 10) else
- (hue, value_plus, chroma, code))
+ value_plus == 10) else (hue, value_plus, chroma,
+ code))
x_plus, y_plus = munsell_specification_to_xy(plus_specification)
if value_minus == value_plus:
@@ -732,10 +703,9 @@ def xyY_to_munsell_specification(xyY):
LCHab = Lab_to_LCHab(Lab)
hue_initial, _value_initial, chroma_initial, code_initial = (
LCHab_to_munsell_specification(LCHab))
- specification_current = [hue_initial,
- value,
- (5 / 5.5) * chroma_initial,
- code_initial]
+ specification_current = [
+ hue_initial, value, (5 / 5.5) * chroma_initial, code_initial
+ ]
convergence_threshold = 0.0001
iterations_maximum = 64
@@ -748,9 +718,8 @@ def xyY_to_munsell_specification(xyY):
specification_current)
hue_angle_current = hue_to_hue_angle(hue_current, code_current)
- chroma_maximum = maximum_chroma_from_renotation(hue_current,
- value,
- code_current)
+ chroma_maximum = maximum_chroma_from_renotation(
+ hue_current, value, code_current)
if chroma_current > chroma_maximum:
chroma_current = specification_current[2] = chroma_maximum
@@ -789,9 +758,7 @@ def xyY_to_munsell_specification(xyY):
hue_inner, code_inner = hue_angle_to_hue(hue_angle_inner)
x_inner, y_inner, _Y_inner = np.ravel(
- munsell_specification_to_xyY((hue_inner,
- value,
- chroma_current,
+ munsell_specification_to_xyY((hue_inner, value, chroma_current,
code_inner)))
if len(phi_differences) >= 2:
@@ -801,8 +768,7 @@ def xyY_to_munsell_specification(xyY):
rho_inner, phi_inner, _z_inner = cartesian_to_cylindrical(
(x_inner - x_center, y_inner - y_center, Y_center))
phi_inner = np.degrees(phi_inner)
- phi_inner_difference = (
- (360 - phi_input + phi_inner) % 360)
+ phi_inner_difference = ((360 - phi_input + phi_inner) % 360)
if phi_inner_difference > 180:
phi_inner_difference -= 360
@@ -820,9 +786,8 @@ def xyY_to_munsell_specification(xyY):
phi_differences_indexes]
hue_angle_difference_new = Extrapolator(
- LinearInterpolator(
- phi_differences,
- hue_angles_differences))(0) % 360
+ LinearInterpolator(phi_differences, hue_angles_differences))(
+ 0) % 360
hue_angle_new = (hue_angle_current + hue_angle_difference_new) % 360
hue_new, code_new = hue_angle_to_hue(hue_angle_new)
@@ -837,9 +802,8 @@ def xyY_to_munsell_specification(xyY):
# TODO: Consider refactoring implementation.
hue_current, _value_current, chroma_current, code_current = (
specification_current)
- chroma_maximum = maximum_chroma_from_renotation(hue_current,
- value,
- code_current)
+ chroma_maximum = maximum_chroma_from_renotation(
+ hue_current, value, code_current)
if chroma_current > chroma_maximum:
chroma_current = specification_current[2] = chroma_maximum
@@ -861,13 +825,13 @@ def xyY_to_munsell_specification(xyY):
raise RuntimeError(('Maximum inner iterations count reached '
'without convergence!'))
- chroma_inner = (((rho_input / rho_current) ** iterations_inner) *
- chroma_current)
+ chroma_inner = (((
+ rho_input / rho_current) ** iterations_inner) * chroma_current)
if chroma_inner > chroma_maximum:
chroma_inner = specification_current[2] = chroma_maximum
- specification_inner = (
- hue_current, value, chroma_inner, code_current)
+ specification_inner = (hue_current, value, chroma_inner,
+ code_current)
x_inner, y_inner, _Y_inner = np.ravel(
munsell_specification_to_xyY(specification_inner))
@@ -933,10 +897,8 @@ def xyY_to_munsell_colour(xyY,
"""
specification = xyY_to_munsell_specification(xyY)
- return munsell_specification_to_munsell_colour(specification,
- hue_decimals,
- value_decimals,
- chroma_decimals)
+ return munsell_specification_to_munsell_colour(
+ specification, hue_decimals, value_decimals, chroma_decimals)
def parse_munsell_colour(munsell_colour):
@@ -968,17 +930,13 @@ def parse_munsell_colour(munsell_colour):
(0.0, 2.0, 4.0, 6)
"""
- match = re.match(MUNSELL_GRAY_PATTERN,
- munsell_colour,
- flags=re.IGNORECASE)
+ match = re.match(MUNSELL_GRAY_PATTERN, munsell_colour, flags=re.IGNORECASE)
if match:
return np.float_(match.group('value'))
- match = re.match(MUNSELL_COLOUR_PATTERN,
- munsell_colour,
- flags=re.IGNORECASE)
+ match = re.match(
+ MUNSELL_COLOUR_PATTERN, munsell_colour, flags=re.IGNORECASE)
if match:
- return (np.float_(match.group('hue')),
- np.float_(match.group('value')),
+ return (np.float_(match.group('hue')), np.float_(match.group('value')),
np.float_(match.group('chroma')),
MUNSELL_HUE_LETTER_CODES.get(match.group('letter').upper()))
@@ -1105,8 +1063,8 @@ def munsell_specification_to_munsell_colour(specification,
"""
if is_grey_munsell_colour(specification):
- return MUNSELL_GRAY_EXTENDED_FORMAT.format(
- specification, value_decimals)
+ return MUNSELL_GRAY_EXTENDED_FORMAT.format(specification,
+ value_decimals)
else:
hue, value, chroma, code = specification
code_values = MUNSELL_HUE_LETTER_CODES.values()
@@ -1128,18 +1086,13 @@ def munsell_specification_to_munsell_colour(specification,
hue, code = 10, (code + 1) % 10
if value == 0:
- return MUNSELL_GRAY_EXTENDED_FORMAT.format(
- specification, value_decimals)
+ return MUNSELL_GRAY_EXTENDED_FORMAT.format(specification,
+ value_decimals)
else:
- hue_letter = MUNSELL_HUE_LETTER_CODES.first_key_from_value(
- code)
- return MUNSELL_COLOUR_EXTENDED_FORMAT.format(hue,
- hue_decimals,
- hue_letter,
- value,
- value_decimals,
- chroma,
- chroma_decimals)
+ hue_letter = MUNSELL_HUE_LETTER_CODES.first_key_from_value(code)
+ return MUNSELL_COLOUR_EXTENDED_FORMAT.format(
+ hue, hue_decimals, hue_letter, value, value_decimals, chroma,
+ chroma_decimals)
def xyY_from_renotation(specification):
@@ -1296,9 +1249,9 @@ def hue_to_hue_angle(hue, code):
"""
single_hue = ((17 - code) % 10 + (hue / 10) - 0.5) % 10
- return LinearInterpolator(
- (0, 2, 3, 4, 5, 6, 8, 9, 10),
- (0, 45, 70, 135, 160, 225, 255, 315, 360))(single_hue)
+ return LinearInterpolator((0, 2, 3, 4, 5, 6, 8, 9, 10),
+ (0, 45, 70, 135, 160, 225, 255, 315,
+ 360))(single_hue)
def hue_angle_to_hue(hue_angle):
@@ -1330,9 +1283,8 @@ def hue_angle_to_hue(hue_angle):
(3.2160000..., 4)
"""
- single_hue = LinearInterpolator(
- (0, 45, 70, 135, 160, 225, 255, 315, 360),
- (0, 2, 3, 4, 5, 6, 8, 9, 10))(hue_angle)
+ single_hue = LinearInterpolator((0, 45, 70, 135, 160, 225, 255, 315, 360),
+ (0, 2, 3, 4, 5, 6, 8, 9, 10))(hue_angle)
if single_hue <= 0.5:
code = 7
@@ -1434,9 +1386,7 @@ def interpolation_method_from_renotation_ovoid(specification):
'Radial'
"""
- interpolation_methods = {0: None,
- 1: 'Linear',
- 2: 'Radial'}
+ interpolation_methods = {0: None, 1: 'Linear', 2: 'Radial'}
interpolation_method = 0
if is_grey_munsell_colour(specification):
# No interpolation needed for grey colours.
@@ -1460,10 +1410,10 @@ def interpolation_method_from_renotation_ovoid(specification):
assert 2 <= chroma <= 50, (
'"{0}" specification chroma must be in domain [2, 50]!'.format(
specification))
- assert abs(
- 2 * (chroma / 2 - round(chroma / 2))) <= INTEGER_THRESHOLD, (
- ('"{0}" specification chroma must be an integer and '
- 'multiple of 2!').format(specification))
+ assert abs(2 *
+ (chroma / 2 - round(chroma / 2))) <= INTEGER_THRESHOLD, ((
+ '"{0}" specification chroma must be an integer and '
+ 'multiple of 2!').format(specification))
chroma = 2 * round(chroma / 2)
@@ -1628,22 +1578,19 @@ def interpolation_method_from_renotation_ovoid(specification):
else:
interpolation_method = 1
elif chroma == 10:
- if (30 < ASTM_hue < 42.5 or
- 5 < ASTM_hue < 25 or
+ if (30 < ASTM_hue < 42.5 or 5 < ASTM_hue < 25 or
60 < ASTM_hue < 82.5):
interpolation_method = 2
else:
interpolation_method = 1
elif chroma == 12:
- if (30 < ASTM_hue < 42.5 or
- 7.5 < ASTM_hue < 27.5 or
+ if (30 < ASTM_hue < 42.5 or 7.5 < ASTM_hue < 27.5 or
80 < ASTM_hue < 82.5):
interpolation_method = 2
else:
interpolation_method = 1
elif chroma >= 14:
- if (32.5 < ASTM_hue < 40 or
- 7.5 < ASTM_hue < 15 or
+ if (32.5 < ASTM_hue < 40 or 7.5 < ASTM_hue < 15 or
80 < ASTM_hue < 82.5):
interpolation_method = 2
else:
@@ -1657,8 +1604,7 @@ def interpolation_method_from_renotation_ovoid(specification):
else:
interpolation_method = 1
elif chroma >= 14:
- if (32.5 < ASTM_hue < 40 or
- 5 < ASTM_hue < 15 or
+ if (32.5 < ASTM_hue < 40 or 5 < ASTM_hue < 15 or
60 < ASTM_hue < 85):
interpolation_method = 2
else:
@@ -1749,20 +1695,18 @@ def xy_from_renotation_ovoid(specification):
assert 2 <= chroma <= 50, (
'"{0}" specification chroma must be in domain [2, 50]!'.format(
specification))
- assert abs(
- 2 * (chroma / 2 - round(chroma / 2))) <= INTEGER_THRESHOLD, (
- ('"{0}" specification chroma must be an integer and '
- 'multiple of 2!').format(specification))
+ assert abs(2 *
+ (chroma / 2 - round(chroma / 2))) <= INTEGER_THRESHOLD, ((
+ '"{0}" specification chroma must be an integer and '
+ 'multiple of 2!').format(specification))
chroma = 2 * round(chroma / 2)
# Checking if renotation data is available without interpolation using
# given threshold.
threshold = 0.001
- if (abs(hue) < threshold or
- abs(hue - 2.5) < threshold or
- abs(hue - 5) < threshold or
- abs(hue - 7.5) < threshold or
+ if (abs(hue) < threshold or abs(hue - 2.5) < threshold or
+ abs(hue - 5) < threshold or abs(hue - 7.5) < threshold or
abs(hue - 10) < threshold):
hue = 2.5 * round(hue / 2.5)
x, y, _Y = xyY_from_renotation((hue, value, chroma, code))
@@ -1775,8 +1719,7 @@ def xy_from_renotation_ovoid(specification):
x_grey, y_grey = MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES
specification_minus = (hue_minus, value, chroma, code_minus)
- x_minus, y_minus, Y_minus = xyY_from_renotation(
- specification_minus)
+ x_minus, y_minus, Y_minus = xyY_from_renotation(specification_minus)
rho_minus, phi_minus, _z_minus = cartesian_to_cylindrical(
(x_minus - x_grey, y_minus - y_grey, Y_minus))
phi_minus = np.degrees(phi_minus)
@@ -1818,12 +1761,12 @@ def xy_from_renotation_ovoid(specification):
rho = LinearInterpolator((lower_hue_angle, upper_hue_angle),
(rho_minus, rho_plus))(hue_angle)
- x, y = tsplit(polar_to_cartesian((rho, np.radians(theta))) +
- np.asarray((x_grey, y_grey)))
+ x, y = tsplit(
+ polar_to_cartesian((rho, np.radians(theta))) + np.asarray(
+ (x_grey, y_grey)))
else:
- raise ValueError(
- 'Invalid interpolation method: "{0}"'.format(
- interpolation_method))
+ raise ValueError('Invalid interpolation method: "{0}"'.format(
+ interpolation_method))
return np.array([x, y])
@@ -1949,28 +1892,26 @@ def maximum_chroma_from_renotation(hue, value, code):
maximum_chromas = _munsell_maximum_chromas_from_renotation()
spc_for_indexes = [chroma[0] for chroma in maximum_chromas]
- ma_limit_mcw = maximum_chromas[
- spc_for_indexes.index((hue_cw, value_minus, code_cw))][1]
- ma_limit_mccw = maximum_chromas[
- spc_for_indexes.index((hue_ccw, value_minus, code_ccw))][1]
+ ma_limit_mcw = maximum_chromas[spc_for_indexes.index((hue_cw, value_minus,
+ code_cw))][1]
+ ma_limit_mccw = maximum_chromas[spc_for_indexes.index((
+ hue_ccw, value_minus, code_ccw))][1]
if value_plus <= 9:
- ma_limit_pcw = maximum_chromas[
- spc_for_indexes.index((hue_cw, value_plus, code_cw))][1]
- ma_limit_pccw = maximum_chromas[
- spc_for_indexes.index((hue_ccw, value_plus, code_ccw))][1]
- max_chroma = min(ma_limit_mcw,
- ma_limit_mccw,
- ma_limit_pcw,
+ ma_limit_pcw = maximum_chromas[spc_for_indexes.index((
+ hue_cw, value_plus, code_cw))][1]
+ ma_limit_pccw = maximum_chromas[spc_for_indexes.index((
+ hue_ccw, value_plus, code_ccw))][1]
+ max_chroma = min(ma_limit_mcw, ma_limit_mccw, ma_limit_pcw,
ma_limit_pccw)
else:
L = luminance_ASTMD153508(value)
L9 = luminance_ASTMD153508(9)
L10 = luminance_ASTMD153508(10)
- max_chroma = min(LinearInterpolator((L9, L10), (ma_limit_mcw, 0))(L),
- LinearInterpolator((L9, L10), (ma_limit_mccw, 0))(
- L))
+ max_chroma = min(
+ LinearInterpolator((L9, L10), (ma_limit_mcw, 0))(L),
+ LinearInterpolator((L9, L10), (ma_limit_mccw, 0))(L))
return max_chroma
@@ -2037,11 +1978,11 @@ def munsell_specification_to_xy(specification):
x_minus, y_minus = (
MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES)
else:
- x_minus, y_minus = xy_from_renotation_ovoid(
- (hue, value, chroma_minus, code))
+ x_minus, y_minus = xy_from_renotation_ovoid((hue, value,
+ chroma_minus, code))
- x_plus, y_plus = xy_from_renotation_ovoid(
- (hue, value, chroma_plus, code))
+ x_plus, y_plus = xy_from_renotation_ovoid((hue, value, chroma_plus,
+ code))
if chroma_minus == chroma_plus:
x = x_minus
diff --git a/colour/notation/tests/tests_munsell.py b/colour/notation/tests/tests_munsell.py
index bd57867d54..e14e916586 100644
--- a/colour/notation/tests/tests_munsell.py
+++ b/colour/notation/tests/tests_munsell.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.notation.munsell` module.
"""
@@ -10,36 +9,28 @@
import numpy as np
import unittest
-from colour.notation.munsell import (
- parse_munsell_colour,
- is_grey_munsell_colour,
- normalize_munsell_specification)
-from colour.notation.munsell import (
- munsell_colour_to_munsell_specification,
- munsell_specification_to_munsell_colour)
-from colour.notation.munsell import (
- xyY_from_renotation,
- is_specification_in_renotation)
+from colour.notation.munsell import (parse_munsell_colour,
+ is_grey_munsell_colour,
+ normalize_munsell_specification)
+from colour.notation.munsell import (munsell_colour_to_munsell_specification,
+ munsell_specification_to_munsell_colour)
+from colour.notation.munsell import (xyY_from_renotation,
+ is_specification_in_renotation)
from colour.notation.munsell import bounding_hues_from_renotation
from colour.notation.munsell import hue_to_hue_angle, hue_angle_to_hue
from colour.notation.munsell import hue_to_ASTM_hue
from colour.notation.munsell import (
- interpolation_method_from_renotation_ovoid,
- xy_from_renotation_ovoid)
+ interpolation_method_from_renotation_ovoid, xy_from_renotation_ovoid)
from colour.notation.munsell import LCHab_to_munsell_specification
from colour.notation.munsell import maximum_chroma_from_renotation
from colour.notation.munsell import munsell_specification_to_xy
-from colour.notation.munsell import (
- munsell_specification_to_xyY,
- xyY_to_munsell_specification)
-from colour.notation import (
- munsell_value_Priest1920,
- munsell_value_Munsell1933,
- munsell_value_Moon1943,
- munsell_value_Saunderson1944,
- munsell_value_Ladd1955,
- munsell_value_McCamy1987,
- munsell_value_ASTMD153508)
+from colour.notation.munsell import (munsell_specification_to_xyY,
+ xyY_to_munsell_specification)
+from colour.notation import (munsell_value_Priest1920,
+ munsell_value_Munsell1933, munsell_value_Moon1943,
+ munsell_value_Saunderson1944,
+ munsell_value_Ladd1955, munsell_value_McCamy1987,
+ munsell_value_ASTMD153508)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -49,1325 +40,1309 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['MUNSELL_SPECIFICATIONS',
- 'MUNSELL_GREYS_SPECIFICATIONS',
- 'MUNSELL_EVEN_SPECIFICATIONS',
- 'MUNSELL_BOUNDING_HUES',
- 'MUNSELL_HUE_TO_ANGLE',
- 'MUNSELL_HUE_TO_ASTM_HUE',
- 'MUNSELL_INTERPOLATION_METHODS',
- 'MUNSELL_XY_FROM_RENOTATION_OVOID',
- 'MUNSELL_SPECIFICATIONS_TO_XY',
- 'MUNSELL_COLOURS_TO_XYY',
- 'MUNSELL_GREYS_TO_XYY',
- 'XYY_TO_MUNSELL_SPECIFICATIONS',
- 'XYY_TO_MUNSELL_GREYS_SPECIFICATIONS',
- 'NON_CONVERGING_XYY',
- 'TestMunsellValuePriest1920',
- 'TestMunsellValueMunsell1933',
- 'TestMunsellValueMoon1943',
- 'TestMunsellValueSaunderson1944',
- 'TestMunsellValueLadd1955',
- 'TestMunsellValueMcCamy1992',
- 'TestMunsellValueASTMD153508',
- 'TestMunsellSpecification_to_xyY',
- 'TestMunsellColour_to_xyY',
- 'TestxyY_to_munsell_specification',
- 'TestxyY_to_munsell_colour',
- 'TestParseMunsellColour',
- 'TestIsGreyMunsellColour',
- 'TestNormalizeMunsellSpecification',
- 'TestMunsellColourToMunsellSpecification',
- 'TestMunsellSpecificationToMunsellColour',
- 'Test_xyY_fromRenotation',
- 'TestIsSpecificationInRenotation',
- 'TestBoundingHuesFromRenotation',
- 'TestHueToHueAngle',
- 'TestHueAngleToHue',
- 'TestHueTo_ASTM_hue',
- 'TestInterpolationMethodFromRenotationOvoid',
- 'Test_xy_fromRenotationOvoid',
- 'TestLCHabToMunsellSpecification',
- 'TestMaximumChromaFromRenotation',
- 'TestMunsellSpecification_to_xy']
+__all__ = [
+ 'MUNSELL_SPECIFICATIONS', 'MUNSELL_GREYS_SPECIFICATIONS',
+ 'MUNSELL_EVEN_SPECIFICATIONS', 'MUNSELL_BOUNDING_HUES',
+ 'MUNSELL_HUE_TO_ANGLE', 'MUNSELL_HUE_TO_ASTM_HUE',
+ 'MUNSELL_INTERPOLATION_METHODS', 'MUNSELL_XY_FROM_RENOTATION_OVOID',
+ 'MUNSELL_SPECIFICATIONS_TO_XY', 'MUNSELL_COLOURS_TO_XYY',
+ 'MUNSELL_GREYS_TO_XYY', 'XYY_TO_MUNSELL_SPECIFICATIONS',
+ 'XYY_TO_MUNSELL_GREYS_SPECIFICATIONS', 'NON_CONVERGING_XYY',
+ 'TestMunsellValuePriest1920', 'TestMunsellValueMunsell1933',
+ 'TestMunsellValueMoon1943', 'TestMunsellValueSaunderson1944',
+ 'TestMunsellValueLadd1955', 'TestMunsellValueMcCamy1992',
+ 'TestMunsellValueASTMD153508', 'TestMunsellSpecification_to_xyY',
+ 'TestMunsellColour_to_xyY', 'TestxyY_to_munsell_specification',
+ 'TestxyY_to_munsell_colour', 'TestParseMunsellColour',
+ 'TestIsGreyMunsellColour', 'TestNormalizeMunsellSpecification',
+ 'TestMunsellColourToMunsellSpecification',
+ 'TestMunsellSpecificationToMunsellColour', 'Test_xyY_fromRenotation',
+ 'TestIsSpecificationInRenotation', 'TestBoundingHuesFromRenotation',
+ 'TestHueToHueAngle', 'TestHueAngleToHue', 'TestHueTo_ASTM_hue',
+ 'TestInterpolationMethodFromRenotationOvoid',
+ 'Test_xy_fromRenotationOvoid', 'TestLCHabToMunsellSpecification',
+ 'TestMaximumChromaFromRenotation', 'TestMunsellSpecification_to_xy'
+]
# TODO: Investigate if tests can be simplified by using a common valid set of
# specifications.
-MUNSELL_SPECIFICATIONS = np.array([
- [2.500000000000000, 7.965379847082716, 11.928546308350969, 4],
- [2.500000000000000, 6.197794822090879, 6.923610826208884, 4],
- [2.500000000000000, 5.311956978256753, 2.000000000000000, 4],
- [5.613007062442384, 8.402756538070792, 18.565908940443911, 4],
- [5.845640071004907, 8.062638664520136, 5.782325614552295, 4],
- [5.780794121059599, 3.174804081025836, 3.349208682559149, 4],
- [5.483684299639117, 3.899412099408013, 5.761459062506715, 4],
- [5.809580308813496, 5.816975143899512, 6.662613753958899, 4],
- [5.209252955662903, 2.977036448356911, 5.141472643810014, 4],
- [7.706105853911573, 2.789942201654241, 11.396648897274897, 4],
- [7.567594286746361, 9.569378264154928, 16.714918860774414, 4],
- [8.117640564564343, 2.748942965149203, 3.165356383264027, 4],
- [7.873120301231125, 2.643847262009281, 13.241107969297714, 4],
- [8.049833222142890, 2.463064987097342, 7.501924679081063, 4],
- [8.355307569391062, 2.703242274198649, 11.925441344336392, 4],
- [8.342795760577609, 1.062744669123403, 6.298818145909256, 4],
- [7.594724402006285, 1.575074512180332, 4.626613135331287, 4],
- [8.195177866085791, 8.732504313513864, 23.571122010181508, 4],
- [7.754763634912469, 8.437206137825585, 21.009449010610680, 4],
- [9.010231962978862, 6.131271188386640, 6.803370568930175, 4],
- [9.041566851651622, 6.454053198559397, 17.010037203566448, 4],
- [9.915652169827913, 8.564387976791460, 11.131082159884320, 4],
- [10.000000000000000, 8.651470349341308, 27.322046186799103, 4],
- [9.961336111598143, 8.039682739223524, 13.200098633440559, 4],
- [9.887406551063181, 8.321342653987184, 2.066096323559838, 4],
- [10.000000000000000, 3.400787121787084, 2.570093220097414, 4],
- [10.000000000000000, 3.063915609453643, 13.514066607169514, 4],
- [10.000000000000000, 5.461465491798149, 12.753899774963989, 4],
- [10.000000000000000, 5.900814094860590, 15.244598276849418, 4],
- [10.000000000000000, 5.422208705414755, 27.929001019877095, 4],
- [9.757039645743053, 5.653647411872443, 3.411287127078690, 4],
- [10.000000000000000, 5.790357134071424, 24.863601306584311, 4],
- [9.862075817629322, 4.487864213671867, 7.671968095000380, 4],
- [3.214093719801356, 9.345163595199718, 3.436793937608287, 3],
- [3.484005759599379, 9.572118958552942, 14.905079424139613, 3],
- [3.196703526060703, 9.059573376604588, 24.780031389053288, 3],
- [2.500000000000000, 9.479129956842218, 27.736581704977635, 3],
- [2.790876344933768, 8.166099921946278, 20.868304564027603, 3],
- [3.221499566897477, 5.507741920664265, 5.467726257137659, 3],
- [2.622512070432247, 5.989380652373817, 19.364472252973304, 3],
- [3.287306102484981, 5.439892524933965, 19.855724192587914, 3],
- [5.727612405003367, 3.013295327457818, 10.746642552166502, 3],
- [5.347955701149093, 3.003537709503816, 18.900471815194905, 3],
- [5.738575171320432, 3.987559993529851, 4.223160837759656, 3],
- [5.720824103581511, 1.804037523043165, 4.878068159363519, 3],
- [5.316780024484356, 1.030508013578952, 8.043957606541364, 3],
- [5.762323000831238, 1.654193495936313, 9.507411716255689, 3],
- [5.985579505387595, 2.210976567398028, 14.803434527189347, 3],
- [5.461619603420755, 2.805568235937479, 6.647154736097002, 3],
- [7.838277926195208, 2.805050016159560, 6.238528025218592, 3],
- [8.283061396817500, 2.716343821673611, 10.350825174769154, 3],
- [7.603155032355272, 6.139421295158034, 29.139541165198704, 3],
- [8.324115039527976, 6.971801555303874, 23.515778973195257, 3],
- [8.444242731246860, 6.657492305333222, 2.413084311304666, 3],
- [8.309061774521076, 6.371190719454564, 17.507252134514488, 3],
- [8.140371170680920, 2.686857386753684, 14.649933295354042, 3],
- [8.484903553213694, 2.205704517797600, 11.879562262633948, 3],
- [8.454109029623016, 2.363050628470814, 4.606317173304252, 3],
- [8.305262429168986, 5.460535517182709, 3.904507271901792, 3],
- [8.189730004579287, 5.069933398792441, 28.126992759236863, 3],
- [7.540287781074750, 5.779995612547662, 6.635319193935916, 3],
- [7.962999134236298, 5.233597701388516, 20.293354805626866, 3],
- [8.432959559038371, 5.797128354507666, 26.469970873757067, 3],
- [10.000000000000000, 9.005161484782885, 6.046995658143270, 3],
- [9.771353946056914, 9.383759836829901, 20.829752715478890, 3],
- [9.376380796522223, 9.460448204508941, 13.348522394106682, 3],
- [9.912704179532229, 4.057804958576875, 25.778231770351923, 3],
- [10.000000000000000, 4.853695964045051, 13.712247643370837, 3],
- [10.000000000000000, 4.221211292509457, 28.587923360931033, 3],
- [9.287535146732925, 4.404206868704275, 6.997389565284625, 3],
- [10.000000000000000, 5.717897422867529, 30.932435068478792, 3],
- [10.000000000000000, 5.121046242854478, 7.946854746461393, 3],
- [10.000000000000000, 5.631186501571907, 26.172410297895773, 3],
- [2.500000000000000, 6.822278767379375, 12.643410557057086, 2],
- [2.500000000000000, 3.343559643400603, 19.167537762557394, 2],
- [3.284581774573411, 3.745747765546542, 10.316761862277126, 2],
- [3.081407549428113, 3.302789020993419, 4.031683724514751, 2],
- [2.500000000000000, 9.595267222759654, 9.136435041220121, 2],
- [2.589916911553009, 9.550557855080539, 8.263133397233354, 2],
- [2.534263462549973, 9.494299074607266, 14.863663104253218, 2],
- [5.275920564662094, 9.022820187513741, 12.879135949769728, 2],
- [5.522856449128964, 9.387711396347438, 17.412586595686815, 2],
- [5.885914939777947, 9.191119089368966, 17.388086814072437, 2],
- [5.471740111697462, 9.868862187868638, 11.646848538821667, 2],
- [5.956560321967156, 4.186123335197883, 4.311690204814390, 2],
- [5.627911194894264, 4.547202429787774, 16.566819144431150, 2],
- [5.853454724533456, 4.592599799739227, 18.835069805085350, 2],
- [5.144720369630256, 5.318575486426688, 18.979172966805407, 2],
- [5.290707446388017, 6.000990946276877, 13.598520998056053, 2],
- [5.415844403197766, 6.398031110922737, 15.178617464461626, 2],
- [8.204144852288245, 5.902107978077237, 4.020177691372295, 2],
- [9.366069953403018, 3.372865386949827, 15.422766182794579, 2],
- [10.000000000000000, 3.949081763597084, 9.192387616705815, 2],
- [10.000000000000000, 3.187455579956449, 15.954247893607032, 2],
- [9.260586271537607, 3.454517733921040, 10.595175791701619, 2],
- [9.571675864670619, 3.149737124891618, 17.398847531397934, 2],
- [3.238739382175979, 4.827650915864795, 3.743510694098863, 1],
- [2.500000000000000, 4.302204354084260, 7.399343614420917, 1],
- [2.500000000000000, 4.329470943798639, 8.860840417367838, 1],
- [2.500000000000000, 7.620094327678255, 10.887265616829124, 1],
- [2.500000000000000, 7.144999653185772, 10.102335374185911, 1],
- [2.610434945585585, 7.700939489093993, 4.236171515065992, 1],
- [2.500000000000000, 8.524455647347406, 5.361363698027430, 1],
- [3.173101460658481, 8.133658146416419, 15.199536235308303, 1],
- [2.500000000000000, 7.129372162253073, 5.420260862573993, 1],
- [2.500000000000000, 7.708509850248770, 9.619364938403443, 1],
- [3.252581509053177, 7.081532543557421, 6.222406020434375, 1],
- [2.500000000000000, 7.675579449401560, 12.261808397585057, 1],
- [2.500000000000000, 3.482580786553791, 7.768505546917617, 1],
- [2.500000000000000, 3.020783157962588, 6.998840911724095, 1],
- [3.020562119690717, 3.122317490920135, 5.203087539105082, 1],
- [5.219091168761326, 3.007065595158593, 13.573887550967275, 1],
- [5.596250628047351, 2.157282552163390, 5.165106850365733, 1],
- [5.078574838897358, 2.963755264589505, 6.859942724404370, 1],
- [5.175617155844582, 2.772951703906637, 4.560800382141030, 1],
- [5.497353020782844, 5.410551418942688, 2.000000000000000, 1],
- [5.841773513544001, 5.686667624085427, 13.289365667818551, 1],
- [5.580549185463668, 6.964187735662777, 16.180320149263402, 1],
- [5.287772726922527, 6.865396694853934, 14.098946461580404, 1],
- [8.358221285614269, 4.591594256415192, 17.271563597297103, 1],
- [7.877244796359770, 4.744438140664897, 5.598934346859475, 1],
- [8.323336953587479, 4.566800376285041, 7.088152366811920, 1],
- [7.845486096299681, 4.586270737017715, 16.233795179282389, 1],
- [8.382569502344943, 4.562211644069123, 13.975124110876290, 1],
- [7.855593749782354, 3.238350356301548, 5.360435825061775, 1],
- [7.655501153733914, 3.903923881082662, 9.769593047963392, 1],
- [7.653019158008493, 6.348396270933699, 11.704589766625281, 1],
- [10.000000000000000, 2.717635329532909, 5.415846167802247, 1],
- [9.196648156004963, 8.150782934993490, 5.069223366759241, 1],
- [10.000000000000000, 6.040694822625091, 7.762802316406850, 1],
- [10.000000000000000, 6.719017792521678, 18.374375386402509, 1],
- [2.873950134580900, 3.510038900108437, 4.494521106912674, 10],
- [2.979763831715893, 8.564237486111701, 6.426710793964199, 10],
- [2.500000000000000, 8.924876646785982, 2.491252841450378, 10],
- [2.500000000000000, 8.121352187119456, 8.823379864036189, 10],
- [2.500000000000000, 4.643160393937538, 18.839339977864491, 10],
- [2.500000000000000, 4.925443059836121, 5.417711811598947, 10],
- [2.500000000000000, 8.509385882792433, 8.045356725346910, 10],
- [2.500000000000000, 2.709647356385667, 16.195810159806815, 10],
- [5.667887162619730, 1.844462206458549, 18.226010811743183, 10],
- [5.759673840199206, 1.960972599684376, 30.428731527415248, 10],
- [5.783634661463273, 1.536081970823734, 21.480194214511137, 10],
- [5.118173248862928, 1.540056335460298, 41.868473358578832, 10],
- [5.757349724389667, 1.638345335050530, 13.609604267804956, 10],
- [5.279304061296045, 4.900840641360432, 22.876127528048663, 10],
- [5.715709801059808, 4.570357108788123, 30.360213488022158, 10],
- [5.947947304520848, 4.273422536180247, 4.896643906619794, 10],
- [5.098993224817240, 4.947505227279317, 26.268750424752579, 10],
- [5.532229497629850, 4.629910893964432, 7.756449262721482, 10],
- [5.923584541768192, 4.593239396795306, 19.567605030849386, 10],
- [5.950156387030171, 2.424634993436330, 4.953666946161412, 10],
- [5.614158136535322, 2.481272758716141, 20.644953904366893, 10],
- [5.435908140730638, 2.788484759470275, 21.585064332200393, 10],
- [5.539908561343329, 2.986434402350627, 44.903699039953160, 10],
- [5.379251432099132, 2.137036038265424, 25.889074558828732, 10],
- [5.632909830682246, 5.934948211512451, 21.384042506861697, 10],
- [5.203326514932920, 5.825367195549048, 15.514467427422431, 10],
- [5.927793692134072, 5.448079050348612, 3.776639519741425, 10],
- [5.817322396187511, 5.292185862716667, 11.318041580907520, 10],
- [7.949960633591607, 2.873765731226449, 25.621368902089333, 10],
- [8.382592436810759, 2.461570417216745, 40.541271952926010, 10],
- [7.963797363322570, 2.200134671312228, 36.707318709966948, 10],
- [8.373924456610474, 2.306688315438474, 8.623846064990166, 10],
- [8.151990686473388, 2.262225123930558, 42.229127196458144, 10],
- [8.255027645326059, 9.609182815192318, 7.080986046028279, 10],
- [8.488384085232076, 8.098523111957578, 9.779628072315807, 10],
- [8.438357068876163, 2.689345228362070, 26.873452492074044, 10],
- [8.309434906530441, 2.462322901174240, 48.499663993444990, 10],
- [7.711579414965501, 2.724728645017314, 5.729859843354196, 10],
- [7.627374087940193, 2.225192393206842, 26.724973070776922, 10],
- [7.693923337226084, 2.657927412397889, 48.407897505690485, 10],
- [10.000000000000000, 6.197418391023862, 10.971953815910661, 10],
- [9.113097274740381, 6.270996638245157, 2.756464595173648, 10],
- [10.000000000000000, 9.235232580795238, 6.003388325186025, 10],
- [10.000000000000000, 5.050367446997329, 19.170756721559698, 10],
- [9.380110088755156, 5.535664930510515, 18.817507743754415, 10],
- [9.001795946577033, 7.786061808916703, 4.453854563212078, 10],
- [10.000000000000000, 7.692030956316567, 3.653159723688856, 10],
- [9.046182896421445, 3.043925987515629, 22.300946806849847, 10],
- [9.459420796383784, 3.037218855958692, 10.552556949414955, 10],
- [10.000000000000000, 3.322950626925242, 31.247622019812400, 10],
- [10.000000000000000, 3.100489343503265, 29.273434731152499, 10],
- [2.500000000000000, 7.990213836555715, 8.375074375178261, 9],
- [2.500000000000000, 7.298301069157875, 9.502846862649331, 9],
- [2.861900517122356, 7.275426002317967, 7.466126134628901, 9],
- [3.087422194135551, 8.485000561300847, 2.493857829360787, 9],
- [2.500000000000000, 3.690667859366627, 19.774716780756169, 9],
- [3.220553507003754, 3.281507210559706, 37.059380662726163, 9],
- [2.500000000000000, 3.898942841249920, 39.166418500944374, 9],
- [2.765403701684196, 3.116906918736094, 29.726535569137937, 9],
- [2.500000000000000, 3.703448940191029, 12.087654687250128, 9],
- [2.500000000000000, 3.433194385943258, 3.382852759577178, 9],
- [2.836612137080781, 3.992426583719960, 2.000000000000000, 9],
- [2.888854554705095, 3.247434603609590, 14.618307037832857, 9],
- [5.164399331990519, 6.234662742406393, 9.111465383743912, 9],
- [5.500356903003388, 6.736841239972426, 13.154128131968298, 9],
- [5.535810057742433, 6.970342536034459, 8.892716664134475, 9],
- [5.590040966343994, 3.566860968884717, 22.756612786898550, 9],
- [5.282620261743346, 3.236734032301957, 18.732823688754383, 9],
- [5.172895640160181, 3.004305123123196, 6.229254345814851, 9],
- [5.259721854731981, 3.300433342987486, 35.890872110681414, 9],
- [5.553646341595925, 3.494850834989339, 10.076683709549055, 9],
- [5.730003972159145, 2.488034141173207, 15.985698390269977, 9],
- [5.782381516990652, 2.481204541395183, 28.774618518379302, 9],
- [5.069379781665461, 6.741533325352479, 2.219484171420659, 9],
- [5.134679670979660, 6.103139133682482, 27.726398643923417, 9],
- [5.383260687864624, 5.560997841342890, 18.302295934127923, 9],
- [5.869792088464701, 5.233311379347905, 32.553432167966633, 9],
- [5.462451143540612, 5.746471808899983, 30.948864634440213, 9],
- [5.357445269639698, 5.688526671944410, 5.261434469006405, 9],
- [5.626373453003034, 5.771003693827525, 25.170846666445236, 9],
- [8.284200895164993, 2.466049819474928, 17.238899804160177, 9],
- [8.318102784124019, 2.265803572668724, 22.596147383535918, 9],
- [7.851936866242713, 7.452293353458780, 20.962374407911458, 9],
- [8.146081336032703, 7.714405906472637, 13.533962918469337, 9],
- [8.097208643162750, 7.247339841946607, 17.338991550524540, 9],
- [7.830256291991797, 6.872416994269415, 10.706822163825924, 9],
- [7.800658970688480, 6.330678323824742, 6.211375680877805, 9],
- [8.044863647118635, 6.808226317611471, 15.557155261544228, 9],
- [8.461774802909071, 4.745965252820717, 36.037296939777320, 9],
- [7.612382882207284, 4.372367470892327, 14.168690780706225, 9],
- [8.169633927695997, 4.488334738003570, 27.235846103864411, 9],
- [9.602031136015775, 5.527970638413552, 20.580635675818101, 9],
- [9.663686030178818, 5.516978463101205, 29.047658472982956, 9],
- [9.752928547364711, 5.461162553197844, 34.114931605281292, 9],
- [10.000000000000000, 5.650424904167431, 4.216215730437086, 9],
- [10.000000000000000, 5.736543677665970, 34.728526755839162, 9],
- [10.000000000000000, 5.436085484926386, 14.779627294882367, 9],
- [10.000000000000000, 5.795441557952790, 2.000000000000000, 9],
- [9.497050913948730, 5.914105479148815, 10.808854780098731, 9],
- [9.826635163465532, 1.975999288230087, 7.067114431849850, 9],
- [9.382502350301259, 4.709738717837755, 19.999476877446362, 9],
- [9.115530591819274, 4.986025386567032, 5.883436488694818, 9],
- [10.000000000000000, 4.813033015882831, 24.745870232952445, 9],
- [9.378359588580793, 4.574376802251692, 26.295787257422923, 9],
- [10.000000000000000, 2.170932245950155, 21.572576356602351, 9],
- [10.000000000000000, 2.571304614356922, 26.039872491235577, 9],
- [2.500000000000000, 2.635760551271271, 4.712138166253982, 8],
- [2.887457866682928, 2.033768154097059, 13.994896052145748, 8],
- [3.435419560439465, 2.229919086421125, 6.718989113532732, 8],
- [2.992533606273717, 1.928933557645075, 7.198014339866309, 8],
- [2.500000000000000, 1.372689060484596, 14.156726710024465, 8],
- [2.610457928897581, 1.213770481399764, 3.345815626895192, 8],
- [5.167065304553812, 7.761502840367845, 2.140948156850635, 8],
- [5.054434114346951, 7.011456904063963, 6.442157332603133, 8],
- [5.803735682450612, 8.512993454403910, 10.443841773523394, 8],
- [5.044877539779968, 6.342036003669621, 18.424428701407553, 8],
- [5.484832402621484, 6.739510598555563, 5.474777491295647, 8],
- [5.162300427200289, 6.576722169349890, 24.999056248525125, 8],
- [5.877256360743413, 6.789776791182118, 15.450444143259661, 8],
- [8.197449080109873, 2.209298497930928, 2.000000000000000, 8],
- [7.997237265754237, 2.060313094466323, 11.655829335806517, 8],
- [7.973192560907184, 8.671283074887089, 4.272886886879181, 8],
- [7.836498646186221, 8.168701526186094, 13.596658717999025, 8],
- [7.782186965908517, 9.202193528464585, 13.902105524067945, 8],
- [9.531795266771761, 5.037755377967032, 2.000000000000000, 8],
- [10.000000000000000, 5.416612103313970, 11.055624912778937, 8],
- [9.312270837393163, 7.466203120412419, 11.185222099189973, 8],
- [10.000000000000000, 7.097905887270363, 13.895455902446677, 8],
- [9.925669940032272, 4.692192166283825, 7.204078988766796, 8],
- [9.416740882402403, 4.697368796121149, 8.720116348180492, 8],
- [10.000000000000000, 4.338509514756336, 16.469698910991372, 8],
- [10.000000000000000, 6.402201264456283, 6.599237233947309, 8],
- [10.000000000000000, 5.182208073338139, 4.550269784467781, 8],
- [9.970332530519679, 5.903209540812212, 10.837022722087644, 8],
- [2.962707587174585, 9.251352163485700, 9.999116931630539, 7],
- [3.167205272899491, 9.141134617154027, 7.383624729892915, 7],
- [2.500000000000000, 5.049858089466979, 17.881593853007615, 7],
- [2.741501863896628, 5.680976628228491, 18.002908737801381, 7],
- [2.500000000000000, 5.848115418935317, 10.232668996271492, 7],
- [2.877902226185231, 5.567414385297515, 3.558203423120179, 7],
- [2.500000000000000, 5.853445073334600, 27.779995926916971, 7],
- [5.412821771284458, 2.521454920411534, 7.258040020605607, 7],
- [5.837547476050840, 2.530273181625722, 11.998261380615471, 7],
- [5.969397543974988, 4.348770633848800, 14.397906420283302, 7],
- [5.004079000563381, 4.657273345320005, 22.736677614468775, 7],
- [5.168438425945292, 4.246412717207690, 4.844860547907693, 7],
- [5.863284315202094, 4.359153796629064, 23.489710023246513, 7],
- [5.756333389411959, 8.952011225713635, 7.301135618422141, 7],
- [5.108337403014788, 8.311542024325179, 11.359771531491097, 7],
- [8.314898437378535, 9.185953513281046, 4.238233636005843, 7],
- [8.201460399608226, 4.230965415446139, 11.589840844520428, 7],
- [7.595604919273442, 4.884451138651340, 6.798265747221928, 7],
- [8.378186361828917, 9.484819582257831, 8.022357890675561, 7],
- [8.028236284464779, 9.757701617444052, 11.574198271062086, 7],
- [8.229270762113973, 8.691786353579515, 6.350022396927342, 7],
- [10.000000000000000, 3.305950965855861, 3.115225963548792, 7],
- [9.756267998308681, 3.186360651735488, 14.803384721914584, 7],
- [10.000000000000000, 3.504689167815543, 13.901609609717390, 7],
- [10.000000000000000, 8.784136629159212, 6.218490965882184, 7],
- [10.000000000000000, 8.374345283261381, 13.887493044276624, 7],
- [10.000000000000000, 4.614045878641700, 14.689071599466930, 7],
- [10.000000000000000, 8.033037300917030, 13.518172354943417, 7],
- [2.745564054714475, 1.652100185202669, 5.569110673549164, 6],
- [3.145288089149191, 5.155515834056653, 8.595832717291000, 6],
- [2.500000000000000, 4.389047661368727, 4.950679151608691, 6],
- [2.500000000000000, 4.394863837189541, 4.383231249423155, 6],
- [2.500000000000000, 1.558025251052636, 3.307282274836235, 6],
- [5.045583268005572, 8.635334543903529, 9.591945248602441, 6],
- [5.594284526041456, 8.632025269800300, 10.197201238166286, 6],
- [5.988802467213943, 8.132531816914582, 12.305951956169229, 6],
- [5.425850947396252, 5.185445600639579, 8.046156862703112, 6],
- [5.369364240119585, 5.088077743168478, 7.340573827339962, 6],
- [5.702045821590509, 5.271793984998375, 10.325652051724541, 6],
- [5.411096326958829, 5.545898372969883, 5.292034843095026, 6],
- [8.242968536635763, 9.082400742895011, 4.900205865328810, 6],
- [8.050426422258862, 9.780537958506372, 18.978339720751418, 6],
- [8.238754570485817, 8.602489911338367, 5.941330110378650, 6],
- [8.395684243897479, 4.506736427736353, 9.461515968715135, 6],
- [10.000000000000000, 5.138757136469953, 12.704963485646498, 6],
- [10.000000000000000, 5.159912610631281, 15.675370760759400, 6],
- [10.000000000000000, 5.549472965121217, 3.506573388368494, 6],
- [10.000000000000000, 5.795090421330749, 14.063922879568509, 6],
- [10.000000000000000, 6.983123234599715, 3.128443413944953, 6],
- [10.000000000000000, 6.680204754366847, 11.632405914314647, 6],
- [9.050263182466011, 6.721800647918977, 17.083676942759791, 6],
- [10.000000000000000, 6.063461620134571, 4.736966947326921, 6],
- [9.409402543801862, 6.944203630692490, 6.287660211686590, 6],
- [9.633394604006961, 7.505827554006868, 4.623044001702525, 6],
- [9.020770192275748, 7.313879416061702, 13.422245014577644, 6],
- [9.263176096861541, 7.357994930871833, 15.233295182477667, 6],
- [3.332782026387723, 7.225679089752617, 16.113419977677538, 5],
- [2.500000000000000, 5.428663116358418, 6.543649602836132, 5],
- [2.500000000000000, 2.829072524106358, 2.000000000000000, 5],
- [2.828559184243374, 8.730390823623916, 21.473258817290873, 5],
- [2.500000000000000, 8.170120100361350, 12.020108658634838, 5],
- [2.500000000000000, 8.743540456183981, 14.427904414153719, 5],
- [2.500000000000000, 4.638913962811717, 8.380243803410817, 5],
- [3.363079416671538, 4.670651645625486, 2.775509664209031, 5],
- [5.339079962653624, 8.064094823108675, 16.611574939424255, 5],
- [5.347356764781598, 8.436417621014639, 15.412165198232049, 5],
- [5.368950609634622, 7.371653807185894, 7.038165919924306, 5],
- [5.929552854535908, 6.895926920816455, 7.572813447048060, 5],
- [5.727946559508910, 6.581660847859535, 10.668172633934036, 5],
- [5.641782139668679, 6.458019104693064, 9.549016885745186, 5],
- [5.344359642058747, 2.871097758194079, 5.430489560972486, 5],
- [7.749909297802317, 4.328832721055091, 4.268933751175051, 5],
- [8.145409228909998, 4.865021714408405, 7.545633529064384, 5],
- [7.907253670159305, 5.688395096546548, 10.770986229289623, 5],
- [7.592508492261312, 5.098997604455221, 4.933568344499713, 5],
- [7.674872690410821, 5.441049019888879, 3.550245288479484, 5],
- [7.991979987062054, 6.616295483614106, 3.283701248747225, 5],
- [9.345599185286883, 7.224736586735167, 17.488521757881820, 5],
- [9.659595218511388, 7.899577776723924, 3.357217748484464, 5]])
+# yapf: disable
+MUNSELL_SPECIFICATIONS = np.array(
+ [[2.500000000000000, 7.965379847082716, 11.928546308350969, 4],
+ [2.500000000000000, 6.197794822090879, 6.923610826208884, 4],
+ [2.500000000000000, 5.311956978256753, 2.000000000000000, 4],
+ [5.613007062442384, 8.402756538070792, 18.565908940443911, 4],
+ [5.845640071004907, 8.062638664520136, 5.782325614552295, 4],
+ [5.780794121059599, 3.174804081025836, 3.349208682559149, 4],
+ [5.483684299639117, 3.899412099408013, 5.761459062506715, 4],
+ [5.809580308813496, 5.816975143899512, 6.662613753958899, 4],
+ [5.209252955662903, 2.977036448356911, 5.141472643810014, 4],
+ [7.706105853911573, 2.789942201654241, 11.396648897274897, 4],
+ [7.567594286746361, 9.569378264154928, 16.714918860774414, 4],
+ [8.117640564564343, 2.748942965149203, 3.165356383264027, 4],
+ [7.873120301231125, 2.643847262009281, 13.241107969297714, 4],
+ [8.049833222142890, 2.463064987097342, 7.501924679081063, 4],
+ [8.355307569391062, 2.703242274198649, 11.925441344336392, 4],
+ [8.342795760577609, 1.062744669123403, 6.298818145909256, 4],
+ [7.594724402006285, 1.575074512180332, 4.626613135331287, 4],
+ [8.195177866085791, 8.732504313513864, 23.571122010181508, 4],
+ [7.754763634912469, 8.437206137825585, 21.009449010610680, 4],
+ [9.010231962978862, 6.131271188386640, 6.803370568930175, 4],
+ [9.041566851651622, 6.454053198559397, 17.010037203566448, 4],
+ [9.915652169827913, 8.564387976791460, 11.131082159884320, 4],
+ [10.000000000000000, 8.651470349341308, 27.322046186799103, 4],
+ [9.961336111598143, 8.039682739223524, 13.200098633440559, 4],
+ [9.887406551063181, 8.321342653987184, 2.066096323559838, 4],
+ [10.000000000000000, 3.400787121787084, 2.570093220097414, 4],
+ [10.000000000000000, 3.063915609453643, 13.514066607169514, 4],
+ [10.000000000000000, 5.461465491798149, 12.753899774963989, 4],
+ [10.000000000000000, 5.900814094860590, 15.244598276849418, 4],
+ [10.000000000000000, 5.422208705414755, 27.929001019877095, 4],
+ [9.757039645743053, 5.653647411872443, 3.411287127078690, 4],
+ [10.000000000000000, 5.790357134071424, 24.863601306584311, 4],
+ [9.862075817629322, 4.487864213671867, 7.671968095000380, 4],
+ [3.214093719801356, 9.345163595199718, 3.436793937608287, 3],
+ [3.484005759599379, 9.572118958552942, 14.905079424139613, 3],
+ [3.196703526060703, 9.059573376604588, 24.780031389053288, 3],
+ [2.500000000000000, 9.479129956842218, 27.736581704977635, 3],
+ [2.790876344933768, 8.166099921946278, 20.868304564027603, 3],
+ [3.221499566897477, 5.507741920664265, 5.467726257137659, 3],
+ [2.622512070432247, 5.989380652373817, 19.364472252973304, 3],
+ [3.287306102484981, 5.439892524933965, 19.855724192587914, 3],
+ [5.727612405003367, 3.013295327457818, 10.746642552166502, 3],
+ [5.347955701149093, 3.003537709503816, 18.900471815194905, 3],
+ [5.738575171320432, 3.987559993529851, 4.223160837759656, 3],
+ [5.720824103581511, 1.804037523043165, 4.878068159363519, 3],
+ [5.316780024484356, 1.030508013578952, 8.043957606541364, 3],
+ [5.762323000831238, 1.654193495936313, 9.507411716255689, 3],
+ [5.985579505387595, 2.210976567398028, 14.803434527189347, 3],
+ [5.461619603420755, 2.805568235937479, 6.647154736097002, 3],
+ [7.838277926195208, 2.805050016159560, 6.238528025218592, 3],
+ [8.283061396817500, 2.716343821673611, 10.350825174769154, 3],
+ [7.603155032355272, 6.139421295158034, 29.139541165198704, 3],
+ [8.324115039527976, 6.971801555303874, 23.515778973195257, 3],
+ [8.444242731246860, 6.657492305333222, 2.413084311304666, 3],
+ [8.309061774521076, 6.371190719454564, 17.507252134514488, 3],
+ [8.140371170680920, 2.686857386753684, 14.649933295354042, 3],
+ [8.484903553213694, 2.205704517797600, 11.879562262633948, 3],
+ [8.454109029623016, 2.363050628470814, 4.606317173304252, 3],
+ [8.305262429168986, 5.460535517182709, 3.904507271901792, 3],
+ [8.189730004579287, 5.069933398792441, 28.126992759236863, 3],
+ [7.540287781074750, 5.779995612547662, 6.635319193935916, 3],
+ [7.962999134236298, 5.233597701388516, 20.293354805626866, 3],
+ [8.432959559038371, 5.797128354507666, 26.469970873757067, 3],
+ [10.000000000000000, 9.005161484782885, 6.046995658143270, 3],
+ [9.771353946056914, 9.383759836829901, 20.829752715478890, 3],
+ [9.376380796522223, 9.460448204508941, 13.348522394106682, 3],
+ [9.912704179532229, 4.057804958576875, 25.778231770351923, 3],
+ [10.000000000000000, 4.853695964045051, 13.712247643370837, 3],
+ [10.000000000000000, 4.221211292509457, 28.587923360931033, 3],
+ [9.287535146732925, 4.404206868704275, 6.997389565284625, 3],
+ [10.000000000000000, 5.717897422867529, 30.932435068478792, 3],
+ [10.000000000000000, 5.121046242854478, 7.946854746461393, 3],
+ [10.000000000000000, 5.631186501571907, 26.172410297895773, 3],
+ [2.500000000000000, 6.822278767379375, 12.643410557057086, 2],
+ [2.500000000000000, 3.343559643400603, 19.167537762557394, 2],
+ [3.284581774573411, 3.745747765546542, 10.316761862277126, 2],
+ [3.081407549428113, 3.302789020993419, 4.031683724514751, 2],
+ [2.500000000000000, 9.595267222759654, 9.136435041220121, 2],
+ [2.589916911553009, 9.550557855080539, 8.263133397233354, 2],
+ [2.534263462549973, 9.494299074607266, 14.863663104253218, 2],
+ [5.275920564662094, 9.022820187513741, 12.879135949769728, 2],
+ [5.522856449128964, 9.387711396347438, 17.412586595686815, 2],
+ [5.885914939777947, 9.191119089368966, 17.388086814072437, 2],
+ [5.471740111697462, 9.868862187868638, 11.646848538821667, 2],
+ [5.956560321967156, 4.186123335197883, 4.311690204814390, 2],
+ [5.627911194894264, 4.547202429787774, 16.566819144431150, 2],
+ [5.853454724533456, 4.592599799739227, 18.835069805085350, 2],
+ [5.144720369630256, 5.318575486426688, 18.979172966805407, 2],
+ [5.290707446388017, 6.000990946276877, 13.598520998056053, 2],
+ [5.415844403197766, 6.398031110922737, 15.178617464461626, 2],
+ [8.204144852288245, 5.902107978077237, 4.020177691372295, 2],
+ [9.366069953403018, 3.372865386949827, 15.422766182794579, 2],
+ [10.000000000000000, 3.949081763597084, 9.192387616705815, 2],
+ [10.000000000000000, 3.187455579956449, 15.954247893607032, 2],
+ [9.260586271537607, 3.454517733921040, 10.595175791701619, 2],
+ [9.571675864670619, 3.149737124891618, 17.398847531397934, 2],
+ [3.238739382175979, 4.827650915864795, 3.743510694098863, 1],
+ [2.500000000000000, 4.302204354084260, 7.399343614420917, 1],
+ [2.500000000000000, 4.329470943798639, 8.860840417367838, 1],
+ [2.500000000000000, 7.620094327678255, 10.887265616829124, 1],
+ [2.500000000000000, 7.144999653185772, 10.102335374185911, 1],
+ [2.610434945585585, 7.700939489093993, 4.236171515065992, 1],
+ [2.500000000000000, 8.524455647347406, 5.361363698027430, 1],
+ [3.173101460658481, 8.133658146416419, 15.199536235308303, 1],
+ [2.500000000000000, 7.129372162253073, 5.420260862573993, 1],
+ [2.500000000000000, 7.708509850248770, 9.619364938403443, 1],
+ [3.252581509053177, 7.081532543557421, 6.222406020434375, 1],
+ [2.500000000000000, 7.675579449401560, 12.261808397585057, 1],
+ [2.500000000000000, 3.482580786553791, 7.768505546917617, 1],
+ [2.500000000000000, 3.020783157962588, 6.998840911724095, 1],
+ [3.020562119690717, 3.122317490920135, 5.203087539105082, 1],
+ [5.219091168761326, 3.007065595158593, 13.573887550967275, 1],
+ [5.596250628047351, 2.157282552163390, 5.165106850365733, 1],
+ [5.078574838897358, 2.963755264589505, 6.859942724404370, 1],
+ [5.175617155844582, 2.772951703906637, 4.560800382141030, 1],
+ [5.497353020782844, 5.410551418942688, 2.000000000000000, 1],
+ [5.841773513544001, 5.686667624085427, 13.289365667818551, 1],
+ [5.580549185463668, 6.964187735662777, 16.180320149263402, 1],
+ [5.287772726922527, 6.865396694853934, 14.098946461580404, 1],
+ [8.358221285614269, 4.591594256415192, 17.271563597297103, 1],
+ [7.877244796359770, 4.744438140664897, 5.598934346859475, 1],
+ [8.323336953587479, 4.566800376285041, 7.088152366811920, 1],
+ [7.845486096299681, 4.586270737017715, 16.233795179282389, 1],
+ [8.382569502344943, 4.562211644069123, 13.975124110876290, 1],
+ [7.855593749782354, 3.238350356301548, 5.360435825061775, 1],
+ [7.655501153733914, 3.903923881082662, 9.769593047963392, 1],
+ [7.653019158008493, 6.348396270933699, 11.704589766625281, 1],
+ [10.000000000000000, 2.717635329532909, 5.415846167802247, 1],
+ [9.196648156004963, 8.150782934993490, 5.069223366759241, 1],
+ [10.000000000000000, 6.040694822625091, 7.762802316406850, 1],
+ [10.000000000000000, 6.719017792521678, 18.374375386402509, 1],
+ [2.873950134580900, 3.510038900108437, 4.494521106912674, 10],
+ [2.979763831715893, 8.564237486111701, 6.426710793964199, 10],
+ [2.500000000000000, 8.924876646785982, 2.491252841450378, 10],
+ [2.500000000000000, 8.121352187119456, 8.823379864036189, 10],
+ [2.500000000000000, 4.643160393937538, 18.839339977864491, 10],
+ [2.500000000000000, 4.925443059836121, 5.417711811598947, 10],
+ [2.500000000000000, 8.509385882792433, 8.045356725346910, 10],
+ [2.500000000000000, 2.709647356385667, 16.195810159806815, 10],
+ [5.667887162619730, 1.844462206458549, 18.226010811743183, 10],
+ [5.759673840199206, 1.960972599684376, 30.428731527415248, 10],
+ [5.783634661463273, 1.536081970823734, 21.480194214511137, 10],
+ [5.118173248862928, 1.540056335460298, 41.868473358578832, 10],
+ [5.757349724389667, 1.638345335050530, 13.609604267804956, 10],
+ [5.279304061296045, 4.900840641360432, 22.876127528048663, 10],
+ [5.715709801059808, 4.570357108788123, 30.360213488022158, 10],
+ [5.947947304520848, 4.273422536180247, 4.896643906619794, 10],
+ [5.098993224817240, 4.947505227279317, 26.268750424752579, 10],
+ [5.532229497629850, 4.629910893964432, 7.756449262721482, 10],
+ [5.923584541768192, 4.593239396795306, 19.567605030849386, 10],
+ [5.950156387030171, 2.424634993436330, 4.953666946161412, 10],
+ [5.614158136535322, 2.481272758716141, 20.644953904366893, 10],
+ [5.435908140730638, 2.788484759470275, 21.585064332200393, 10],
+ [5.539908561343329, 2.986434402350627, 44.903699039953160, 10],
+ [5.379251432099132, 2.137036038265424, 25.889074558828732, 10],
+ [5.632909830682246, 5.934948211512451, 21.384042506861697, 10],
+ [5.203326514932920, 5.825367195549048, 15.514467427422431, 10],
+ [5.927793692134072, 5.448079050348612, 3.776639519741425, 10],
+ [5.817322396187511, 5.292185862716667, 11.318041580907520, 10],
+ [7.949960633591607, 2.873765731226449, 25.621368902089333, 10],
+ [8.382592436810759, 2.461570417216745, 40.541271952926010, 10],
+ [7.963797363322570, 2.200134671312228, 36.707318709966948, 10],
+ [8.373924456610474, 2.306688315438474, 8.623846064990166, 10],
+ [8.151990686473388, 2.262225123930558, 42.229127196458144, 10],
+ [8.255027645326059, 9.609182815192318, 7.080986046028279, 10],
+ [8.488384085232076, 8.098523111957578, 9.779628072315807, 10],
+ [8.438357068876163, 2.689345228362070, 26.873452492074044, 10],
+ [8.309434906530441, 2.462322901174240, 48.499663993444990, 10],
+ [7.711579414965501, 2.724728645017314, 5.729859843354196, 10],
+ [7.627374087940193, 2.225192393206842, 26.724973070776922, 10],
+ [7.693923337226084, 2.657927412397889, 48.407897505690485, 10],
+ [10.000000000000000, 6.197418391023862, 10.971953815910661, 10],
+ [9.113097274740381, 6.270996638245157, 2.756464595173648, 10],
+ [10.000000000000000, 9.235232580795238, 6.003388325186025, 10],
+ [10.000000000000000, 5.050367446997329, 19.170756721559698, 10],
+ [9.380110088755156, 5.535664930510515, 18.817507743754415, 10],
+ [9.001795946577033, 7.786061808916703, 4.453854563212078, 10],
+ [10.000000000000000, 7.692030956316567, 3.653159723688856, 10],
+ [9.046182896421445, 3.043925987515629, 22.300946806849847, 10],
+ [9.459420796383784, 3.037218855958692, 10.552556949414955, 10],
+ [10.000000000000000, 3.322950626925242, 31.247622019812400, 10],
+ [10.000000000000000, 3.100489343503265, 29.273434731152499, 10],
+ [2.500000000000000, 7.990213836555715, 8.375074375178261, 9],
+ [2.500000000000000, 7.298301069157875, 9.502846862649331, 9],
+ [2.861900517122356, 7.275426002317967, 7.466126134628901, 9],
+ [3.087422194135551, 8.485000561300847, 2.493857829360787, 9],
+ [2.500000000000000, 3.690667859366627, 19.774716780756169, 9],
+ [3.220553507003754, 3.281507210559706, 37.059380662726163, 9],
+ [2.500000000000000, 3.898942841249920, 39.166418500944374, 9],
+ [2.765403701684196, 3.116906918736094, 29.726535569137937, 9],
+ [2.500000000000000, 3.703448940191029, 12.087654687250128, 9],
+ [2.500000000000000, 3.433194385943258, 3.382852759577178, 9],
+ [2.836612137080781, 3.992426583719960, 2.000000000000000, 9],
+ [2.888854554705095, 3.247434603609590, 14.618307037832857, 9],
+ [5.164399331990519, 6.234662742406393, 9.111465383743912, 9],
+ [5.500356903003388, 6.736841239972426, 13.154128131968298, 9],
+ [5.535810057742433, 6.970342536034459, 8.892716664134475, 9],
+ [5.590040966343994, 3.566860968884717, 22.756612786898550, 9],
+ [5.282620261743346, 3.236734032301957, 18.732823688754383, 9],
+ [5.172895640160181, 3.004305123123196, 6.229254345814851, 9],
+ [5.259721854731981, 3.300433342987486, 35.890872110681414, 9],
+ [5.553646341595925, 3.494850834989339, 10.076683709549055, 9],
+ [5.730003972159145, 2.488034141173207, 15.985698390269977, 9],
+ [5.782381516990652, 2.481204541395183, 28.774618518379302, 9],
+ [5.069379781665461, 6.741533325352479, 2.219484171420659, 9],
+ [5.134679670979660, 6.103139133682482, 27.726398643923417, 9],
+ [5.383260687864624, 5.560997841342890, 18.302295934127923, 9],
+ [5.869792088464701, 5.233311379347905, 32.553432167966633, 9],
+ [5.462451143540612, 5.746471808899983, 30.948864634440213, 9],
+ [5.357445269639698, 5.688526671944410, 5.261434469006405, 9],
+ [5.626373453003034, 5.771003693827525, 25.170846666445236, 9],
+ [8.284200895164993, 2.466049819474928, 17.238899804160177, 9],
+ [8.318102784124019, 2.265803572668724, 22.596147383535918, 9],
+ [7.851936866242713, 7.452293353458780, 20.962374407911458, 9],
+ [8.146081336032703, 7.714405906472637, 13.533962918469337, 9],
+ [8.097208643162750, 7.247339841946607, 17.338991550524540, 9],
+ [7.830256291991797, 6.872416994269415, 10.706822163825924, 9],
+ [7.800658970688480, 6.330678323824742, 6.211375680877805, 9],
+ [8.044863647118635, 6.808226317611471, 15.557155261544228, 9],
+ [8.461774802909071, 4.745965252820717, 36.037296939777320, 9],
+ [7.612382882207284, 4.372367470892327, 14.168690780706225, 9],
+ [8.169633927695997, 4.488334738003570, 27.235846103864411, 9],
+ [9.602031136015775, 5.527970638413552, 20.580635675818101, 9],
+ [9.663686030178818, 5.516978463101205, 29.047658472982956, 9],
+ [9.752928547364711, 5.461162553197844, 34.114931605281292, 9],
+ [10.000000000000000, 5.650424904167431, 4.216215730437086, 9],
+ [10.000000000000000, 5.736543677665970, 34.728526755839162, 9],
+ [10.000000000000000, 5.436085484926386, 14.779627294882367, 9],
+ [10.000000000000000, 5.795441557952790, 2.000000000000000, 9],
+ [9.497050913948730, 5.914105479148815, 10.808854780098731, 9],
+ [9.826635163465532, 1.975999288230087, 7.067114431849850, 9],
+ [9.382502350301259, 4.709738717837755, 19.999476877446362, 9],
+ [9.115530591819274, 4.986025386567032, 5.883436488694818, 9],
+ [10.000000000000000, 4.813033015882831, 24.745870232952445, 9],
+ [9.378359588580793, 4.574376802251692, 26.295787257422923, 9],
+ [10.000000000000000, 2.170932245950155, 21.572576356602351, 9],
+ [10.000000000000000, 2.571304614356922, 26.039872491235577, 9],
+ [2.500000000000000, 2.635760551271271, 4.712138166253982, 8],
+ [2.887457866682928, 2.033768154097059, 13.994896052145748, 8],
+ [3.435419560439465, 2.229919086421125, 6.718989113532732, 8],
+ [2.992533606273717, 1.928933557645075, 7.198014339866309, 8],
+ [2.500000000000000, 1.372689060484596, 14.156726710024465, 8],
+ [2.610457928897581, 1.213770481399764, 3.345815626895192, 8],
+ [5.167065304553812, 7.761502840367845, 2.140948156850635, 8],
+ [5.054434114346951, 7.011456904063963, 6.442157332603133, 8],
+ [5.803735682450612, 8.512993454403910, 10.443841773523394, 8],
+ [5.044877539779968, 6.342036003669621, 18.424428701407553, 8],
+ [5.484832402621484, 6.739510598555563, 5.474777491295647, 8],
+ [5.162300427200289, 6.576722169349890, 24.999056248525125, 8],
+ [5.877256360743413, 6.789776791182118, 15.450444143259661, 8],
+ [8.197449080109873, 2.209298497930928, 2.000000000000000, 8],
+ [7.997237265754237, 2.060313094466323, 11.655829335806517, 8],
+ [7.973192560907184, 8.671283074887089, 4.272886886879181, 8],
+ [7.836498646186221, 8.168701526186094, 13.596658717999025, 8],
+ [7.782186965908517, 9.202193528464585, 13.902105524067945, 8],
+ [9.531795266771761, 5.037755377967032, 2.000000000000000, 8],
+ [10.000000000000000, 5.416612103313970, 11.055624912778937, 8],
+ [9.312270837393163, 7.466203120412419, 11.185222099189973, 8],
+ [10.000000000000000, 7.097905887270363, 13.895455902446677, 8],
+ [9.925669940032272, 4.692192166283825, 7.204078988766796, 8],
+ [9.416740882402403, 4.697368796121149, 8.720116348180492, 8],
+ [10.000000000000000, 4.338509514756336, 16.469698910991372, 8],
+ [10.000000000000000, 6.402201264456283, 6.599237233947309, 8],
+ [10.000000000000000, 5.182208073338139, 4.550269784467781, 8],
+ [9.970332530519679, 5.903209540812212, 10.837022722087644, 8],
+ [2.962707587174585, 9.251352163485700, 9.999116931630539, 7],
+ [3.167205272899491, 9.141134617154027, 7.383624729892915, 7],
+ [2.500000000000000, 5.049858089466979, 17.881593853007615, 7],
+ [2.741501863896628, 5.680976628228491, 18.002908737801381, 7],
+ [2.500000000000000, 5.848115418935317, 10.232668996271492, 7],
+ [2.877902226185231, 5.567414385297515, 3.558203423120179, 7],
+ [2.500000000000000, 5.853445073334600, 27.779995926916971, 7],
+ [5.412821771284458, 2.521454920411534, 7.258040020605607, 7],
+ [5.837547476050840, 2.530273181625722, 11.998261380615471, 7],
+ [5.969397543974988, 4.348770633848800, 14.397906420283302, 7],
+ [5.004079000563381, 4.657273345320005, 22.736677614468775, 7],
+ [5.168438425945292, 4.246412717207690, 4.844860547907693, 7],
+ [5.863284315202094, 4.359153796629064, 23.489710023246513, 7],
+ [5.756333389411959, 8.952011225713635, 7.301135618422141, 7],
+ [5.108337403014788, 8.311542024325179, 11.359771531491097, 7],
+ [8.314898437378535, 9.185953513281046, 4.238233636005843, 7],
+ [8.201460399608226, 4.230965415446139, 11.589840844520428, 7],
+ [7.595604919273442, 4.884451138651340, 6.798265747221928, 7],
+ [8.378186361828917, 9.484819582257831, 8.022357890675561, 7],
+ [8.028236284464779, 9.757701617444052, 11.574198271062086, 7],
+ [8.229270762113973, 8.691786353579515, 6.350022396927342, 7],
+ [10.000000000000000, 3.305950965855861, 3.115225963548792, 7],
+ [9.756267998308681, 3.186360651735488, 14.803384721914584, 7],
+ [10.000000000000000, 3.504689167815543, 13.901609609717390, 7],
+ [10.000000000000000, 8.784136629159212, 6.218490965882184, 7],
+ [10.000000000000000, 8.374345283261381, 13.887493044276624, 7],
+ [10.000000000000000, 4.614045878641700, 14.689071599466930, 7],
+ [10.000000000000000, 8.033037300917030, 13.518172354943417, 7],
+ [2.745564054714475, 1.652100185202669, 5.569110673549164, 6],
+ [3.145288089149191, 5.155515834056653, 8.595832717291000, 6],
+ [2.500000000000000, 4.389047661368727, 4.950679151608691, 6],
+ [2.500000000000000, 4.394863837189541, 4.383231249423155, 6],
+ [2.500000000000000, 1.558025251052636, 3.307282274836235, 6],
+ [5.045583268005572, 8.635334543903529, 9.591945248602441, 6],
+ [5.594284526041456, 8.632025269800300, 10.197201238166286, 6],
+ [5.988802467213943, 8.132531816914582, 12.305951956169229, 6],
+ [5.425850947396252, 5.185445600639579, 8.046156862703112, 6],
+ [5.369364240119585, 5.088077743168478, 7.340573827339962, 6],
+ [5.702045821590509, 5.271793984998375, 10.325652051724541, 6],
+ [5.411096326958829, 5.545898372969883, 5.292034843095026, 6],
+ [8.242968536635763, 9.082400742895011, 4.900205865328810, 6],
+ [8.050426422258862, 9.780537958506372, 18.978339720751418, 6],
+ [8.238754570485817, 8.602489911338367, 5.941330110378650, 6],
+ [8.395684243897479, 4.506736427736353, 9.461515968715135, 6],
+ [10.000000000000000, 5.138757136469953, 12.704963485646498, 6],
+ [10.000000000000000, 5.159912610631281, 15.675370760759400, 6],
+ [10.000000000000000, 5.549472965121217, 3.506573388368494, 6],
+ [10.000000000000000, 5.795090421330749, 14.063922879568509, 6],
+ [10.000000000000000, 6.983123234599715, 3.128443413944953, 6],
+ [10.000000000000000, 6.680204754366847, 11.632405914314647, 6],
+ [9.050263182466011, 6.721800647918977, 17.083676942759791, 6],
+ [10.000000000000000, 6.063461620134571, 4.736966947326921, 6],
+ [9.409402543801862, 6.944203630692490, 6.287660211686590, 6],
+ [9.633394604006961, 7.505827554006868, 4.623044001702525, 6],
+ [9.020770192275748, 7.313879416061702, 13.422245014577644, 6],
+ [9.263176096861541, 7.357994930871833, 15.233295182477667, 6],
+ [3.332782026387723, 7.225679089752617, 16.113419977677538, 5],
+ [2.500000000000000, 5.428663116358418, 6.543649602836132, 5],
+ [2.500000000000000, 2.829072524106358, 2.000000000000000, 5],
+ [2.828559184243374, 8.730390823623916, 21.473258817290873, 5],
+ [2.500000000000000, 8.170120100361350, 12.020108658634838, 5],
+ [2.500000000000000, 8.743540456183981, 14.427904414153719, 5],
+ [2.500000000000000, 4.638913962811717, 8.380243803410817, 5],
+ [3.363079416671538, 4.670651645625486, 2.775509664209031, 5],
+ [5.339079962653624, 8.064094823108675, 16.611574939424255, 5],
+ [5.347356764781598, 8.436417621014639, 15.412165198232049, 5],
+ [5.368950609634622, 7.371653807185894, 7.038165919924306, 5],
+ [5.929552854535908, 6.895926920816455, 7.572813447048060, 5],
+ [5.727946559508910, 6.581660847859535, 10.668172633934036, 5],
+ [5.641782139668679, 6.458019104693064, 9.549016885745186, 5],
+ [5.344359642058747, 2.871097758194079, 5.430489560972486, 5],
+ [7.749909297802317, 4.328832721055091, 4.268933751175051, 5],
+ [8.145409228909998, 4.865021714408405, 7.545633529064384, 5],
+ [7.907253670159305, 5.688395096546548, 10.770986229289623, 5],
+ [7.592508492261312, 5.098997604455221, 4.933568344499713, 5],
+ [7.674872690410821, 5.441049019888879, 3.550245288479484, 5],
+ [7.991979987062054, 6.616295483614106, 3.283701248747225, 5],
+ [9.345599185286883, 7.224736586735167, 17.488521757881820, 5],
+ [9.659595218511388, 7.899577776723924, 3.357217748484464, 5]])
+# yapf: enable
MUNSELL_GREYS_SPECIFICATIONS = np.linspace(0, 10, 25)
-MUNSELL_EVEN_SPECIFICATIONS = np.array([
- [2.5, 5.0, 12.0, 4],
- [2.5, 5.0, 32.0, 4],
- [2.5, 5.0, 22.0, 4],
- [2.5, 5.0, 32.0, 4],
- [2.5, 6.0, 18.0, 4],
- [2.5, 6.0, 32.0, 4],
- [2.5, 6.0, 6.0, 4],
- [2.5, 5.0, 42.0, 4],
- [2.5, 5.0, 26.0, 4],
- [2.5, 5.0, 48.0, 4],
- [2.5, 2.0, 14.0, 4],
- [2.5, 2.0, 14.0, 4],
- [2.5, 0.0, 14.0, 4],
- [2.5, 0.0, 2.0, 4],
- [5.0, 1.0, 46.0, 4],
- [5.0, 1.0, 38.0, 4],
- [5.0, 1.0, 12.0, 4],
- [5.0, 1.0, 10.0, 4],
- [5.0, 4.0, 16.0, 4],
- [5.0, 2.0, 44.0, 4],
- [5.0, 7.0, 2.0, 4],
- [5.0, 7.0, 8.0, 4],
- [5.0, 7.0, 32.0, 4],
- [7.5, 2.0, 28.0, 4],
- [7.5, 2.0, 12.0, 4],
- [7.5, 2.0, 34.0, 4],
- [7.5, 4.0, 24.0, 4],
- [7.5, 4.0, 10.0, 4],
- [7.5, 4.0, 18.0, 4],
- [7.5, 9.0, 44.0, 4],
- [7.5, 5.0, 12.0, 4],
- [7.5, 5.0, 40.0, 4],
- [7.5, 5.0, 30.0, 4],
- [7.5, 5.0, 12.0, 4],
- [10.0, 3.0, 38.0, 4],
- [10.0, 3.0, 16.0, 4],
- [10.0, 3.0, 32.0, 4],
- [10.0, 3.0, 44.0, 4],
- [10.0, 3.0, 42.0, 4],
- [10.0, 3.0, 34.0, 4],
- [10.0, 3.0, 18.0, 4],
- [10.0, 7.0, 10.0, 4],
- [10.0, 7.0, 40.0, 4],
- [10.0, 7.0, 12.0, 4],
- [10.0, 6.0, 42.0, 4],
- [10.0, 6.0, 6.0, 4],
- [10.0, 4.0, 40.0, 4],
- [2.5, 7.0, 28.0, 3],
- [2.5, 7.0, 26.0, 3],
- [2.5, 9.0, 44.0, 3],
- [2.5, 9.0, 26.0, 3],
- [2.5, 0.0, 32.0, 3],
- [2.5, 0.0, 26.0, 3],
- [2.5, 8.0, 30.0, 3],
- [2.5, 8.0, 30.0, 3],
- [2.5, 8.0, 6.0, 3],
- [2.5, 6.0, 32.0, 3],
- [2.5, 6.0, 12.0, 3],
- [5.0, 7.0, 28.0, 3],
- [5.0, 7.0, 26.0, 3],
- [5.0, 7.0, 46.0, 3],
- [5.0, 7.0, 10.0, 3],
- [5.0, 6.0, 10.0, 3],
- [5.0, 6.0, 44.0, 3],
- [5.0, 1.0, 2.0, 3],
- [5.0, 9.0, 34.0, 3],
- [5.0, 9.0, 30.0, 3],
- [7.5, 3.0, 12.0, 3],
- [7.5, 7.0, 26.0, 3],
- [7.5, 7.0, 18.0, 3],
- [7.5, 7.0, 42.0, 3],
- [7.5, 7.0, 20.0, 3],
- [7.5, 7.0, 16.0, 3],
- [7.5, 3.0, 36.0, 3],
- [7.5, 3.0, 38.0, 3],
- [7.5, 3.0, 14.0, 3],
- [7.5, 2.0, 30.0, 3],
- [7.5, 2.0, 12.0, 3],
- [7.5, 2.0, 8.0, 3],
- [7.5, 2.0, 6.0, 3],
- [7.5, 6.0, 34.0, 3],
- [7.5, 6.0, 12.0, 3],
- [10.0, 4.0, 14.0, 3],
- [10.0, 4.0, 40.0, 3],
- [10.0, 5.0, 2.0, 3],
- [10.0, 5.0, 26.0, 3],
- [10.0, 6.0, 40.0, 3],
- [10.0, 6.0, 46.0, 3],
- [10.0, 6.0, 18.0, 3],
- [10.0, 6.0, 38.0, 3],
- [10.0, 3.0, 16.0, 3],
- [10.0, 3.0, 32.0, 3],
- [10.0, 3.0, 26.0, 3],
- [10.0, 3.0, 22.0, 3],
- [10.0, 8.0, 2.0, 3],
- [10.0, 8.0, 10.0, 3],
- [10.0, 8.0, 12.0, 3],
- [10.0, 8.0, 18.0, 3],
- [10.0, 8.0, 44.0, 3],
- [2.5, 8.0, 2.0, 2],
- [2.5, 8.0, 42.0, 2],
- [2.5, 7.0, 34.0, 2],
- [2.5, 4.0, 36.0, 2],
- [2.5, 4.0, 34.0, 2],
- [2.5, 4.0, 22.0, 2],
- [2.5, 0.0, 42.0, 2],
- [2.5, 0.0, 32.0, 2],
- [2.5, 1.0, 28.0, 2],
- [2.5, 1.0, 2.0, 2],
- [2.5, 1.0, 24.0, 2],
- [2.5, 1.0, 12.0, 2],
- [5.0, 5.0, 22.0, 2],
- [5.0, 5.0, 46.0, 2],
- [5.0, 5.0, 24.0, 2],
- [5.0, 1.0, 48.0, 2],
- [5.0, 1.0, 12.0, 2],
- [5.0, 1.0, 16.0, 2],
- [5.0, 1.0, 2.0, 2],
- [5.0, 1.0, 18.0, 2],
- [5.0, 8.0, 28.0, 2],
- [5.0, 8.0, 32.0, 2],
- [5.0, 8.0, 24.0, 2],
- [5.0, 8.0, 38.0, 2],
- [5.0, 2.0, 24.0, 2],
- [5.0, 2.0, 4.0, 2],
- [5.0, 2.0, 32.0, 2],
- [5.0, 2.0, 38.0, 2],
- [5.0, 9.0, 36.0, 2],
- [5.0, 9.0, 34.0, 2],
- [5.0, 9.0, 4.0, 2],
- [7.5, 7.0, 28.0, 2],
- [7.5, 7.0, 10.0, 2],
- [7.5, 7.0, 48.0, 2],
- [7.5, 9.0, 48.0, 2],
- [7.5, 9.0, 48.0, 2],
- [7.5, 9.0, 30.0, 2],
- [7.5, 5.0, 42.0, 2],
- [7.5, 5.0, 46.0, 2],
- [7.5, 6.0, 26.0, 2],
- [7.5, 6.0, 28.0, 2],
- [7.5, 6.0, 22.0, 2],
- [7.5, 6.0, 10.0, 2],
- [7.5, 6.0, 32.0, 2],
- [7.5, 6.0, 32.0, 2],
- [10.0, 7.0, 10.0, 2],
- [10.0, 7.0, 30.0, 2],
- [10.0, 7.0, 30.0, 2],
- [10.0, 7.0, 14.0, 2],
- [10.0, 7.0, 10.0, 2],
- [10.0, 7.0, 12.0, 2],
- [10.0, 8.0, 12.0, 2],
- [10.0, 8.0, 28.0, 2],
- [10.0, 8.0, 42.0, 2],
- [10.0, 8.0, 4.0, 2],
- [10.0, 8.0, 10.0, 2],
- [10.0, 8.0, 22.0, 2],
- [10.0, 9.0, 6.0, 2],
- [10.0, 9.0, 38.0, 2],
- [2.5, 2.0, 18.0, 1],
- [2.5, 2.0, 24.0, 1],
- [2.5, 9.0, 18.0, 1],
- [2.5, 9.0, 28.0, 1],
- [2.5, 9.0, 20.0, 1],
- [2.5, 4.0, 14.0, 1],
- [2.5, 4.0, 36.0, 1],
- [2.5, 4.0, 26.0, 1],
- [2.5, 3.0, 22.0, 1],
- [2.5, 3.0, 42.0, 1],
- [2.5, 3.0, 32.0, 1],
- [2.5, 3.0, 16.0, 1],
- [2.5, 3.0, 38.0, 1],
- [2.5, 9.0, 2.0, 1],
- [2.5, 9.0, 8.0, 1],
- [2.5, 9.0, 26.0, 1],
- [2.5, 9.0, 42.0, 1],
- [5.0, 2.0, 2.0, 1],
- [5.0, 2.0, 14.0, 1],
- [5.0, 2.0, 8.0, 1],
- [5.0, 1.0, 20.0, 1],
- [5.0, 1.0, 32.0, 1],
- [5.0, 3.0, 48.0, 1],
- [5.0, 0.0, 42.0, 1],
- [7.5, 3.0, 2.0, 1],
- [7.5, 3.0, 36.0, 1],
- [7.5, 5.0, 32.0, 1],
- [7.5, 5.0, 20.0, 1],
- [7.5, 5.0, 34.0, 1],
- [7.5, 0.0, 6.0, 1],
- [7.5, 0.0, 12.0, 1],
- [7.5, 8.0, 48.0, 1],
- [7.5, 8.0, 32.0, 1],
- [7.5, 8.0, 4.0, 1],
- [10.0, 5.0, 22.0, 1],
- [10.0, 5.0, 18.0, 1],
- [10.0, 5.0, 46.0, 1],
- [10.0, 5.0, 12.0, 1],
- [10.0, 5.0, 30.0, 1],
- [10.0, 7.0, 36.0, 1],
- [10.0, 7.0, 30.0, 1],
- [10.0, 7.0, 20.0, 1],
- [10.0, 7.0, 38.0, 1],
- [10.0, 7.0, 20.0, 1],
- [10.0, 1.0, 18.0, 1],
- [10.0, 1.0, 10.0, 1],
- [10.0, 1.0, 18.0, 1],
- [10.0, 1.0, 20.0, 1],
- [10.0, 0.0, 12.0, 1],
- [10.0, 0.0, 46.0, 1],
- [10.0, 0.0, 38.0, 1],
- [2.5, 7.0, 40.0, 10],
- [2.5, 7.0, 22.0, 10],
- [2.5, 4.0, 12.0, 10],
- [2.5, 4.0, 32.0, 10],
- [2.5, 4.0, 36.0, 10],
- [2.5, 0.0, 20.0, 10],
- [2.5, 0.0, 30.0, 10],
- [2.5, 3.0, 40.0, 10],
- [2.5, 3.0, 10.0, 10],
- [2.5, 8.0, 42.0, 10],
- [2.5, 8.0, 4.0, 10],
- [2.5, 8.0, 44.0, 10],
- [2.5, 8.0, 32.0, 10],
- [2.5, 8.0, 24.0, 10],
- [5.0, 9.0, 42.0, 10],
- [5.0, 9.0, 18.0, 10],
- [5.0, 9.0, 2.0, 10],
- [5.0, 7.0, 46.0, 10],
- [5.0, 7.0, 42.0, 10],
- [5.0, 7.0, 34.0, 10],
- [5.0, 0.0, 46.0, 10],
- [5.0, 0.0, 8.0, 10],
- [5.0, 5.0, 28.0, 10],
- [5.0, 1.0, 4.0, 10],
- [5.0, 1.0, 10.0, 10],
- [5.0, 1.0, 26.0, 10],
- [7.5, 3.0, 26.0, 10],
- [7.5, 3.0, 42.0, 10],
- [7.5, 3.0, 36.0, 10],
- [7.5, 0.0, 16.0, 10],
- [7.5, 0.0, 40.0, 10],
- [7.5, 2.0, 4.0, 10],
- [7.5, 2.0, 14.0, 10],
- [7.5, 2.0, 46.0, 10],
- [7.5, 8.0, 38.0, 10],
- [7.5, 8.0, 6.0, 10],
- [7.5, 8.0, 24.0, 10],
- [7.5, 8.0, 20.0, 10],
- [7.5, 0.0, 48.0, 10],
- [7.5, 0.0, 20.0, 10],
- [7.5, 0.0, 46.0, 10],
- [7.5, 0.0, 38.0, 10],
- [10.0, 2.0, 32.0, 10],
- [10.0, 2.0, 10.0, 10],
- [10.0, 2.0, 30.0, 10],
- [10.0, 8.0, 14.0, 10],
- [10.0, 8.0, 24.0, 10],
- [10.0, 8.0, 44.0, 10],
- [10.0, 9.0, 28.0, 10],
- [10.0, 9.0, 36.0, 10],
- [10.0, 9.0, 12.0, 10],
- [10.0, 6.0, 20.0, 10],
- [10.0, 6.0, 46.0, 10],
- [10.0, 6.0, 20.0, 10],
- [10.0, 6.0, 28.0, 10],
- [10.0, 6.0, 16.0, 10],
- [10.0, 6.0, 44.0, 10],
- [10.0, 6.0, 28.0, 10],
- [2.5, 6.0, 6.0, 9],
- [2.5, 5.0, 24.0, 9],
- [2.5, 5.0, 6.0, 9],
- [2.5, 2.0, 42.0, 9],
- [2.5, 2.0, 24.0, 9],
- [2.5, 2.0, 36.0, 9],
- [2.5, 2.0, 42.0, 9],
- [2.5, 2.0, 16.0, 9],
- [2.5, 2.0, 22.0, 9],
- [2.5, 2.0, 26.0, 9],
- [2.5, 2.0, 36.0, 9],
- [2.5, 8.0, 30.0, 9],
- [2.5, 8.0, 6.0, 9],
- [5.0, 9.0, 6.0, 9],
- [5.0, 9.0, 22.0, 9],
- [5.0, 9.0, 42.0, 9],
- [5.0, 1.0, 10.0, 9],
- [5.0, 2.0, 32.0, 9],
- [5.0, 2.0, 28.0, 9],
- [5.0, 0.0, 34.0, 9],
- [5.0, 0.0, 22.0, 9],
- [5.0, 4.0, 2.0, 9],
- [5.0, 4.0, 2.0, 9],
- [5.0, 4.0, 4.0, 9],
- [7.5, 5.0, 6.0, 9],
- [7.5, 5.0, 28.0, 9],
- [7.5, 3.0, 2.0, 9],
- [7.5, 3.0, 34.0, 9],
- [7.5, 3.0, 8.0, 9],
- [7.5, 7.0, 46.0, 9],
- [7.5, 9.0, 34.0, 9],
- [7.5, 9.0, 44.0, 9],
- [7.5, 4.0, 10.0, 9],
- [7.5, 4.0, 10.0, 9],
- [10.0, 4.0, 16.0, 9],
- [10.0, 4.0, 4.0, 9],
- [10.0, 1.0, 44.0, 9],
- [10.0, 1.0, 16.0, 9],
- [10.0, 1.0, 30.0, 9],
- [10.0, 1.0, 44.0, 9],
- [10.0, 3.0, 4.0, 9],
- [10.0, 3.0, 46.0, 9],
- [10.0, 0.0, 14.0, 9],
- [2.5, 1.0, 4.0, 8],
- [2.5, 1.0, 18.0, 8],
- [2.5, 1.0, 8.0, 8],
- [2.5, 3.0, 32.0, 8],
- [2.5, 3.0, 28.0, 8],
- [2.5, 3.0, 46.0, 8],
- [2.5, 3.0, 12.0, 8],
- [2.5, 3.0, 18.0, 8],
- [2.5, 0.0, 34.0, 8],
- [2.5, 0.0, 22.0, 8],
- [2.5, 2.0, 22.0, 8],
- [2.5, 2.0, 14.0, 8],
- [2.5, 2.0, 42.0, 8],
- [2.5, 0.0, 16.0, 8],
- [5.0, 4.0, 24.0, 8],
- [5.0, 4.0, 26.0, 8],
- [5.0, 0.0, 26.0, 8],
- [5.0, 2.0, 44.0, 8],
- [5.0, 2.0, 38.0, 8],
- [5.0, 2.0, 48.0, 8],
- [5.0, 2.0, 26.0, 8],
- [5.0, 2.0, 6.0, 8],
- [5.0, 4.0, 12.0, 8],
- [5.0, 9.0, 36.0, 8],
- [5.0, 9.0, 48.0, 8],
- [5.0, 9.0, 16.0, 8],
- [5.0, 9.0, 6.0, 8],
- [7.5, 0.0, 34.0, 8],
- [7.5, 6.0, 10.0, 8],
- [7.5, 6.0, 12.0, 8],
- [7.5, 6.0, 10.0, 8],
- [7.5, 9.0, 26.0, 8],
- [7.5, 9.0, 6.0, 8],
- [7.5, 9.0, 40.0, 8],
- [7.5, 9.0, 18.0, 8],
- [7.5, 4.0, 20.0, 8],
- [7.5, 4.0, 42.0, 8],
- [7.5, 4.0, 16.0, 8],
- [10.0, 5.0, 24.0, 8],
- [10.0, 5.0, 44.0, 8],
- [10.0, 5.0, 20.0, 8],
- [10.0, 5.0, 22.0, 8],
- [10.0, 3.0, 16.0, 8],
- [10.0, 3.0, 14.0, 8],
- [10.0, 3.0, 6.0, 8],
- [10.0, 2.0, 24.0, 8],
- [10.0, 2.0, 36.0, 8],
- [10.0, 2.0, 46.0, 8],
- [10.0, 0.0, 42.0, 8],
- [10.0, 0.0, 26.0, 8],
- [10.0, 0.0, 42.0, 8],
- [10.0, 0.0, 10.0, 8],
- [10.0, 9.0, 12.0, 8],
- [10.0, 9.0, 8.0, 8],
- [2.5, 4.0, 42.0, 7],
- [2.5, 4.0, 14.0, 7],
- [2.5, 4.0, 46.0, 7],
- [2.5, 4.0, 18.0, 7],
- [2.5, 2.0, 2.0, 7],
- [2.5, 2.0, 38.0, 7],
- [2.5, 2.0, 14.0, 7],
- [2.5, 8.0, 26.0, 7],
- [2.5, 7.0, 12.0, 7],
- [2.5, 7.0, 46.0, 7],
- [2.5, 1.0, 44.0, 7],
- [5.0, 8.0, 26.0, 7],
- [5.0, 0.0, 46.0, 7],
- [5.0, 9.0, 44.0, 7],
- [5.0, 9.0, 16.0, 7],
- [5.0, 9.0, 40.0, 7],
- [5.0, 5.0, 14.0, 7],
- [5.0, 7.0, 6.0, 7],
- [5.0, 7.0, 30.0, 7],
- [7.5, 1.0, 16.0, 7],
- [7.5, 1.0, 18.0, 7],
- [7.5, 1.0, 30.0, 7],
- [7.5, 1.0, 4.0, 7],
- [7.5, 1.0, 10.0, 7],
- [7.5, 1.0, 40.0, 7],
- [7.5, 1.0, 18.0, 7],
- [7.5, 3.0, 14.0, 7],
- [7.5, 3.0, 48.0, 7],
- [7.5, 3.0, 48.0, 7],
- [7.5, 3.0, 6.0, 7],
- [7.5, 0.0, 36.0, 7],
- [7.5, 0.0, 42.0, 7],
- [7.5, 0.0, 22.0, 7],
- [10.0, 9.0, 8.0, 7],
- [10.0, 9.0, 8.0, 7],
- [10.0, 7.0, 36.0, 7],
- [10.0, 7.0, 46.0, 7],
- [10.0, 7.0, 20.0, 7],
- [10.0, 7.0, 14.0, 7],
- [10.0, 4.0, 32.0, 7],
- [10.0, 4.0, 16.0, 7],
- [10.0, 1.0, 24.0, 7],
- [10.0, 1.0, 40.0, 7],
- [10.0, 1.0, 18.0, 7],
- [10.0, 1.0, 24.0, 7],
- [10.0, 7.0, 30.0, 7],
- [10.0, 7.0, 30.0, 7],
- [2.5, 5.0, 24.0, 6],
- [2.5, 5.0, 42.0, 6],
- [2.5, 8.0, 34.0, 6],
- [2.5, 8.0, 34.0, 6],
- [2.5, 8.0, 48.0, 6],
- [2.5, 8.0, 26.0, 6],
- [2.5, 3.0, 28.0, 6],
- [5.0, 4.0, 44.0, 6],
- [5.0, 4.0, 46.0, 6],
- [5.0, 6.0, 28.0, 6],
- [5.0, 6.0, 46.0, 6],
- [5.0, 2.0, 10.0, 6],
- [5.0, 2.0, 4.0, 6],
- [5.0, 2.0, 34.0, 6],
- [5.0, 4.0, 46.0, 6],
- [5.0, 4.0, 20.0, 6],
- [7.5, 7.0, 2.0, 6],
- [7.5, 6.0, 46.0, 6],
- [7.5, 6.0, 48.0, 6],
- [7.5, 6.0, 36.0, 6],
- [7.5, 6.0, 42.0, 6],
- [10.0, 7.0, 8.0, 6],
- [10.0, 8.0, 18.0, 6],
- [10.0, 8.0, 42.0, 6],
- [10.0, 8.0, 32.0, 6],
- [10.0, 2.0, 22.0, 6],
- [10.0, 2.0, 28.0, 6],
- [10.0, 2.0, 6.0, 6],
- [10.0, 2.0, 36.0, 6],
- [10.0, 2.0, 48.0, 6],
- [10.0, 2.0, 28.0, 6],
- [10.0, 2.0, 36.0, 6],
- [10.0, 2.0, 6.0, 6],
- [10.0, 9.0, 24.0, 6],
- [2.5, 6.0, 42.0, 5],
- [2.5, 6.0, 8.0, 5],
- [2.5, 7.0, 20.0, 5],
- [2.5, 7.0, 4.0, 5],
- [2.5, 7.0, 16.0, 5],
- [2.5, 5.0, 34.0, 5],
- [2.5, 5.0, 22.0, 5],
- [2.5, 2.0, 26.0, 5],
- [2.5, 2.0, 38.0, 5],
- [2.5, 2.0, 30.0, 5],
- [5.0, 9.0, 42.0, 5],
- [5.0, 9.0, 20.0, 5],
- [5.0, 9.0, 32.0, 5],
- [5.0, 6.0, 46.0, 5],
- [5.0, 6.0, 14.0, 5],
- [5.0, 0.0, 38.0, 5],
- [5.0, 0.0, 16.0, 5],
- [5.0, 4.0, 16.0, 5],
- [5.0, 4.0, 42.0, 5],
- [5.0, 4.0, 8.0, 5],
- [5.0, 9.0, 2.0, 5],
- [5.0, 9.0, 26.0, 5],
- [7.5, 4.0, 20.0, 5],
- [7.5, 4.0, 6.0, 5],
- [7.5, 9.0, 6.0, 5],
- [7.5, 9.0, 48.0, 5],
- [7.5, 9.0, 46.0, 5],
- [7.5, 9.0, 36.0, 5],
- [7.5, 6.0, 40.0, 5],
- [7.5, 3.0, 28.0, 5],
- [7.5, 3.0, 24.0, 5],
- [7.5, 7.0, 14.0, 5],
- [7.5, 7.0, 26.0, 5],
- [7.5, 7.0, 48.0, 5],
- [7.5, 7.0, 16.0, 5],
- [10.0, 4.0, 42.0, 5],
- [10.0, 9.0, 42.0, 5],
- [10.0, 9.0, 6.0, 5],
- [10.0, 9.0, 12.0, 5],
- [10.0, 0.0, 16.0, 5],
- [10.0, 0.0, 14.0, 5],
- [10.0, 8.0, 28.0, 5],
- [10.0, 8.0, 12.0, 5],
- [10.0, 8.0, 34.0, 5],
- [10.0, 6.0, 22.0, 5],
- [10.0, 6.0, 44.0, 5],
- [10.0, 6.0, 32.0, 5]])
-
-MUNSELL_BOUNDING_HUES = np.array([
- [(2.5, 4.0), (2.5, 4.0)],
- [(2.5, 4.0), (2.5, 4.0)],
- [(2.5, 4.0), (2.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(5.0, 4.0), (7.5, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(10.0, 4.0), (10.0, 4.0)],
- [(7.5, 4.0), (10.0, 4.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (2.5, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(2.5, 3.0), (5.0, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(5.0, 3.0), (7.5, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(7.5, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(10.0, 3.0), (10.0, 3.0)],
- [(2.5, 2.0), (2.5, 2.0)],
- [(2.5, 2.0), (2.5, 2.0)],
- [(2.5, 2.0), (5.0, 2.0)],
- [(2.5, 2.0), (5.0, 2.0)],
- [(2.5, 2.0), (2.5, 2.0)],
- [(2.5, 2.0), (5.0, 2.0)],
- [(2.5, 2.0), (5.0, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(5.0, 2.0), (7.5, 2.0)],
- [(7.5, 2.0), (10.0, 2.0)],
- [(7.5, 2.0), (10.0, 2.0)],
- [(10.0, 2.0), (10.0, 2.0)],
- [(10.0, 2.0), (10.0, 2.0)],
- [(7.5, 2.0), (10.0, 2.0)],
- [(7.5, 2.0), (10.0, 2.0)],
- [(2.5, 1.0), (5.0, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (5.0, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (5.0, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (5.0, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (2.5, 1.0)],
- [(2.5, 1.0), (5.0, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(5.0, 1.0), (7.5, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(10.0, 1.0), (10.0, 1.0)],
- [(7.5, 1.0), (10.0, 1.0)],
- [(10.0, 1.0), (10.0, 1.0)],
- [(10.0, 1.0), (10.0, 1.0)],
- [(2.5, 10.0), (5.0, 10.0)],
- [(2.5, 10.0), (5.0, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(2.5, 10.0), (2.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(5.0, 10.0), (7.5, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(7.5, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(10.0, 10.0), (10.0, 10.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (2.5, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(2.5, 9.0), (5.0, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(5.0, 9.0), (7.5, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(7.5, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(10.0, 9.0), (10.0, 9.0)],
- [(2.5, 8.0), (2.5, 8.0)],
- [(2.5, 8.0), (5.0, 8.0)],
- [(2.5, 8.0), (5.0, 8.0)],
- [(2.5, 8.0), (5.0, 8.0)],
- [(2.5, 8.0), (2.5, 8.0)],
- [(2.5, 8.0), (5.0, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(5.0, 8.0), (7.5, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(10.0, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(10.0, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(10.0, 8.0), (10.0, 8.0)],
- [(10.0, 8.0), (10.0, 8.0)],
- [(10.0, 8.0), (10.0, 8.0)],
- [(7.5, 8.0), (10.0, 8.0)],
- [(2.5, 7.0), (5.0, 7.0)],
- [(2.5, 7.0), (5.0, 7.0)],
- [(2.5, 7.0), (2.5, 7.0)],
- [(2.5, 7.0), (5.0, 7.0)],
- [(2.5, 7.0), (2.5, 7.0)],
- [(2.5, 7.0), (5.0, 7.0)],
- [(2.5, 7.0), (2.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(5.0, 7.0), (7.5, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(7.5, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(10.0, 7.0), (10.0, 7.0)],
- [(2.5, 6.0), (5.0, 6.0)],
- [(2.5, 6.0), (5.0, 6.0)],
- [(2.5, 6.0), (2.5, 6.0)],
- [(2.5, 6.0), (2.5, 6.0)],
- [(2.5, 6.0), (2.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(5.0, 6.0), (7.5, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(10.0, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(7.5, 6.0), (10.0, 6.0)],
- [(2.5, 5.0), (5.0, 5.0)],
- [(2.5, 5.0), (2.5, 5.0)],
- [(2.5, 5.0), (2.5, 5.0)],
- [(2.5, 5.0), (5.0, 5.0)],
- [(2.5, 5.0), (2.5, 5.0)],
- [(2.5, 5.0), (2.5, 5.0)],
- [(2.5, 5.0), (2.5, 5.0)],
- [(2.5, 5.0), (5.0, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(5.0, 5.0), (7.5, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)],
- [(7.5, 5.0), (10.0, 5.0)]])
-
-MUNSELL_HUE_TO_ANGLE = np.array([
- [2.5, 1, 208.750],
- [2.5, 2, 153.750],
- [2.5, 3, 118.750],
- [2.5, 4, 63.750],
- [2.5, 5, 39.375],
- [2.5, 6, 16.875],
- [2.5, 7, 348.750],
- [2.5, 8, 300.000],
- [2.5, 9, 251.250],
- [2.5, 10, 236.250],
- [5.0, 1, 225.000],
- [5.0, 2, 160.000],
- [5.0, 3, 135.000],
- [5.0, 4, 70.000],
- [5.0, 5, 45.000],
- [5.0, 6, 22.500],
- [5.0, 7, 0.000],
- [5.0, 8, 315.000],
- [5.0, 9, 255.000],
- [5.0, 10, 240.000],
- [7.5, 1, 228.750],
- [7.5, 2, 176.250],
- [7.5, 3, 141.250],
- [7.5, 4, 86.250],
- [7.5, 5, 51.250],
- [7.5, 6, 28.125],
- [7.5, 7, 5.625],
- [7.5, 8, 326.250],
- [7.5, 9, 270.000],
- [7.5, 10, 243.750],
- [10.0, 1, 232.500],
- [10.0, 2, 192.500],
- [10.0, 3, 147.500],
- [10.0, 4, 102.500],
- [10.0, 5, 57.500],
- [10.0, 6, 33.750],
- [10.0, 7, 11.250],
- [10.0, 8, 337.500],
- [10.0, 9, 285.000],
- [10.0, 10, 247.500]])
-
-MUNSELL_HUE_TO_ASTM_HUE = np.array([
- [2.5, 0, 72.5],
- [2.5, 1, 62.5],
- [2.5, 2, 52.5],
- [2.5, 3, 42.5],
- [2.5, 4, 32.5],
- [2.5, 5, 22.5],
- [2.5, 6, 12.5],
- [2.5, 7, 2.5],
- [2.5, 8, 92.5],
- [2.5, 9, 82.5],
- [2.5, 10, 72.5],
- [5.0, 0, 75.0],
- [5.0, 1, 65.0],
- [5.0, 2, 55.0],
- [5.0, 3, 45.0],
- [5.0, 4, 35.0],
- [5.0, 5, 25.0],
- [5.0, 6, 15.0],
- [5.0, 7, 5.0],
- [5.0, 8, 95.0],
- [5.0, 9, 85.0],
- [5.0, 10, 75.0],
- [7.5, 0, 77.5],
- [7.5, 1, 67.5],
- [7.5, 2, 57.5],
- [7.5, 3, 47.5],
- [7.5, 4, 37.5],
- [7.5, 5, 27.5],
- [7.5, 6, 17.5],
- [7.5, 7, 7.5],
- [7.5, 8, 97.5],
- [7.5, 9, 87.5],
- [7.5, 10, 77.5],
- [10.0, 0, 80.0],
- [10.0, 1, 70.0],
- [10.0, 2, 60.0],
- [10.0, 3, 50.0],
- [10.0, 4, 40.0],
- [10.0, 5, 30.0],
- [10.0, 6, 20.0],
- [10.0, 7, 10.0],
- [10.0, 8, 100.0],
- [10.0, 9, 90.0],
- [10.0, 10, 80.0]])
+MUNSELL_EVEN_SPECIFICATIONS = np.array(
+ [[2.5, 5.0, 12.0, 4],
+ [2.5, 5.0, 32.0, 4],
+ [2.5, 5.0, 22.0, 4],
+ [2.5, 5.0, 32.0, 4],
+ [2.5, 6.0, 18.0, 4],
+ [2.5, 6.0, 32.0, 4],
+ [2.5, 6.0, 6.0, 4],
+ [2.5, 5.0, 42.0, 4],
+ [2.5, 5.0, 26.0, 4],
+ [2.5, 5.0, 48.0, 4],
+ [2.5, 2.0, 14.0, 4],
+ [2.5, 2.0, 14.0, 4],
+ [2.5, 0.0, 14.0, 4],
+ [2.5, 0.0, 2.0, 4],
+ [5.0, 1.0, 46.0, 4],
+ [5.0, 1.0, 38.0, 4],
+ [5.0, 1.0, 12.0, 4],
+ [5.0, 1.0, 10.0, 4],
+ [5.0, 4.0, 16.0, 4],
+ [5.0, 2.0, 44.0, 4],
+ [5.0, 7.0, 2.0, 4],
+ [5.0, 7.0, 8.0, 4],
+ [5.0, 7.0, 32.0, 4],
+ [7.5, 2.0, 28.0, 4],
+ [7.5, 2.0, 12.0, 4],
+ [7.5, 2.0, 34.0, 4],
+ [7.5, 4.0, 24.0, 4],
+ [7.5, 4.0, 10.0, 4],
+ [7.5, 4.0, 18.0, 4],
+ [7.5, 9.0, 44.0, 4],
+ [7.5, 5.0, 12.0, 4],
+ [7.5, 5.0, 40.0, 4],
+ [7.5, 5.0, 30.0, 4],
+ [7.5, 5.0, 12.0, 4],
+ [10.0, 3.0, 38.0, 4],
+ [10.0, 3.0, 16.0, 4],
+ [10.0, 3.0, 32.0, 4],
+ [10.0, 3.0, 44.0, 4],
+ [10.0, 3.0, 42.0, 4],
+ [10.0, 3.0, 34.0, 4],
+ [10.0, 3.0, 18.0, 4],
+ [10.0, 7.0, 10.0, 4],
+ [10.0, 7.0, 40.0, 4],
+ [10.0, 7.0, 12.0, 4],
+ [10.0, 6.0, 42.0, 4],
+ [10.0, 6.0, 6.0, 4],
+ [10.0, 4.0, 40.0, 4],
+ [2.5, 7.0, 28.0, 3],
+ [2.5, 7.0, 26.0, 3],
+ [2.5, 9.0, 44.0, 3],
+ [2.5, 9.0, 26.0, 3],
+ [2.5, 0.0, 32.0, 3],
+ [2.5, 0.0, 26.0, 3],
+ [2.5, 8.0, 30.0, 3],
+ [2.5, 8.0, 30.0, 3],
+ [2.5, 8.0, 6.0, 3],
+ [2.5, 6.0, 32.0, 3],
+ [2.5, 6.0, 12.0, 3],
+ [5.0, 7.0, 28.0, 3],
+ [5.0, 7.0, 26.0, 3],
+ [5.0, 7.0, 46.0, 3],
+ [5.0, 7.0, 10.0, 3],
+ [5.0, 6.0, 10.0, 3],
+ [5.0, 6.0, 44.0, 3],
+ [5.0, 1.0, 2.0, 3],
+ [5.0, 9.0, 34.0, 3],
+ [5.0, 9.0, 30.0, 3],
+ [7.5, 3.0, 12.0, 3],
+ [7.5, 7.0, 26.0, 3],
+ [7.5, 7.0, 18.0, 3],
+ [7.5, 7.0, 42.0, 3],
+ [7.5, 7.0, 20.0, 3],
+ [7.5, 7.0, 16.0, 3],
+ [7.5, 3.0, 36.0, 3],
+ [7.5, 3.0, 38.0, 3],
+ [7.5, 3.0, 14.0, 3],
+ [7.5, 2.0, 30.0, 3],
+ [7.5, 2.0, 12.0, 3],
+ [7.5, 2.0, 8.0, 3],
+ [7.5, 2.0, 6.0, 3],
+ [7.5, 6.0, 34.0, 3],
+ [7.5, 6.0, 12.0, 3],
+ [10.0, 4.0, 14.0, 3],
+ [10.0, 4.0, 40.0, 3],
+ [10.0, 5.0, 2.0, 3],
+ [10.0, 5.0, 26.0, 3],
+ [10.0, 6.0, 40.0, 3],
+ [10.0, 6.0, 46.0, 3],
+ [10.0, 6.0, 18.0, 3],
+ [10.0, 6.0, 38.0, 3],
+ [10.0, 3.0, 16.0, 3],
+ [10.0, 3.0, 32.0, 3],
+ [10.0, 3.0, 26.0, 3],
+ [10.0, 3.0, 22.0, 3],
+ [10.0, 8.0, 2.0, 3],
+ [10.0, 8.0, 10.0, 3],
+ [10.0, 8.0, 12.0, 3],
+ [10.0, 8.0, 18.0, 3],
+ [10.0, 8.0, 44.0, 3],
+ [2.5, 8.0, 2.0, 2],
+ [2.5, 8.0, 42.0, 2],
+ [2.5, 7.0, 34.0, 2],
+ [2.5, 4.0, 36.0, 2],
+ [2.5, 4.0, 34.0, 2],
+ [2.5, 4.0, 22.0, 2],
+ [2.5, 0.0, 42.0, 2],
+ [2.5, 0.0, 32.0, 2],
+ [2.5, 1.0, 28.0, 2],
+ [2.5, 1.0, 2.0, 2],
+ [2.5, 1.0, 24.0, 2],
+ [2.5, 1.0, 12.0, 2],
+ [5.0, 5.0, 22.0, 2],
+ [5.0, 5.0, 46.0, 2],
+ [5.0, 5.0, 24.0, 2],
+ [5.0, 1.0, 48.0, 2],
+ [5.0, 1.0, 12.0, 2],
+ [5.0, 1.0, 16.0, 2],
+ [5.0, 1.0, 2.0, 2],
+ [5.0, 1.0, 18.0, 2],
+ [5.0, 8.0, 28.0, 2],
+ [5.0, 8.0, 32.0, 2],
+ [5.0, 8.0, 24.0, 2],
+ [5.0, 8.0, 38.0, 2],
+ [5.0, 2.0, 24.0, 2],
+ [5.0, 2.0, 4.0, 2],
+ [5.0, 2.0, 32.0, 2],
+ [5.0, 2.0, 38.0, 2],
+ [5.0, 9.0, 36.0, 2],
+ [5.0, 9.0, 34.0, 2],
+ [5.0, 9.0, 4.0, 2],
+ [7.5, 7.0, 28.0, 2],
+ [7.5, 7.0, 10.0, 2],
+ [7.5, 7.0, 48.0, 2],
+ [7.5, 9.0, 48.0, 2],
+ [7.5, 9.0, 48.0, 2],
+ [7.5, 9.0, 30.0, 2],
+ [7.5, 5.0, 42.0, 2],
+ [7.5, 5.0, 46.0, 2],
+ [7.5, 6.0, 26.0, 2],
+ [7.5, 6.0, 28.0, 2],
+ [7.5, 6.0, 22.0, 2],
+ [7.5, 6.0, 10.0, 2],
+ [7.5, 6.0, 32.0, 2],
+ [7.5, 6.0, 32.0, 2],
+ [10.0, 7.0, 10.0, 2],
+ [10.0, 7.0, 30.0, 2],
+ [10.0, 7.0, 30.0, 2],
+ [10.0, 7.0, 14.0, 2],
+ [10.0, 7.0, 10.0, 2],
+ [10.0, 7.0, 12.0, 2],
+ [10.0, 8.0, 12.0, 2],
+ [10.0, 8.0, 28.0, 2],
+ [10.0, 8.0, 42.0, 2],
+ [10.0, 8.0, 4.0, 2],
+ [10.0, 8.0, 10.0, 2],
+ [10.0, 8.0, 22.0, 2],
+ [10.0, 9.0, 6.0, 2],
+ [10.0, 9.0, 38.0, 2],
+ [2.5, 2.0, 18.0, 1],
+ [2.5, 2.0, 24.0, 1],
+ [2.5, 9.0, 18.0, 1],
+ [2.5, 9.0, 28.0, 1],
+ [2.5, 9.0, 20.0, 1],
+ [2.5, 4.0, 14.0, 1],
+ [2.5, 4.0, 36.0, 1],
+ [2.5, 4.0, 26.0, 1],
+ [2.5, 3.0, 22.0, 1],
+ [2.5, 3.0, 42.0, 1],
+ [2.5, 3.0, 32.0, 1],
+ [2.5, 3.0, 16.0, 1],
+ [2.5, 3.0, 38.0, 1],
+ [2.5, 9.0, 2.0, 1],
+ [2.5, 9.0, 8.0, 1],
+ [2.5, 9.0, 26.0, 1],
+ [2.5, 9.0, 42.0, 1],
+ [5.0, 2.0, 2.0, 1],
+ [5.0, 2.0, 14.0, 1],
+ [5.0, 2.0, 8.0, 1],
+ [5.0, 1.0, 20.0, 1],
+ [5.0, 1.0, 32.0, 1],
+ [5.0, 3.0, 48.0, 1],
+ [5.0, 0.0, 42.0, 1],
+ [7.5, 3.0, 2.0, 1],
+ [7.5, 3.0, 36.0, 1],
+ [7.5, 5.0, 32.0, 1],
+ [7.5, 5.0, 20.0, 1],
+ [7.5, 5.0, 34.0, 1],
+ [7.5, 0.0, 6.0, 1],
+ [7.5, 0.0, 12.0, 1],
+ [7.5, 8.0, 48.0, 1],
+ [7.5, 8.0, 32.0, 1],
+ [7.5, 8.0, 4.0, 1],
+ [10.0, 5.0, 22.0, 1],
+ [10.0, 5.0, 18.0, 1],
+ [10.0, 5.0, 46.0, 1],
+ [10.0, 5.0, 12.0, 1],
+ [10.0, 5.0, 30.0, 1],
+ [10.0, 7.0, 36.0, 1],
+ [10.0, 7.0, 30.0, 1],
+ [10.0, 7.0, 20.0, 1],
+ [10.0, 7.0, 38.0, 1],
+ [10.0, 7.0, 20.0, 1],
+ [10.0, 1.0, 18.0, 1],
+ [10.0, 1.0, 10.0, 1],
+ [10.0, 1.0, 18.0, 1],
+ [10.0, 1.0, 20.0, 1],
+ [10.0, 0.0, 12.0, 1],
+ [10.0, 0.0, 46.0, 1],
+ [10.0, 0.0, 38.0, 1],
+ [2.5, 7.0, 40.0, 10],
+ [2.5, 7.0, 22.0, 10],
+ [2.5, 4.0, 12.0, 10],
+ [2.5, 4.0, 32.0, 10],
+ [2.5, 4.0, 36.0, 10],
+ [2.5, 0.0, 20.0, 10],
+ [2.5, 0.0, 30.0, 10],
+ [2.5, 3.0, 40.0, 10],
+ [2.5, 3.0, 10.0, 10],
+ [2.5, 8.0, 42.0, 10],
+ [2.5, 8.0, 4.0, 10],
+ [2.5, 8.0, 44.0, 10],
+ [2.5, 8.0, 32.0, 10],
+ [2.5, 8.0, 24.0, 10],
+ [5.0, 9.0, 42.0, 10],
+ [5.0, 9.0, 18.0, 10],
+ [5.0, 9.0, 2.0, 10],
+ [5.0, 7.0, 46.0, 10],
+ [5.0, 7.0, 42.0, 10],
+ [5.0, 7.0, 34.0, 10],
+ [5.0, 0.0, 46.0, 10],
+ [5.0, 0.0, 8.0, 10],
+ [5.0, 5.0, 28.0, 10],
+ [5.0, 1.0, 4.0, 10],
+ [5.0, 1.0, 10.0, 10],
+ [5.0, 1.0, 26.0, 10],
+ [7.5, 3.0, 26.0, 10],
+ [7.5, 3.0, 42.0, 10],
+ [7.5, 3.0, 36.0, 10],
+ [7.5, 0.0, 16.0, 10],
+ [7.5, 0.0, 40.0, 10],
+ [7.5, 2.0, 4.0, 10],
+ [7.5, 2.0, 14.0, 10],
+ [7.5, 2.0, 46.0, 10],
+ [7.5, 8.0, 38.0, 10],
+ [7.5, 8.0, 6.0, 10],
+ [7.5, 8.0, 24.0, 10],
+ [7.5, 8.0, 20.0, 10],
+ [7.5, 0.0, 48.0, 10],
+ [7.5, 0.0, 20.0, 10],
+ [7.5, 0.0, 46.0, 10],
+ [7.5, 0.0, 38.0, 10],
+ [10.0, 2.0, 32.0, 10],
+ [10.0, 2.0, 10.0, 10],
+ [10.0, 2.0, 30.0, 10],
+ [10.0, 8.0, 14.0, 10],
+ [10.0, 8.0, 24.0, 10],
+ [10.0, 8.0, 44.0, 10],
+ [10.0, 9.0, 28.0, 10],
+ [10.0, 9.0, 36.0, 10],
+ [10.0, 9.0, 12.0, 10],
+ [10.0, 6.0, 20.0, 10],
+ [10.0, 6.0, 46.0, 10],
+ [10.0, 6.0, 20.0, 10],
+ [10.0, 6.0, 28.0, 10],
+ [10.0, 6.0, 16.0, 10],
+ [10.0, 6.0, 44.0, 10],
+ [10.0, 6.0, 28.0, 10],
+ [2.5, 6.0, 6.0, 9],
+ [2.5, 5.0, 24.0, 9],
+ [2.5, 5.0, 6.0, 9],
+ [2.5, 2.0, 42.0, 9],
+ [2.5, 2.0, 24.0, 9],
+ [2.5, 2.0, 36.0, 9],
+ [2.5, 2.0, 42.0, 9],
+ [2.5, 2.0, 16.0, 9],
+ [2.5, 2.0, 22.0, 9],
+ [2.5, 2.0, 26.0, 9],
+ [2.5, 2.0, 36.0, 9],
+ [2.5, 8.0, 30.0, 9],
+ [2.5, 8.0, 6.0, 9],
+ [5.0, 9.0, 6.0, 9],
+ [5.0, 9.0, 22.0, 9],
+ [5.0, 9.0, 42.0, 9],
+ [5.0, 1.0, 10.0, 9],
+ [5.0, 2.0, 32.0, 9],
+ [5.0, 2.0, 28.0, 9],
+ [5.0, 0.0, 34.0, 9],
+ [5.0, 0.0, 22.0, 9],
+ [5.0, 4.0, 2.0, 9],
+ [5.0, 4.0, 2.0, 9],
+ [5.0, 4.0, 4.0, 9],
+ [7.5, 5.0, 6.0, 9],
+ [7.5, 5.0, 28.0, 9],
+ [7.5, 3.0, 2.0, 9],
+ [7.5, 3.0, 34.0, 9],
+ [7.5, 3.0, 8.0, 9],
+ [7.5, 7.0, 46.0, 9],
+ [7.5, 9.0, 34.0, 9],
+ [7.5, 9.0, 44.0, 9],
+ [7.5, 4.0, 10.0, 9],
+ [7.5, 4.0, 10.0, 9],
+ [10.0, 4.0, 16.0, 9],
+ [10.0, 4.0, 4.0, 9],
+ [10.0, 1.0, 44.0, 9],
+ [10.0, 1.0, 16.0, 9],
+ [10.0, 1.0, 30.0, 9],
+ [10.0, 1.0, 44.0, 9],
+ [10.0, 3.0, 4.0, 9],
+ [10.0, 3.0, 46.0, 9],
+ [10.0, 0.0, 14.0, 9],
+ [2.5, 1.0, 4.0, 8],
+ [2.5, 1.0, 18.0, 8],
+ [2.5, 1.0, 8.0, 8],
+ [2.5, 3.0, 32.0, 8],
+ [2.5, 3.0, 28.0, 8],
+ [2.5, 3.0, 46.0, 8],
+ [2.5, 3.0, 12.0, 8],
+ [2.5, 3.0, 18.0, 8],
+ [2.5, 0.0, 34.0, 8],
+ [2.5, 0.0, 22.0, 8],
+ [2.5, 2.0, 22.0, 8],
+ [2.5, 2.0, 14.0, 8],
+ [2.5, 2.0, 42.0, 8],
+ [2.5, 0.0, 16.0, 8],
+ [5.0, 4.0, 24.0, 8],
+ [5.0, 4.0, 26.0, 8],
+ [5.0, 0.0, 26.0, 8],
+ [5.0, 2.0, 44.0, 8],
+ [5.0, 2.0, 38.0, 8],
+ [5.0, 2.0, 48.0, 8],
+ [5.0, 2.0, 26.0, 8],
+ [5.0, 2.0, 6.0, 8],
+ [5.0, 4.0, 12.0, 8],
+ [5.0, 9.0, 36.0, 8],
+ [5.0, 9.0, 48.0, 8],
+ [5.0, 9.0, 16.0, 8],
+ [5.0, 9.0, 6.0, 8],
+ [7.5, 0.0, 34.0, 8],
+ [7.5, 6.0, 10.0, 8],
+ [7.5, 6.0, 12.0, 8],
+ [7.5, 6.0, 10.0, 8],
+ [7.5, 9.0, 26.0, 8],
+ [7.5, 9.0, 6.0, 8],
+ [7.5, 9.0, 40.0, 8],
+ [7.5, 9.0, 18.0, 8],
+ [7.5, 4.0, 20.0, 8],
+ [7.5, 4.0, 42.0, 8],
+ [7.5, 4.0, 16.0, 8],
+ [10.0, 5.0, 24.0, 8],
+ [10.0, 5.0, 44.0, 8],
+ [10.0, 5.0, 20.0, 8],
+ [10.0, 5.0, 22.0, 8],
+ [10.0, 3.0, 16.0, 8],
+ [10.0, 3.0, 14.0, 8],
+ [10.0, 3.0, 6.0, 8],
+ [10.0, 2.0, 24.0, 8],
+ [10.0, 2.0, 36.0, 8],
+ [10.0, 2.0, 46.0, 8],
+ [10.0, 0.0, 42.0, 8],
+ [10.0, 0.0, 26.0, 8],
+ [10.0, 0.0, 42.0, 8],
+ [10.0, 0.0, 10.0, 8],
+ [10.0, 9.0, 12.0, 8],
+ [10.0, 9.0, 8.0, 8],
+ [2.5, 4.0, 42.0, 7],
+ [2.5, 4.0, 14.0, 7],
+ [2.5, 4.0, 46.0, 7],
+ [2.5, 4.0, 18.0, 7],
+ [2.5, 2.0, 2.0, 7],
+ [2.5, 2.0, 38.0, 7],
+ [2.5, 2.0, 14.0, 7],
+ [2.5, 8.0, 26.0, 7],
+ [2.5, 7.0, 12.0, 7],
+ [2.5, 7.0, 46.0, 7],
+ [2.5, 1.0, 44.0, 7],
+ [5.0, 8.0, 26.0, 7],
+ [5.0, 0.0, 46.0, 7],
+ [5.0, 9.0, 44.0, 7],
+ [5.0, 9.0, 16.0, 7],
+ [5.0, 9.0, 40.0, 7],
+ [5.0, 5.0, 14.0, 7],
+ [5.0, 7.0, 6.0, 7],
+ [5.0, 7.0, 30.0, 7],
+ [7.5, 1.0, 16.0, 7],
+ [7.5, 1.0, 18.0, 7],
+ [7.5, 1.0, 30.0, 7],
+ [7.5, 1.0, 4.0, 7],
+ [7.5, 1.0, 10.0, 7],
+ [7.5, 1.0, 40.0, 7],
+ [7.5, 1.0, 18.0, 7],
+ [7.5, 3.0, 14.0, 7],
+ [7.5, 3.0, 48.0, 7],
+ [7.5, 3.0, 48.0, 7],
+ [7.5, 3.0, 6.0, 7],
+ [7.5, 0.0, 36.0, 7],
+ [7.5, 0.0, 42.0, 7],
+ [7.5, 0.0, 22.0, 7],
+ [10.0, 9.0, 8.0, 7],
+ [10.0, 9.0, 8.0, 7],
+ [10.0, 7.0, 36.0, 7],
+ [10.0, 7.0, 46.0, 7],
+ [10.0, 7.0, 20.0, 7],
+ [10.0, 7.0, 14.0, 7],
+ [10.0, 4.0, 32.0, 7],
+ [10.0, 4.0, 16.0, 7],
+ [10.0, 1.0, 24.0, 7],
+ [10.0, 1.0, 40.0, 7],
+ [10.0, 1.0, 18.0, 7],
+ [10.0, 1.0, 24.0, 7],
+ [10.0, 7.0, 30.0, 7],
+ [10.0, 7.0, 30.0, 7],
+ [2.5, 5.0, 24.0, 6],
+ [2.5, 5.0, 42.0, 6],
+ [2.5, 8.0, 34.0, 6],
+ [2.5, 8.0, 34.0, 6],
+ [2.5, 8.0, 48.0, 6],
+ [2.5, 8.0, 26.0, 6],
+ [2.5, 3.0, 28.0, 6],
+ [5.0, 4.0, 44.0, 6],
+ [5.0, 4.0, 46.0, 6],
+ [5.0, 6.0, 28.0, 6],
+ [5.0, 6.0, 46.0, 6],
+ [5.0, 2.0, 10.0, 6],
+ [5.0, 2.0, 4.0, 6],
+ [5.0, 2.0, 34.0, 6],
+ [5.0, 4.0, 46.0, 6],
+ [5.0, 4.0, 20.0, 6],
+ [7.5, 7.0, 2.0, 6],
+ [7.5, 6.0, 46.0, 6],
+ [7.5, 6.0, 48.0, 6],
+ [7.5, 6.0, 36.0, 6],
+ [7.5, 6.0, 42.0, 6],
+ [10.0, 7.0, 8.0, 6],
+ [10.0, 8.0, 18.0, 6],
+ [10.0, 8.0, 42.0, 6],
+ [10.0, 8.0, 32.0, 6],
+ [10.0, 2.0, 22.0, 6],
+ [10.0, 2.0, 28.0, 6],
+ [10.0, 2.0, 6.0, 6],
+ [10.0, 2.0, 36.0, 6],
+ [10.0, 2.0, 48.0, 6],
+ [10.0, 2.0, 28.0, 6],
+ [10.0, 2.0, 36.0, 6],
+ [10.0, 2.0, 6.0, 6],
+ [10.0, 9.0, 24.0, 6],
+ [2.5, 6.0, 42.0, 5],
+ [2.5, 6.0, 8.0, 5],
+ [2.5, 7.0, 20.0, 5],
+ [2.5, 7.0, 4.0, 5],
+ [2.5, 7.0, 16.0, 5],
+ [2.5, 5.0, 34.0, 5],
+ [2.5, 5.0, 22.0, 5],
+ [2.5, 2.0, 26.0, 5],
+ [2.5, 2.0, 38.0, 5],
+ [2.5, 2.0, 30.0, 5],
+ [5.0, 9.0, 42.0, 5],
+ [5.0, 9.0, 20.0, 5],
+ [5.0, 9.0, 32.0, 5],
+ [5.0, 6.0, 46.0, 5],
+ [5.0, 6.0, 14.0, 5],
+ [5.0, 0.0, 38.0, 5],
+ [5.0, 0.0, 16.0, 5],
+ [5.0, 4.0, 16.0, 5],
+ [5.0, 4.0, 42.0, 5],
+ [5.0, 4.0, 8.0, 5],
+ [5.0, 9.0, 2.0, 5],
+ [5.0, 9.0, 26.0, 5],
+ [7.5, 4.0, 20.0, 5],
+ [7.5, 4.0, 6.0, 5],
+ [7.5, 9.0, 6.0, 5],
+ [7.5, 9.0, 48.0, 5],
+ [7.5, 9.0, 46.0, 5],
+ [7.5, 9.0, 36.0, 5],
+ [7.5, 6.0, 40.0, 5],
+ [7.5, 3.0, 28.0, 5],
+ [7.5, 3.0, 24.0, 5],
+ [7.5, 7.0, 14.0, 5],
+ [7.5, 7.0, 26.0, 5],
+ [7.5, 7.0, 48.0, 5],
+ [7.5, 7.0, 16.0, 5],
+ [10.0, 4.0, 42.0, 5],
+ [10.0, 9.0, 42.0, 5],
+ [10.0, 9.0, 6.0, 5],
+ [10.0, 9.0, 12.0, 5],
+ [10.0, 0.0, 16.0, 5],
+ [10.0, 0.0, 14.0, 5],
+ [10.0, 8.0, 28.0, 5],
+ [10.0, 8.0, 12.0, 5],
+ [10.0, 8.0, 34.0, 5],
+ [10.0, 6.0, 22.0, 5],
+ [10.0, 6.0, 44.0, 5],
+ [10.0, 6.0, 32.0, 5]]) # yapf: disable
+
+MUNSELL_BOUNDING_HUES = np.array(
+ [[(2.5, 4.0), (2.5, 4.0)],
+ [(2.5, 4.0), (2.5, 4.0)],
+ [(2.5, 4.0), (2.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(5.0, 4.0), (7.5, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(10.0, 4.0), (10.0, 4.0)],
+ [(7.5, 4.0), (10.0, 4.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (2.5, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(2.5, 3.0), (5.0, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(5.0, 3.0), (7.5, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(7.5, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(10.0, 3.0), (10.0, 3.0)],
+ [(2.5, 2.0), (2.5, 2.0)],
+ [(2.5, 2.0), (2.5, 2.0)],
+ [(2.5, 2.0), (5.0, 2.0)],
+ [(2.5, 2.0), (5.0, 2.0)],
+ [(2.5, 2.0), (2.5, 2.0)],
+ [(2.5, 2.0), (5.0, 2.0)],
+ [(2.5, 2.0), (5.0, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(5.0, 2.0), (7.5, 2.0)],
+ [(7.5, 2.0), (10.0, 2.0)],
+ [(7.5, 2.0), (10.0, 2.0)],
+ [(10.0, 2.0), (10.0, 2.0)],
+ [(10.0, 2.0), (10.0, 2.0)],
+ [(7.5, 2.0), (10.0, 2.0)],
+ [(7.5, 2.0), (10.0, 2.0)],
+ [(2.5, 1.0), (5.0, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (5.0, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (5.0, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (5.0, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (2.5, 1.0)],
+ [(2.5, 1.0), (5.0, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(5.0, 1.0), (7.5, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(10.0, 1.0), (10.0, 1.0)],
+ [(7.5, 1.0), (10.0, 1.0)],
+ [(10.0, 1.0), (10.0, 1.0)],
+ [(10.0, 1.0), (10.0, 1.0)],
+ [(2.5, 10.0), (5.0, 10.0)],
+ [(2.5, 10.0), (5.0, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(2.5, 10.0), (2.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(5.0, 10.0), (7.5, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(7.5, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(10.0, 10.0), (10.0, 10.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (2.5, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(2.5, 9.0), (5.0, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(5.0, 9.0), (7.5, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(7.5, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(10.0, 9.0), (10.0, 9.0)],
+ [(2.5, 8.0), (2.5, 8.0)],
+ [(2.5, 8.0), (5.0, 8.0)],
+ [(2.5, 8.0), (5.0, 8.0)],
+ [(2.5, 8.0), (5.0, 8.0)],
+ [(2.5, 8.0), (2.5, 8.0)],
+ [(2.5, 8.0), (5.0, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(5.0, 8.0), (7.5, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(10.0, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(10.0, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(10.0, 8.0), (10.0, 8.0)],
+ [(10.0, 8.0), (10.0, 8.0)],
+ [(10.0, 8.0), (10.0, 8.0)],
+ [(7.5, 8.0), (10.0, 8.0)],
+ [(2.5, 7.0), (5.0, 7.0)],
+ [(2.5, 7.0), (5.0, 7.0)],
+ [(2.5, 7.0), (2.5, 7.0)],
+ [(2.5, 7.0), (5.0, 7.0)],
+ [(2.5, 7.0), (2.5, 7.0)],
+ [(2.5, 7.0), (5.0, 7.0)],
+ [(2.5, 7.0), (2.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(5.0, 7.0), (7.5, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(7.5, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(10.0, 7.0), (10.0, 7.0)],
+ [(2.5, 6.0), (5.0, 6.0)],
+ [(2.5, 6.0), (5.0, 6.0)],
+ [(2.5, 6.0), (2.5, 6.0)],
+ [(2.5, 6.0), (2.5, 6.0)],
+ [(2.5, 6.0), (2.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(5.0, 6.0), (7.5, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(10.0, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(7.5, 6.0), (10.0, 6.0)],
+ [(2.5, 5.0), (5.0, 5.0)],
+ [(2.5, 5.0), (2.5, 5.0)],
+ [(2.5, 5.0), (2.5, 5.0)],
+ [(2.5, 5.0), (5.0, 5.0)],
+ [(2.5, 5.0), (2.5, 5.0)],
+ [(2.5, 5.0), (2.5, 5.0)],
+ [(2.5, 5.0), (2.5, 5.0)],
+ [(2.5, 5.0), (5.0, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(5.0, 5.0), (7.5, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)],
+ [(7.5, 5.0), (10.0, 5.0)]]) # yapf: disable
+
+MUNSELL_HUE_TO_ANGLE = np.array(
+ [[2.5, 1, 208.750],
+ [2.5, 2, 153.750],
+ [2.5, 3, 118.750],
+ [2.5, 4, 63.750],
+ [2.5, 5, 39.375],
+ [2.5, 6, 16.875],
+ [2.5, 7, 348.750],
+ [2.5, 8, 300.000],
+ [2.5, 9, 251.250],
+ [2.5, 10, 236.250],
+ [5.0, 1, 225.000],
+ [5.0, 2, 160.000],
+ [5.0, 3, 135.000],
+ [5.0, 4, 70.000],
+ [5.0, 5, 45.000],
+ [5.0, 6, 22.500],
+ [5.0, 7, 0.000],
+ [5.0, 8, 315.000],
+ [5.0, 9, 255.000],
+ [5.0, 10, 240.000],
+ [7.5, 1, 228.750],
+ [7.5, 2, 176.250],
+ [7.5, 3, 141.250],
+ [7.5, 4, 86.250],
+ [7.5, 5, 51.250],
+ [7.5, 6, 28.125],
+ [7.5, 7, 5.625],
+ [7.5, 8, 326.250],
+ [7.5, 9, 270.000],
+ [7.5, 10, 243.750],
+ [10.0, 1, 232.500],
+ [10.0, 2, 192.500],
+ [10.0, 3, 147.500],
+ [10.0, 4, 102.500],
+ [10.0, 5, 57.500],
+ [10.0, 6, 33.750],
+ [10.0, 7, 11.250],
+ [10.0, 8, 337.500],
+ [10.0, 9, 285.000],
+ [10.0, 10, 247.500]]) # yapf: disable
+
+MUNSELL_HUE_TO_ASTM_HUE = np.array(
+ [[2.5, 0, 72.5],
+ [2.5, 1, 62.5],
+ [2.5, 2, 52.5],
+ [2.5, 3, 42.5],
+ [2.5, 4, 32.5],
+ [2.5, 5, 22.5],
+ [2.5, 6, 12.5],
+ [2.5, 7, 2.5],
+ [2.5, 8, 92.5],
+ [2.5, 9, 82.5],
+ [2.5, 10, 72.5],
+ [5.0, 0, 75.0],
+ [5.0, 1, 65.0],
+ [5.0, 2, 55.0],
+ [5.0, 3, 45.0],
+ [5.0, 4, 35.0],
+ [5.0, 5, 25.0],
+ [5.0, 6, 15.0],
+ [5.0, 7, 5.0],
+ [5.0, 8, 95.0],
+ [5.0, 9, 85.0],
+ [5.0, 10, 75.0],
+ [7.5, 0, 77.5],
+ [7.5, 1, 67.5],
+ [7.5, 2, 57.5],
+ [7.5, 3, 47.5],
+ [7.5, 4, 37.5],
+ [7.5, 5, 27.5],
+ [7.5, 6, 17.5],
+ [7.5, 7, 7.5],
+ [7.5, 8, 97.5],
+ [7.5, 9, 87.5],
+ [7.5, 10, 77.5],
+ [10.0, 0, 80.0],
+ [10.0, 1, 70.0],
+ [10.0, 2, 60.0],
+ [10.0, 3, 50.0],
+ [10.0, 4, 40.0],
+ [10.0, 5, 30.0],
+ [10.0, 6, 20.0],
+ [10.0, 7, 10.0],
+ [10.0, 8, 100.0],
+ [10.0, 9, 90.0],
+ [10.0, 10, 80.0]]) # yapf: disable
MUNSELL_INTERPOLATION_METHODS = (
'Radial',
@@ -1861,7 +1836,7 @@
'Linear',
'Radial',
'Radial',
- 'Radial')
+ 'Radial') # yapf: disable
MUNSELL_XY_FROM_RENOTATION_OVOID = (
(0.4333, 0.5602),
@@ -2355,7 +2330,7 @@
None,
None,
None,
- None)
+ None) # yapf: disable
MUNSELL_SPECIFICATIONS_TO_XY = (
((2.500000000000000, 8.000000000000000, 11.928546308350969, 4),
@@ -3075,7 +3050,7 @@
((9.345599185286883, 7.000000000000000, 17.488521757881820, 5),
(0.464927819285986, 0.537405269620011)),
((9.659595218511388, 8.000000000000000, 3.357217748484464, 5),
- (0.351436092963224, 0.377417525766746)))
+ (0.351436092963224, 0.377417525766746))) # yapf: disable
MUNSELL_COLOURS_TO_XYY = (
(0.41515095, 0.51288165, 0.57024410),
@@ -3421,7 +3396,7 @@
(0.37226961, 0.39738120, 0.23381716),
(0.35899980, 0.38250951, 0.36788985),
(0.46379107, 0.53608140, 0.45228296),
- (0.35180708, 0.37798088, 0.55904288))
+ (0.35180708, 0.37798088, 0.55904288)) # yapf: disable
MUNSELL_GREYS_TO_XYY = (
(0.31006, 0.31616, 0.00000000),
@@ -3448,8 +3423,9 @@
(0.31006, 0.31616, 0.71566876),
(0.31006, 0.31616, 0.80259539),
(0.31006, 0.31616, 0.89710353),
- (0.31006, 0.31616, 1.00000000))
+ (0.31006, 0.31616, 1.00000000)) # yapf: disable
+# yapf: disable
XYY_TO_MUNSELL_SPECIFICATIONS = (
((0.415150950000000, 0.512881650000000, 0.570244100000000),
(2.497425498445040, 7.965379827810718, 11.928549858473941, 4)),
@@ -3947,6 +3923,7 @@
(7.992180735900773, 6.616295461168346, 3.285836544709042, 5)),
((0.351807080000000, 0.377980880000000, 0.559042880000000),
(9.711479428331863, 7.899577772446339, 3.357708715547692, 5)))
+# yapf: enable
XYY_TO_MUNSELL_GREYS_SPECIFICATIONS = (
((0.31006, 0.31616, 0.00000000), 0.000000000000000),
@@ -3973,7 +3950,7 @@
((0.31006, 0.31616, 0.71566876), 8.749999993544938),
((0.31006, 0.31616, 0.80259539), 9.166666622097262),
((0.31006, 0.31616, 0.89710353), 9.583333299971065),
- ((0.31006, 0.31616, 1.00000000), 10.000000000000000))
+ ((0.31006, 0.31616, 1.00000000), 10.000000000000000)) # yapf: disable
NON_CONVERGING_XYY = (
(0.33159302, 0.43388935, 0.89380734),
@@ -3982,7 +3959,7 @@
(0.28155768, 0.33248001, 0.89992977),
(0.29624596, 0.31950269, 0.96665647),
(0.13833192, 0.07953813, 0.02236117),
- (0.22907253, 0.06719948, 0.06903321))
+ (0.22907253, 0.06719948, 0.06903321)) # yapf: disable
class TestMunsellValuePriest1920(unittest.TestCase):
@@ -3998,19 +3975,13 @@ def test_munsell_value_Priest1920(self):
"""
self.assertAlmostEqual(
- munsell_value_Priest1920(10.08),
- 3.17490157,
- places=7)
+ munsell_value_Priest1920(10.08), 3.17490157, places=7)
self.assertAlmostEqual(
- munsell_value_Priest1920(56.76),
- 7.53392328,
- places=7)
+ munsell_value_Priest1920(56.76), 7.53392328, places=7)
self.assertAlmostEqual(
- munsell_value_Priest1920(98.32),
- 9.91564420,
- places=7)
+ munsell_value_Priest1920(98.32), 9.91564420, places=7)
def test_n_dimensional_munsell_value_Priest1920(self):
"""
@@ -4021,30 +3992,22 @@ def test_n_dimensional_munsell_value_Priest1920(self):
Y = 10.08
V = 3.17490157
np.testing.assert_almost_equal(
- munsell_value_Priest1920(Y),
- V,
- decimal=7)
+ munsell_value_Priest1920(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- munsell_value_Priest1920(Y),
- V,
- decimal=7)
+ munsell_value_Priest1920(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
np.testing.assert_almost_equal(
- munsell_value_Priest1920(Y),
- V,
- decimal=7)
+ munsell_value_Priest1920(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
np.testing.assert_almost_equal(
- munsell_value_Priest1920(Y),
- V,
- decimal=7)
+ munsell_value_Priest1920(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_Priest1920(self):
@@ -4070,19 +4033,13 @@ def test_munsell_value_Munsell1933(self):
"""
self.assertAlmostEqual(
- munsell_value_Munsell1933(10.08),
- 3.79183555,
- places=7)
+ munsell_value_Munsell1933(10.08), 3.79183555, places=7)
self.assertAlmostEqual(
- munsell_value_Munsell1933(56.76),
- 8.27013182,
- places=7)
+ munsell_value_Munsell1933(56.76), 8.27013182, places=7)
self.assertAlmostEqual(
- munsell_value_Munsell1933(98.32),
- 9.95457711,
- places=7)
+ munsell_value_Munsell1933(98.32), 9.95457711, places=7)
def test_n_dimensional_munsell_value_Munsell1933(self):
"""
@@ -4093,30 +4050,22 @@ def test_n_dimensional_munsell_value_Munsell1933(self):
Y = 10.08
V = 3.79183555
np.testing.assert_almost_equal(
- munsell_value_Munsell1933(Y),
- V,
- decimal=7)
+ munsell_value_Munsell1933(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- munsell_value_Munsell1933(Y),
- V,
- decimal=7)
+ munsell_value_Munsell1933(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
np.testing.assert_almost_equal(
- munsell_value_Munsell1933(Y),
- V,
- decimal=7)
+ munsell_value_Munsell1933(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
np.testing.assert_almost_equal(
- munsell_value_Munsell1933(Y),
- V,
- decimal=7)
+ munsell_value_Munsell1933(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_Munsell1933(self):
@@ -4142,19 +4091,13 @@ def test_munsell_value_Moon1943(self):
"""
self.assertAlmostEqual(
- munsell_value_Moon1943(10.08),
- 3.74629715,
- places=7)
+ munsell_value_Moon1943(10.08), 3.74629715, places=7)
self.assertAlmostEqual(
- munsell_value_Moon1943(56.76),
- 7.82258143,
- places=7)
+ munsell_value_Moon1943(56.76), 7.82258143, places=7)
self.assertAlmostEqual(
- munsell_value_Moon1943(98.32),
- 9.88538236,
- places=7)
+ munsell_value_Moon1943(98.32), 9.88538236, places=7)
def test_n_dimensional_munsell_value_Moon1943(self):
"""
@@ -4164,31 +4107,19 @@ def test_n_dimensional_munsell_value_Moon1943(self):
Y = 10.08
V = 3.74629715
- np.testing.assert_almost_equal(
- munsell_value_Moon1943(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Moon1943(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- munsell_value_Moon1943(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Moon1943(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- munsell_value_Moon1943(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Moon1943(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
- np.testing.assert_almost_equal(
- munsell_value_Moon1943(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Moon1943(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_Moon1943(self):
@@ -4214,19 +4145,13 @@ def test_munsell_value_Saunderson1944(self):
"""
self.assertAlmostEqual(
- munsell_value_Saunderson1944(10.08),
- 3.68650806,
- places=7)
+ munsell_value_Saunderson1944(10.08), 3.68650806, places=7)
self.assertAlmostEqual(
- munsell_value_Saunderson1944(56.76),
- 7.89881184,
- places=7)
+ munsell_value_Saunderson1944(56.76), 7.89881184, places=7)
self.assertAlmostEqual(
- munsell_value_Saunderson1944(98.32),
- 9.85197101,
- places=7)
+ munsell_value_Saunderson1944(98.32), 9.85197101, places=7)
def test_n_dimensional_munsell_value_Saunderson1944(self):
"""
@@ -4237,30 +4162,22 @@ def test_n_dimensional_munsell_value_Saunderson1944(self):
Y = 10.08
V = 3.68650806
np.testing.assert_almost_equal(
- munsell_value_Saunderson1944(Y),
- V,
- decimal=7)
+ munsell_value_Saunderson1944(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- munsell_value_Saunderson1944(Y),
- V,
- decimal=7)
+ munsell_value_Saunderson1944(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
np.testing.assert_almost_equal(
- munsell_value_Saunderson1944(Y),
- V,
- decimal=7)
+ munsell_value_Saunderson1944(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
np.testing.assert_almost_equal(
- munsell_value_Saunderson1944(Y),
- V,
- decimal=7)
+ munsell_value_Saunderson1944(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_Saunderson1944(self):
@@ -4286,19 +4203,13 @@ def test_munsell_value_Ladd1955(self):
"""
self.assertAlmostEqual(
- munsell_value_Ladd1955(10.08),
- 3.69528622,
- places=7)
+ munsell_value_Ladd1955(10.08), 3.69528622, places=7)
self.assertAlmostEqual(
- munsell_value_Ladd1955(56.76),
- 7.84875137,
- places=7)
+ munsell_value_Ladd1955(56.76), 7.84875137, places=7)
self.assertAlmostEqual(
- munsell_value_Ladd1955(98.32),
- 9.75492814,
- places=7)
+ munsell_value_Ladd1955(98.32), 9.75492814, places=7)
def test_n_dimensional_munsell_value_Ladd1955(self):
"""
@@ -4308,31 +4219,19 @@ def test_n_dimensional_munsell_value_Ladd1955(self):
Y = 10.08
V = 3.69528622
- np.testing.assert_almost_equal(
- munsell_value_Ladd1955(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Ladd1955(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
- np.testing.assert_almost_equal(
- munsell_value_Ladd1955(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Ladd1955(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
- np.testing.assert_almost_equal(
- munsell_value_Ladd1955(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Ladd1955(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
- np.testing.assert_almost_equal(
- munsell_value_Ladd1955(Y),
- V,
- decimal=7)
+ np.testing.assert_almost_equal(munsell_value_Ladd1955(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_Ladd1955(self):
@@ -4358,19 +4257,13 @@ def test_munsell_value_McCamy1987(self):
"""
self.assertAlmostEqual(
- munsell_value_McCamy1987(10.08),
- 3.734723525854632,
- places=7)
+ munsell_value_McCamy1987(10.08), 3.734723525854632, places=7)
self.assertAlmostEqual(
- munsell_value_McCamy1987(56.76),
- 7.951693123402992,
- places=7)
+ munsell_value_McCamy1987(56.76), 7.951693123402992, places=7)
self.assertAlmostEqual(
- munsell_value_McCamy1987(98.32),
- 9.935265378231314,
- places=7)
+ munsell_value_McCamy1987(98.32), 9.935265378231314, places=7)
def test_n_dimensional_munsell_value_McCamy1987(self):
"""
@@ -4381,30 +4274,22 @@ def test_n_dimensional_munsell_value_McCamy1987(self):
Y = 10.08
V = 3.734723525854632
np.testing.assert_almost_equal(
- munsell_value_McCamy1987(Y),
- V,
- decimal=7)
+ munsell_value_McCamy1987(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- munsell_value_McCamy1987(Y),
- V,
- decimal=7)
+ munsell_value_McCamy1987(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
np.testing.assert_almost_equal(
- munsell_value_McCamy1987(Y),
- V,
- decimal=7)
+ munsell_value_McCamy1987(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
np.testing.assert_almost_equal(
- munsell_value_McCamy1987(Y),
- V,
- decimal=7)
+ munsell_value_McCamy1987(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_McCamy1987(self):
@@ -4430,19 +4315,13 @@ def test_munsell_value_ASTMD153508(self):
"""
self.assertAlmostEqual(
- munsell_value_ASTMD153508(10.08),
- 3.734476476931135,
- places=7)
+ munsell_value_ASTMD153508(10.08), 3.734476476931135, places=7)
self.assertAlmostEqual(
- munsell_value_ASTMD153508(56.76),
- 7.94992421,
- places=7)
+ munsell_value_ASTMD153508(56.76), 7.94992421, places=7)
self.assertAlmostEqual(
- munsell_value_ASTMD153508(98.32),
- 9.934372853115544,
- places=7)
+ munsell_value_ASTMD153508(98.32), 9.934372853115544, places=7)
def test_n_dimensional_munsell_value_ASTMD153508(self):
"""
@@ -4453,30 +4332,22 @@ def test_n_dimensional_munsell_value_ASTMD153508(self):
Y = 10.08
V = 3.734476476931135
np.testing.assert_almost_equal(
- munsell_value_ASTMD153508(Y),
- V,
- decimal=7)
+ munsell_value_ASTMD153508(Y), V, decimal=7)
V = np.tile(V, 6)
Y = np.tile(Y, 6)
np.testing.assert_almost_equal(
- munsell_value_ASTMD153508(Y),
- V,
- decimal=7)
+ munsell_value_ASTMD153508(Y), V, decimal=7)
V = np.reshape(V, (2, 3))
Y = np.reshape(Y, (2, 3))
np.testing.assert_almost_equal(
- munsell_value_ASTMD153508(Y),
- V,
- decimal=7)
+ munsell_value_ASTMD153508(Y), V, decimal=7)
V = np.reshape(V, (2, 3, 1))
Y = np.reshape(Y, (2, 3, 1))
np.testing.assert_almost_equal(
- munsell_value_ASTMD153508(Y),
- V,
- decimal=7)
+ munsell_value_ASTMD153508(Y), V, decimal=7)
@ignore_numpy_errors
def test_nan_munsell_value_ASTMD153508(self):
@@ -4545,9 +4416,7 @@ def test_xyY_to_munsell_specification(self):
for xyY, specification in XYY_TO_MUNSELL_SPECIFICATIONS:
np.testing.assert_almost_equal(
- xyY_to_munsell_specification(xyY),
- specification,
- decimal=7)
+ xyY_to_munsell_specification(xyY), specification, decimal=7)
for xyY in NON_CONVERGING_XYY:
self.assertRaises((RuntimeError, ValueError),
@@ -4555,9 +4424,7 @@ def test_xyY_to_munsell_specification(self):
for xyY, specification in XYY_TO_MUNSELL_GREYS_SPECIFICATIONS:
np.testing.assert_almost_equal(
- xyY_to_munsell_specification(xyY),
- specification,
- decimal=7)
+ xyY_to_munsell_specification(xyY), specification, decimal=7)
class TestxyY_to_munsell_colour(unittest.TestCase):
@@ -4591,11 +4458,11 @@ def test_parse_munsell_colour(self):
self.assertEqual(parse_munsell_colour('N5.2'), 5.2)
- self.assertTupleEqual(parse_munsell_colour('0YR 2.0/4.0'),
- (0.0, 2.0, 4.0, 6))
+ self.assertTupleEqual(
+ parse_munsell_colour('0YR 2.0/4.0'), (0.0, 2.0, 4.0, 6))
- self.assertTupleEqual(parse_munsell_colour('4.2YR 8.1/5.3'),
- (4.2, 8.1, 5.3, 6))
+ self.assertTupleEqual(
+ parse_munsell_colour('4.2YR 8.1/5.3'), (4.2, 8.1, 5.3, 6))
class TestIsGreyMunsellColour(unittest.TestCase):
@@ -4630,20 +4497,18 @@ def test_normalize_munsell_specification(self):
"""
self.assertTupleEqual(
- normalize_munsell_specification((0.0, 2.0, 4.0, 6)),
- (10.0, 2.0, 4.0, 7))
+ normalize_munsell_specification((0.0, 2.0, 4.0, 6)), (10.0, 2.0,
+ 4.0, 7))
self.assertTupleEqual(
- normalize_munsell_specification((0.0, 2.0, 4.0, 8)),
- (10.0, 2.0, 4.0, 9))
+ normalize_munsell_specification((0.0, 2.0, 4.0, 8)), (10.0, 2.0,
+ 4.0, 9))
self.assertTupleEqual(
- normalize_munsell_specification((0, 2.0, 4.0, 10)),
- (10.0, 2.0, 4.0, 1))
+ normalize_munsell_specification((0, 2.0, 4.0, 10)), (10.0, 2.0,
+ 4.0, 1))
- self.assertEqual(
- normalize_munsell_specification((0, 2.0, 0, 10)),
- 2)
+ self.assertEqual(normalize_munsell_specification((0, 2.0, 0, 10)), 2)
class TestMunsellColourToMunsellSpecification(unittest.TestCase):
@@ -4670,11 +4535,9 @@ def test_munsell_colour_to_munsell_specification(self):
munsell_colour_to_munsell_specification('10.0B 2.0/4.0'),
(10.0, 2.0, 4.0, 1))
- self.assertEqual(munsell_colour_to_munsell_specification('N5.2'),
- 5.2)
+ self.assertEqual(munsell_colour_to_munsell_specification('N5.2'), 5.2)
self.assertEqual(
- munsell_colour_to_munsell_specification('0.0YR 2.0/0.0'),
- 2)
+ munsell_colour_to_munsell_specification('0.0YR 2.0/0.0'), 2)
class TestMunsellSpecificationToMunsellColour(unittest.TestCase):
@@ -4701,8 +4564,7 @@ def test_munsell_specification_to_munsell_colour(self):
munsell_specification_to_munsell_colour((10.0, 2.0, 4.0, 1)),
'10.0B 2.0/4.0')
- self.assertEqual(munsell_specification_to_munsell_colour(5.2),
- 'N5.2')
+ self.assertEqual(munsell_specification_to_munsell_colour(5.2), 'N5.2')
class Test_xyY_fromRenotation(unittest.TestCase):
@@ -4845,8 +4707,9 @@ def test_xy_from_renotation_ovoid(self):
for i, specification in enumerate(MUNSELL_EVEN_SPECIFICATIONS):
if is_specification_in_renotation(specification):
- self.assertEqual(xy_from_renotation_ovoid(specification),
- MUNSELL_XY_FROM_RENOTATION_OVOID[i])
+ self.assertEqual(
+ xy_from_renotation_ovoid(specification),
+ MUNSELL_XY_FROM_RENOTATION_OVOID[i])
class TestLCHabToMunsellSpecification(unittest.TestCase):
@@ -4892,14 +4755,12 @@ def test_maximum_chroma_from_renotation(self):
definition.
"""
- self.assertEqual(maximum_chroma_from_renotation(2.5, 5, 5),
- 14.0)
+ self.assertEqual(maximum_chroma_from_renotation(2.5, 5, 5), 14.0)
- self.assertEqual(maximum_chroma_from_renotation(8.675, 1.225, 10),
- 48.0)
+ self.assertEqual(
+ maximum_chroma_from_renotation(8.675, 1.225, 10), 48.0)
- self.assertEqual(maximum_chroma_from_renotation(6.875, 3.425, 1),
- 16.0)
+ self.assertEqual(maximum_chroma_from_renotation(6.875, 3.425, 1), 16.0)
class TestMunsellSpecification_to_xy(unittest.TestCase):
@@ -4916,9 +4777,7 @@ def test_munsell_specification_to_xy(self):
for specification, xy in MUNSELL_SPECIFICATIONS_TO_XY:
np.testing.assert_almost_equal(
- munsell_specification_to_xy(specification),
- xy,
- decimal=7)
+ munsell_specification_to_xy(specification), xy, decimal=7)
for specification in MUNSELL_GREYS_SPECIFICATIONS:
np.testing.assert_array_equal(
diff --git a/colour/notation/tests/tests_triplet.py b/colour/notation/tests/tests_triplet.py
index 71c8b5d0a8..ab5caf3830 100644
--- a/colour/notation/tests/tests_triplet.py
+++ b/colour/notation/tests/tests_triplet.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.notation.triplet` module.
"""
@@ -11,9 +10,7 @@
import unittest
from itertools import permutations
-from colour.notation.triplet import (
- RGB_to_HEX,
- HEX_to_RGB)
+from colour.notation.triplet import (RGB_to_HEX, HEX_to_RGB)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -23,8 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_to_HEX',
- 'TestHEX_to_RGB']
+__all__ = ['TestRGB_to_HEX', 'TestHEX_to_RGB']
class TestRGB_to_HEX(unittest.TestCase):
diff --git a/colour/notation/triplet.py b/colour/notation/triplet.py
index 6af650f53e..5a8b5d4ce7 100644
--- a/colour/notation/triplet.py
+++ b/colour/notation/triplet.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Hexadecimal Triplet Notation
============================
@@ -22,8 +21,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RGB_to_HEX',
- 'HEX_to_RGB']
+__all__ = ['RGB_to_HEX', 'HEX_to_RGB']
def RGB_to_HEX(RGB):
@@ -94,9 +92,8 @@ def to_RGB(x):
Converts given hexadecimal representation to *RGB*.
"""
- length = len(x)
- return [int(x[i:i + length // 3], 16)
- for i in range(0, length, length // 3)]
+ l_x = len(x)
+ return [int(x[i:i + l_x // 3], 16) for i in range(0, l_x, l_x // 3)]
to_RGB_v = np.vectorize(to_RGB, otypes=[np.ndarray])
diff --git a/colour/phenomenons/__init__.py b/colour/phenomenons/__init__.py
index 861db0135c..d6c85c4f99 100644
--- a/colour/phenomenons/__init__.py
+++ b/colour/phenomenons/__init__.py
@@ -3,13 +3,10 @@
from __future__ import absolute_import
-from .rayleigh import (
- scattering_cross_section,
- rayleigh_optical_depth,
- rayleigh_scattering,
- rayleigh_scattering_spd)
+from .rayleigh import (scattering_cross_section, rayleigh_optical_depth,
+ rayleigh_scattering, rayleigh_scattering_spd)
-__all__ = ['scattering_cross_section',
- 'rayleigh_optical_depth',
- 'rayleigh_scattering',
- 'rayleigh_scattering_spd']
+__all__ = [
+ 'scattering_cross_section', 'rayleigh_optical_depth',
+ 'rayleigh_scattering', 'rayleigh_scattering_spd'
+]
diff --git a/colour/phenomenons/rayleigh.py b/colour/phenomenons/rayleigh.py
index 7deedc5b35..0870b1dc0f 100644
--- a/colour/phenomenons/rayleigh.py
+++ b/colour/phenomenons/rayleigh.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Rayleigh Optical Depth - Scattering in the Atmosphere
=====================================================
@@ -31,9 +30,8 @@
import numpy as np
-from colour.colorimetry import (
- DEFAULT_SPECTRAL_SHAPE,
- SpectralPowerDistribution)
+from colour.colorimetry import (DEFAULT_SPECTRAL_SHAPE,
+ SpectralPowerDistribution)
from colour.constants import AVOGADRO_CONSTANT
from colour.utilities import filter_kwargs
@@ -44,27 +42,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['STANDARD_AIR_TEMPERATURE',
- 'STANDARD_CO2_CONCENTRATION',
- 'AVERAGE_PRESSURE_MEAN_SEA_LEVEL',
- 'DEFAULT_LATITUDE',
- 'DEFAULT_ALTITUDE',
- 'air_refraction_index_Penndorf1957',
- 'air_refraction_index_Edlen1966',
- 'air_refraction_index_Peck1972',
- 'air_refraction_index_Bodhaine1999',
- 'N2_depolarisation',
- 'O2_depolarisation',
- 'F_air_Penndorf1957',
- 'F_air_Young1981',
- 'F_air_Bates1984',
- 'F_air_Bodhaine1999',
- 'molecular_density',
- 'mean_molecular_weights',
- 'gravity_List1968',
- 'scattering_cross_section',
- 'rayleigh_optical_depth',
- 'rayleigh_scattering']
+__all__ = [
+ 'STANDARD_AIR_TEMPERATURE', 'STANDARD_CO2_CONCENTRATION',
+ 'AVERAGE_PRESSURE_MEAN_SEA_LEVEL', 'DEFAULT_LATITUDE', 'DEFAULT_ALTITUDE',
+ 'air_refraction_index_Penndorf1957', 'air_refraction_index_Edlen1966',
+ 'air_refraction_index_Peck1972', 'air_refraction_index_Bodhaine1999',
+ 'N2_depolarisation', 'O2_depolarisation', 'F_air_Penndorf1957',
+ 'F_air_Young1981', 'F_air_Bates1984', 'F_air_Bodhaine1999',
+ 'molecular_density', 'mean_molecular_weights', 'gravity_List1968',
+ 'scattering_cross_section', 'rayleigh_optical_depth', 'rayleigh_scattering'
+]
STANDARD_AIR_TEMPERATURE = 288.15
"""
@@ -133,7 +120,7 @@ def air_refraction_index_Penndorf1957(wavelength):
n = 6432.8 + 2949810 / (146 - wl ** (-2)) + 25540 / (41 - wl ** (-2))
n /= 1.0e8
- n += + 1
+ n += +1
return n
@@ -168,7 +155,7 @@ def air_refraction_index_Edlen1966(wavelength):
n = 8342.13 + 2406030 / (130 - wl ** (-2)) + 15997 / (38.9 - wl ** (-2))
n /= 1.0e8
- n += + 1
+ n += +1
return n
@@ -205,14 +192,13 @@ def air_refraction_index_Peck1972(wavelength):
n = (8060.51 + 2480990 / (132.274 - wl ** (-2)) + 17455.7 /
(39.32957 - wl ** (-2)))
n /= 1.0e8
- n += + 1
+ n += +1
return n
def air_refraction_index_Bodhaine1999(
- wavelength,
- CO2_concentration=STANDARD_CO2_CONCENTRATION):
+ wavelength, CO2_concentration=STANDARD_CO2_CONCENTRATION):
"""
Returns the air refraction index :math:`n_s` from given wavelength
:math:`\lambda` in micrometers (:math:`\mu m`) using
@@ -627,8 +613,8 @@ def scattering_cross_section(wavelength,
F_air = F_air(**filter_kwargs(
F_air, wavelength=wl_micrometers, CO2_concentration=CO2_c))
- sigma = (24 * np.pi ** 3 * (n_s ** 2 - 1) ** 2 /
- (wl ** 4 * N_s ** 2 * (n_s ** 2 + 2) ** 2))
+ sigma = (24 * np.pi ** 3 * (n_s ** 2 - 1) ** 2 / (wl ** 4 * N_s ** 2 *
+ (n_s ** 2 + 2) ** 2))
sigma *= F_air
return sigma
@@ -693,12 +679,8 @@ def rayleigh_optical_depth(wavelength,
# Conversion from pascal to dyne/cm2.
P = np.asarray(pressure * 10)
- sigma = scattering_cross_section(wavelength,
- CO2_c,
- temperature,
- avogadro_constant,
- n_s,
- F_air)
+ sigma = scattering_cross_section(wavelength, CO2_c, temperature,
+ avogadro_constant, n_s, F_air)
m_a = mean_molecular_weights(CO2_c)
g = gravity_List1968(latitude, altitude)
@@ -762,18 +744,11 @@ def rayleigh_scattering_spd(shape=DEFAULT_SPECTRAL_SHAPE,
wavelengths = shape.range()
return SpectralPowerDistribution(
name=('Rayleigh Scattering - {0} ppm, {1} K, {2} Pa, {3} Degrees, '
- '{4} m').format(CO2_concentration,
- temperature,
- pressure,
- latitude,
- altitude),
- data=dict(zip(wavelengths,
- rayleigh_optical_depth(wavelengths * 10e-8,
- CO2_concentration,
- temperature,
- pressure,
- latitude,
- altitude,
- avogadro_constant,
- n_s,
- F_air))))
+ '{4} m').format(CO2_concentration, temperature, pressure,
+ latitude, altitude),
+ data=dict(
+ zip(wavelengths,
+ rayleigh_optical_depth(wavelengths * 10e-8, CO2_concentration,
+ temperature, pressure, latitude,
+ altitude, avogadro_constant, n_s,
+ F_air))))
diff --git a/colour/phenomenons/tests/tests_rayleigh.py b/colour/phenomenons/tests/tests_rayleigh.py
index 4dae3d88d3..40cf1d8503 100644
--- a/colour/phenomenons/tests/tests_rayleigh.py
+++ b/colour/phenomenons/tests/tests_rayleigh.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.phenomenons.rayleigh` module.
"""
@@ -12,23 +11,13 @@
from itertools import permutations
from colour.phenomenons.rayleigh import (
- air_refraction_index_Penndorf1957,
- air_refraction_index_Edlen1966,
- air_refraction_index_Peck1972,
- air_refraction_index_Bodhaine1999,
- N2_depolarisation,
- O2_depolarisation,
- F_air_Penndorf1957,
- F_air_Young1981,
- F_air_Bates1984,
- F_air_Bodhaine1999,
- molecular_density,
- mean_molecular_weights,
- gravity_List1968)
+ air_refraction_index_Penndorf1957, air_refraction_index_Edlen1966,
+ air_refraction_index_Peck1972, air_refraction_index_Bodhaine1999,
+ N2_depolarisation, O2_depolarisation, F_air_Penndorf1957, F_air_Young1981,
+ F_air_Bates1984, F_air_Bodhaine1999, molecular_density,
+ mean_molecular_weights, gravity_List1968)
from colour.phenomenons import (
- scattering_cross_section,
- rayleigh_optical_depth,
- rayleigh_scattering_spd)
+ scattering_cross_section, rayleigh_optical_depth, rayleigh_scattering_spd)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -38,23 +27,16 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['RAYLEIGH_SCATTERING_SPD_DATA',
- 'TestAirRefractionIndexPenndorf1957',
- 'TestAirRefractionIndexEdlen1966',
- 'TestAirRefractionIndexPeck1972',
- 'TestAirRefractionIndexBodhaine1999',
- 'TestN2Depolarisation',
- 'TestO2Depolarisation',
- 'TestF_airPenndorf1957',
- 'TestF_airYoung1981',
- 'TestF_airBates1984',
- 'TestF_airBodhaine1999',
- 'TestMolecularDensity',
- 'TestMeanMolecularWeights',
- 'TestGravityList1968',
- 'TestScatteringCrossSection',
- 'TestRayleighOpticalDepth',
- 'TestRayleighScatteringSpd']
+__all__ = [
+ 'RAYLEIGH_SCATTERING_SPD_DATA', 'TestAirRefractionIndexPenndorf1957',
+ 'TestAirRefractionIndexEdlen1966', 'TestAirRefractionIndexPeck1972',
+ 'TestAirRefractionIndexBodhaine1999', 'TestN2Depolarisation',
+ 'TestO2Depolarisation', 'TestF_airPenndorf1957', 'TestF_airYoung1981',
+ 'TestF_airBates1984', 'TestF_airBodhaine1999', 'TestMolecularDensity',
+ 'TestMeanMolecularWeights', 'TestGravityList1968',
+ 'TestScatteringCrossSection', 'TestRayleighOpticalDepth',
+ 'TestRayleighScatteringSpd'
+]
RAYLEIGH_SCATTERING_SPD_DATA = (
0.59910134,
@@ -477,7 +459,7 @@
0.02565374,
0.02552084,
0.02538880,
- 0.02525761)
+ 0.02525761) # yapf: disable
class TestAirRefractionIndexPenndorf1957(unittest.TestCase):
@@ -516,30 +498,22 @@ def test_n_dimensional_air_refraction_index_Penndorf1957(self):
wl = 0.360
n = 1.000285316795146
np.testing.assert_almost_equal(
- air_refraction_index_Penndorf1957(wl),
- n,
- decimal=7)
+ air_refraction_index_Penndorf1957(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
np.testing.assert_almost_equal(
- air_refraction_index_Penndorf1957(wl),
- n,
- decimal=7)
+ air_refraction_index_Penndorf1957(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
np.testing.assert_almost_equal(
- air_refraction_index_Penndorf1957(wl),
- n,
- decimal=7)
+ air_refraction_index_Penndorf1957(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
np.testing.assert_almost_equal(
- air_refraction_index_Penndorf1957(wl),
- n,
- decimal=7)
+ air_refraction_index_Penndorf1957(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_air_refraction_index_Penndorf1957(self):
@@ -588,30 +562,22 @@ def test_n_dimensional_air_refraction_index_Edlen1966(self):
wl = 0.360
n = 1.000285308809879
np.testing.assert_almost_equal(
- air_refraction_index_Edlen1966(wl),
- n,
- decimal=7)
+ air_refraction_index_Edlen1966(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
np.testing.assert_almost_equal(
- air_refraction_index_Edlen1966(wl),
- n,
- decimal=7)
+ air_refraction_index_Edlen1966(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
np.testing.assert_almost_equal(
- air_refraction_index_Edlen1966(wl),
- n,
- decimal=7)
+ air_refraction_index_Edlen1966(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
np.testing.assert_almost_equal(
- air_refraction_index_Edlen1966(wl),
- n,
- decimal=7)
+ air_refraction_index_Edlen1966(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_air_refraction_index_Edlen1966(self):
@@ -637,19 +603,13 @@ def test_air_refraction_index_Peck1972(self):
"""
self.assertAlmostEqual(
- air_refraction_index_Peck1972(0.360),
- 1.000285310285056,
- places=10)
+ air_refraction_index_Peck1972(0.360), 1.000285310285056, places=10)
self.assertAlmostEqual(
- air_refraction_index_Peck1972(0.555),
- 1.000277726541484,
- places=10)
+ air_refraction_index_Peck1972(0.555), 1.000277726541484, places=10)
self.assertAlmostEqual(
- air_refraction_index_Peck1972(0.830),
- 1.000274859144804,
- places=10)
+ air_refraction_index_Peck1972(0.830), 1.000274859144804, places=10)
def test_n_dimensional_air_refraction_index_Peck1972(self):
"""
@@ -660,30 +620,22 @@ def test_n_dimensional_air_refraction_index_Peck1972(self):
wl = 0.360
n = 1.000285310285056
np.testing.assert_almost_equal(
- air_refraction_index_Peck1972(wl),
- n,
- decimal=7)
+ air_refraction_index_Peck1972(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
np.testing.assert_almost_equal(
- air_refraction_index_Peck1972(wl),
- n,
- decimal=7)
+ air_refraction_index_Peck1972(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
np.testing.assert_almost_equal(
- air_refraction_index_Peck1972(wl),
- n,
- decimal=7)
+ air_refraction_index_Peck1972(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
np.testing.assert_almost_equal(
- air_refraction_index_Peck1972(wl),
- n,
- decimal=7)
+ air_refraction_index_Peck1972(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_air_refraction_index_Peck1972(self):
@@ -747,30 +699,22 @@ def test_n_dimensional_air_refraction_index_Bodhaine1999(self):
wl = 0.360
n = 1.000285310285056
np.testing.assert_almost_equal(
- air_refraction_index_Bodhaine1999(wl),
- n,
- decimal=7)
+ air_refraction_index_Bodhaine1999(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
np.testing.assert_almost_equal(
- air_refraction_index_Bodhaine1999(wl),
- n,
- decimal=7)
+ air_refraction_index_Bodhaine1999(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
np.testing.assert_almost_equal(
- air_refraction_index_Bodhaine1999(wl),
- n,
- decimal=7)
+ air_refraction_index_Bodhaine1999(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
np.testing.assert_almost_equal(
- air_refraction_index_Bodhaine1999(wl),
- n,
- decimal=7)
+ air_refraction_index_Bodhaine1999(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_air_refraction_index_Bodhaine1999(self):
@@ -799,19 +743,13 @@ def test_N2_depolarisation(self):
"""
self.assertAlmostEqual(
- N2_depolarisation(0.360),
- 1.036445987654321,
- places=7)
+ N2_depolarisation(0.360), 1.036445987654321, places=7)
self.assertAlmostEqual(
- N2_depolarisation(0.555),
- 1.035029137245354,
- places=7)
+ N2_depolarisation(0.555), 1.035029137245354, places=7)
self.assertAlmostEqual(
- N2_depolarisation(0.830),
- 1.034460153868486,
- places=7)
+ N2_depolarisation(0.830), 1.034460153868486, places=7)
def test_n_dimensional_N2_depolarisation(self):
"""
@@ -821,31 +759,19 @@ def test_n_dimensional_N2_depolarisation(self):
wl = 0.360
n = 1.036445987654321
- np.testing.assert_almost_equal(
- N2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(N2_depolarisation(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- N2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(N2_depolarisation(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- N2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(N2_depolarisation(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- N2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(N2_depolarisation(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_N2_depolarisation(self):
@@ -854,8 +780,7 @@ def test_nan_N2_depolarisation(self):
nan support.
"""
- N2_depolarisation(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ N2_depolarisation(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestO2Depolarisation(unittest.TestCase):
@@ -870,19 +795,13 @@ def test_O2_depolarisation(self):
"""
self.assertAlmostEqual(
- O2_depolarisation(0.360),
- 1.115307746532541,
- places=7)
+ O2_depolarisation(0.360), 1.115307746532541, places=7)
self.assertAlmostEqual(
- O2_depolarisation(0.555),
- 1.102022536201071,
- places=7)
+ O2_depolarisation(0.555), 1.102022536201071, places=7)
self.assertAlmostEqual(
- O2_depolarisation(0.830),
- 1.098315561269013,
- places=7)
+ O2_depolarisation(0.830), 1.098315561269013, places=7)
def test_n_dimensional_O2_depolarisation(self):
"""
@@ -892,31 +811,19 @@ def test_n_dimensional_O2_depolarisation(self):
wl = 0.360
n = 1.115307746532541
- np.testing.assert_almost_equal(
- O2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(O2_depolarisation(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- O2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(O2_depolarisation(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- O2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(O2_depolarisation(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- O2_depolarisation(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(O2_depolarisation(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_O2_depolarisation(self):
@@ -925,8 +832,7 @@ def test_nan_O2_depolarisation(self):
nan support.
"""
- O2_depolarisation(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ O2_depolarisation(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestF_airPenndorf1957(unittest.TestCase):
@@ -951,31 +857,19 @@ def test_n_dimensional_F_air_Penndorf1957(self):
wl = 0.360
n = 1.0608
- np.testing.assert_almost_equal(
- F_air_Penndorf1957(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Penndorf1957(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- F_air_Penndorf1957(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Penndorf1957(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- F_air_Penndorf1957(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Penndorf1957(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- F_air_Penndorf1957(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Penndorf1957(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_F_air_Penndorf1957(self):
@@ -984,8 +878,7 @@ def test_nan_F_air_Penndorf1957(self):
nan support.
"""
- F_air_Penndorf1957(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ F_air_Penndorf1957(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestF_airYoung1981(unittest.TestCase):
@@ -1009,31 +902,19 @@ def test_n_dimensional_F_air_Young1981(self):
wl = 0.360
n = 1.0480
- np.testing.assert_almost_equal(
- F_air_Young1981(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Young1981(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- F_air_Young1981(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Young1981(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- F_air_Young1981(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Young1981(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- F_air_Young1981(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Young1981(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_F_air_Young1981(self):
@@ -1042,8 +923,7 @@ def test_nan_F_air_Young1981(self):
nan support.
"""
- F_air_Young1981(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ F_air_Young1981(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestF_airBates1984(unittest.TestCase):
@@ -1058,19 +938,13 @@ def test_F_air_Bates1984(self):
"""
self.assertAlmostEqual(
- F_air_Bates1984(0.360),
- 1.051997277711708,
- places=7)
+ F_air_Bates1984(0.360), 1.051997277711708, places=7)
self.assertAlmostEqual(
- F_air_Bates1984(0.555),
- 1.048153579718658,
- places=7)
+ F_air_Bates1984(0.555), 1.048153579718658, places=7)
self.assertAlmostEqual(
- F_air_Bates1984(0.830),
- 1.046947068600589,
- places=7)
+ F_air_Bates1984(0.830), 1.046947068600589, places=7)
def test_n_dimensional_F_air_Bates1984(self):
"""
@@ -1080,31 +954,19 @@ def test_n_dimensional_F_air_Bates1984(self):
wl = 0.360
n = 1.051997277711708
- np.testing.assert_almost_equal(
- F_air_Bates1984(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bates1984(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- F_air_Bates1984(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bates1984(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- F_air_Bates1984(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bates1984(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- F_air_Bates1984(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bates1984(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_F_air_Bates1984(self):
@@ -1113,8 +975,7 @@ def test_nan_F_air_Bates1984(self):
nan support.
"""
- F_air_Bates1984(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ F_air_Bates1984(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestF_airBodhaine1999(unittest.TestCase):
@@ -1130,34 +991,22 @@ def test_F_air_Bodhaine1999(self):
"""
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.360),
- 1.125664021159081,
- places=7)
+ F_air_Bodhaine1999(0.360), 1.125664021159081, places=7)
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.555),
- 1.124691670240156,
- places=7)
+ F_air_Bodhaine1999(0.555), 1.124691670240156, places=7)
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.830),
- 1.124386455783539,
- places=7)
+ F_air_Bodhaine1999(0.830), 1.124386455783539, places=7)
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.360, 0),
- 1.052629792313939,
- places=7)
+ F_air_Bodhaine1999(0.360, 0), 1.052629792313939, places=7)
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.555, 360),
- 1.127993015096689,
- places=7)
+ F_air_Bodhaine1999(0.555, 360), 1.127993015096689, places=7)
self.assertAlmostEqual(
- F_air_Bodhaine1999(0.830, 620),
- 1.13577082,
- places=7)
+ F_air_Bodhaine1999(0.830, 620), 1.13577082, places=7)
def test_n_dimensional_F_air_Bodhaine1999(self):
"""
@@ -1167,31 +1016,19 @@ def test_n_dimensional_F_air_Bodhaine1999(self):
wl = 0.360
n = 1.125664021159081
- np.testing.assert_almost_equal(
- F_air_Bodhaine1999(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bodhaine1999(wl), n, decimal=7)
wl = np.tile(wl, 6)
n = np.tile(n, 6)
- np.testing.assert_almost_equal(
- F_air_Bodhaine1999(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bodhaine1999(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3))
n = np.reshape(n, (2, 3))
- np.testing.assert_almost_equal(
- F_air_Bodhaine1999(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bodhaine1999(wl), n, decimal=7)
wl = np.reshape(wl, (2, 3, 1))
n = np.reshape(n, (2, 3, 1))
- np.testing.assert_almost_equal(
- F_air_Bodhaine1999(wl),
- n,
- decimal=7)
+ np.testing.assert_almost_equal(F_air_Bodhaine1999(wl), n, decimal=7)
@ignore_numpy_errors
def test_nan_F_air_Bodhaine1999(self):
@@ -1220,19 +1057,13 @@ def test_molecular_density(self):
"""
self.assertAlmostEqual(
- molecular_density(200),
- 3.669449208173649e+19,
- delta=10000)
+ molecular_density(200), 3.669449208173649e+19, delta=10000)
self.assertAlmostEqual(
- molecular_density(300),
- 2.4462994721157665e+19,
- delta=10000)
+ molecular_density(300), 2.4462994721157665e+19, delta=10000)
self.assertAlmostEqual(
- molecular_density(400),
- 1.834724604086825e+19,
- delta=10000)
+ molecular_density(400), 1.834724604086825e+19, delta=10000)
def test_n_dimensional_molecular_density(self):
"""
@@ -1243,30 +1074,22 @@ def test_n_dimensional_molecular_density(self):
temperature = 200
N_s = 3.669449208173649e+19
np.testing.assert_almost_equal(
- molecular_density(temperature),
- N_s,
- decimal=7)
+ molecular_density(temperature), N_s, decimal=7)
temperature = np.tile(temperature, 6)
N_s = np.tile(N_s, 6)
np.testing.assert_almost_equal(
- molecular_density(temperature),
- N_s,
- decimal=7)
+ molecular_density(temperature), N_s, decimal=7)
temperature = np.reshape(temperature, (2, 3))
N_s = np.reshape(N_s, (2, 3))
np.testing.assert_almost_equal(
- molecular_density(temperature),
- N_s,
- decimal=7)
+ molecular_density(temperature), N_s, decimal=7)
temperature = np.reshape(temperature, (2, 3, 1))
N_s = np.reshape(N_s, (2, 3, 1))
np.testing.assert_almost_equal(
- molecular_density(temperature),
- N_s,
- decimal=7)
+ molecular_density(temperature), N_s, decimal=7)
@ignore_numpy_errors
def test_nan_molecular_density(self):
@@ -1275,8 +1098,7 @@ def test_nan_molecular_density(self):
nan support.
"""
- molecular_density(
- np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
+ molecular_density(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
class TestMeanMolecularWeights(unittest.TestCase):
@@ -1291,20 +1113,13 @@ def test_mean_molecular_weights(self):
definition.
"""
- self.assertAlmostEqual(
- mean_molecular_weights(0),
- 28.9595,
- places=7)
+ self.assertAlmostEqual(mean_molecular_weights(0), 28.9595, places=7)
self.assertAlmostEqual(
- mean_molecular_weights(360),
- 28.964920015999997,
- places=7)
+ mean_molecular_weights(360), 28.964920015999997, places=7)
self.assertAlmostEqual(
- mean_molecular_weights(620),
- 28.968834471999998,
- places=7)
+ mean_molecular_weights(620), 28.968834471999998, places=7)
def test_n_dimensional_mean_molecular_weights(self):
"""
@@ -1315,30 +1130,22 @@ def test_n_dimensional_mean_molecular_weights(self):
CO2_c = 300
m_a = 28.964016679999997
np.testing.assert_almost_equal(
- mean_molecular_weights(CO2_c),
- m_a,
- decimal=7)
+ mean_molecular_weights(CO2_c), m_a, decimal=7)
CO2_c = np.tile(CO2_c, 6)
m_a = np.tile(m_a, 6)
np.testing.assert_almost_equal(
- mean_molecular_weights(CO2_c),
- m_a,
- decimal=7)
+ mean_molecular_weights(CO2_c), m_a, decimal=7)
CO2_c = np.reshape(CO2_c, (2, 3))
m_a = np.reshape(m_a, (2, 3))
np.testing.assert_almost_equal(
- mean_molecular_weights(CO2_c),
- m_a,
- decimal=7)
+ mean_molecular_weights(CO2_c), m_a, decimal=7)
CO2_c = np.reshape(CO2_c, (2, 3, 1))
m_a = np.reshape(m_a, (2, 3, 1))
np.testing.assert_almost_equal(
- mean_molecular_weights(CO2_c),
- m_a,
- decimal=7)
+ mean_molecular_weights(CO2_c), m_a, decimal=7)
@ignore_numpy_errors
def test_nan_mean_molecular_weights(self):
@@ -1362,20 +1169,13 @@ def test_gravity_List1968(self):
Tests :func:`colour.phenomenons.rayleigh.gravity_List1968` definition.
"""
- self.assertAlmostEqual(
- gravity_List1968(0, 0),
- 978.03560706,
- places=7)
+ self.assertAlmostEqual(gravity_List1968(0, 0), 978.03560706, places=7)
self.assertAlmostEqual(
- gravity_List1968(45, 1500),
- 980.15334386,
- places=7)
+ gravity_List1968(45, 1500), 980.15334386, places=7)
self.assertAlmostEqual(
- gravity_List1968(48.8567, 35),
- 980.95241784,
- places=7)
+ gravity_List1968(48.8567, 35), 980.95241784, places=7)
def test_n_dimensional_gravity_List1968(self):
"""
@@ -1384,28 +1184,16 @@ def test_n_dimensional_gravity_List1968(self):
"""
g = 978.03560706
- np.testing.assert_almost_equal(
- gravity_List1968(),
- g,
- decimal=7)
+ np.testing.assert_almost_equal(gravity_List1968(), g, decimal=7)
g = np.tile(g, 6)
- np.testing.assert_almost_equal(
- gravity_List1968(),
- g,
- decimal=7)
+ np.testing.assert_almost_equal(gravity_List1968(), g, decimal=7)
g = np.reshape(g, (2, 3))
- np.testing.assert_almost_equal(
- gravity_List1968(),
- g,
- decimal=7)
+ np.testing.assert_almost_equal(gravity_List1968(), g, decimal=7)
g = np.reshape(g, (2, 3, 1))
- np.testing.assert_almost_equal(
- gravity_List1968(),
- g,
- decimal=7)
+ np.testing.assert_almost_equal(gravity_List1968(), g, decimal=7)
@ignore_numpy_errors
def test_nan_gravity_List1968(self):
@@ -1488,27 +1276,19 @@ def test_n_dimensional_scattering_cross_section(self):
wl = 360 * 10e-8
sigma = 2.781289234802031e-26
np.testing.assert_almost_equal(
- scattering_cross_section(wl),
- sigma,
- decimal=32)
+ scattering_cross_section(wl), sigma, decimal=32)
sigma = np.tile(sigma, 6)
np.testing.assert_almost_equal(
- scattering_cross_section(wl),
- sigma,
- decimal=32)
+ scattering_cross_section(wl), sigma, decimal=32)
sigma = np.reshape(sigma, (2, 3))
np.testing.assert_almost_equal(
- scattering_cross_section(wl),
- sigma,
- decimal=32)
+ scattering_cross_section(wl), sigma, decimal=32)
sigma = np.reshape(sigma, (2, 3, 1))
np.testing.assert_almost_equal(
- scattering_cross_section(wl),
- sigma,
- decimal=32)
+ scattering_cross_section(wl), sigma, decimal=32)
@ignore_numpy_errors
def test_nan_scattering_cross_section(self):
@@ -1523,8 +1303,8 @@ def test_nan_scattering_cross_section(self):
wavelength = case
CO2_concentration = case
temperature = case
- scattering_cross_section(
- wavelength, CO2_concentration, temperature)
+ scattering_cross_section(wavelength, CO2_concentration,
+ temperature)
class TestRayleighOpticalDepth(unittest.TestCase):
@@ -1540,19 +1320,13 @@ def test_rayleigh_optical_depth(self):
"""
self.assertAlmostEqual(
- rayleigh_optical_depth(360 * 10e-8),
- 0.599101336848028,
- places=7)
+ rayleigh_optical_depth(360 * 10e-8), 0.599101336848028, places=7)
self.assertAlmostEqual(
- rayleigh_optical_depth(555 * 10e-8),
- 0.100407017728965,
- places=7)
+ rayleigh_optical_depth(555 * 10e-8), 0.100407017728965, places=7)
self.assertAlmostEqual(
- rayleigh_optical_depth(830 * 10e-8),
- 0.019655847912114,
- places=7)
+ rayleigh_optical_depth(830 * 10e-8), 0.019655847912114, places=7)
self.assertAlmostEqual(
rayleigh_optical_depth(555 * 10e-8, 0),
@@ -1623,27 +1397,19 @@ def test_n_dimensional_rayleigh_optical_depth(self):
wl = 360 * 10e-8
T_R = 0.599101336848028
np.testing.assert_almost_equal(
- rayleigh_optical_depth(wl),
- T_R,
- decimal=7)
+ rayleigh_optical_depth(wl), T_R, decimal=7)
T_R = np.tile(T_R, 6)
np.testing.assert_almost_equal(
- rayleigh_optical_depth(wl),
- T_R,
- decimal=7)
+ rayleigh_optical_depth(wl), T_R, decimal=7)
T_R = np.reshape(T_R, (2, 3))
np.testing.assert_almost_equal(
- rayleigh_optical_depth(wl),
- T_R,
- decimal=7)
+ rayleigh_optical_depth(wl), T_R, decimal=7)
T_R = np.reshape(T_R, (2, 3, 1))
np.testing.assert_almost_equal(
- rayleigh_optical_depth(wl),
- T_R,
- decimal=7)
+ rayleigh_optical_depth(wl), T_R, decimal=7)
@ignore_numpy_errors
def test_nan_rayleigh_optical_depth(self):
@@ -1660,8 +1426,8 @@ def test_nan_rayleigh_optical_depth(self):
temperature = case
latitude = case
altitude = case
- rayleigh_optical_depth(
- wavelength, CO2_concentration, temperature, latitude, altitude)
+ rayleigh_optical_depth(wavelength, CO2_concentration, temperature,
+ latitude, altitude)
class TestRayleighScatteringSpd(unittest.TestCase):
diff --git a/colour/plotting/__init__.py b/colour/plotting/__init__.py
index 7ec8322ce5..d6d63d4098 100644
--- a/colour/plotting/__init__.py
+++ b/colour/plotting/__init__.py
@@ -6,59 +6,30 @@
from .dataset import * # noqa
from . import dataset
from .common import (
- PLOTTING_RESOURCES_DIRECTORY,
- DEFAULT_FIGURE_ASPECT_RATIO,
- DEFAULT_FIGURE_WIDTH,
- DEFAULT_FIGURE_HEIGHT,
- DEFAULT_FIGURE_SIZE,
- DEFAULT_FONT_SIZE,
- DEFAULT_COLOUR_CYCLE,
- DEFAULT_HATCH_PATTERNS,
- DEFAULT_PARAMETERS,
- DEFAULT_PLOTTING_ILLUMINANT,
- DEFAULT_PLOTTING_ENCODING_CCTF,
- colour_plotting_defaults,
- ColourParameter,
- colour_cycle,
- canvas,
- camera,
- decorate,
- boundaries,
- display,
- label_rectangles,
- equal_axes3d,
- get_RGB_colourspace,
- get_cmfs,
- get_illuminant,
- colour_parameters_plot,
- single_colour_plot,
- multi_colour_plot,
- image_plot)
+ PLOTTING_RESOURCES_DIRECTORY, DEFAULT_FIGURE_ASPECT_RATIO,
+ DEFAULT_FIGURE_WIDTH, DEFAULT_FIGURE_HEIGHT, DEFAULT_FIGURE_SIZE,
+ DEFAULT_FONT_SIZE, DEFAULT_COLOUR_CYCLE, DEFAULT_HATCH_PATTERNS,
+ DEFAULT_PARAMETERS, DEFAULT_PLOTTING_ILLUMINANT,
+ DEFAULT_PLOTTING_ENCODING_CCTF, colour_plotting_defaults, ColourParameter,
+ colour_cycle, canvas, camera, decorate, boundaries, display,
+ label_rectangles, equal_axes3d, get_RGB_colourspace, get_cmfs,
+ get_illuminant, colour_parameters_plot, single_colour_plot,
+ multi_colour_plot, image_plot)
from .colorimetry import (
- single_spd_plot,
- multi_spd_plot,
- single_cmfs_plot,
- multi_cmfs_plot,
- single_illuminant_relative_spd_plot,
- multi_illuminants_relative_spd_plot,
- visible_spectrum_plot,
- single_lightness_function_plot,
- multi_lightness_function_plot,
- blackbody_spectral_radiance_plot,
+ single_spd_plot, multi_spd_plot, single_cmfs_plot, multi_cmfs_plot,
+ single_illuminant_relative_spd_plot, multi_illuminants_relative_spd_plot,
+ visible_spectrum_plot, single_lightness_function_plot,
+ multi_lightness_function_plot, blackbody_spectral_radiance_plot,
blackbody_colours_plot)
from .characterisation import colour_checker_plot
-from .diagrams import (
- CIE_1931_chromaticity_diagram_plot,
- CIE_1960_UCS_chromaticity_diagram_plot,
- CIE_1976_UCS_chromaticity_diagram_plot,
- spds_CIE_1931_chromaticity_diagram_plot,
- spds_CIE_1960_UCS_chromaticity_diagram_plot,
- spds_CIE_1976_UCS_chromaticity_diagram_plot)
+from .diagrams import (CIE_1931_chromaticity_diagram_plot,
+ CIE_1960_UCS_chromaticity_diagram_plot,
+ CIE_1976_UCS_chromaticity_diagram_plot,
+ spds_CIE_1931_chromaticity_diagram_plot,
+ spds_CIE_1960_UCS_chromaticity_diagram_plot,
+ spds_CIE_1976_UCS_chromaticity_diagram_plot)
from .corresponding import corresponding_chromaticities_prediction_plot
-from .geometry import (
- quad,
- grid,
- cube)
+from .geometry import (quad, grid, cube)
from .models import (
RGB_colourspaces_CIE_1931_chromaticity_diagram_plot,
RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot,
@@ -66,17 +37,14 @@
RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot,
RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot,
RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot,
- single_cctf_plot,
- multi_cctf_plot)
-from .notation import (
- single_munsell_value_function_plot,
- multi_munsell_value_function_plot)
+ single_cctf_plot, multi_cctf_plot)
+from .notation import (single_munsell_value_function_plot,
+ multi_munsell_value_function_plot)
from .phenomenon import single_rayleigh_scattering_spd_plot, the_blue_sky_plot
-from .quality import (
- single_spd_colour_rendering_index_bars_plot,
- multi_spd_colour_rendering_index_bars_plot,
- single_spd_colour_quality_scale_bars_plot,
- multi_spd_colour_quality_scale_bars_plot)
+from .quality import (single_spd_colour_rendering_index_bars_plot,
+ multi_spd_colour_rendering_index_bars_plot,
+ single_spd_colour_quality_scale_bars_plot,
+ multi_spd_colour_quality_scale_bars_plot)
from .temperature import (
planckian_locus_CIE_1931_chromaticity_diagram_plot,
planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot)
@@ -85,61 +53,35 @@
__all__ = []
__all__ += dataset.__all__
__all__ += [
- 'PLOTTING_RESOURCES_DIRECTORY',
- 'DEFAULT_FIGURE_ASPECT_RATIO',
- 'DEFAULT_FIGURE_WIDTH',
- 'DEFAULT_FIGURE_HEIGHT',
- 'DEFAULT_FIGURE_SIZE',
- 'DEFAULT_FONT_SIZE',
- 'DEFAULT_COLOUR_CYCLE',
- 'DEFAULT_HATCH_PATTERNS',
- 'DEFAULT_PARAMETERS',
- 'DEFAULT_PLOTTING_ILLUMINANT',
- 'DEFAULT_PLOTTING_ENCODING_CCTF',
- 'colour_plotting_defaults',
- 'ColourParameter',
- 'colour_cycle',
- 'canvas',
- 'camera',
- 'decorate',
- 'boundaries',
- 'display',
- 'label_rectangles',
- 'equal_axes3d',
- 'get_RGB_colourspace',
- 'get_cmfs',
- 'get_illuminant',
- 'colour_parameters_plot',
- 'single_colour_plot',
- 'multi_colour_plot',
- 'image_plot']
+ 'PLOTTING_RESOURCES_DIRECTORY', 'DEFAULT_FIGURE_ASPECT_RATIO',
+ 'DEFAULT_FIGURE_WIDTH', 'DEFAULT_FIGURE_HEIGHT', 'DEFAULT_FIGURE_SIZE',
+ 'DEFAULT_FONT_SIZE', 'DEFAULT_COLOUR_CYCLE', 'DEFAULT_HATCH_PATTERNS',
+ 'DEFAULT_PARAMETERS', 'DEFAULT_PLOTTING_ILLUMINANT',
+ 'DEFAULT_PLOTTING_ENCODING_CCTF', 'colour_plotting_defaults',
+ 'ColourParameter', 'colour_cycle', 'canvas', 'camera', 'decorate',
+ 'boundaries', 'display', 'label_rectangles', 'equal_axes3d',
+ 'get_RGB_colourspace', 'get_cmfs', 'get_illuminant',
+ 'colour_parameters_plot', 'single_colour_plot', 'multi_colour_plot',
+ 'image_plot'
+]
__all__ += [
- 'single_spd_plot',
- 'multi_spd_plot',
- 'single_cmfs_plot',
- 'multi_cmfs_plot',
+ 'single_spd_plot', 'multi_spd_plot', 'single_cmfs_plot', 'multi_cmfs_plot',
'single_illuminant_relative_spd_plot',
- 'multi_illuminants_relative_spd_plot',
- 'visible_spectrum_plot',
- 'single_lightness_function_plot',
- 'multi_lightness_function_plot',
- 'blackbody_spectral_radiance_plot',
- 'blackbody_colours_plot']
-__all__ += [
- 'colour_checker_plot']
+ 'multi_illuminants_relative_spd_plot', 'visible_spectrum_plot',
+ 'single_lightness_function_plot', 'multi_lightness_function_plot',
+ 'blackbody_spectral_radiance_plot', 'blackbody_colours_plot'
+]
+__all__ += ['colour_checker_plot']
__all__ += [
'CIE_1931_chromaticity_diagram_plot',
'CIE_1960_UCS_chromaticity_diagram_plot',
'CIE_1976_UCS_chromaticity_diagram_plot',
'spds_CIE_1931_chromaticity_diagram_plot',
'spds_CIE_1960_UCS_chromaticity_diagram_plot',
- 'spds_CIE_1976_UCS_chromaticity_diagram_plot']
-__all__ += [
- 'corresponding_chromaticities_prediction_plot']
-__all__ += [
- 'quad',
- 'grid',
- 'cube']
+ 'spds_CIE_1976_UCS_chromaticity_diagram_plot'
+]
+__all__ += ['corresponding_chromaticities_prediction_plot']
+__all__ += ['quad', 'grid', 'cube']
__all__ += [
'RGB_colourspaces_CIE_1931_chromaticity_diagram_plot',
'RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot',
@@ -147,18 +89,20 @@
'RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot',
'RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot',
'RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot',
- 'single_cctf_plot',
- 'multi_cctf_plot']
+ 'single_cctf_plot', 'multi_cctf_plot'
+]
__all__ += [
- 'single_munsell_value_function_plot',
- 'multi_munsell_value_function_plot']
+ 'single_munsell_value_function_plot', 'multi_munsell_value_function_plot'
+]
__all__ += ['single_rayleigh_scattering_spd_plot', 'the_blue_sky_plot']
__all__ += [
'single_spd_colour_rendering_index_bars_plot',
'multi_spd_colour_rendering_index_bars_plot',
'single_spd_colour_quality_scale_bars_plot',
- 'multi_spd_colour_quality_scale_bars_plot']
+ 'multi_spd_colour_quality_scale_bars_plot'
+]
__all__ += [
'planckian_locus_CIE_1931_chromaticity_diagram_plot',
- 'planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot']
+ 'planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot'
+]
__all__ += ['RGB_colourspaces_gamuts_plot', 'RGB_scatter_plot']
diff --git a/colour/plotting/characterisation.py b/colour/plotting/characterisation.py
index c980db0cb7..af7d3c09ee 100644
--- a/colour/plotting/characterisation.py
+++ b/colour/plotting/characterisation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Characterisation Plotting
=========================
@@ -18,13 +17,8 @@
from colour.characterisation import COLOURCHECKERS
from colour.models import RGB_COLOURSPACES
from colour.models import XYZ_to_sRGB, xyY_to_XYZ
-from colour.plotting import (
- ColourParameter,
- boundaries,
- canvas,
- decorate,
- display,
- multi_colour_plot)
+from colour.plotting import (ColourParameter, boundaries, canvas, decorate,
+ display, multi_colour_plot)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -93,10 +87,9 @@ def colour_checker_plot(colour_checker='ColorChecker 2005', **kwargs):
colour_checker, name = COLOURCHECKERS.get(colour_checker), colour_checker
if colour_checker is None:
- raise KeyError(
- ('Colour checker "{0}" not found in '
- 'factory colour checkers: "{1}".').format(
- name, sorted(COLOURCHECKERS.keys())))
+ raise KeyError(('Colour checker "{0}" not found in '
+ 'factory colour checkers: "{1}".').format(
+ name, sorted(COLOURCHECKERS.keys())))
_name, data, illuminant = colour_checker
colour_parameters = []
@@ -120,7 +113,8 @@ def colour_checker_plot(colour_checker='ColorChecker 2005', **kwargs):
'across': across,
'text_size': 8,
'background_colour': background_colour,
- 'margins': (-0.125, 0.125, -0.5, 0.125)}
+ 'margins': (-0.125, 0.125, -0.5, 0.125)
+ }
settings.update(kwargs)
multi_colour_plot(colour_parameters, **settings)
@@ -128,19 +122,21 @@ def colour_checker_plot(colour_checker='ColorChecker 2005', **kwargs):
text_x = width * (across / 2) + (across * (spacing / 2)) - spacing / 2
text_y = -(len(colour_parameters) / across + spacing / 2)
- pylab.text(text_x,
- text_y,
- '{0} - {1} - Colour Rendition Chart'.format(
- name, RGB_COLOURSPACES['sRGB'].name),
- color='0.95',
- clip_on=True,
- ha='center')
+ pylab.text(
+ text_x,
+ text_y,
+ '{0} - {1} - Colour Rendition Chart'.format(
+ name, RGB_COLOURSPACES['sRGB'].name),
+ color='0.95',
+ clip_on=True,
+ ha='center')
settings.update({
'title': name,
'facecolor': background_colour,
'edgecolor': None,
- 'standalone': True})
+ 'standalone': True
+ })
boundaries(**settings)
decorate(**settings)
diff --git a/colour/plotting/colorimetry.py b/colour/plotting/colorimetry.py
index 2cf5796c64..8bb69e3796 100644
--- a/colour/plotting/colorimetry.py
+++ b/colour/plotting/colorimetry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colorimetry Plotting
====================
@@ -32,28 +31,15 @@
import pylab
from six.moves import reduce
-from colour.colorimetry import (
- DEFAULT_SPECTRAL_SHAPE,
- ILLUMINANTS,
- ILLUMINANTS_RELATIVE_SPDS,
- LIGHTNESS_METHODS,
- SpectralShape,
- blackbody_spd,
- spectral_to_XYZ,
- wavelength_to_XYZ)
+from colour.colorimetry import (DEFAULT_SPECTRAL_SHAPE, ILLUMINANTS,
+ ILLUMINANTS_RELATIVE_SPDS, LIGHTNESS_METHODS,
+ SpectralShape, blackbody_spd, spectral_to_XYZ,
+ wavelength_to_XYZ)
from colour.models import XYZ_to_sRGB
-from colour.plotting import (
- ColourParameter,
- DEFAULT_PLOTTING_ENCODING_CCTF,
- DEFAULT_FIGURE_WIDTH,
- boundaries,
- canvas,
- colour_parameters_plot,
- decorate,
- display,
- get_cmfs,
- get_illuminant,
- single_colour_plot)
+from colour.plotting import (ColourParameter, DEFAULT_PLOTTING_ENCODING_CCTF,
+ DEFAULT_FIGURE_WIDTH, boundaries, canvas,
+ colour_parameters_plot, decorate, display,
+ get_cmfs, get_illuminant, single_colour_plot)
from colour.utilities import normalise_maximum
__author__ = 'Colour Developers'
@@ -63,17 +49,13 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['single_spd_plot',
- 'multi_spd_plot',
- 'single_cmfs_plot',
- 'multi_cmfs_plot',
- 'single_illuminant_relative_spd_plot',
- 'multi_illuminants_relative_spd_plot',
- 'visible_spectrum_plot',
- 'single_lightness_function_plot',
- 'multi_lightness_function_plot',
- 'blackbody_spectral_radiance_plot',
- 'blackbody_colours_plot']
+__all__ = [
+ 'single_spd_plot', 'multi_spd_plot', 'single_cmfs_plot', 'multi_cmfs_plot',
+ 'single_illuminant_relative_spd_plot',
+ 'multi_illuminants_relative_spd_plot', 'visible_spectrum_plot',
+ 'single_lightness_function_plot', 'multi_lightness_function_plot',
+ 'blackbody_spectral_radiance_plot', 'blackbody_colours_plot'
+]
def single_spd_plot(spd,
@@ -143,14 +125,15 @@ def single_spd_plot(spd,
'x_label': 'Wavelength $\\lambda$ (nm)',
'y_label': 'Spectral Power Distribution',
'x_tighten': True,
- 'y_tighten': True}
+ 'y_tighten': True
+ }
settings.update(kwargs)
- return colour_parameters_plot(
- [ColourParameter(x=x[0], y1=x[1], RGB=x[2])
- for x in tuple(zip(wavelengths, y1, colours))],
- **settings)
+ return colour_parameters_plot([
+ ColourParameter(x=x[0], y1=x[1], RGB=x[2])
+ for x in tuple(zip(wavelengths, y1, colours))
+ ], **settings)
def multi_spd_plot(spds,
@@ -217,20 +200,27 @@ def multi_spd_plot(spds,
XYZ = normalise_maximum(XYZ, clip=False)
RGB = np.clip(XYZ_to_sRGB(XYZ), 0, 1)
- pylab.plot(wavelengths, values, color=RGB, label=spd.title,
- linewidth=2)
+ pylab.plot(
+ wavelengths, values, color=RGB, label=spd.title, linewidth=2)
else:
pylab.plot(wavelengths, values, label=spd.title, linewidth=2)
settings = {
- 'x_label': 'Wavelength $\\lambda$ (nm)',
- 'y_label': 'Spectral Power Distribution',
- 'x_tighten': True,
- 'y_tighten': True,
- 'legend': True,
- 'legend_location': 'upper left',
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max))}
+ 'x_label':
+ 'Wavelength $\\lambda$ (nm)',
+ 'y_label':
+ 'Spectral Power Distribution',
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper left',
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max))
+ }
settings.update(kwargs)
boundaries(**settings)
@@ -266,8 +256,7 @@ def single_cmfs_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs):
"""
cmfs = get_cmfs(cmfs)
- settings = {
- 'title': '{0} - Colour Matching Functions'.format(cmfs.title)}
+ settings = {'title': '{0} - Colour Matching Functions'.format(cmfs.title)}
settings.update(kwargs)
return multi_cmfs_plot((cmfs.name, ), **settings)
@@ -309,16 +298,13 @@ def multi_cmfs_plot(cmfs=None, **kwargs):
'CIE 1964 10 Degree Standard Observer')
x_limit_min, x_limit_max, y_limit_min, y_limit_max = [], [], [], []
- for axis, rgb in (('x', (1, 0, 0)),
- ('y', (0, 1, 0)),
- ('z', (0, 0, 1))):
+ for axis, rgb in (('x', (1, 0, 0)), ('y', (0, 1, 0)), ('z', (0, 0, 1))):
for i, cmfs_i in enumerate(cmfs):
cmfs_i = get_cmfs(cmfs_i)
- rgb = [reduce(lambda y, _: y * 0.5, range(i), x) # noqa
- for x in rgb]
+ rgb = [reduce(lambda y, _: y * 0.5, range(i), x) for x in rgb]
wavelengths, values = tuple(
- zip(*[(key, value) for key, value in getattr(cmfs_i, axis)]))
+ zip(* [(key, value) for key, value in getattr(cmfs_i, axis)]))
shape = cmfs_i.shape
x_limit_min.append(shape.start)
@@ -326,26 +312,36 @@ def multi_cmfs_plot(cmfs=None, **kwargs):
y_limit_min.append(min(values))
y_limit_max.append(max(values))
- pylab.plot(wavelengths,
- values,
- color=rgb,
- label=u'{0} - {1}'.format(
- cmfs_i.labels[axis], cmfs_i.title),
- linewidth=2)
+ pylab.plot(
+ wavelengths,
+ values,
+ color=rgb,
+ label=u'{0} - {1}'.format(cmfs_i.labels[axis], cmfs_i.title),
+ linewidth=2)
settings = {
- 'title': '{0} - Colour Matching Functions'.format(', '.join(
- [get_cmfs(c).title for c in cmfs])),
- 'x_label': 'Wavelength $\\lambda$ (nm)',
- 'y_label': 'Tristimulus Values',
- 'x_tighten': True,
- 'y_tighten': True,
- 'legend': True,
- 'legend_location': 'upper right',
- 'grid': True,
- 'y_axis_line': True,
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max))}
+ 'title':
+ '{0} - Colour Matching Functions'
+ .format(', '.join([get_cmfs(c).title for c in cmfs])),
+ 'x_label':
+ 'Wavelength $\\lambda$ (nm)',
+ 'y_label':
+ 'Tristimulus Values',
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper right',
+ 'grid':
+ True,
+ 'y_axis_line':
+ True,
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max))
+ }
settings.update(kwargs)
boundaries(**settings)
@@ -355,9 +351,7 @@ def multi_cmfs_plot(cmfs=None, **kwargs):
def single_illuminant_relative_spd_plot(
- illuminant='A',
- cmfs='CIE 1931 2 Degree Standard Observer',
- **kwargs):
+ illuminant='A', cmfs='CIE 1931 2 Degree Standard Observer', **kwargs):
"""
Plots given single illuminant relative spectral power distribution.
@@ -395,9 +389,7 @@ def single_illuminant_relative_spd_plot(
illuminant = get_illuminant(illuminant)
- settings = {
- 'title': title,
- 'y_label': 'Relative Power'}
+ settings = {'title': title, 'y_label': 'Relative Power'}
settings.update(kwargs)
return single_spd_plot(illuminant, **settings)
@@ -443,10 +435,12 @@ def multi_illuminants_relative_spd_plot(illuminants=None, **kwargs):
spds.append(get_illuminant(illuminant))
settings = {
- 'title': (
- '{0} - Illuminants Relative Spectral Power Distribution').format(
- ', '.join([spd.title for spd in spds])),
- 'y_label': 'Relative Power'}
+ 'title':
+ '{0} - Illuminants Relative Spectral Power Distribution'
+ .format(', '.join([spd.title for spd in spds])),
+ 'y_label':
+ 'Relative Power'
+ }
settings.update(kwargs)
return multi_spd_plot(spds, **settings)
@@ -512,12 +506,14 @@ def visible_spectrum_plot(cmfs='CIE 1931 2 Degree Standard Observer',
'y_label': False,
'x_tighten': True,
'y_tighten': True,
- 'y_ticker': False}
+ 'y_ticker': False
+ }
settings.update(kwargs)
- return colour_parameters_plot([ColourParameter(x=x[0], RGB=x[1])
- for x in tuple(zip(wavelengths, colours))],
- **settings)
+ return colour_parameters_plot([
+ ColourParameter(x=x[0], RGB=x[1])
+ for x in tuple(zip(wavelengths, colours))
+ ], **settings)
def single_lightness_function_plot(function='CIE 1976', **kwargs):
@@ -546,8 +542,7 @@ def single_lightness_function_plot(function='CIE 1976', **kwargs):
>>> single_lightness_function_plot() # doctest: +SKIP
"""
- settings = {
- 'title': '{0} - Lightness Function'.format(function)}
+ settings = {'title': '{0} - Lightness Function'.format(function)}
settings.update(kwargs)
return multi_lightness_function_plot((function, ), **settings)
@@ -586,8 +581,7 @@ def multi_lightness_function_plot(functions=None, **kwargs):
>>> multi_lightness_function_plot(fs) # doctest: +SKIP
"""
- settings = {
- 'figure_size': (DEFAULT_FIGURE_WIDTH, DEFAULT_FIGURE_WIDTH)}
+ settings = {'figure_size': (DEFAULT_FIGURE_WIDTH, DEFAULT_FIGURE_WIDTH)}
settings.update(kwargs)
canvas(**settings)
@@ -599,15 +593,15 @@ def multi_lightness_function_plot(functions=None, **kwargs):
for function in functions:
function, name = LIGHTNESS_METHODS.get(function), function
if function is None:
- raise KeyError(
- ('"{0}" "Lightness" function not found in factory '
- '"Lightness" functions: "{1}".').format(
- name, sorted(LIGHTNESS_METHODS.keys())))
-
- pylab.plot(samples,
- [function(x) for x in samples],
- label='{0}'.format(name),
- linewidth=2)
+ raise KeyError(('"{0}" "Lightness" function not found in factory '
+ '"Lightness" functions: "{1}".').format(
+ name, sorted(LIGHTNESS_METHODS.keys())))
+ # TODO: Handle condition statement with metadata capabilities.
+ pylab.plot(
+ samples, (function(samples / 100) if
+ name.lower() == 'fairchild 2010' else function(samples)),
+ label='{0}'.format(name),
+ linewidth=2)
settings.update({
'title': '{0} - Lightness Functions'.format(', '.join(functions)),
@@ -618,7 +612,8 @@ def multi_lightness_function_plot(functions=None, **kwargs):
'legend_location': 'upper left',
'grid': True,
'limits': (0, 100, 0, 100),
- 'aspect': 'equal'})
+ 'aspect': 'equal'
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -675,7 +670,8 @@ def blackbody_spectral_radiance_plot(
settings = {
'title': '{0} - Spectral Radiance'.format(blackbody),
'y_label': 'W / (sr m$^2$) / m',
- 'standalone': False}
+ 'standalone': False
+ }
settings.update(kwargs)
single_spd_plot(spd, cmfs.name, **settings)
@@ -685,16 +681,17 @@ def blackbody_spectral_radiance_plot(
matplotlib.pyplot.subplot(212)
- settings = {'title': '{0} - Colour'.format(blackbody),
- 'x_label': '{0}K'.format(temperature),
- 'y_label': '',
- 'aspect': None,
- 'standalone': False}
+ settings = {
+ 'title': '{0} - Colour'.format(blackbody),
+ 'x_label': '{0}K'.format(temperature),
+ 'y_label': '',
+ 'aspect': None,
+ 'standalone': False
+ }
single_colour_plot(ColourParameter(name='', RGB=RGB), **settings)
- settings = {
- 'standalone': True}
+ settings = {'standalone': True}
settings.update(kwargs)
boundaries(**settings)
@@ -758,9 +755,11 @@ def blackbody_colours_plot(shape=SpectralShape(150, 12500, 50),
'y_label': '',
'x_tighten': True,
'y_tighten': True,
- 'y_ticker': False}
+ 'y_ticker': False
+ }
settings.update(kwargs)
- return colour_parameters_plot([ColourParameter(x=x[0], RGB=x[1])
- for x in tuple(zip(temperatures, colours))],
- **settings)
+ return colour_parameters_plot([
+ ColourParameter(x=x[0], RGB=x[1])
+ for x in tuple(zip(temperatures, colours))
+ ], **settings)
diff --git a/colour/plotting/common.py b/colour/plotting/common.py
index 6d12878e3d..37820d5853 100644
--- a/colour/plotting/common.py
+++ b/colour/plotting/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Common Plotting
===============
@@ -46,38 +45,21 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['PLOTTING_RESOURCES_DIRECTORY',
- 'DEFAULT_FIGURE_ASPECT_RATIO',
- 'DEFAULT_FIGURE_WIDTH',
- 'DEFAULT_FIGURE_HEIGHT',
- 'DEFAULT_FIGURE_SIZE',
- 'DEFAULT_FONT_SIZE',
- 'DEFAULT_COLOUR_CYCLE',
- 'DEFAULT_HATCH_PATTERNS',
- 'DEFAULT_PARAMETERS',
- 'DEFAULT_PLOTTING_ILLUMINANT',
- 'DEFAULT_PLOTTING_ENCODING_CCTF',
- 'colour_plotting_defaults',
- 'ColourParameter',
- 'colour_cycle',
- 'canvas',
- 'camera',
- 'decorate',
- 'boundaries',
- 'display',
- 'label_rectangles',
- 'equal_axes3d',
- 'get_RGB_colourspace',
- 'get_cmfs',
- 'get_illuminant',
- 'colour_parameters_plot',
- 'single_colour_plot',
- 'multi_colour_plot',
- 'image_plot']
+__all__ = [
+ 'PLOTTING_RESOURCES_DIRECTORY', 'DEFAULT_FIGURE_ASPECT_RATIO',
+ 'DEFAULT_FIGURE_WIDTH', 'DEFAULT_FIGURE_HEIGHT', 'DEFAULT_FIGURE_SIZE',
+ 'DEFAULT_FONT_SIZE', 'DEFAULT_COLOUR_CYCLE', 'DEFAULT_HATCH_PATTERNS',
+ 'DEFAULT_PARAMETERS', 'DEFAULT_PLOTTING_ILLUMINANT',
+ 'DEFAULT_PLOTTING_ENCODING_CCTF', 'colour_plotting_defaults',
+ 'ColourParameter', 'colour_cycle', 'canvas', 'camera', 'decorate',
+ 'boundaries', 'display', 'label_rectangles', 'equal_axes3d',
+ 'get_RGB_colourspace', 'get_cmfs', 'get_illuminant',
+ 'colour_parameters_plot', 'single_colour_plot', 'multi_colour_plot',
+ 'image_plot'
+]
PLOTTING_RESOURCES_DIRECTORY = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- 'resources')
+ os.path.dirname(os.path.abspath(__file__)), 'resources')
"""
Resources directory.
@@ -149,7 +131,8 @@
'legend.fontsize': DEFAULT_FONT_SIZE * 0.9,
'xtick.labelsize': DEFAULT_FONT_SIZE,
'ytick.labelsize': DEFAULT_FONT_SIZE,
- 'axes.color_cycle': DEFAULT_COLOUR_CYCLE}
+ 'axes.prop_cycle': matplotlib.cycler(color=DEFAULT_COLOUR_CYCLE)
+}
"""
Default plotting parameters.
@@ -196,8 +179,7 @@ def colour_plotting_defaults(parameters=None):
class ColourParameter(
- namedtuple('ColourParameter',
- ('name', 'RGB', 'x', 'y0', 'y1'))):
+ namedtuple('ColourParameter', ('name', 'RGB', 'x', 'y0', 'y1'))):
"""
Defines a data structure for plotting a colour polygon in various spectral
figures.
@@ -221,8 +203,7 @@ def __new__(cls, name=None, RGB=None, x=None, y0=None, y1=None):
Returns a new instance of the :class:`ColourParameter` class.
"""
- return super(ColourParameter, cls).__new__(
- cls, name, RGB, x, y0, y1)
+ return super(ColourParameter, cls).__new__(cls, name, RGB, x, y0, y1)
def colour_cycle(**kwargs):
@@ -242,16 +223,16 @@ def colour_cycle(**kwargs):
Colour cycle iterator.
"""
- settings = Structure(
- **{'colour_cycle_map': 'hsv',
- 'colour_cycle_count': len(DEFAULT_COLOUR_CYCLE)})
+ settings = Structure(**{
+ 'colour_cycle_map': 'hsv',
+ 'colour_cycle_count': len(DEFAULT_COLOUR_CYCLE)
+ })
settings.update(kwargs)
if settings.colour_cycle_map is None:
cycle = DEFAULT_COLOUR_CYCLE
else:
- cycle = getattr(matplotlib.pyplot.cm,
- settings.colour_cycle_map)(
+ cycle = getattr(matplotlib.pyplot.cm, settings.colour_cycle_map)(
np.linspace(0, 1, settings.colour_cycle_count))
return itertools.cycle(cycle)
@@ -273,8 +254,7 @@ def canvas(**kwargs):
Current figure.
"""
- settings = Structure(
- **{'figure_size': DEFAULT_FIGURE_SIZE})
+ settings = Structure(**{'figure_size': DEFAULT_FIGURE_SIZE})
settings.update(kwargs)
figure = matplotlib.pyplot.gcf()
@@ -368,24 +348,25 @@ def decorate(**kwargs):
Current axes.
"""
- settings = Structure(
- **{'title': None,
- 'x_label': None,
- 'y_label': None,
- 'legend': False,
- 'legend_columns': 1,
- 'legend_location': 'upper right',
- 'x_ticker': True,
- 'y_ticker': True,
- 'x_ticker_locator': matplotlib.ticker.AutoMinorLocator(2),
- 'y_ticker_locator': matplotlib.ticker.AutoMinorLocator(2),
- 'grid': False,
- 'grid_which': 'both',
- 'grid_axis': 'both',
- 'x_axis_line': False,
- 'y_axis_line': False,
- 'aspect': None,
- 'no_axes': False})
+ settings = Structure(**{
+ 'title': None,
+ 'x_label': None,
+ 'y_label': None,
+ 'legend': False,
+ 'legend_columns': 1,
+ 'legend_location': 'upper right',
+ 'x_ticker': True,
+ 'y_ticker': True,
+ 'x_ticker_locator': matplotlib.ticker.AutoMinorLocator(2),
+ 'y_ticker_locator': matplotlib.ticker.AutoMinorLocator(2),
+ 'grid': False,
+ 'grid_which': 'both',
+ 'grid_axis': 'both',
+ 'x_axis_line': False,
+ 'y_axis_line': False,
+ 'aspect': None,
+ 'no_axes': False
+ })
settings.update(kwargs)
axes = matplotlib.pyplot.gca()
@@ -396,16 +377,14 @@ def decorate(**kwargs):
if settings.y_label:
pylab.ylabel(settings.y_label)
if settings.legend:
- pylab.legend(loc=settings.legend_location,
- ncol=settings.legend_columns)
+ pylab.legend(
+ loc=settings.legend_location, ncol=settings.legend_columns)
if settings.x_ticker:
- axes.xaxis.set_minor_locator(
- settings.x_ticker_locator)
+ axes.xaxis.set_minor_locator(settings.x_ticker_locator)
else:
axes.set_xticks([])
if settings.y_ticker:
- axes.yaxis.set_minor_locator(
- settings.y_ticker_locator)
+ axes.yaxis.set_minor_locator(settings.y_ticker_locator)
else:
axes.set_yticks([])
if settings.grid:
@@ -452,18 +431,18 @@ def boundaries(**kwargs):
Current axes.
"""
- settings = Structure(
- **{'bounding_box': None,
- 'x_tighten': False,
- 'y_tighten': False,
- 'limits': (0, 1, 0, 1),
- 'margins': (0, 0, 0, 0)})
+ settings = Structure(**{
+ 'bounding_box': None,
+ 'x_tighten': False,
+ 'y_tighten': False,
+ 'limits': (0, 1, 0, 1),
+ 'margins': (0, 0, 0, 0)
+ })
settings.update(kwargs)
axes = matplotlib.pyplot.gca()
if settings.bounding_box is None:
- x_limit_min, x_limit_max, y_limit_min, y_limit_max = (
- settings.limits)
+ x_limit_min, x_limit_max, y_limit_min, y_limit_max = (settings.limits)
x_margin_min, x_margin_max, y_margin_min, y_margin_max = (
settings.margins)
if settings.x_tighten:
@@ -494,9 +473,7 @@ def display(**kwargs):
Current figure or None.
"""
- settings = Structure(
- **{'standalone': True,
- 'filename': None})
+ settings = Structure(**{'standalone': True, 'filename': None})
settings.update(kwargs)
figure = matplotlib.pyplot.gcf()
@@ -551,13 +528,15 @@ def label_rectangles(rectangles,
width = rectangle.get_width()
ha = 'center'
va = 'bottom'
- pylab.text(x + width / 2 + offset[0] * width,
- height + offset[1] * y_m,
- '{0:.1f}'.format(height),
- ha=ha, va=va,
- rotation=rotation,
- fontsize=text_size,
- clip_on=True)
+ pylab.text(
+ x + width / 2 + offset[0] * width,
+ height + offset[1] * y_m,
+ '{0:.1f}'.format(height),
+ ha=ha,
+ va=va,
+ rotation=rotation,
+ fontsize=text_size,
+ clip_on=True)
return True
@@ -578,8 +557,8 @@ def equal_axes3d(axes):
"""
axes.set_aspect('equal')
- extents = np.array([getattr(axes, 'get_{}lim'.format(axis))()
- for axis in 'xyz'])
+ extents = np.array(
+ [getattr(axes, 'get_{}lim'.format(axis))() for axis in 'xyz'])
centers = np.mean(extents, axis=1)
extent = np.max(np.abs(extents[..., 1] - extents[..., 0]))
@@ -616,8 +595,8 @@ def get_RGB_colourspace(colourspace):
if colourspace is None:
raise KeyError(
('"{0}" colourspace not found in factory RGB colourspaces: '
- '"{1}".').format(
- name, ', '.join(sorted(RGB_COLOURSPACES.keys()))))
+ '"{1}".').format(name,
+ ', '.join(sorted(RGB_COLOURSPACES.keys()))))
return colourspace
@@ -673,9 +652,8 @@ def get_illuminant(illuminant):
illuminant, name = ILLUMINANTS_RELATIVE_SPDS.get(illuminant), illuminant
if illuminant is None:
- raise KeyError(
- '"{0}" not found in factory illuminants: "{1}".'.format(
- name, ', '.join(sorted(ILLUMINANTS_RELATIVE_SPDS.keys()))))
+ raise KeyError('"{0}" not found in factory illuminants: "{1}".'.format(
+ name, ', '.join(sorted(ILLUMINANTS_RELATIVE_SPDS.keys()))))
return illuminant
@@ -730,36 +708,35 @@ def colour_parameters_plot(colour_parameters,
x0 = colour_parameters[i].x
x01 = colour_parameters[i + 1].x
y0 = (0
- if colour_parameters[i].y0 is None else
- colour_parameters[i].y0)
+ if colour_parameters[i].y0 is None else colour_parameters[i].y0)
y1 = (1
- if colour_parameters[i].y1 is None else
- colour_parameters[i].y1)
- y01 = (0
- if colour_parameters[i].y0 is None else
+ if colour_parameters[i].y1 is None else colour_parameters[i].y1)
+ y01 = (0 if colour_parameters[i].y0 is None else
colour_parameters[i + 1].y0)
- y11 = (1
- if colour_parameters[i].y1 is None else
+ y11 = (1 if colour_parameters[i].y1 is None else
colour_parameters[i + 1].y1)
x_polygon = (x0, x01, x01, x0)
y_polygon = (y0, y01, y11, y1)
- pylab.fill(x_polygon,
- y_polygon,
- color=colour_parameters[i].RGB,
- edgecolor=colour_parameters[i].RGB)
+ pylab.fill(
+ x_polygon,
+ y_polygon,
+ color=colour_parameters[i].RGB,
+ edgecolor=colour_parameters[i].RGB)
if all([x.y0 is not None for x in colour_parameters]) and y0_plot:
- pylab.plot([x.x for x in colour_parameters],
- [x.y0 for x in colour_parameters],
- color='black',
- linewidth=2)
+ pylab.plot(
+ [x.x
+ for x in colour_parameters], [x.y0 for x in colour_parameters],
+ color='black',
+ linewidth=2)
if all([x.y1 is not None for x in colour_parameters]) and y1_plot:
- pylab.plot([x.x for x in colour_parameters],
- [x.y1 for x in colour_parameters],
- color='black',
- linewidth=2)
+ pylab.plot(
+ [x.x
+ for x in colour_parameters], [x.y1 for x in colour_parameters],
+ color='black',
+ linewidth=2)
y_limit_min0 = min(
[0 if x.y0 is None else x.y0 for x in colour_parameters])
@@ -771,12 +748,14 @@ def colour_parameters_plot(colour_parameters,
[1 if x.y1 is None else x.y1 for x in colour_parameters])
settings = {
- 'x_label': 'Parameter',
- 'y_label': 'Colour',
+ 'x_label':
+ 'Parameter',
+ 'y_label':
+ 'Colour',
'limits': (min([0 if x.x is None else x.x for x in colour_parameters]),
max([1 if x.x is None else x.x for x in colour_parameters]),
- y_limit_min0,
- y_limit_max1)}
+ y_limit_min0, y_limit_max1)
+ }
settings.update(kwargs)
boundaries(**settings)
@@ -833,7 +812,7 @@ def single_colour_plot(colour_parameter, **kwargs):
>>> single_colour_plot(ColourParameter(RGB)) # doctest: +SKIP
"""
- return multi_colour_plot((colour_parameter,), **kwargs)
+ return multi_colour_plot((colour_parameter, ), **kwargs)
def multi_colour_plot(colour_parameters,
@@ -907,8 +886,12 @@ def multi_colour_plot(colour_parameters,
y_polygon = (y0, y0, y1, y1)
pylab.fill(x_polygon, y_polygon, color=colour_parameters[i].RGB)
if colour_parameter.name is not None and text_display:
- pylab.text(x0 + text_offset, y0 + text_offset,
- colour_parameter.name, clip_on=True, size=text_size)
+ pylab.text(
+ x0 + text_offset,
+ y0 + text_offset,
+ colour_parameter.name,
+ clip_on=True,
+ size=text_size)
offsetX += width + spacing
@@ -924,7 +907,8 @@ def multi_colour_plot(colour_parameters,
'x_ticker': False,
'y_ticker': False,
'limits': (x_limit_min, x_limit_max, y_limit_min, y_limit_max),
- 'aspect': 'equal'}
+ 'aspect': 'equal'
+ }
settings.update(kwargs)
boundaries(**settings)
@@ -990,23 +974,25 @@ def image_plot(image,
image = np.asarray(image)
- pylab.imshow(np.clip(image, 0, 1),
- interpolation=interpolation,
- cmap=colour_map)
+ pylab.imshow(
+ np.clip(image, 0, 1), interpolation=interpolation, cmap=colour_map)
height = image.shape[0]
- pylab.text(0 + label_size,
- height - label_size,
- label,
- color=label_colour if label_colour is not None else (1, 1, 1),
- alpha=label_alpha,
- fontsize=label_size)
-
- settings = {'x_ticker': False,
- 'y_ticker': False,
- 'no_axes': True,
- 'bounding_box': (0, 1, 0, 1)}
+ pylab.text(
+ 0 + label_size,
+ height - label_size,
+ label,
+ color=label_colour if label_colour is not None else (1, 1, 1),
+ alpha=label_alpha,
+ fontsize=label_size)
+
+ settings = {
+ 'x_ticker': False,
+ 'y_ticker': False,
+ 'no_axes': True,
+ 'bounding_box': (0, 1, 0, 1)
+ }
settings.update(kwargs)
canvas(**settings)
diff --git a/colour/plotting/corresponding.py b/colour/plotting/corresponding.py
index 5058ea65d4..8241a7a3d2 100644
--- a/colour/plotting/corresponding.py
+++ b/colour/plotting/corresponding.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Corresponding Chromaticities Prediction Plotting
================================================
@@ -14,13 +13,9 @@
import pylab
from colour.corresponding import corresponding_chromaticities_prediction
-from colour.plotting import (
- CIE_1976_UCS_chromaticity_diagram_plot,
- DEFAULT_FIGURE_WIDTH,
- boundaries,
- canvas,
- decorate,
- display)
+from colour.plotting import (CIE_1976_UCS_chromaticity_diagram_plot,
+ DEFAULT_FIGURE_WIDTH, boundaries, canvas,
+ decorate, display)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -32,11 +27,10 @@
__all__ = ['corresponding_chromaticities_prediction_plot']
-def corresponding_chromaticities_prediction_plot(
- experiment=1,
- model='Von Kries',
- transform='CAT02',
- **kwargs):
+def corresponding_chromaticities_prediction_plot(experiment=1,
+ model='Von Kries',
+ transform='CAT02',
+ **kwargs):
"""
Plots given chromatic adaptation model corresponding chromaticities
prediction.
@@ -78,12 +72,14 @@ def corresponding_chromaticities_prediction_plot(
settings.update({
'title': (('Corresponding Chromaticities Prediction\n{0} ({1}) - '
'Experiment {2}\nCIE 1976 UCS Chromaticity Diagram').format(
- model, transform, experiment)
- if model.lower() in ('von kries', 'vonkries') else
- ('Corresponding Chromaticities Prediction\n{0} - '
- 'Experiment {1}\nCIE 1976 UCS Chromaticity Diagram').format(
- model, experiment)),
- 'standalone': False})
+ model, transform, experiment)
+ if model.lower() in ('von kries', 'vonkries') else
+ ('Corresponding Chromaticities Prediction\n{0} - '
+ 'Experiment {1}\nCIE 1976 UCS Chromaticity Diagram').format(
+ model, experiment)),
+ 'standalone':
+ False
+ })
settings.update(kwargs)
CIE_1976_UCS_chromaticity_diagram_plot(**settings)
@@ -93,14 +89,15 @@ def corresponding_chromaticities_prediction_plot(
for result in results:
name, uvp_t, uvp_m, uvp_p = result
- pylab.arrow(uvp_t[0],
- uvp_t[1],
- uvp_p[0] - uvp_t[0] - 0.1 * (uvp_p[0] - uvp_t[0]),
- uvp_p[1] - uvp_t[1] - 0.1 * (uvp_p[1] - uvp_t[1]),
- head_width=0.005,
- head_length=0.005,
- linewidth=0.5,
- color='black')
+ pylab.arrow(
+ uvp_t[0],
+ uvp_t[1],
+ uvp_p[0] - uvp_t[0] - 0.1 * (uvp_p[0] - uvp_t[0]),
+ uvp_p[1] - uvp_t[1] - 0.1 * (uvp_p[1] - uvp_t[1]),
+ head_width=0.005,
+ head_length=0.005,
+ linewidth=0.5,
+ color='black')
pylab.plot(uvp_t[0], uvp_t[1], 'o', color='white')
pylab.plot(uvp_m[0], uvp_m[1], '^', color='white')
pylab.plot(uvp_p[0], uvp_p[1], '^', color='black')
@@ -108,7 +105,8 @@ def corresponding_chromaticities_prediction_plot(
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.7, -0.1, 0.7),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
diff --git a/colour/plotting/dataset/astm_g_173.py b/colour/plotting/dataset/astm_g_173.py
index 71edeffec5..3d0b900480 100644
--- a/colour/plotting/dataset/astm_g_173.py
+++ b/colour/plotting/dataset/astm_g_173.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
ASTM G-173 Solar Spectral Irradiance
====================================
@@ -26,8 +25,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ASTM_G_173_ETR_DATA',
- 'ASTM_G_173_ETR']
+__all__ = ['ASTM_G_173_ETR_DATA', 'ASTM_G_173_ETR']
ASTM_G_173_ETR_DATA = {
280.0: 0.08200,
@@ -2031,11 +2029,11 @@
3985.0: 0.00880,
3990.0: 0.00878,
3995.0: 0.00870,
- 4000.0: 0.00868}
+ 4000.0: 0.00868
+}
ASTM_G_173_ETR = SpectralPowerDistribution('ASTM G-173 ETR',
ASTM_G_173_ETR_DATA)
-
"""
Extraterrestrial Radiation (solar spectrum at top of atmosphere) at mean
Earth-Sun distance.
diff --git a/colour/plotting/diagrams.py b/colour/plotting/diagrams.py
index 42eeeb4ce3..6eb1b78132 100644
--- a/colour/plotting/diagrams.py
+++ b/colour/plotting/diagrams.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CIE Chromaticity Diagrams Plotting
==================================
@@ -29,25 +28,12 @@
from colour.algebra import normalise_vector
from colour.colorimetry import spectral_to_XYZ
-from colour.models import (
- Luv_to_uv,
- Luv_uv_to_xy,
- UCS_to_uv,
- UCS_uv_to_xy,
- XYZ_to_Luv,
- XYZ_to_UCS,
- XYZ_to_sRGB,
- XYZ_to_xy,
- xy_to_XYZ)
-from colour.plotting import (
- DEFAULT_FIGURE_WIDTH,
- DEFAULT_PLOTTING_ILLUMINANT,
- PLOTTING_RESOURCES_DIRECTORY,
- canvas,
- decorate,
- boundaries,
- display,
- get_cmfs)
+from colour.models import (Luv_to_uv, Luv_uv_to_xy, UCS_to_uv, UCS_uv_to_xy,
+ XYZ_to_Luv, XYZ_to_UCS, XYZ_to_sRGB, XYZ_to_xy,
+ xy_to_XYZ)
+from colour.plotting import (DEFAULT_FIGURE_WIDTH, DEFAULT_PLOTTING_ILLUMINANT,
+ PLOTTING_RESOURCES_DIRECTORY, canvas, decorate,
+ boundaries, display, get_cmfs)
from colour.utilities import normalise_maximum, tsplit, tstack
__author__ = 'Colour Developers'
@@ -57,15 +43,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CIE_1931_chromaticity_diagram_colours_plot',
- 'CIE_1931_chromaticity_diagram_plot',
- 'CIE_1960_UCS_chromaticity_diagram_colours_plot',
- 'CIE_1960_UCS_chromaticity_diagram_plot',
- 'CIE_1976_UCS_chromaticity_diagram_colours_plot',
- 'CIE_1976_UCS_chromaticity_diagram_plot',
- 'spds_CIE_1931_chromaticity_diagram_plot',
- 'spds_CIE_1960_UCS_chromaticity_diagram_plot',
- 'spds_CIE_1976_UCS_chromaticity_diagram_plot']
+__all__ = [
+ 'CIE_1931_chromaticity_diagram_colours_plot',
+ 'CIE_1931_chromaticity_diagram_plot',
+ 'CIE_1960_UCS_chromaticity_diagram_colours_plot',
+ 'CIE_1960_UCS_chromaticity_diagram_plot',
+ 'CIE_1976_UCS_chromaticity_diagram_colours_plot',
+ 'CIE_1976_UCS_chromaticity_diagram_plot',
+ 'spds_CIE_1931_chromaticity_diagram_plot',
+ 'spds_CIE_1960_UCS_chromaticity_diagram_plot',
+ 'spds_CIE_1976_UCS_chromaticity_diagram_plot'
+]
def CIE_1931_chromaticity_diagram_colours_plot(
@@ -111,10 +99,10 @@ def CIE_1931_chromaticity_diagram_colours_plot(
illuminant = DEFAULT_PLOTTING_ILLUMINANT
- triangulation = Delaunay(XYZ_to_xy(cmfs.values, illuminant),
- qhull_options='QJ')
- xx, yy = np.meshgrid(np.linspace(0, 1, samples),
- np.linspace(0, 1, samples))
+ triangulation = Delaunay(
+ XYZ_to_xy(cmfs.values, illuminant), qhull_options='QJ')
+ xx, yy = np.meshgrid(
+ np.linspace(0, 1, samples), np.linspace(0, 1, samples))
xy = tstack((xx, yy))
xy = xy[triangulation.find_simplex(xy) > 0]
@@ -129,7 +117,8 @@ def CIE_1931_chromaticity_diagram_colours_plot(
settings.update({
'x_ticker': False,
'y_ticker': False,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
ax = matplotlib.pyplot.gca()
@@ -188,8 +177,8 @@ def CIE_1931_chromaticity_diagram_plot(
cmfs.name.replace(' ', '_'))))
pylab.imshow(image, interpolation=None, extent=(0, 1, 0, 1))
- labels = (
- 390, 460, 470, 480, 490, 500, 510, 520, 540, 560, 580, 600, 620, 700)
+ labels = (390, 460, 470, 480, 490, 500, 510, 520, 540, 560, 580, 600, 620,
+ 700)
wavelengths = cmfs.wavelengths
equal_energy = np.array([1 / 3] * 2)
@@ -199,10 +188,10 @@ def CIE_1931_chromaticity_diagram_plot(
wavelengths_chromaticity_coordinates = dict(tuple(zip(wavelengths, xy)))
pylab.plot(xy[..., 0], xy[..., 1], color='black', linewidth=2)
- pylab.plot((xy[-1][0], xy[0][0]),
- (xy[-1][1], xy[0][1]),
- color='black',
- linewidth=2)
+ pylab.plot(
+ (xy[-1][0], xy[0][0]), (xy[-1][1], xy[0][1]),
+ color='black',
+ linewidth=2)
for label in labels:
x, y = wavelengths_chromaticity_coordinates[label]
@@ -211,8 +200,7 @@ def CIE_1931_chromaticity_diagram_plot(
index = bisect.bisect(wavelengths, label)
left = wavelengths[index - 1] if index >= 0 else wavelengths[index]
right = (wavelengths[index]
- if index < len(wavelengths) else
- wavelengths[-1])
+ if index < len(wavelengths) else wavelengths[-1])
dx = (wavelengths_chromaticity_coordinates[right][0] -
wavelengths_chromaticity_coordinates[left][0])
@@ -222,25 +210,25 @@ def CIE_1931_chromaticity_diagram_plot(
xy = np.array([x, y])
direction = np.array([-dy, dx])
- normal = (np.array([-dy, dx])
- if np.dot(normalise_vector(xy - equal_energy),
- normalise_vector(direction)) > 0 else
- np.array([dy, -dx]))
+ normal = (np.array([-dy, dx]) if np.dot(
+ normalise_vector(xy - equal_energy), normalise_vector(direction)) >
+ 0 else np.array([dy, -dx]))
normal = normalise_vector(normal)
normal /= 25
- pylab.plot((x, x + normal[0] * 0.75),
- (y, y + normal[1] * 0.75),
- color='black',
- linewidth=1.5)
- pylab.text(x + normal[0],
- y + normal[1],
- label,
- color='black',
- clip_on=True,
- ha='left' if normal[0] >= 0 else 'right',
- va='center',
- fontdict={'size': 'small'})
+ pylab.plot(
+ (x, x + normal[0] * 0.75), (y, y + normal[1] * 0.75),
+ color='black',
+ linewidth=1.5)
+ pylab.text(
+ x + normal[0],
+ y + normal[1],
+ label,
+ color='black',
+ clip_on=True,
+ ha='left' if normal[0] >= 0 else 'right',
+ va='center',
+ fontdict={'size': 'small'})
ticks = np.arange(-10, 10, 0.1)
@@ -252,7 +240,8 @@ def CIE_1931_chromaticity_diagram_plot(
'x_label': 'CIE x',
'y_label': 'CIE y',
'grid': True,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -304,10 +293,10 @@ def CIE_1960_UCS_chromaticity_diagram_colours_plot(
illuminant = DEFAULT_PLOTTING_ILLUMINANT
- triangulation = Delaunay(UCS_to_uv(XYZ_to_UCS(cmfs.values)),
- qhull_options='QJ')
- xx, yy = np.meshgrid(np.linspace(0, 1, samples),
- np.linspace(0, 1, samples))
+ triangulation = Delaunay(
+ UCS_to_uv(XYZ_to_UCS(cmfs.values)), qhull_options='QJ')
+ xx, yy = np.meshgrid(
+ np.linspace(0, 1, samples), np.linspace(0, 1, samples))
xy = tstack((xx, yy))
xy = xy[triangulation.find_simplex(xy) > 0]
@@ -322,7 +311,8 @@ def CIE_1960_UCS_chromaticity_diagram_colours_plot(
settings.update({
'x_ticker': False,
'y_ticker': False,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
ax = matplotlib.pyplot.gca()
@@ -379,8 +369,8 @@ def CIE_1960_UCS_chromaticity_diagram_plot(
cmfs.name.replace(' ', '_'))))
pylab.imshow(image, interpolation=None, extent=(0, 1, 0, 1))
- labels = (420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530,
- 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 680)
+ labels = (420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540,
+ 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 680)
wavelengths = cmfs.wavelengths
equal_energy = np.array([1 / 3] * 2)
@@ -390,10 +380,10 @@ def CIE_1960_UCS_chromaticity_diagram_plot(
wavelengths_chromaticity_coordinates = dict(tuple(zip(wavelengths, uv)))
pylab.plot(uv[..., 0], uv[..., 1], color='black', linewidth=2)
- pylab.plot((uv[-1][0], uv[0][0]),
- (uv[-1][1], uv[0][1]),
- color='black',
- linewidth=2)
+ pylab.plot(
+ (uv[-1][0], uv[0][0]), (uv[-1][1], uv[0][1]),
+ color='black',
+ linewidth=2)
for label in labels:
u, v = wavelengths_chromaticity_coordinates[label]
@@ -402,8 +392,7 @@ def CIE_1960_UCS_chromaticity_diagram_plot(
index = bisect.bisect(wavelengths, label)
left = wavelengths[index - 1] if index >= 0 else wavelengths[index]
right = (wavelengths[index]
- if index < len(wavelengths) else
- wavelengths[-1])
+ if index < len(wavelengths) else wavelengths[-1])
dx = (wavelengths_chromaticity_coordinates[right][0] -
wavelengths_chromaticity_coordinates[left][0])
@@ -413,25 +402,25 @@ def CIE_1960_UCS_chromaticity_diagram_plot(
uv = np.array([u, v])
direction = np.array([-dy, dx])
- normal = (np.array([-dy, dx])
- if np.dot(normalise_vector(uv - equal_energy),
- normalise_vector(direction)) > 0 else
- np.array([dy, -dx]))
+ normal = (np.array([-dy, dx]) if np.dot(
+ normalise_vector(uv - equal_energy), normalise_vector(direction)) >
+ 0 else np.array([dy, -dx]))
normal = normalise_vector(normal)
normal /= 25
- pylab.plot((u, u + normal[0] * 0.75),
- (v, v + normal[1] * 0.75),
- color='black',
- linewidth=1.5)
- pylab.text(u + normal[0],
- v + normal[1],
- label,
- color='black',
- clip_on=True,
- ha='left' if normal[0] >= 0 else 'right',
- va='center',
- fontdict={'size': 'small'})
+ pylab.plot(
+ (u, u + normal[0] * 0.75), (v, v + normal[1] * 0.75),
+ color='black',
+ linewidth=1.5)
+ pylab.text(
+ u + normal[0],
+ v + normal[1],
+ label,
+ color='black',
+ clip_on=True,
+ ha='left' if normal[0] >= 0 else 'right',
+ va='center',
+ fontdict={'size': 'small'})
ticks = np.arange(-10, 10, 0.1)
@@ -443,7 +432,8 @@ def CIE_1960_UCS_chromaticity_diagram_plot(
'x_label': 'CIE u',
'y_label': 'CIE v',
'grid': True,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -498,8 +488,8 @@ def CIE_1976_UCS_chromaticity_diagram_colours_plot(
triangulation = Delaunay(
Luv_to_uv(XYZ_to_Luv(cmfs.values, illuminant), illuminant),
qhull_options='QJ Qf')
- xx, yy = np.meshgrid(np.linspace(0, 1, samples),
- np.linspace(0, 1, samples))
+ xx, yy = np.meshgrid(
+ np.linspace(0, 1, samples), np.linspace(0, 1, samples))
xy = tstack((xx, yy))
xy = xy[triangulation.find_simplex(xy) > 0]
@@ -514,7 +504,8 @@ def CIE_1976_UCS_chromaticity_diagram_colours_plot(
settings.update({
'x_ticker': False,
'y_ticker': False,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
ax = matplotlib.pyplot.gca()
@@ -573,8 +564,8 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
cmfs.name.replace(' ', '_'))))
pylab.imshow(image, interpolation=None, extent=(0, 1, 0, 1))
- labels = (420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530,
- 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 680)
+ labels = (420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540,
+ 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 680)
wavelengths = cmfs.wavelengths
equal_energy = np.array([1 / 3] * 2)
@@ -584,10 +575,10 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
wavelengths_chromaticity_coordinates = dict(zip(wavelengths, uv))
pylab.plot(uv[..., 0], uv[..., 1], color='black', linewidth=2)
- pylab.plot((uv[-1][0], uv[0][0]),
- (uv[-1][1], uv[0][1]),
- color='black',
- linewidth=2)
+ pylab.plot(
+ (uv[-1][0], uv[0][0]), (uv[-1][1], uv[0][1]),
+ color='black',
+ linewidth=2)
for label in labels:
u, v = wavelengths_chromaticity_coordinates[label]
@@ -596,8 +587,7 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
index = bisect.bisect(wavelengths, label)
left = wavelengths[index - 1] if index >= 0 else wavelengths[index]
right = (wavelengths[index]
- if index < len(wavelengths) else
- wavelengths[-1])
+ if index < len(wavelengths) else wavelengths[-1])
dx = (wavelengths_chromaticity_coordinates[right][0] -
wavelengths_chromaticity_coordinates[left][0])
@@ -607,25 +597,25 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
uv = np.array([u, v])
direction = np.array([-dy, dx])
- normal = (np.array([-dy, dx])
- if np.dot(normalise_vector(uv - equal_energy),
- normalise_vector(direction)) > 0 else
- np.array([dy, -dx]))
+ normal = (np.array([-dy, dx]) if np.dot(
+ normalise_vector(uv - equal_energy), normalise_vector(direction)) >
+ 0 else np.array([dy, -dx]))
normal = normalise_vector(normal)
normal /= 25
- pylab.plot((u, u + normal[0] * 0.75),
- (v, v + normal[1] * 0.75),
- color='black',
- linewidth=1.5)
- pylab.text(u + normal[0],
- v + normal[1],
- label,
- color='black',
- clip_on=True,
- ha='left' if normal[0] >= 0 else 'right',
- va='center',
- fontdict={'size': 'small'})
+ pylab.plot(
+ (u, u + normal[0] * 0.75), (v, v + normal[1] * 0.75),
+ color='black',
+ linewidth=1.5)
+ pylab.text(
+ u + normal[0],
+ v + normal[1],
+ label,
+ color='black',
+ clip_on=True,
+ ha='left' if normal[0] >= 0 else 'right',
+ va='center',
+ fontdict={'size': 'small'})
ticks = np.arange(-10, 10, 0.1)
@@ -637,7 +627,8 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
'x_label': 'CIE u\'',
'y_label': 'CIE v\'',
'grid': True,
- 'bounding_box': (0, 1, 0, 1)})
+ 'bounding_box': (0, 1, 0, 1)
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -647,9 +638,7 @@ def CIE_1976_UCS_chromaticity_diagram_plot(
def spds_CIE_1931_chromaticity_diagram_plot(
- spds,
- cmfs='CIE 1931 2 Degree Standard Observer',
- annotate=True,
+ spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True,
**kwargs):
"""
Plots given spectral power distribution chromaticity coordinates into the
@@ -701,19 +690,21 @@ def spds_CIE_1931_chromaticity_diagram_plot(
pylab.plot(xy[0], xy[1], 'o', color='white')
if spd.name is not None and annotate:
- pylab.annotate(spd.name,
- xy=xy,
- xytext=(50, 30),
- color='black',
- textcoords='offset points',
- arrowprops=dict(arrowstyle='->',
- connectionstyle='arc3, rad=0.2'))
+ pylab.annotate(
+ spd.name,
+ xy=xy,
+ xytext=(50, 30),
+ color='black',
+ textcoords='offset points',
+ arrowprops=dict(
+ arrowstyle='->', connectionstyle='arc3, rad=0.2'))
settings.update({
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.9, -0.1, 0.9),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -723,9 +714,7 @@ def spds_CIE_1931_chromaticity_diagram_plot(
def spds_CIE_1960_UCS_chromaticity_diagram_plot(
- spds,
- cmfs='CIE 1931 2 Degree Standard Observer',
- annotate=True,
+ spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True,
**kwargs):
"""
Plots given spectral power distribution chromaticity coordinates into the
@@ -777,19 +766,21 @@ def spds_CIE_1960_UCS_chromaticity_diagram_plot(
pylab.plot(uv[0], uv[1], 'o', color='white')
if spd.name is not None and annotate:
- pylab.annotate(spd.name,
- xy=uv,
- xytext=(50, 30),
- color='black',
- textcoords='offset points',
- arrowprops=dict(arrowstyle='->',
- connectionstyle='arc3, rad=0.2'))
+ pylab.annotate(
+ spd.name,
+ xy=uv,
+ xytext=(50, 30),
+ color='black',
+ textcoords='offset points',
+ arrowprops=dict(
+ arrowstyle='->', connectionstyle='arc3, rad=0.2'))
settings.update({
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.7, -0.2, 0.6),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -799,9 +790,7 @@ def spds_CIE_1960_UCS_chromaticity_diagram_plot(
def spds_CIE_1976_UCS_chromaticity_diagram_plot(
- spds,
- cmfs='CIE 1931 2 Degree Standard Observer',
- annotate=True,
+ spds, cmfs='CIE 1931 2 Degree Standard Observer', annotate=True,
**kwargs):
"""
Plots given spectral power distribution chromaticity coordinates into the
@@ -853,19 +842,21 @@ def spds_CIE_1976_UCS_chromaticity_diagram_plot(
pylab.plot(uv[0], uv[1], 'o', color='white')
if spd.name is not None and annotate:
- pylab.annotate(spd.name,
- xy=uv,
- xytext=(50, 30),
- color='black',
- textcoords='offset points',
- arrowprops=dict(arrowstyle='->',
- connectionstyle='arc3, rad=0.2'))
+ pylab.annotate(
+ spd.name,
+ xy=uv,
+ xytext=(50, 30),
+ color='black',
+ textcoords='offset points',
+ arrowprops=dict(
+ arrowstyle='->', connectionstyle='arc3, rad=0.2'))
settings.update({
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.7, -0.1, 0.7),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
diff --git a/colour/plotting/geometry.py b/colour/plotting/geometry.py
index a00781741c..6d7e8fcc33 100644
--- a/colour/plotting/geometry.py
+++ b/colour/plotting/geometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Geometry Plotting Utilities
===========================
@@ -23,9 +22,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['quad',
- 'grid',
- 'cube']
+__all__ = ['quad', 'grid', 'cube']
def quad(plane='xy', origin=None, width=1, height=1, depth=0):
@@ -65,20 +62,14 @@ def quad(plane='xy', origin=None, width=1, height=1, depth=0):
plane = plane.lower()
if plane == 'xy':
- vertices = ((u, v, depth),
- (u + width, v, depth),
- (u + width, v + height, depth),
- (u, v + height, depth))
+ vertices = ((u, v, depth), (u + width, v, depth),
+ (u + width, v + height, depth), (u, v + height, depth))
elif plane == 'xz':
- vertices = ((u, depth, v),
- (u + width, depth, v),
- (u + width, depth, v + height),
- (u, depth, v + height))
+ vertices = ((u, depth, v), (u + width, depth, v),
+ (u + width, depth, v + height), (u, depth, v + height))
elif plane == 'yz':
- vertices = ((depth, u, v),
- (depth, u + width, v),
- (depth, u + width, v + height),
- (depth, u, v + height))
+ vertices = ((depth, u, v), (depth, u + width, v),
+ (depth, u + width, v + height), (depth, u, v + height))
else:
raise ValueError('"{0}" is not a supported plane!'.format(plane))
@@ -226,8 +217,7 @@ def cube(plane=None,
"""
plane = (('+x', '-x', '+y', '-y', '+z', '-z')
- if plane is None else
- [p.lower() for p in plane])
+ if plane is None else [p.lower() for p in plane])
u, v, w = (0, 0, 0) if origin is None else origin
w_s, h_s, d_s = width_segments, height_segments, depth_segments
diff --git a/colour/plotting/models.py b/colour/plotting/models.py
index e5f36cb5e7..a43c3e54af 100644
--- a/colour/plotting/models.py
+++ b/colour/plotting/models.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Models Plotting
======================
@@ -23,32 +22,15 @@
import pylab
from colour.constants import EPSILON
-from colour.models import (
- LCHab_to_Lab,
- Lab_to_XYZ,
- Luv_to_uv,
- POINTER_GAMUT_BOUNDARIES,
- POINTER_GAMUT_DATA,
- POINTER_GAMUT_ILLUMINANT,
- RGB_to_XYZ,
- UCS_to_uv,
- XYZ_to_Luv,
- XYZ_to_UCS,
- XYZ_to_xy,
- xy_to_XYZ)
+from colour.models import (LCHab_to_Lab, Lab_to_XYZ, Luv_to_uv,
+ POINTER_GAMUT_BOUNDARIES, POINTER_GAMUT_DATA,
+ POINTER_GAMUT_ILLUMINANT, RGB_to_XYZ, UCS_to_uv,
+ XYZ_to_Luv, XYZ_to_UCS, XYZ_to_xy, xy_to_XYZ)
from colour.plotting import (
- CIE_1931_chromaticity_diagram_plot,
- CIE_1960_UCS_chromaticity_diagram_plot,
- CIE_1976_UCS_chromaticity_diagram_plot,
- DEFAULT_FIGURE_WIDTH,
- DEFAULT_PLOTTING_ILLUMINANT,
- boundaries,
- canvas,
- colour_cycle,
- decorate,
- display,
- get_RGB_colourspace,
- get_cmfs)
+ CIE_1931_chromaticity_diagram_plot, CIE_1960_UCS_chromaticity_diagram_plot,
+ CIE_1976_UCS_chromaticity_diagram_plot, DEFAULT_FIGURE_WIDTH,
+ DEFAULT_PLOTTING_ILLUMINANT, boundaries, canvas, colour_cycle, decorate,
+ display, get_RGB_colourspace, get_cmfs)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -64,13 +46,12 @@
'RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot',
'RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot',
'RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot',
- 'single_cctf_plot',
- 'multi_cctf_plot']
+ 'single_cctf_plot', 'multi_cctf_plot'
+]
def RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
- colourspaces=None,
- cmfs='CIE 1931 2 Degree Standard Observer',
+ colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer',
**kwargs):
"""
Plots given *RGB* colourspaces in *CIE 1931 Chromaticity Diagram*.
@@ -115,9 +96,12 @@ def RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
cmfs, name = get_cmfs(cmfs), cmfs
settings = {
- 'title': '{0} - {1} - CIE 1931 Chromaticity Diagram'.format(
- ', '.join(colourspaces), name),
- 'standalone': False}
+ 'title':
+ '{0} - {1} - CIE 1931 Chromaticity Diagram'.format(
+ ', '.join(colourspaces), name),
+ 'standalone':
+ False
+ }
settings.update(kwargs)
CIE_1931_chromaticity_diagram_plot(**settings)
@@ -125,8 +109,10 @@ def RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
x_limit_min, x_limit_max = [-0.1], [0.9]
y_limit_min, y_limit_max = [-0.1], [0.9]
- settings = {'colour_cycle_map': 'rainbow',
- 'colour_cycle_count': len(colourspaces)}
+ settings = {
+ 'colour_cycle_map': 'rainbow',
+ 'colour_cycle_count': len(colourspaces)
+ }
settings.update(kwargs)
cycle = colour_cycle(**settings)
@@ -135,74 +121,79 @@ def RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
if colourspace == 'Pointer Gamut':
xy = np.asarray(POINTER_GAMUT_BOUNDARIES)
alpha_p, colour_p = 0.85, '0.95'
- pylab.plot(xy[..., 0],
- xy[..., 1],
- label='Pointer\'s Gamut',
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
- pylab.plot((xy[-1][0], xy[0][0]),
- (xy[-1][1], xy[0][1]),
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
-
- XYZ = Lab_to_XYZ(LCHab_to_Lab(POINTER_GAMUT_DATA),
- POINTER_GAMUT_ILLUMINANT)
+ pylab.plot(
+ xy[..., 0],
+ xy[..., 1],
+ label='Pointer\'s Gamut',
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+ pylab.plot(
+ (xy[-1][0], xy[0][0]), (xy[-1][1], xy[0][1]),
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+
+ XYZ = Lab_to_XYZ(
+ LCHab_to_Lab(POINTER_GAMUT_DATA), POINTER_GAMUT_ILLUMINANT)
xy = XYZ_to_xy(XYZ, POINTER_GAMUT_ILLUMINANT)
- pylab.scatter(xy[..., 0],
- xy[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ xy[..., 0],
+ xy[..., 1],
+ alpha=alpha_p / 2,
+ color=colour_p,
+ marker='+')
else:
colourspace, name = get_RGB_colourspace(colourspace), colourspace
r, g, b, _a = next(cycle)
- primaries = colourspace.primaries
- whitepoint = colourspace.whitepoint
-
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- color=(r, g, b),
- label=colourspace.name,
- linewidth=2)
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- 'o',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[0, 0], primaries[1, 0]),
- (primaries[0, 1], primaries[1, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[1, 0], primaries[2, 0]),
- (primaries[1, 1], primaries[2, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[2, 0], primaries[0, 0]),
- (primaries[2, 1], primaries[0, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
-
- x_limit_min.append(np.amin(primaries[..., 0]) - 0.1)
- y_limit_min.append(np.amin(primaries[..., 1]) - 0.1)
- x_limit_max.append(np.amax(primaries[..., 0]) + 0.1)
- y_limit_max.append(np.amax(primaries[..., 1]) + 0.1)
+ P = colourspace.primaries
+ W = colourspace.whitepoint
+
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]),
+ color=(r, g, b),
+ label=colourspace.name,
+ linewidth=2)
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]), 'o', color=(r, g, b), linewidth=2)
+ pylab.plot(
+ (P[0, 0], P[1, 0]), (P[0, 1], P[1, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[1, 0], P[2, 0]), (P[1, 1], P[2, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[2, 0], P[0, 0]), (P[2, 1], P[0, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+
+ x_limit_min.append(np.amin(P[..., 0]) - 0.1)
+ y_limit_min.append(np.amin(P[..., 1]) - 0.1)
+ x_limit_max.append(np.amax(P[..., 0]) + 0.1)
+ y_limit_max.append(np.amax(P[..., 1]) + 0.1)
settings.update({
- 'legend': True,
- 'legend_location': 'upper right',
- 'x_tighten': True,
- 'y_tighten': True,
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max)),
- 'standalone': True})
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper right',
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max)),
+ 'standalone':
+ True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -212,8 +203,7 @@ def RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
- colourspaces=None,
- cmfs='CIE 1931 2 Degree Standard Observer',
+ colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer',
**kwargs):
"""
Plots given *RGB* colourspaces in *CIE 1960 UCS Chromaticity Diagram*.
@@ -258,9 +248,12 @@ def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
cmfs, name = get_cmfs(cmfs), cmfs
settings = {
- 'title': '{0} - {1} - CIE 1960 UCS Chromaticity Diagram'.format(
- ', '.join(colourspaces), name),
- 'standalone': False}
+ 'title':
+ '{0} - {1} - CIE 1960 UCS Chromaticity Diagram'.format(
+ ', '.join(colourspaces), name),
+ 'standalone':
+ False
+ }
settings.update(kwargs)
CIE_1960_UCS_chromaticity_diagram_plot(**settings)
@@ -268,8 +261,10 @@ def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
x_limit_min, x_limit_max = [-0.1], [0.7]
y_limit_min, y_limit_max = [-0.2], [0.6]
- settings = {'colour_cycle_map': 'rainbow',
- 'colour_cycle_count': len(colourspaces)}
+ settings = {
+ 'colour_cycle_map': 'rainbow',
+ 'colour_cycle_count': len(colourspaces)
+ }
settings.update(kwargs)
cycle = colour_cycle(**settings)
@@ -278,26 +273,28 @@ def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
if colourspace == 'Pointer Gamut':
uv = UCS_to_uv(XYZ_to_UCS(xy_to_XYZ(POINTER_GAMUT_BOUNDARIES)))
alpha_p, colour_p = 0.85, '0.95'
- pylab.plot(uv[..., 0],
- uv[..., 1],
- label='Pointer\'s Gamut',
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
- pylab.plot((uv[-1][0], uv[0][0]),
- (uv[-1][1], uv[0][1]),
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
-
- XYZ = Lab_to_XYZ(LCHab_to_Lab(POINTER_GAMUT_DATA),
- POINTER_GAMUT_ILLUMINANT)
+ pylab.plot(
+ uv[..., 0],
+ uv[..., 1],
+ label='Pointer\'s Gamut',
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+ pylab.plot(
+ (uv[-1][0], uv[0][0]), (uv[-1][1], uv[0][1]),
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+
+ XYZ = Lab_to_XYZ(
+ LCHab_to_Lab(POINTER_GAMUT_DATA), POINTER_GAMUT_ILLUMINANT)
uv = UCS_to_uv(XYZ_to_UCS(XYZ))
- pylab.scatter(uv[..., 0],
- uv[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ uv[..., 0],
+ uv[..., 1],
+ alpha=alpha_p / 2,
+ color=colour_p,
+ marker='+')
else:
colourspace, name = get_RGB_colourspace(colourspace), colourspace
@@ -307,53 +304,54 @@ def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
# RGB colourspaces such as *ACES2065-1* have primaries with
# chromaticity coordinates set to 0 thus we prevent nan from being
# yield by zero division in later colour transformations.
- primaries = np.where(colourspace.primaries == 0,
- EPSILON,
- colourspace.primaries)
-
- primaries = UCS_to_uv(XYZ_to_UCS(xy_to_XYZ(primaries)))
- whitepoint = UCS_to_uv(XYZ_to_UCS(xy_to_XYZ(
- colourspace.whitepoint)))
-
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- color=(r, g, b),
- label=colourspace.name,
- linewidth=2)
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- 'o',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[0, 0], primaries[1, 0]),
- (primaries[0, 1], primaries[1, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[1, 0], primaries[2, 0]),
- (primaries[1, 1], primaries[2, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[2, 0], primaries[0, 0]),
- (primaries[2, 1], primaries[0, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
-
- x_limit_min.append(np.amin(primaries[..., 0]) - 0.1)
- y_limit_min.append(np.amin(primaries[..., 1]) - 0.1)
- x_limit_max.append(np.amax(primaries[..., 0]) + 0.1)
- y_limit_max.append(np.amax(primaries[..., 1]) + 0.1)
+ P = np.where(colourspace.primaries == 0, EPSILON,
+ colourspace.primaries)
+
+ P = UCS_to_uv(XYZ_to_UCS(xy_to_XYZ(P)))
+ W = UCS_to_uv(XYZ_to_UCS(xy_to_XYZ(colourspace.whitepoint)))
+
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]),
+ color=(r, g, b),
+ label=colourspace.name,
+ linewidth=2)
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]), 'o', color=(r, g, b), linewidth=2)
+ pylab.plot(
+ (P[0, 0], P[1, 0]), (P[0, 1], P[1, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[1, 0], P[2, 0]), (P[1, 1], P[2, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[2, 0], P[0, 0]), (P[2, 1], P[0, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+
+ x_limit_min.append(np.amin(P[..., 0]) - 0.1)
+ y_limit_min.append(np.amin(P[..., 1]) - 0.1)
+ x_limit_max.append(np.amax(P[..., 0]) + 0.1)
+ y_limit_max.append(np.amax(P[..., 1]) + 0.1)
settings.update({
- 'legend': True,
- 'legend_location': 'upper right',
- 'x_tighten': True,
- 'y_tighten': True,
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max)),
- 'standalone': True})
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper right',
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max)),
+ 'standalone':
+ True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -363,8 +361,7 @@ def RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
def RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
- colourspaces=None,
- cmfs='CIE 1931 2 Degree Standard Observer',
+ colourspaces=None, cmfs='CIE 1931 2 Degree Standard Observer',
**kwargs):
"""
Plots given *RGB* colourspaces in *CIE 1976 UCS Chromaticity Diagram*.
@@ -411,9 +408,12 @@ def RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
illuminant = DEFAULT_PLOTTING_ILLUMINANT
settings = {
- 'title': '{0} - {1} - CIE 1976 UCS Chromaticity Diagram'.format(
- ', '.join(colourspaces), name),
- 'standalone': False}
+ 'title':
+ '{0} - {1} - CIE 1976 UCS Chromaticity Diagram'.format(
+ ', '.join(colourspaces), name),
+ 'standalone':
+ False
+ }
settings.update(kwargs)
CIE_1976_UCS_chromaticity_diagram_plot(**settings)
@@ -421,37 +421,42 @@ def RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
x_limit_min, x_limit_max = [-0.1], [0.7]
y_limit_min, y_limit_max = [-0.1], [0.7]
- settings = {'colour_cycle_map': 'rainbow',
- 'colour_cycle_count': len(colourspaces)}
+ settings = {
+ 'colour_cycle_map': 'rainbow',
+ 'colour_cycle_count': len(colourspaces)
+ }
settings.update(kwargs)
cycle = colour_cycle(**settings)
for colourspace in colourspaces:
if colourspace == 'Pointer Gamut':
- uv = Luv_to_uv(XYZ_to_Luv(xy_to_XYZ(
- POINTER_GAMUT_BOUNDARIES), illuminant), illuminant)
+ uv = Luv_to_uv(
+ XYZ_to_Luv(xy_to_XYZ(POINTER_GAMUT_BOUNDARIES), illuminant),
+ illuminant)
alpha_p, colour_p = 0.85, '0.95'
- pylab.plot(uv[..., 0],
- uv[..., 1],
- label='Pointer\'s Gamut',
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
- pylab.plot((uv[-1][0], uv[0][0]),
- (uv[-1][1], uv[0][1]),
- color=colour_p,
- alpha=alpha_p,
- linewidth=2)
-
- XYZ = Lab_to_XYZ(LCHab_to_Lab(POINTER_GAMUT_DATA),
- POINTER_GAMUT_ILLUMINANT)
+ pylab.plot(
+ uv[..., 0],
+ uv[..., 1],
+ label='Pointer\'s Gamut',
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+ pylab.plot(
+ (uv[-1][0], uv[0][0]), (uv[-1][1], uv[0][1]),
+ color=colour_p,
+ alpha=alpha_p,
+ linewidth=2)
+
+ XYZ = Lab_to_XYZ(
+ LCHab_to_Lab(POINTER_GAMUT_DATA), POINTER_GAMUT_ILLUMINANT)
uv = Luv_to_uv(XYZ_to_Luv(XYZ, illuminant), illuminant)
- pylab.scatter(uv[..., 0],
- uv[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ uv[..., 0],
+ uv[..., 1],
+ alpha=alpha_p / 2,
+ color=colour_p,
+ marker='+')
else:
colourspace, name = get_RGB_colourspace(colourspace), colourspace
@@ -461,54 +466,56 @@ def RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
# RGB colourspaces such as *ACES2065-1* have primaries with
# chromaticity coordinates set to 0 thus we prevent nan from being
# yield by zero division in later colour transformations.
- primaries = np.where(colourspace.primaries == 0,
- EPSILON,
- colourspace.primaries)
-
- primaries = Luv_to_uv(XYZ_to_Luv(xy_to_XYZ(
- primaries), illuminant), illuminant)
- whitepoint = Luv_to_uv(XYZ_to_Luv(xy_to_XYZ(
- colourspace.whitepoint), illuminant), illuminant)
-
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- color=(r, g, b),
- label=colourspace.name,
- linewidth=2)
- pylab.plot((whitepoint[0], whitepoint[0]),
- (whitepoint[1], whitepoint[1]),
- 'o',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[0, 0], primaries[1, 0]),
- (primaries[0, 1], primaries[1, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[1, 0], primaries[2, 0]),
- (primaries[1, 1], primaries[2, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
- pylab.plot((primaries[2, 0], primaries[0, 0]),
- (primaries[2, 1], primaries[0, 1]),
- 'o-',
- color=(r, g, b),
- linewidth=2)
-
- x_limit_min.append(np.amin(primaries[..., 0]) - 0.1)
- y_limit_min.append(np.amin(primaries[..., 1]) - 0.1)
- x_limit_max.append(np.amax(primaries[..., 0]) + 0.1)
- y_limit_max.append(np.amax(primaries[..., 1]) + 0.1)
+ P = np.where(colourspace.primaries == 0, EPSILON,
+ colourspace.primaries)
+
+ P = Luv_to_uv(XYZ_to_Luv(xy_to_XYZ(P), illuminant), illuminant)
+ W = Luv_to_uv(
+ XYZ_to_Luv(xy_to_XYZ(colourspace.whitepoint), illuminant),
+ illuminant)
+
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]),
+ color=(r, g, b),
+ label=colourspace.name,
+ linewidth=2)
+ pylab.plot(
+ (W[0], W[0]), (W[1], W[1]), 'o', color=(r, g, b), linewidth=2)
+ pylab.plot(
+ (P[0, 0], P[1, 0]), (P[0, 1], P[1, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[1, 0], P[2, 0]), (P[1, 1], P[2, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+ pylab.plot(
+ (P[2, 0], P[0, 0]), (P[2, 1], P[0, 1]),
+ 'o-',
+ color=(r, g, b),
+ linewidth=2)
+
+ x_limit_min.append(np.amin(P[..., 0]) - 0.1)
+ y_limit_min.append(np.amin(P[..., 1]) - 0.1)
+ x_limit_max.append(np.amax(P[..., 0]) + 0.1)
+ y_limit_max.append(np.amax(P[..., 1]) + 0.1)
settings.update({
- 'legend': True,
- 'legend_location': 'upper right',
- 'x_tighten': True,
- 'y_tighten': True,
- 'limits': (min(x_limit_min), max(x_limit_max),
- min(y_limit_min), max(y_limit_max)),
- 'standalone': True})
+ 'legend':
+ True,
+ 'legend_location':
+ 'upper right',
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'limits': (min(x_limit_min), max(x_limit_max), min(y_limit_min),
+ max(y_limit_max)),
+ 'standalone':
+ True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -518,9 +525,7 @@ def RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
def RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
- RGB,
- colourspace,
- **kwargs):
+ RGB, colourspace, **kwargs):
"""
Plots given *RGB* colourspace array in *CIE 1931 Chromaticity Diagram*.
@@ -559,24 +564,18 @@ def RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
settings.update({'standalone': False})
colourspace, name = get_RGB_colourspace(colourspace), colourspace
- settings['colourspaces'] = (
- [name] + settings.get('colourspaces', []))
+ settings['colourspaces'] = ([name] + settings.get('colourspaces', []))
RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(**settings)
alpha_p, colour_p = 0.85, 'black'
- xy = XYZ_to_xy(RGB_to_XYZ(RGB,
- colourspace.whitepoint,
- colourspace.whitepoint,
- colourspace.RGB_to_XYZ_matrix),
- colourspace.whitepoint)
+ xy = XYZ_to_xy(
+ RGB_to_XYZ(RGB, colourspace.whitepoint, colourspace.whitepoint,
+ colourspace.RGB_to_XYZ_matrix), colourspace.whitepoint)
- pylab.scatter(xy[..., 0],
- xy[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ xy[..., 0], xy[..., 1], alpha=alpha_p / 2, color=colour_p, marker='+')
settings.update({'standalone': True})
settings.update(kwargs)
@@ -588,9 +587,7 @@ def RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
def RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
- RGB,
- colourspace,
- **kwargs):
+ RGB, colourspace, **kwargs):
"""
Plots given *RGB* colourspace array in *CIE 1960 UCS Chromaticity Diagram*.
@@ -629,23 +626,19 @@ def RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
settings.update({'standalone': False})
colourspace, name = get_RGB_colourspace(colourspace), colourspace
- settings['colourspaces'] = (
- [name] + settings.get('colourspaces', []))
+ settings['colourspaces'] = ([name] + settings.get('colourspaces', []))
RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(**settings)
alpha_p, colour_p = 0.85, 'black'
- uv = UCS_to_uv(XYZ_to_UCS(RGB_to_XYZ(RGB,
- colourspace.whitepoint,
- colourspace.whitepoint,
- colourspace.RGB_to_XYZ_matrix)))
+ uv = UCS_to_uv(
+ XYZ_to_UCS(
+ RGB_to_XYZ(RGB, colourspace.whitepoint, colourspace.whitepoint,
+ colourspace.RGB_to_XYZ_matrix)))
- pylab.scatter(uv[..., 0],
- uv[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ uv[..., 0], uv[..., 1], alpha=alpha_p / 2, color=colour_p, marker='+')
settings.update({'standalone': True})
settings.update(kwargs)
@@ -657,9 +650,7 @@ def RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
def RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(
- RGB,
- colourspace,
- **kwargs):
+ RGB, colourspace, **kwargs):
"""
Plots given *RGB* colourspace array in *CIE 1976 UCS Chromaticity Diagram*.
@@ -698,25 +689,20 @@ def RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(
settings.update({'standalone': False})
colourspace, name = get_RGB_colourspace(colourspace), colourspace
- settings['colourspaces'] = (
- [name] + settings.get('colourspaces', []))
+ settings['colourspaces'] = ([name] + settings.get('colourspaces', []))
RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(**settings)
alpha_p, colour_p = 0.85, 'black'
- uv = Luv_to_uv(XYZ_to_Luv(RGB_to_XYZ(RGB,
- colourspace.whitepoint,
- colourspace.whitepoint,
- colourspace.RGB_to_XYZ_matrix),
- colourspace.whitepoint),
- colourspace.whitepoint)
+ uv = Luv_to_uv(
+ XYZ_to_Luv(
+ RGB_to_XYZ(RGB, colourspace.whitepoint, colourspace.whitepoint,
+ colourspace.RGB_to_XYZ_matrix), colourspace.whitepoint),
+ colourspace.whitepoint)
- pylab.scatter(uv[..., 0],
- uv[..., 1],
- alpha=alpha_p / 2,
- color=colour_p,
- marker='+')
+ pylab.scatter(
+ uv[..., 0], uv[..., 1], alpha=alpha_p / 2, color=colour_p, marker='+')
settings.update({'standalone': True})
settings.update(kwargs)
@@ -755,8 +741,11 @@ def single_cctf_plot(colourspace='Rec. 709', decoding_cctf=False, **kwargs):
>>> single_cctf_plot() # doctest: +SKIP
"""
- settings = {'title': '{0} - {1} CCTF'.format(
- colourspace, 'Decoding' if decoding_cctf else 'Encoding')}
+ settings = {
+ 'title':
+ '{0} - {1} CCTF'.format(colourspace, 'Decoding'
+ if decoding_cctf else 'Encoding')
+ }
settings.update(kwargs)
return multi_cctf_plot([colourspace], decoding_cctf, **settings)
@@ -805,15 +794,12 @@ def multi_cctf_plot(colourspaces=None, decoding_cctf=False, **kwargs):
RGBs = (colourspace.decoding_cctf(samples)
if decoding_cctf else colourspace.encoding_cctf(samples))
- pylab.plot(samples,
- RGBs,
- label=u'{0}'.format(colourspace.name),
- linewidth=2)
+ pylab.plot(
+ samples, RGBs, label=u'{0}'.format(colourspace.name), linewidth=2)
+ mode = 'Decoding' if decoding_cctf else 'Encoding'
settings.update({
- 'title': '{0} - {1} CCTFs'.format(
- ', '.join(colourspaces),
- 'Decoding' if decoding_cctf else 'Encoding'),
+ 'title': '{0} - {1} CCTFs'.format(', '.join(colourspaces), mode),
'x_tighten': True,
'x_label': 'Signal Value' if decoding_cctf else 'Tristimulus Value',
'y_label': 'Tristimulus Value' if decoding_cctf else 'Signal Value',
@@ -821,7 +807,8 @@ def multi_cctf_plot(colourspaces=None, decoding_cctf=False, **kwargs):
'legend_location': 'upper left',
'grid': True,
'limits': (0, 1, 0, 1),
- 'aspect': 'equal'})
+ 'aspect': 'equal'
+ })
settings.update(kwargs)
boundaries(**settings)
diff --git a/colour/plotting/notation.py b/colour/plotting/notation.py
index 26c8d31532..d9785f2608 100644
--- a/colour/plotting/notation.py
+++ b/colour/plotting/notation.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Notation Systems Plotting
================================
@@ -17,12 +16,8 @@
import pylab
from colour.notation import MUNSELL_VALUE_METHODS
-from colour.plotting import (
- DEFAULT_FIGURE_WIDTH,
- boundaries,
- canvas,
- decorate,
- display)
+from colour.plotting import (DEFAULT_FIGURE_WIDTH, boundaries, canvas,
+ decorate, display)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -31,13 +26,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['single_munsell_value_function_plot',
- 'multi_munsell_value_function_plot']
+__all__ = [
+ 'single_munsell_value_function_plot', 'multi_munsell_value_function_plot'
+]
-def single_munsell_value_function_plot(
- function='ASTM D1535-08',
- **kwargs):
+def single_munsell_value_function_plot(function='ASTM D1535-08', **kwargs):
"""
Plots given *Lightness* function.
@@ -70,9 +64,7 @@ def single_munsell_value_function_plot(
return multi_munsell_value_function_plot((function, ), **settings)
-def multi_munsell_value_function_plot(
- functions=None,
- **kwargs):
+def multi_munsell_value_function_plot(functions=None, **kwargs):
"""
Plots given *Munsell* value functions.
@@ -120,12 +112,12 @@ def multi_munsell_value_function_plot(
raise KeyError(
('"{0}" "Munsell" value function not found in '
'factory "Munsell" value functions: "{1}".').format(
- name, sorted(MUNSELL_VALUE_METHODS.keys())))
+ name, sorted(MUNSELL_VALUE_METHODS.keys())))
- pylab.plot(samples,
- [function(x) for x in samples],
- label=u'{0}'.format(name),
- linewidth=2)
+ pylab.plot(
+ samples, [function(x) for x in samples],
+ label=u'{0}'.format(name),
+ linewidth=2)
settings.update({
'title': '{0} - Munsell Functions'.format(', '.join(functions)),
@@ -136,7 +128,8 @@ def multi_munsell_value_function_plot(
'legend_location': 'upper left',
'grid': True,
'bounding_box': (0, 100, 0, 10),
- 'aspect': 10})
+ 'aspect': 10
+ })
settings.update(kwargs)
boundaries(**settings)
diff --git a/colour/plotting/phenomenon.py b/colour/plotting/phenomenon.py
index 0c76e15963..a7465ddebb 100644
--- a/colour/plotting/phenomenon.py
+++ b/colour/plotting/phenomenon.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Optical Phenomenon Plotting
===========================
@@ -19,21 +18,11 @@
from colour.models import XYZ_to_sRGB
from colour.phenomenons import rayleigh_scattering_spd
from colour.phenomenons.rayleigh import (
- AVERAGE_PRESSURE_MEAN_SEA_LEVEL,
- DEFAULT_ALTITUDE,
- DEFAULT_LATITUDE,
- STANDARD_AIR_TEMPERATURE,
- STANDARD_CO2_CONCENTRATION)
-from colour.plotting import (
- ASTM_G_173_ETR,
- ColourParameter,
- boundaries,
- canvas,
- decorate,
- display,
- get_cmfs,
- single_colour_plot,
- single_spd_plot)
+ AVERAGE_PRESSURE_MEAN_SEA_LEVEL, DEFAULT_ALTITUDE, DEFAULT_LATITUDE,
+ STANDARD_AIR_TEMPERATURE, STANDARD_CO2_CONCENTRATION)
+from colour.plotting import (ASTM_G_173_ETR, ColourParameter, boundaries,
+ canvas, decorate, display, get_cmfs,
+ single_colour_plot, single_spd_plot)
from colour.utilities import normalise_maximum
__author__ = 'Colour Developers'
@@ -98,24 +87,16 @@ def single_rayleigh_scattering_spd_plot(
cmfs = get_cmfs(cmfs)
- settings = {
- 'title': title,
- 'y_label': 'Optical Depth'}
+ settings = {'title': title, 'y_label': 'Optical Depth'}
settings.update(kwargs)
- spd = rayleigh_scattering_spd(cmfs.shape,
- CO2_concentration,
- temperature,
- pressure,
- latitude,
- altitude)
+ spd = rayleigh_scattering_spd(cmfs.shape, CO2_concentration, temperature,
+ pressure, latitude, altitude)
return single_spd_plot(spd, **settings)
-def the_blue_sky_plot(
- cmfs='CIE 1931 2 Degree Standard Observer',
- **kwargs):
+def the_blue_sky_plot(cmfs='CIE 1931 2 Degree Standard Observer', **kwargs):
"""
Plots the blue sky.
@@ -159,7 +140,8 @@ def the_blue_sky_plot(
settings = {
'title': 'The Blue Sky - Synthetic Spectral Power Distribution',
'y_label': u'W / m-2 / nm-1',
- 'standalone': False}
+ 'standalone': False
+ }
settings.update(kwargs)
single_spd_plot(spd, name, **settings)
@@ -167,19 +149,24 @@ def the_blue_sky_plot(
matplotlib.pyplot.subplot(212)
settings = {
- 'title': 'The Blue Sky - Colour',
+ 'title':
+ 'The Blue Sky - Colour',
'x_label': ('The sky is blue because molecules in the atmosphere '
'scatter shorter wavelengths more than longer ones.\n'
'The synthetic spectral power distribution is computed as '
'follows: '
'(ASTM G-173 ETR * Standard Air Rayleigh Scattering).'),
- 'y_label': '',
- 'aspect': None,
- 'standalone': False}
+ 'y_label':
+ '',
+ 'aspect':
+ None,
+ 'standalone':
+ False
+ }
blue_sky_color = XYZ_to_sRGB(spectral_to_XYZ(spd))
- single_colour_plot(ColourParameter('', normalise_maximum(blue_sky_color)),
- **settings)
+ single_colour_plot(
+ ColourParameter('', normalise_maximum(blue_sky_color)), **settings)
settings = {'standalone': True}
settings.update(kwargs)
diff --git a/colour/plotting/quality.py b/colour/plotting/quality.py
index 229bc1cd31..e102ca240c 100644
--- a/colour/plotting/quality.py
+++ b/colour/plotting/quality.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Quality Plotting
=======================
@@ -20,18 +19,11 @@
from itertools import cycle
from colour.models import XYZ_to_sRGB
-from colour.quality import (
- colour_quality_scale,
- colour_rendering_index)
+from colour.quality import (colour_quality_scale, colour_rendering_index)
from colour.quality.cri import TCS_ColorimetryData
-from colour.plotting import (
- DEFAULT_FIGURE_WIDTH,
- DEFAULT_HATCH_PATTERNS,
- boundaries,
- canvas,
- decorate,
- display,
- label_rectangles)
+from colour.plotting import (DEFAULT_FIGURE_WIDTH, DEFAULT_HATCH_PATTERNS,
+ boundaries, canvas, decorate, display,
+ label_rectangles)
from colour.utilities import warning
__author__ = 'Colour Developers'
@@ -41,11 +33,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['colour_quality_bars_plot',
- 'single_spd_colour_rendering_index_bars_plot',
- 'multi_spd_colour_rendering_index_bars_plot',
- 'single_spd_colour_quality_scale_bars_plot',
- 'multi_spd_colour_quality_scale_bars_plot']
+__all__ = [
+ 'colour_quality_bars_plot', 'single_spd_colour_rendering_index_bars_plot',
+ 'multi_spd_colour_rendering_index_bars_plot',
+ 'single_spd_colour_quality_scale_bars_plot',
+ 'multi_spd_colour_quality_scale_bars_plot'
+]
def colour_quality_bars_plot(specifications,
@@ -106,16 +99,17 @@ def colour_quality_bars_plot(specifications,
if hatching is None:
hatching = False if count_s == 1 else True
for i, specification in enumerate(specifications):
- Q_a, Q_as, colorimetry_data = (specification.Q_a,
- specification.Q_as,
+ Q_a, Q_as, colorimetry_data = (specification.Q_a, specification.Q_as,
specification.colorimetry_data)
count_Q_as = len(Q_as)
- colours = ([[1] * 3] + [np.clip(XYZ_to_sRGB(x.XYZ), 0, 1)
- for x in colorimetry_data[0]])
+ colours = (
+ [[1] * 3] +
+ [np.clip(XYZ_to_sRGB(x.XYZ), 0, 1) for x in colorimetry_data[0]])
- x = (i + np.arange(0, (count_Q_as + 1) * (count_s + 1), (count_s + 1),
- dtype=np.float_)) * bar_width
+ x = (i + np.arange(
+ 0, (count_Q_as + 1) * (count_s + 1), (count_s + 1),
+ dtype=np.float_)) * bar_width
y = [s[1].Q_a for s in sorted(Q_as.items(), key=lambda s: s[0])]
y = np.array([Q_a] + list(y))
@@ -127,13 +121,13 @@ def colour_quality_bars_plot(specifications,
y = np.abs(y)
- bars = pylab.bar(x,
- y,
- color=colours,
- width=bar_width,
- hatch=(next(patterns) * hatching_repeat
- if hatching else None),
- label=specification.name)
+ bars = pylab.bar(
+ x,
+ y,
+ color=colours,
+ width=bar_width,
+ hatch=(next(patterns) * hatching_repeat if hatching else None),
+ label=specification.name)
if labels:
label_rectangles(
@@ -145,23 +139,28 @@ def colour_quality_bars_plot(specifications,
pylab.axhline(y=100, color='black', linestyle='--')
- pylab.xticks((np.arange(0, (count_Q_as + 1) * (count_s + 1), (count_s + 1),
- dtype=np.float_) *
- bar_width + (count_s * bar_width / 2)),
- ['Qa'] + ['Q{0}'.format(index + 1)
- for index in range(0, count_Q_as + 1, 1)])
+ pylab.xticks((np.arange(
+ 0, (count_Q_as + 1) * (count_s + 1),
+ (count_s + 1), dtype=np.float_) * bar_width +
+ (count_s * bar_width / 2)), ['Qa'] + [
+ 'Q{0}'.format(index + 1)
+ for index in range(0, count_Q_as + 1, 1)
+ ])
pylab.yticks(range(0, 100 + y_ticks_interval, y_ticks_interval))
settings.update({
- 'title': 'Colour Quality',
- 'legend': hatching,
- 'x_tighten': True,
- 'y_tighten': True,
- 'limits': (-bar_width,
- ((count_Q_as + 1) * (count_s + 1)) / 2,
- 0,
- 120),
- 'aspect': 1 / (120 / (bar_width + len(Q_as) + bar_width * 2))})
+ 'title':
+ 'Colour Quality',
+ 'legend':
+ hatching,
+ 'x_tighten':
+ True,
+ 'y_tighten':
+ True,
+ 'limits': (-bar_width, ((count_Q_as + 1) * (count_s + 1)) / 2, 0, 120),
+ 'aspect':
+ 1 / (120 / (bar_width + len(Q_as) + bar_width * 2))
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -260,8 +259,9 @@ def multi_spd_colour_rendering_index_bars_plot(spds, **kwargs):
settings.update(kwargs)
settings.update({'standalone': False})
- specifications = [colour_rendering_index(spd, additional_data=True)
- for spd in spds]
+ specifications = [
+ colour_rendering_index(spd, additional_data=True) for spd in spds
+ ]
# *colour rendering index* colorimetry data tristimulus values are
# computed in [0, 100] domain however `colour_quality_bars_plot` expects
@@ -271,15 +271,16 @@ def multi_spd_colour_rendering_index_bars_plot(spds, **kwargs):
for specification in specifications:
colorimetry_data = specification.colorimetry_data
for i, c_d in enumerate(colorimetry_data[0]):
- colorimetry_data[0][i] = TCS_ColorimetryData(c_d.name,
- c_d.XYZ / 100,
- c_d.uv,
- c_d.UVW)
+ colorimetry_data[0][i] = TCS_ColorimetryData(
+ c_d.name, c_d.XYZ / 100, c_d.uv, c_d.UVW)
colour_quality_bars_plot(specifications, **settings)
- settings = {'title': 'Colour Rendering Index - {0}'.format(', '.join(
- [spd.title for spd in spds]))}
+ settings = {
+ 'title':
+ 'Colour Rendering Index - {0}'
+ .format(', '.join([spd.title for spd in spds]))
+ }
settings.update(kwargs)
decorate(**settings)
@@ -377,12 +378,16 @@ def multi_spd_colour_quality_scale_bars_plot(spds, **kwargs):
settings.update(kwargs)
settings.update({'standalone': False})
- specifications = [colour_quality_scale(spd, additional_data=True)
- for spd in spds]
+ specifications = [
+ colour_quality_scale(spd, additional_data=True) for spd in spds
+ ]
colour_quality_bars_plot(specifications, **settings)
- settings = {'title': 'Colour Quality Scale - {0}'.format(', '.join(
- [spd.title for spd in spds]))}
+ settings = {
+ 'title':
+ 'Colour Quality Scale - {0}'
+ .format(', '.join([spd.title for spd in spds]))
+ }
settings.update(kwargs)
decorate(**settings)
diff --git a/colour/plotting/temperature.py b/colour/plotting/temperature.py
index 6a24aebc08..c12cebe76e 100644
--- a/colour/plotting/temperature.py
+++ b/colour/plotting/temperature.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Temperature & Correlated Colour Temperature Plotting
===========================================================
@@ -17,21 +16,12 @@
import numpy as np
import pylab
-from colour.colorimetry import (
- CMFS,
- ILLUMINANTS)
-from colour.models import (
- UCS_uv_to_xy,
- XYZ_to_UCS,
- UCS_to_uv,
- xy_to_XYZ)
+from colour.colorimetry import (CMFS, ILLUMINANTS)
+from colour.models import (UCS_uv_to_xy, XYZ_to_UCS, UCS_to_uv, xy_to_XYZ)
from colour.temperature import CCT_to_uv
-from colour.plotting import (
- CIE_1931_chromaticity_diagram_plot,
- CIE_1960_UCS_chromaticity_diagram_plot,
- boundaries,
- decorate,
- display)
+from colour.plotting import (CIE_1931_chromaticity_diagram_plot,
+ CIE_1960_UCS_chromaticity_diagram_plot,
+ boundaries, decorate, display)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -40,13 +30,14 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['planckian_locus_CIE_1931_chromaticity_diagram_plot',
- 'planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot']
+__all__ = [
+ 'planckian_locus_CIE_1931_chromaticity_diagram_plot',
+ 'planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot'
+]
-def planckian_locus_CIE_1931_chromaticity_diagram_plot(
- illuminants=None,
- **kwargs):
+def planckian_locus_CIE_1931_chromaticity_diagram_plot(illuminants=None,
+ **kwargs):
"""
Plots the planckian locus and given illuminants in
*CIE 1931 Chromaticity Diagram*.
@@ -91,19 +82,21 @@ def planckian_locus_CIE_1931_chromaticity_diagram_plot(
settings = {
'title': ('{0} Illuminants - Planckian Locus\n'
'CIE 1931 Chromaticity Diagram - '
- 'CIE 1931 2 Degree Standard Observer').format(
- ', '.join(illuminants))
- if illuminants else
- ('Planckian Locus\nCIE 1931 Chromaticity Diagram - '
- 'CIE 1931 2 Degree Standard Observer'),
- 'standalone': False}
+ 'CIE 1931 2 Degree Standard Observer'
+ ).format(', '.join(illuminants)) if illuminants else
+ ('Planckian Locus\nCIE 1931 Chromaticity Diagram - '
+ 'CIE 1931 2 Degree Standard Observer'),
+ 'standalone':
+ False
+ }
settings.update(kwargs)
CIE_1931_chromaticity_diagram_plot(**settings)
start, end = 1667, 100000
- xy = np.array([UCS_uv_to_xy(CCT_to_uv(x, 'Robertson 1968', D_uv=0))
- for x in np.arange(start, end + 250, 250)])
+ xy = np.array(
+ [UCS_uv_to_xy(CCT_to_uv(x, 'Robertson 1968', D_uv=0))
+ for x in np.arange(start, end + 250, 250)]) # yapf: disable
pylab.plot(xy[..., 0], xy[..., 1], color='black', linewidth=2)
@@ -111,12 +104,13 @@ def planckian_locus_CIE_1931_chromaticity_diagram_plot(
x0, y0 = UCS_uv_to_xy(CCT_to_uv(i, 'Robertson 1968', D_uv=-0.025))
x1, y1 = UCS_uv_to_xy(CCT_to_uv(i, 'Robertson 1968', D_uv=0.025))
pylab.plot((x0, x1), (y0, y1), color='black', linewidth=2)
- pylab.annotate('{0}K'.format(i),
- xy=(x0, y0),
- xytext=(0, -10),
- color='black',
- textcoords='offset points',
- size='x-small')
+ pylab.annotate(
+ '{0}K'.format(i),
+ xy=(x0, y0),
+ xytext=(0, -10),
+ color='black',
+ textcoords='offset points',
+ size='x-small')
for illuminant in illuminants:
xy = ILLUMINANTS.get(cmfs.name).get(illuminant)
@@ -128,19 +122,20 @@ def planckian_locus_CIE_1931_chromaticity_diagram_plot(
pylab.plot(xy[0], xy[1], 'o', color='white', linewidth=2)
- pylab.annotate(illuminant,
- xy=(xy[0], xy[1]),
- xytext=(-50, 30),
- color='black',
- textcoords='offset points',
- arrowprops=dict(arrowstyle='->',
- connectionstyle='arc3, rad=-0.2'))
+ pylab.annotate(
+ illuminant,
+ xy=(xy[0], xy[1]),
+ xytext=(-50, 30),
+ color='black',
+ textcoords='offset points',
+ arrowprops=dict(arrowstyle='->', connectionstyle='arc3, rad=-0.2'))
settings.update({
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.9, -0.1, 0.9),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
@@ -150,8 +145,7 @@ def planckian_locus_CIE_1931_chromaticity_diagram_plot(
def planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
- illuminants=None,
- **kwargs):
+ illuminants=None, **kwargs):
"""
Plots the planckian locus and given illuminants in
*CIE 1960 UCS Chromaticity Diagram*.
@@ -196,19 +190,21 @@ def planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
settings = {
'title': ('{0} Illuminants - Planckian Locus\n'
'CIE 1960 UCS Chromaticity Diagram - '
- 'CIE 1931 2 Degree Standard Observer').format(
- ', '.join(illuminants))
- if illuminants else
- ('Planckian Locus\nCIE 1960 UCS Chromaticity Diagram - '
- 'CIE 1931 2 Degree Standard Observer'),
- 'standalone': False}
+ 'CIE 1931 2 Degree Standard Observer'
+ ).format(', '.join(illuminants)) if illuminants else
+ ('Planckian Locus\nCIE 1960 UCS Chromaticity Diagram - '
+ 'CIE 1931 2 Degree Standard Observer'),
+ 'standalone':
+ False
+ }
settings.update(kwargs)
CIE_1960_UCS_chromaticity_diagram_plot(**settings)
start, end = 1667, 100000
- uv = np.array([CCT_to_uv(x, 'Robertson 1968', D_uv=0)
- for x in np.arange(start, end + 250, 250)])
+ uv = np.array(
+ [CCT_to_uv(x, 'Robertson 1968', D_uv=0)
+ for x in np.arange(start, end + 250, 250)]) # yapf: disable
pylab.plot(uv[..., 0], uv[..., 1], color='black', linewidth=2)
@@ -216,12 +212,13 @@ def planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
u0, v0 = CCT_to_uv(i, 'Robertson 1968', D_uv=-0.05)
u1, v1 = CCT_to_uv(i, 'Robertson 1968', D_uv=0.05)
pylab.plot((u0, u1), (v0, v1), color='black', linewidth=2)
- pylab.annotate('{0}K'.format(i),
- xy=(u0, v0),
- xytext=(0, -10),
- color='black',
- textcoords='offset points',
- size='x-small')
+ pylab.annotate(
+ '{0}K'.format(i),
+ xy=(u0, v0),
+ xytext=(0, -10),
+ color='black',
+ textcoords='offset points',
+ size='x-small')
for illuminant in illuminants:
xy = ILLUMINANTS.get(cmfs.name).get(illuminant)
@@ -235,19 +232,20 @@ def planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
pylab.plot(uv[0], uv[1], 'o', color='white', linewidth=2)
- pylab.annotate(illuminant,
- xy=(uv[0], uv[1]),
- xytext=(-50, 30),
- color='black',
- textcoords='offset points',
- arrowprops=dict(arrowstyle='->',
- connectionstyle='arc3, rad=-0.2'))
+ pylab.annotate(
+ illuminant,
+ xy=(uv[0], uv[1]),
+ xytext=(-50, 30),
+ color='black',
+ textcoords='offset points',
+ arrowprops=dict(arrowstyle='->', connectionstyle='arc3, rad=-0.2'))
settings.update({
'x_tighten': True,
'y_tighten': True,
'limits': (-0.1, 0.7, -0.2, 0.6),
- 'standalone': True})
+ 'standalone': True
+ })
settings.update(kwargs)
boundaries(**settings)
diff --git a/colour/plotting/tests/tests_geometry.py b/colour/plotting/tests/tests_geometry.py
index 46b3d1ea60..7d989447c7 100644
--- a/colour/plotting/tests/tests_geometry.py
+++ b/colour/plotting/tests/tests_geometry.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.plotting.geometry` module.
"""
@@ -19,9 +18,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestQuad',
- 'TestGrid',
- 'TestCube']
+__all__ = ['TestQuad', 'TestGrid', 'TestCube']
class TestQuad(unittest.TestCase):
@@ -37,50 +34,39 @@ def test_quad(self):
np.testing.assert_almost_equal(
quad(),
- np.array([[0, 0, 0],
- [1, 0, 0],
- [1, 1, 0],
- [0, 1, 0]]),
+ np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]),
decimal=7)
np.testing.assert_almost_equal(
quad('xz'),
- np.array([[0, 0, 0],
- [1, 0, 0],
- [1, 0, 1],
- [0, 0, 1]]),
+ np.array([[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]]),
decimal=7)
np.testing.assert_almost_equal(
quad('yz'),
- np.array([[0, 0, 0],
- [0, 1, 0],
- [0, 1, 1],
- [0, 0, 1]]),
+ np.array([[0, 0, 0], [0, 1, 0], [0, 1, 1], [0, 0, 1]]),
decimal=7)
np.testing.assert_almost_equal(
- quad('xy',
- origin=np.array([0.2, 0.4]),
- width=0.2,
- height=0.4,
- depth=0.6),
- np.array([[0.2, 0.4, 0.6],
- [0.4, 0.4, 0.6],
- [0.4, 0.8, 0.6],
+ quad(
+ 'xy',
+ origin=np.array([0.2, 0.4]),
+ width=0.2,
+ height=0.4,
+ depth=0.6),
+ np.array([[0.2, 0.4, 0.6], [0.4, 0.4, 0.6], [0.4, 0.8, 0.6],
[0.2, 0.8, 0.6]]),
decimal=7)
np.testing.assert_almost_equal(
- quad('xy',
- origin=np.array([-0.2, -0.4]),
- width=-0.2,
- height=-0.4,
- depth=-0.6),
- np.array([[-0.2, -0.4, -0.6],
- [-0.4, -0.4, -0.6],
- [-0.4, -0.8, -0.6],
- [-0.2, -0.8, -0.6]]),
+ quad(
+ 'xy',
+ origin=np.array([-0.2, -0.4]),
+ width=-0.2,
+ height=-0.4,
+ depth=-0.6),
+ np.array([[-0.2, -0.4, -0.6], [-0.4, -0.4, -0.6],
+ [-0.4, -0.8, -0.6], [-0.2, -0.8, -0.6]]),
decimal=7)
@@ -97,26 +83,17 @@ def test_grid(self):
np.testing.assert_almost_equal(
grid(),
- np.array([[[0, 0, 0],
- [1, 0, 0],
- [1, 1, 0],
- [0, 1, 0]]]),
+ np.array([[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]]),
decimal=7)
np.testing.assert_almost_equal(
grid('xz'),
- np.array([[[0, 0, 0],
- [1, 0, 0],
- [1, 0, 1],
- [0, 0, 1]]]),
+ np.array([[[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
grid('yz'),
- np.array([[[0, 0, 0],
- [0, 1, 0],
- [0, 1, 1],
- [0, 0, 1]]]),
+ np.array([[[0, 0, 0], [0, 1, 0], [0, 1, 1], [0, 0, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
@@ -127,43 +104,44 @@ def test_grid(self):
depth=0.6,
width_segments=3,
height_segments=3),
- np.array([[[0.20000000, 0.40000000, 0.60000000],
- [0.26666667, 0.40000000, 0.60000000],
- [0.26666667, 0.53333333, 0.60000000],
- [0.20000000, 0.53333333, 0.60000000]],
- [[0.20000000, 0.53333333, 0.60000000],
- [0.26666667, 0.53333333, 0.60000000],
- [0.26666667, 0.66666667, 0.60000000],
- [0.20000000, 0.66666667, 0.60000000]],
- [[0.20000000, 0.66666667, 0.60000000],
- [0.26666667, 0.66666667, 0.60000000],
- [0.26666667, 0.80000000, 0.60000000],
- [0.20000000, 0.80000000, 0.60000000]],
- [[0.26666667, 0.40000000, 0.60000000],
- [0.33333333, 0.40000000, 0.60000000],
- [0.33333333, 0.53333333, 0.60000000],
- [0.26666667, 0.53333333, 0.60000000]],
- [[0.26666667, 0.53333333, 0.60000000],
- [0.33333333, 0.53333333, 0.60000000],
- [0.33333333, 0.66666667, 0.60000000],
- [0.26666667, 0.66666667, 0.60000000]],
- [[0.26666667, 0.66666667, 0.60000000],
- [0.33333333, 0.66666667, 0.60000000],
- [0.33333333, 0.80000000, 0.60000000],
- [0.26666667, 0.80000000, 0.60000000]],
- [[0.33333333, 0.40000000, 0.60000000],
- [0.40000000, 0.40000000, 0.60000000],
- [0.40000000, 0.53333333, 0.60000000],
- [0.33333333, 0.53333333, 0.60000000]],
- [[0.33333333, 0.53333333, 0.60000000],
- [0.40000000, 0.53333333, 0.60000000],
- [0.40000000, 0.66666667, 0.60000000],
- [0.33333333, 0.66666667, 0.60000000]],
- [[0.33333333, 0.66666667, 0.60000000],
- [0.40000000, 0.66666667, 0.60000000],
- [0.40000000, 0.80000000, 0.60000000],
- [0.33333333, 0.80000000, 0.60000000]]]),
- decimal=7)
+ np.array(
+ [[[0.20000000, 0.40000000, 0.60000000],
+ [0.26666667, 0.40000000, 0.60000000],
+ [0.26666667, 0.53333333, 0.60000000],
+ [0.20000000, 0.53333333, 0.60000000]],
+ [[0.20000000, 0.53333333, 0.60000000],
+ [0.26666667, 0.53333333, 0.60000000],
+ [0.26666667, 0.66666667, 0.60000000],
+ [0.20000000, 0.66666667, 0.60000000]],
+ [[0.20000000, 0.66666667, 0.60000000],
+ [0.26666667, 0.66666667, 0.60000000],
+ [0.26666667, 0.80000000, 0.60000000],
+ [0.20000000, 0.80000000, 0.60000000]],
+ [[0.26666667, 0.40000000, 0.60000000],
+ [0.33333333, 0.40000000, 0.60000000],
+ [0.33333333, 0.53333333, 0.60000000],
+ [0.26666667, 0.53333333, 0.60000000]],
+ [[0.26666667, 0.53333333, 0.60000000],
+ [0.33333333, 0.53333333, 0.60000000],
+ [0.33333333, 0.66666667, 0.60000000],
+ [0.26666667, 0.66666667, 0.60000000]],
+ [[0.26666667, 0.66666667, 0.60000000],
+ [0.33333333, 0.66666667, 0.60000000],
+ [0.33333333, 0.80000000, 0.60000000],
+ [0.26666667, 0.80000000, 0.60000000]],
+ [[0.33333333, 0.40000000, 0.60000000],
+ [0.40000000, 0.40000000, 0.60000000],
+ [0.40000000, 0.53333333, 0.60000000],
+ [0.33333333, 0.53333333, 0.60000000]],
+ [[0.33333333, 0.53333333, 0.60000000],
+ [0.40000000, 0.53333333, 0.60000000],
+ [0.40000000, 0.66666667, 0.60000000],
+ [0.33333333, 0.66666667, 0.60000000]],
+ [[0.33333333, 0.66666667, 0.60000000],
+ [0.40000000, 0.66666667, 0.60000000],
+ [0.40000000, 0.80000000, 0.60000000],
+ [0.33333333, 0.80000000, 0.60000000]]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
grid('xy',
@@ -173,43 +151,44 @@ def test_grid(self):
depth=-0.6,
width_segments=3,
height_segments=3),
- np.array([[[-0.20000000, -0.40000000, -0.60000000],
- [-0.26666667, -0.40000000, -0.60000000],
- [-0.26666667, -0.53333333, -0.60000000],
- [-0.20000000, -0.53333333, -0.60000000]],
- [[-0.20000000, -0.53333333, -0.60000000],
- [-0.26666667, -0.53333333, -0.60000000],
- [-0.26666667, -0.66666667, -0.60000000],
- [-0.20000000, -0.66666667, -0.60000000]],
- [[-0.20000000, -0.66666667, -0.60000000],
- [-0.26666667, -0.66666667, -0.60000000],
- [-0.26666667, -0.80000000, -0.60000000],
- [-0.20000000, -0.80000000, -0.60000000]],
- [[-0.26666667, -0.40000000, -0.60000000],
- [-0.33333333, -0.40000000, -0.60000000],
- [-0.33333333, -0.53333333, -0.60000000],
- [-0.26666667, -0.53333333, -0.60000000]],
- [[-0.26666667, -0.53333333, -0.60000000],
- [-0.33333333, -0.53333333, -0.60000000],
- [-0.33333333, -0.66666667, -0.60000000],
- [-0.26666667, -0.66666667, -0.60000000]],
- [[-0.26666667, -0.66666667, -0.60000000],
- [-0.33333333, -0.66666667, -0.60000000],
- [-0.33333333, -0.80000000, -0.60000000],
- [-0.26666667, -0.80000000, -0.60000000]],
- [[-0.33333333, -0.40000000, -0.60000000],
- [-0.40000000, -0.40000000, -0.60000000],
- [-0.40000000, -0.53333333, -0.60000000],
- [-0.33333333, -0.53333333, -0.60000000]],
- [[-0.33333333, -0.53333333, -0.60000000],
- [-0.40000000, -0.53333333, -0.60000000],
- [-0.40000000, -0.66666667, -0.60000000],
- [-0.33333333, -0.66666667, -0.60000000]],
- [[-0.33333333, -0.66666667, -0.60000000],
- [-0.40000000, -0.66666667, -0.60000000],
- [-0.40000000, -0.80000000, -0.60000000],
- [-0.33333333, -0.80000000, -0.60000000]]]),
- decimal=7)
+ np.array(
+ [[[-0.20000000, -0.40000000, -0.60000000],
+ [-0.26666667, -0.40000000, -0.60000000],
+ [-0.26666667, -0.53333333, -0.60000000],
+ [-0.20000000, -0.53333333, -0.60000000]],
+ [[-0.20000000, -0.53333333, -0.60000000],
+ [-0.26666667, -0.53333333, -0.60000000],
+ [-0.26666667, -0.66666667, -0.60000000],
+ [-0.20000000, -0.66666667, -0.60000000]],
+ [[-0.20000000, -0.66666667, -0.60000000],
+ [-0.26666667, -0.66666667, -0.60000000],
+ [-0.26666667, -0.80000000, -0.60000000],
+ [-0.20000000, -0.80000000, -0.60000000]],
+ [[-0.26666667, -0.40000000, -0.60000000],
+ [-0.33333333, -0.40000000, -0.60000000],
+ [-0.33333333, -0.53333333, -0.60000000],
+ [-0.26666667, -0.53333333, -0.60000000]],
+ [[-0.26666667, -0.53333333, -0.60000000],
+ [-0.33333333, -0.53333333, -0.60000000],
+ [-0.33333333, -0.66666667, -0.60000000],
+ [-0.26666667, -0.66666667, -0.60000000]],
+ [[-0.26666667, -0.66666667, -0.60000000],
+ [-0.33333333, -0.66666667, -0.60000000],
+ [-0.33333333, -0.80000000, -0.60000000],
+ [-0.26666667, -0.80000000, -0.60000000]],
+ [[-0.33333333, -0.40000000, -0.60000000],
+ [-0.40000000, -0.40000000, -0.60000000],
+ [-0.40000000, -0.53333333, -0.60000000],
+ [-0.33333333, -0.53333333, -0.60000000]],
+ [[-0.33333333, -0.53333333, -0.60000000],
+ [-0.40000000, -0.53333333, -0.60000000],
+ [-0.40000000, -0.66666667, -0.60000000],
+ [-0.33333333, -0.66666667, -0.60000000]],
+ [[-0.33333333, -0.66666667, -0.60000000],
+ [-0.40000000, -0.66666667, -0.60000000],
+ [-0.40000000, -0.80000000, -0.60000000],
+ [-0.33333333, -0.80000000, -0.60000000]]]),
+ decimal=7) # yapf: disable
class TestCube(unittest.TestCase):
@@ -225,78 +204,61 @@ def test_cube(self):
np.testing.assert_almost_equal(
cube(),
- np.array([[[0, 0, 0],
- [1, 0, 0],
- [1, 1, 0],
- [0, 1, 0]],
- [[0, 0, 1],
- [1, 0, 1],
- [1, 1, 1],
- [0, 1, 1]],
- [[0, 0, 0],
- [1, 0, 0],
- [1, 0, 1],
- [0, 0, 1]],
- [[0, 1, 0],
- [1, 1, 0],
- [1, 1, 1],
- [0, 1, 1]],
- [[0, 0, 0],
- [0, 1, 0],
- [0, 1, 1],
- [0, 0, 1]],
- [[1, 0, 0],
- [1, 1, 0],
- [1, 1, 1],
- [1, 0, 1]]]),
- decimal=7)
+ np.array(
+ [[[0, 0, 0],
+ [1, 0, 0],
+ [1, 1, 0],
+ [0, 1, 0]],
+ [[0, 0, 1],
+ [1, 0, 1],
+ [1, 1, 1],
+ [0, 1, 1]],
+ [[0, 0, 0],
+ [1, 0, 0],
+ [1, 0, 1],
+ [0, 0, 1]],
+ [[0, 1, 0],
+ [1, 1, 0],
+ [1, 1, 1],
+ [0, 1, 1]],
+ [[0, 0, 0],
+ [0, 1, 0],
+ [0, 1, 1],
+ [0, 0, 1]],
+ [[1, 0, 0],
+ [1, 1, 0],
+ [1, 1, 1],
+ [1, 0, 1]]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
- cube(('+x',)),
- np.array([[[1, 0, 0],
- [1, 1, 0],
- [1, 1, 1],
- [1, 0, 1]]]),
+ cube(('+x', )),
+ np.array([[[1, 0, 0], [1, 1, 0], [1, 1, 1], [1, 0, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
- cube(('-x',)),
- np.array([[[0, 0, 0],
- [0, 1, 0],
- [0, 1, 1],
- [0, 0, 1]]]),
+ cube(('-x', )),
+ np.array([[[0, 0, 0], [0, 1, 0], [0, 1, 1], [0, 0, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
- cube(('+y',)),
- np.array([[[0, 1, 0],
- [1, 1, 0],
- [1, 1, 1],
- [0, 1, 1]]]),
+ cube(('+y', )),
+ np.array([[[0, 1, 0], [1, 1, 0], [1, 1, 1], [0, 1, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
- cube(('-y',)),
- np.array([[[0, 0, 0],
- [1, 0, 0],
- [1, 0, 1],
- [0, 0, 1]]]),
+ cube(('-y', )),
+ np.array([[[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
- cube(('+z',)),
- np.array([[[0, 0, 1],
- [1, 0, 1],
- [1, 1, 1],
- [0, 1, 1]]]),
+ cube(('+z', )),
+ np.array([[[0, 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]]]),
decimal=7)
np.testing.assert_almost_equal(
- cube(('-z',)),
- np.array([[[0, 0, 0],
- [1, 0, 0],
- [1, 1, 0],
- [0, 1, 0]]]),
+ cube(('-z', )),
+ np.array([[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]]),
decimal=7)
np.testing.assert_almost_equal(
@@ -307,223 +269,224 @@ def test_cube(self):
width_segments=3,
height_segments=3,
depth_segments=3),
- np.array([[[0.20000000, 0.60000000, 0.40000000],
- [0.26666667, 0.60000000, 0.40000000],
- [0.26666667, 0.80000000, 0.40000000],
- [0.20000000, 0.80000000, 0.40000000]],
- [[0.20000000, 0.80000000, 0.40000000],
- [0.26666667, 0.80000000, 0.40000000],
- [0.26666667, 1.00000000, 0.40000000],
- [0.20000000, 1.00000000, 0.40000000]],
- [[0.20000000, 1.00000000, 0.40000000],
- [0.26666667, 1.00000000, 0.40000000],
- [0.26666667, 1.20000000, 0.40000000],
- [0.20000000, 1.20000000, 0.40000000]],
- [[0.26666667, 0.60000000, 0.40000000],
- [0.33333333, 0.60000000, 0.40000000],
- [0.33333333, 0.80000000, 0.40000000],
- [0.26666667, 0.80000000, 0.40000000]],
- [[0.26666667, 0.80000000, 0.40000000],
- [0.33333333, 0.80000000, 0.40000000],
- [0.33333333, 1.00000000, 0.40000000],
- [0.26666667, 1.00000000, 0.40000000]],
- [[0.26666667, 1.00000000, 0.40000000],
- [0.33333333, 1.00000000, 0.40000000],
- [0.33333333, 1.20000000, 0.40000000],
- [0.26666667, 1.20000000, 0.40000000]],
- [[0.33333333, 0.60000000, 0.40000000],
- [0.40000000, 0.60000000, 0.40000000],
- [0.40000000, 0.80000000, 0.40000000],
- [0.33333333, 0.80000000, 0.40000000]],
- [[0.33333333, 0.80000000, 0.40000000],
- [0.40000000, 0.80000000, 0.40000000],
- [0.40000000, 1.00000000, 0.40000000],
- [0.33333333, 1.00000000, 0.40000000]],
- [[0.33333333, 1.00000000, 0.40000000],
- [0.40000000, 1.00000000, 0.40000000],
- [0.40000000, 1.20000000, 0.40000000],
- [0.33333333, 1.20000000, 0.40000000]],
- [[0.20000000, 0.60000000, 0.80000000],
- [0.26666667, 0.60000000, 0.80000000],
- [0.26666667, 0.80000000, 0.80000000],
- [0.20000000, 0.80000000, 0.80000000]],
- [[0.20000000, 0.80000000, 0.80000000],
- [0.26666667, 0.80000000, 0.80000000],
- [0.26666667, 1.00000000, 0.80000000],
- [0.20000000, 1.00000000, 0.80000000]],
- [[0.20000000, 1.00000000, 0.80000000],
- [0.26666667, 1.00000000, 0.80000000],
- [0.26666667, 1.20000000, 0.80000000],
- [0.20000000, 1.20000000, 0.80000000]],
- [[0.26666667, 0.60000000, 0.80000000],
- [0.33333333, 0.60000000, 0.80000000],
- [0.33333333, 0.80000000, 0.80000000],
- [0.26666667, 0.80000000, 0.80000000]],
- [[0.26666667, 0.80000000, 0.80000000],
- [0.33333333, 0.80000000, 0.80000000],
- [0.33333333, 1.00000000, 0.80000000],
- [0.26666667, 1.00000000, 0.80000000]],
- [[0.26666667, 1.00000000, 0.80000000],
- [0.33333333, 1.00000000, 0.80000000],
- [0.33333333, 1.20000000, 0.80000000],
- [0.26666667, 1.20000000, 0.80000000]],
- [[0.33333333, 0.60000000, 0.80000000],
- [0.40000000, 0.60000000, 0.80000000],
- [0.40000000, 0.80000000, 0.80000000],
- [0.33333333, 0.80000000, 0.80000000]],
- [[0.33333333, 0.80000000, 0.80000000],
- [0.40000000, 0.80000000, 0.80000000],
- [0.40000000, 1.00000000, 0.80000000],
- [0.33333333, 1.00000000, 0.80000000]],
- [[0.33333333, 1.00000000, 0.80000000],
- [0.40000000, 1.00000000, 0.80000000],
- [0.40000000, 1.20000000, 0.80000000],
- [0.33333333, 1.20000000, 0.80000000]],
- [[0.20000000, 0.60000000, 0.40000000],
- [0.26666667, 0.60000000, 0.40000000],
- [0.26666667, 0.60000000, 0.53333333],
- [0.20000000, 0.60000000, 0.53333333]],
- [[0.20000000, 0.60000000, 0.53333333],
- [0.26666667, 0.60000000, 0.53333333],
- [0.26666667, 0.60000000, 0.66666667],
- [0.20000000, 0.60000000, 0.66666667]],
- [[0.20000000, 0.60000000, 0.66666667],
- [0.26666667, 0.60000000, 0.66666667],
- [0.26666667, 0.60000000, 0.80000000],
- [0.20000000, 0.60000000, 0.80000000]],
- [[0.26666667, 0.60000000, 0.40000000],
- [0.33333333, 0.60000000, 0.40000000],
- [0.33333333, 0.60000000, 0.53333333],
- [0.26666667, 0.60000000, 0.53333333]],
- [[0.26666667, 0.60000000, 0.53333333],
- [0.33333333, 0.60000000, 0.53333333],
- [0.33333333, 0.60000000, 0.66666667],
- [0.26666667, 0.60000000, 0.66666667]],
- [[0.26666667, 0.60000000, 0.66666667],
- [0.33333333, 0.60000000, 0.66666667],
- [0.33333333, 0.60000000, 0.80000000],
- [0.26666667, 0.60000000, 0.80000000]],
- [[0.33333333, 0.60000000, 0.40000000],
- [0.40000000, 0.60000000, 0.40000000],
- [0.40000000, 0.60000000, 0.53333333],
- [0.33333333, 0.60000000, 0.53333333]],
- [[0.33333333, 0.60000000, 0.53333333],
- [0.40000000, 0.60000000, 0.53333333],
- [0.40000000, 0.60000000, 0.66666667],
- [0.33333333, 0.60000000, 0.66666667]],
- [[0.33333333, 0.60000000, 0.66666667],
- [0.40000000, 0.60000000, 0.66666667],
- [0.40000000, 0.60000000, 0.80000000],
- [0.33333333, 0.60000000, 0.80000000]],
- [[0.20000000, 1.20000000, 0.40000000],
- [0.26666667, 1.20000000, 0.40000000],
- [0.26666667, 1.20000000, 0.53333333],
- [0.20000000, 1.20000000, 0.53333333]],
- [[0.20000000, 1.20000000, 0.53333333],
- [0.26666667, 1.20000000, 0.53333333],
- [0.26666667, 1.20000000, 0.66666667],
- [0.20000000, 1.20000000, 0.66666667]],
- [[0.20000000, 1.20000000, 0.66666667],
- [0.26666667, 1.20000000, 0.66666667],
- [0.26666667, 1.20000000, 0.80000000],
- [0.20000000, 1.20000000, 0.80000000]],
- [[0.26666667, 1.20000000, 0.40000000],
- [0.33333333, 1.20000000, 0.40000000],
- [0.33333333, 1.20000000, 0.53333333],
- [0.26666667, 1.20000000, 0.53333333]],
- [[0.26666667, 1.20000000, 0.53333333],
- [0.33333333, 1.20000000, 0.53333333],
- [0.33333333, 1.20000000, 0.66666667],
- [0.26666667, 1.20000000, 0.66666667]],
- [[0.26666667, 1.20000000, 0.66666667],
- [0.33333333, 1.20000000, 0.66666667],
- [0.33333333, 1.20000000, 0.80000000],
- [0.26666667, 1.20000000, 0.80000000]],
- [[0.33333333, 1.20000000, 0.40000000],
- [0.40000000, 1.20000000, 0.40000000],
- [0.40000000, 1.20000000, 0.53333333],
- [0.33333333, 1.20000000, 0.53333333]],
- [[0.33333333, 1.20000000, 0.53333333],
- [0.40000000, 1.20000000, 0.53333333],
- [0.40000000, 1.20000000, 0.66666667],
- [0.33333333, 1.20000000, 0.66666667]],
- [[0.33333333, 1.20000000, 0.66666667],
- [0.40000000, 1.20000000, 0.66666667],
- [0.40000000, 1.20000000, 0.80000000],
- [0.33333333, 1.20000000, 0.80000000]],
- [[0.20000000, 0.60000000, 0.40000000],
- [0.20000000, 0.80000000, 0.40000000],
- [0.20000000, 0.80000000, 0.53333333],
- [0.20000000, 0.60000000, 0.53333333]],
- [[0.20000000, 0.60000000, 0.53333333],
- [0.20000000, 0.80000000, 0.53333333],
- [0.20000000, 0.80000000, 0.66666667],
- [0.20000000, 0.60000000, 0.66666667]],
- [[0.20000000, 0.60000000, 0.66666667],
- [0.20000000, 0.80000000, 0.66666667],
- [0.20000000, 0.80000000, 0.80000000],
- [0.20000000, 0.60000000, 0.80000000]],
- [[0.20000000, 0.80000000, 0.40000000],
- [0.20000000, 1.00000000, 0.40000000],
- [0.20000000, 1.00000000, 0.53333333],
- [0.20000000, 0.80000000, 0.53333333]],
- [[0.20000000, 0.80000000, 0.53333333],
- [0.20000000, 1.00000000, 0.53333333],
- [0.20000000, 1.00000000, 0.66666667],
- [0.20000000, 0.80000000, 0.66666667]],
- [[0.20000000, 0.80000000, 0.66666667],
- [0.20000000, 1.00000000, 0.66666667],
- [0.20000000, 1.00000000, 0.80000000],
- [0.20000000, 0.80000000, 0.80000000]],
- [[0.20000000, 1.00000000, 0.40000000],
- [0.20000000, 1.20000000, 0.40000000],
- [0.20000000, 1.20000000, 0.53333333],
- [0.20000000, 1.00000000, 0.53333333]],
- [[0.20000000, 1.00000000, 0.53333333],
- [0.20000000, 1.20000000, 0.53333333],
- [0.20000000, 1.20000000, 0.66666667],
- [0.20000000, 1.00000000, 0.66666667]],
- [[0.20000000, 1.00000000, 0.66666667],
- [0.20000000, 1.20000000, 0.66666667],
- [0.20000000, 1.20000000, 0.80000000],
- [0.20000000, 1.00000000, 0.80000000]],
- [[0.40000000, 0.60000000, 0.40000000],
- [0.40000000, 0.80000000, 0.40000000],
- [0.40000000, 0.80000000, 0.53333333],
- [0.40000000, 0.60000000, 0.53333333]],
- [[0.40000000, 0.60000000, 0.53333333],
- [0.40000000, 0.80000000, 0.53333333],
- [0.40000000, 0.80000000, 0.66666667],
- [0.40000000, 0.60000000, 0.66666667]],
- [[0.40000000, 0.60000000, 0.66666667],
- [0.40000000, 0.80000000, 0.66666667],
- [0.40000000, 0.80000000, 0.80000000],
- [0.40000000, 0.60000000, 0.80000000]],
- [[0.40000000, 0.80000000, 0.40000000],
- [0.40000000, 1.00000000, 0.40000000],
- [0.40000000, 1.00000000, 0.53333333],
- [0.40000000, 0.80000000, 0.53333333]],
- [[0.40000000, 0.80000000, 0.53333333],
- [0.40000000, 1.00000000, 0.53333333],
- [0.40000000, 1.00000000, 0.66666667],
- [0.40000000, 0.80000000, 0.66666667]],
- [[0.40000000, 0.80000000, 0.66666667],
- [0.40000000, 1.00000000, 0.66666667],
- [0.40000000, 1.00000000, 0.80000000],
- [0.40000000, 0.80000000, 0.80000000]],
- [[0.40000000, 1.00000000, 0.40000000],
- [0.40000000, 1.20000000, 0.40000000],
- [0.40000000, 1.20000000, 0.53333333],
- [0.40000000, 1.00000000, 0.53333333]],
- [[0.40000000, 1.00000000, 0.53333333],
- [0.40000000, 1.20000000, 0.53333333],
- [0.40000000, 1.20000000, 0.66666667],
- [0.40000000, 1.00000000, 0.66666667]],
- [[0.40000000, 1.00000000, 0.66666667],
- [0.40000000, 1.20000000, 0.66666667],
- [0.40000000, 1.20000000, 0.80000000],
- [0.40000000, 1.00000000, 0.80000000]]]),
- decimal=7)
+ np.array(
+ [[[0.20000000, 0.60000000, 0.40000000],
+ [0.26666667, 0.60000000, 0.40000000],
+ [0.26666667, 0.80000000, 0.40000000],
+ [0.20000000, 0.80000000, 0.40000000]],
+ [[0.20000000, 0.80000000, 0.40000000],
+ [0.26666667, 0.80000000, 0.40000000],
+ [0.26666667, 1.00000000, 0.40000000],
+ [0.20000000, 1.00000000, 0.40000000]],
+ [[0.20000000, 1.00000000, 0.40000000],
+ [0.26666667, 1.00000000, 0.40000000],
+ [0.26666667, 1.20000000, 0.40000000],
+ [0.20000000, 1.20000000, 0.40000000]],
+ [[0.26666667, 0.60000000, 0.40000000],
+ [0.33333333, 0.60000000, 0.40000000],
+ [0.33333333, 0.80000000, 0.40000000],
+ [0.26666667, 0.80000000, 0.40000000]],
+ [[0.26666667, 0.80000000, 0.40000000],
+ [0.33333333, 0.80000000, 0.40000000],
+ [0.33333333, 1.00000000, 0.40000000],
+ [0.26666667, 1.00000000, 0.40000000]],
+ [[0.26666667, 1.00000000, 0.40000000],
+ [0.33333333, 1.00000000, 0.40000000],
+ [0.33333333, 1.20000000, 0.40000000],
+ [0.26666667, 1.20000000, 0.40000000]],
+ [[0.33333333, 0.60000000, 0.40000000],
+ [0.40000000, 0.60000000, 0.40000000],
+ [0.40000000, 0.80000000, 0.40000000],
+ [0.33333333, 0.80000000, 0.40000000]],
+ [[0.33333333, 0.80000000, 0.40000000],
+ [0.40000000, 0.80000000, 0.40000000],
+ [0.40000000, 1.00000000, 0.40000000],
+ [0.33333333, 1.00000000, 0.40000000]],
+ [[0.33333333, 1.00000000, 0.40000000],
+ [0.40000000, 1.00000000, 0.40000000],
+ [0.40000000, 1.20000000, 0.40000000],
+ [0.33333333, 1.20000000, 0.40000000]],
+ [[0.20000000, 0.60000000, 0.80000000],
+ [0.26666667, 0.60000000, 0.80000000],
+ [0.26666667, 0.80000000, 0.80000000],
+ [0.20000000, 0.80000000, 0.80000000]],
+ [[0.20000000, 0.80000000, 0.80000000],
+ [0.26666667, 0.80000000, 0.80000000],
+ [0.26666667, 1.00000000, 0.80000000],
+ [0.20000000, 1.00000000, 0.80000000]],
+ [[0.20000000, 1.00000000, 0.80000000],
+ [0.26666667, 1.00000000, 0.80000000],
+ [0.26666667, 1.20000000, 0.80000000],
+ [0.20000000, 1.20000000, 0.80000000]],
+ [[0.26666667, 0.60000000, 0.80000000],
+ [0.33333333, 0.60000000, 0.80000000],
+ [0.33333333, 0.80000000, 0.80000000],
+ [0.26666667, 0.80000000, 0.80000000]],
+ [[0.26666667, 0.80000000, 0.80000000],
+ [0.33333333, 0.80000000, 0.80000000],
+ [0.33333333, 1.00000000, 0.80000000],
+ [0.26666667, 1.00000000, 0.80000000]],
+ [[0.26666667, 1.00000000, 0.80000000],
+ [0.33333333, 1.00000000, 0.80000000],
+ [0.33333333, 1.20000000, 0.80000000],
+ [0.26666667, 1.20000000, 0.80000000]],
+ [[0.33333333, 0.60000000, 0.80000000],
+ [0.40000000, 0.60000000, 0.80000000],
+ [0.40000000, 0.80000000, 0.80000000],
+ [0.33333333, 0.80000000, 0.80000000]],
+ [[0.33333333, 0.80000000, 0.80000000],
+ [0.40000000, 0.80000000, 0.80000000],
+ [0.40000000, 1.00000000, 0.80000000],
+ [0.33333333, 1.00000000, 0.80000000]],
+ [[0.33333333, 1.00000000, 0.80000000],
+ [0.40000000, 1.00000000, 0.80000000],
+ [0.40000000, 1.20000000, 0.80000000],
+ [0.33333333, 1.20000000, 0.80000000]],
+ [[0.20000000, 0.60000000, 0.40000000],
+ [0.26666667, 0.60000000, 0.40000000],
+ [0.26666667, 0.60000000, 0.53333333],
+ [0.20000000, 0.60000000, 0.53333333]],
+ [[0.20000000, 0.60000000, 0.53333333],
+ [0.26666667, 0.60000000, 0.53333333],
+ [0.26666667, 0.60000000, 0.66666667],
+ [0.20000000, 0.60000000, 0.66666667]],
+ [[0.20000000, 0.60000000, 0.66666667],
+ [0.26666667, 0.60000000, 0.66666667],
+ [0.26666667, 0.60000000, 0.80000000],
+ [0.20000000, 0.60000000, 0.80000000]],
+ [[0.26666667, 0.60000000, 0.40000000],
+ [0.33333333, 0.60000000, 0.40000000],
+ [0.33333333, 0.60000000, 0.53333333],
+ [0.26666667, 0.60000000, 0.53333333]],
+ [[0.26666667, 0.60000000, 0.53333333],
+ [0.33333333, 0.60000000, 0.53333333],
+ [0.33333333, 0.60000000, 0.66666667],
+ [0.26666667, 0.60000000, 0.66666667]],
+ [[0.26666667, 0.60000000, 0.66666667],
+ [0.33333333, 0.60000000, 0.66666667],
+ [0.33333333, 0.60000000, 0.80000000],
+ [0.26666667, 0.60000000, 0.80000000]],
+ [[0.33333333, 0.60000000, 0.40000000],
+ [0.40000000, 0.60000000, 0.40000000],
+ [0.40000000, 0.60000000, 0.53333333],
+ [0.33333333, 0.60000000, 0.53333333]],
+ [[0.33333333, 0.60000000, 0.53333333],
+ [0.40000000, 0.60000000, 0.53333333],
+ [0.40000000, 0.60000000, 0.66666667],
+ [0.33333333, 0.60000000, 0.66666667]],
+ [[0.33333333, 0.60000000, 0.66666667],
+ [0.40000000, 0.60000000, 0.66666667],
+ [0.40000000, 0.60000000, 0.80000000],
+ [0.33333333, 0.60000000, 0.80000000]],
+ [[0.20000000, 1.20000000, 0.40000000],
+ [0.26666667, 1.20000000, 0.40000000],
+ [0.26666667, 1.20000000, 0.53333333],
+ [0.20000000, 1.20000000, 0.53333333]],
+ [[0.20000000, 1.20000000, 0.53333333],
+ [0.26666667, 1.20000000, 0.53333333],
+ [0.26666667, 1.20000000, 0.66666667],
+ [0.20000000, 1.20000000, 0.66666667]],
+ [[0.20000000, 1.20000000, 0.66666667],
+ [0.26666667, 1.20000000, 0.66666667],
+ [0.26666667, 1.20000000, 0.80000000],
+ [0.20000000, 1.20000000, 0.80000000]],
+ [[0.26666667, 1.20000000, 0.40000000],
+ [0.33333333, 1.20000000, 0.40000000],
+ [0.33333333, 1.20000000, 0.53333333],
+ [0.26666667, 1.20000000, 0.53333333]],
+ [[0.26666667, 1.20000000, 0.53333333],
+ [0.33333333, 1.20000000, 0.53333333],
+ [0.33333333, 1.20000000, 0.66666667],
+ [0.26666667, 1.20000000, 0.66666667]],
+ [[0.26666667, 1.20000000, 0.66666667],
+ [0.33333333, 1.20000000, 0.66666667],
+ [0.33333333, 1.20000000, 0.80000000],
+ [0.26666667, 1.20000000, 0.80000000]],
+ [[0.33333333, 1.20000000, 0.40000000],
+ [0.40000000, 1.20000000, 0.40000000],
+ [0.40000000, 1.20000000, 0.53333333],
+ [0.33333333, 1.20000000, 0.53333333]],
+ [[0.33333333, 1.20000000, 0.53333333],
+ [0.40000000, 1.20000000, 0.53333333],
+ [0.40000000, 1.20000000, 0.66666667],
+ [0.33333333, 1.20000000, 0.66666667]],
+ [[0.33333333, 1.20000000, 0.66666667],
+ [0.40000000, 1.20000000, 0.66666667],
+ [0.40000000, 1.20000000, 0.80000000],
+ [0.33333333, 1.20000000, 0.80000000]],
+ [[0.20000000, 0.60000000, 0.40000000],
+ [0.20000000, 0.80000000, 0.40000000],
+ [0.20000000, 0.80000000, 0.53333333],
+ [0.20000000, 0.60000000, 0.53333333]],
+ [[0.20000000, 0.60000000, 0.53333333],
+ [0.20000000, 0.80000000, 0.53333333],
+ [0.20000000, 0.80000000, 0.66666667],
+ [0.20000000, 0.60000000, 0.66666667]],
+ [[0.20000000, 0.60000000, 0.66666667],
+ [0.20000000, 0.80000000, 0.66666667],
+ [0.20000000, 0.80000000, 0.80000000],
+ [0.20000000, 0.60000000, 0.80000000]],
+ [[0.20000000, 0.80000000, 0.40000000],
+ [0.20000000, 1.00000000, 0.40000000],
+ [0.20000000, 1.00000000, 0.53333333],
+ [0.20000000, 0.80000000, 0.53333333]],
+ [[0.20000000, 0.80000000, 0.53333333],
+ [0.20000000, 1.00000000, 0.53333333],
+ [0.20000000, 1.00000000, 0.66666667],
+ [0.20000000, 0.80000000, 0.66666667]],
+ [[0.20000000, 0.80000000, 0.66666667],
+ [0.20000000, 1.00000000, 0.66666667],
+ [0.20000000, 1.00000000, 0.80000000],
+ [0.20000000, 0.80000000, 0.80000000]],
+ [[0.20000000, 1.00000000, 0.40000000],
+ [0.20000000, 1.20000000, 0.40000000],
+ [0.20000000, 1.20000000, 0.53333333],
+ [0.20000000, 1.00000000, 0.53333333]],
+ [[0.20000000, 1.00000000, 0.53333333],
+ [0.20000000, 1.20000000, 0.53333333],
+ [0.20000000, 1.20000000, 0.66666667],
+ [0.20000000, 1.00000000, 0.66666667]],
+ [[0.20000000, 1.00000000, 0.66666667],
+ [0.20000000, 1.20000000, 0.66666667],
+ [0.20000000, 1.20000000, 0.80000000],
+ [0.20000000, 1.00000000, 0.80000000]],
+ [[0.40000000, 0.60000000, 0.40000000],
+ [0.40000000, 0.80000000, 0.40000000],
+ [0.40000000, 0.80000000, 0.53333333],
+ [0.40000000, 0.60000000, 0.53333333]],
+ [[0.40000000, 0.60000000, 0.53333333],
+ [0.40000000, 0.80000000, 0.53333333],
+ [0.40000000, 0.80000000, 0.66666667],
+ [0.40000000, 0.60000000, 0.66666667]],
+ [[0.40000000, 0.60000000, 0.66666667],
+ [0.40000000, 0.80000000, 0.66666667],
+ [0.40000000, 0.80000000, 0.80000000],
+ [0.40000000, 0.60000000, 0.80000000]],
+ [[0.40000000, 0.80000000, 0.40000000],
+ [0.40000000, 1.00000000, 0.40000000],
+ [0.40000000, 1.00000000, 0.53333333],
+ [0.40000000, 0.80000000, 0.53333333]],
+ [[0.40000000, 0.80000000, 0.53333333],
+ [0.40000000, 1.00000000, 0.53333333],
+ [0.40000000, 1.00000000, 0.66666667],
+ [0.40000000, 0.80000000, 0.66666667]],
+ [[0.40000000, 0.80000000, 0.66666667],
+ [0.40000000, 1.00000000, 0.66666667],
+ [0.40000000, 1.00000000, 0.80000000],
+ [0.40000000, 0.80000000, 0.80000000]],
+ [[0.40000000, 1.00000000, 0.40000000],
+ [0.40000000, 1.20000000, 0.40000000],
+ [0.40000000, 1.20000000, 0.53333333],
+ [0.40000000, 1.00000000, 0.53333333]],
+ [[0.40000000, 1.00000000, 0.53333333],
+ [0.40000000, 1.20000000, 0.53333333],
+ [0.40000000, 1.20000000, 0.66666667],
+ [0.40000000, 1.00000000, 0.66666667]],
+ [[0.40000000, 1.00000000, 0.66666667],
+ [0.40000000, 1.20000000, 0.66666667],
+ [0.40000000, 1.20000000, 0.80000000],
+ [0.40000000, 1.00000000, 0.80000000]]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
cube(origin=np.array([-0.2, -0.4, -0.6]),
@@ -533,223 +496,224 @@ def test_cube(self):
width_segments=3,
height_segments=3,
depth_segments=3),
- np.array([[[-0.20000000, -0.60000000, -0.40000000],
- [-0.26666667, -0.60000000, -0.40000000],
- [-0.26666667, -0.80000000, -0.40000000],
- [-0.20000000, -0.80000000, -0.40000000]],
- [[-0.20000000, -0.80000000, -0.40000000],
- [-0.26666667, -0.80000000, -0.40000000],
- [-0.26666667, -1.00000000, -0.40000000],
- [-0.20000000, -1.00000000, -0.40000000]],
- [[-0.20000000, -1.00000000, -0.40000000],
- [-0.26666667, -1.00000000, -0.40000000],
- [-0.26666667, -1.20000000, -0.40000000],
- [-0.20000000, -1.20000000, -0.40000000]],
- [[-0.26666667, -0.60000000, -0.40000000],
- [-0.33333333, -0.60000000, -0.40000000],
- [-0.33333333, -0.80000000, -0.40000000],
- [-0.26666667, -0.80000000, -0.40000000]],
- [[-0.26666667, -0.80000000, -0.40000000],
- [-0.33333333, -0.80000000, -0.40000000],
- [-0.33333333, -1.00000000, -0.40000000],
- [-0.26666667, -1.00000000, -0.40000000]],
- [[-0.26666667, -1.00000000, -0.40000000],
- [-0.33333333, -1.00000000, -0.40000000],
- [-0.33333333, -1.20000000, -0.40000000],
- [-0.26666667, -1.20000000, -0.40000000]],
- [[-0.33333333, -0.60000000, -0.40000000],
- [-0.40000000, -0.60000000, -0.40000000],
- [-0.40000000, -0.80000000, -0.40000000],
- [-0.33333333, -0.80000000, -0.40000000]],
- [[-0.33333333, -0.80000000, -0.40000000],
- [-0.40000000, -0.80000000, -0.40000000],
- [-0.40000000, -1.00000000, -0.40000000],
- [-0.33333333, -1.00000000, -0.40000000]],
- [[-0.33333333, -1.00000000, -0.40000000],
- [-0.40000000, -1.00000000, -0.40000000],
- [-0.40000000, -1.20000000, -0.40000000],
- [-0.33333333, -1.20000000, -0.40000000]],
- [[-0.20000000, -0.60000000, -0.80000000],
- [-0.26666667, -0.60000000, -0.80000000],
- [-0.26666667, -0.80000000, -0.80000000],
- [-0.20000000, -0.80000000, -0.80000000]],
- [[-0.20000000, -0.80000000, -0.80000000],
- [-0.26666667, -0.80000000, -0.80000000],
- [-0.26666667, -1.00000000, -0.80000000],
- [-0.20000000, -1.00000000, -0.80000000]],
- [[-0.20000000, -1.00000000, -0.80000000],
- [-0.26666667, -1.00000000, -0.80000000],
- [-0.26666667, -1.20000000, -0.80000000],
- [-0.20000000, -1.20000000, -0.80000000]],
- [[-0.26666667, -0.60000000, -0.80000000],
- [-0.33333333, -0.60000000, -0.80000000],
- [-0.33333333, -0.80000000, -0.80000000],
- [-0.26666667, -0.80000000, -0.80000000]],
- [[-0.26666667, -0.80000000, -0.80000000],
- [-0.33333333, -0.80000000, -0.80000000],
- [-0.33333333, -1.00000000, -0.80000000],
- [-0.26666667, -1.00000000, -0.80000000]],
- [[-0.26666667, -1.00000000, -0.80000000],
- [-0.33333333, -1.00000000, -0.80000000],
- [-0.33333333, -1.20000000, -0.80000000],
- [-0.26666667, -1.20000000, -0.80000000]],
- [[-0.33333333, -0.60000000, -0.80000000],
- [-0.40000000, -0.60000000, -0.80000000],
- [-0.40000000, -0.80000000, -0.80000000],
- [-0.33333333, -0.80000000, -0.80000000]],
- [[-0.33333333, -0.80000000, -0.80000000],
- [-0.40000000, -0.80000000, -0.80000000],
- [-0.40000000, -1.00000000, -0.80000000],
- [-0.33333333, -1.00000000, -0.80000000]],
- [[-0.33333333, -1.00000000, -0.80000000],
- [-0.40000000, -1.00000000, -0.80000000],
- [-0.40000000, -1.20000000, -0.80000000],
- [-0.33333333, -1.20000000, -0.80000000]],
- [[-0.20000000, -0.60000000, -0.40000000],
- [-0.26666667, -0.60000000, -0.40000000],
- [-0.26666667, -0.60000000, -0.53333333],
- [-0.20000000, -0.60000000, -0.53333333]],
- [[-0.20000000, -0.60000000, -0.53333333],
- [-0.26666667, -0.60000000, -0.53333333],
- [-0.26666667, -0.60000000, -0.66666667],
- [-0.20000000, -0.60000000, -0.66666667]],
- [[-0.20000000, -0.60000000, -0.66666667],
- [-0.26666667, -0.60000000, -0.66666667],
- [-0.26666667, -0.60000000, -0.80000000],
- [-0.20000000, -0.60000000, -0.80000000]],
- [[-0.26666667, -0.60000000, -0.40000000],
- [-0.33333333, -0.60000000, -0.40000000],
- [-0.33333333, -0.60000000, -0.53333333],
- [-0.26666667, -0.60000000, -0.53333333]],
- [[-0.26666667, -0.60000000, -0.53333333],
- [-0.33333333, -0.60000000, -0.53333333],
- [-0.33333333, -0.60000000, -0.66666667],
- [-0.26666667, -0.60000000, -0.66666667]],
- [[-0.26666667, -0.60000000, -0.66666667],
- [-0.33333333, -0.60000000, -0.66666667],
- [-0.33333333, -0.60000000, -0.80000000],
- [-0.26666667, -0.60000000, -0.80000000]],
- [[-0.33333333, -0.60000000, -0.40000000],
- [-0.40000000, -0.60000000, -0.40000000],
- [-0.40000000, -0.60000000, -0.53333333],
- [-0.33333333, -0.60000000, -0.53333333]],
- [[-0.33333333, -0.60000000, -0.53333333],
- [-0.40000000, -0.60000000, -0.53333333],
- [-0.40000000, -0.60000000, -0.66666667],
- [-0.33333333, -0.60000000, -0.66666667]],
- [[-0.33333333, -0.60000000, -0.66666667],
- [-0.40000000, -0.60000000, -0.66666667],
- [-0.40000000, -0.60000000, -0.80000000],
- [-0.33333333, -0.60000000, -0.80000000]],
- [[-0.20000000, -1.20000000, -0.40000000],
- [-0.26666667, -1.20000000, -0.40000000],
- [-0.26666667, -1.20000000, -0.53333333],
- [-0.20000000, -1.20000000, -0.53333333]],
- [[-0.20000000, -1.20000000, -0.53333333],
- [-0.26666667, -1.20000000, -0.53333333],
- [-0.26666667, -1.20000000, -0.66666667],
- [-0.20000000, -1.20000000, -0.66666667]],
- [[-0.20000000, -1.20000000, -0.66666667],
- [-0.26666667, -1.20000000, -0.66666667],
- [-0.26666667, -1.20000000, -0.80000000],
- [-0.20000000, -1.20000000, -0.80000000]],
- [[-0.26666667, -1.20000000, -0.40000000],
- [-0.33333333, -1.20000000, -0.40000000],
- [-0.33333333, -1.20000000, -0.53333333],
- [-0.26666667, -1.20000000, -0.53333333]],
- [[-0.26666667, -1.20000000, -0.53333333],
- [-0.33333333, -1.20000000, -0.53333333],
- [-0.33333333, -1.20000000, -0.66666667],
- [-0.26666667, -1.20000000, -0.66666667]],
- [[-0.26666667, -1.20000000, -0.66666667],
- [-0.33333333, -1.20000000, -0.66666667],
- [-0.33333333, -1.20000000, -0.80000000],
- [-0.26666667, -1.20000000, -0.80000000]],
- [[-0.33333333, -1.20000000, -0.40000000],
- [-0.40000000, -1.20000000, -0.40000000],
- [-0.40000000, -1.20000000, -0.53333333],
- [-0.33333333, -1.20000000, -0.53333333]],
- [[-0.33333333, -1.20000000, -0.53333333],
- [-0.40000000, -1.20000000, -0.53333333],
- [-0.40000000, -1.20000000, -0.66666667],
- [-0.33333333, -1.20000000, -0.66666667]],
- [[-0.33333333, -1.20000000, -0.66666667],
- [-0.40000000, -1.20000000, -0.66666667],
- [-0.40000000, -1.20000000, -0.80000000],
- [-0.33333333, -1.20000000, -0.80000000]],
- [[-0.20000000, -0.60000000, -0.40000000],
- [-0.20000000, -0.80000000, -0.40000000],
- [-0.20000000, -0.80000000, -0.53333333],
- [-0.20000000, -0.60000000, -0.53333333]],
- [[-0.20000000, -0.60000000, -0.53333333],
- [-0.20000000, -0.80000000, -0.53333333],
- [-0.20000000, -0.80000000, -0.66666667],
- [-0.20000000, -0.60000000, -0.66666667]],
- [[-0.20000000, -0.60000000, -0.66666667],
- [-0.20000000, -0.80000000, -0.66666667],
- [-0.20000000, -0.80000000, -0.80000000],
- [-0.20000000, -0.60000000, -0.80000000]],
- [[-0.20000000, -0.80000000, -0.40000000],
- [-0.20000000, -1.00000000, -0.40000000],
- [-0.20000000, -1.00000000, -0.53333333],
- [-0.20000000, -0.80000000, -0.53333333]],
- [[-0.20000000, -0.80000000, -0.53333333],
- [-0.20000000, -1.00000000, -0.53333333],
- [-0.20000000, -1.00000000, -0.66666667],
- [-0.20000000, -0.80000000, -0.66666667]],
- [[-0.20000000, -0.80000000, -0.66666667],
- [-0.20000000, -1.00000000, -0.66666667],
- [-0.20000000, -1.00000000, -0.80000000],
- [-0.20000000, -0.80000000, -0.80000000]],
- [[-0.20000000, -1.00000000, -0.40000000],
- [-0.20000000, -1.20000000, -0.40000000],
- [-0.20000000, -1.20000000, -0.53333333],
- [-0.20000000, -1.00000000, -0.53333333]],
- [[-0.20000000, -1.00000000, -0.53333333],
- [-0.20000000, -1.20000000, -0.53333333],
- [-0.20000000, -1.20000000, -0.66666667],
- [-0.20000000, -1.00000000, -0.66666667]],
- [[-0.20000000, -1.00000000, -0.66666667],
- [-0.20000000, -1.20000000, -0.66666667],
- [-0.20000000, -1.20000000, -0.80000000],
- [-0.20000000, -1.00000000, -0.80000000]],
- [[-0.40000000, -0.60000000, -0.40000000],
- [-0.40000000, -0.80000000, -0.40000000],
- [-0.40000000, -0.80000000, -0.53333333],
- [-0.40000000, -0.60000000, -0.53333333]],
- [[-0.40000000, -0.60000000, -0.53333333],
- [-0.40000000, -0.80000000, -0.53333333],
- [-0.40000000, -0.80000000, -0.66666667],
- [-0.40000000, -0.60000000, -0.66666667]],
- [[-0.40000000, -0.60000000, -0.66666667],
- [-0.40000000, -0.80000000, -0.66666667],
- [-0.40000000, -0.80000000, -0.80000000],
- [-0.40000000, -0.60000000, -0.80000000]],
- [[-0.40000000, -0.80000000, -0.40000000],
- [-0.40000000, -1.00000000, -0.40000000],
- [-0.40000000, -1.00000000, -0.53333333],
- [-0.40000000, -0.80000000, -0.53333333]],
- [[-0.40000000, -0.80000000, -0.53333333],
- [-0.40000000, -1.00000000, -0.53333333],
- [-0.40000000, -1.00000000, -0.66666667],
- [-0.40000000, -0.80000000, -0.66666667]],
- [[-0.40000000, -0.80000000, -0.66666667],
- [-0.40000000, -1.00000000, -0.66666667],
- [-0.40000000, -1.00000000, -0.80000000],
- [-0.40000000, -0.80000000, -0.80000000]],
- [[-0.40000000, -1.00000000, -0.40000000],
- [-0.40000000, -1.20000000, -0.40000000],
- [-0.40000000, -1.20000000, -0.53333333],
- [-0.40000000, -1.00000000, -0.53333333]],
- [[-0.40000000, -1.00000000, -0.53333333],
- [-0.40000000, -1.20000000, -0.53333333],
- [-0.40000000, -1.20000000, -0.66666667],
- [-0.40000000, -1.00000000, -0.66666667]],
- [[-0.40000000, -1.00000000, -0.66666667],
- [-0.40000000, -1.20000000, -0.66666667],
- [-0.40000000, -1.20000000, -0.80000000],
- [-0.40000000, -1.00000000, -0.80000000]]]),
- decimal=7)
+ np.array(
+ [[[-0.20000000, -0.60000000, -0.40000000],
+ [-0.26666667, -0.60000000, -0.40000000],
+ [-0.26666667, -0.80000000, -0.40000000],
+ [-0.20000000, -0.80000000, -0.40000000]],
+ [[-0.20000000, -0.80000000, -0.40000000],
+ [-0.26666667, -0.80000000, -0.40000000],
+ [-0.26666667, -1.00000000, -0.40000000],
+ [-0.20000000, -1.00000000, -0.40000000]],
+ [[-0.20000000, -1.00000000, -0.40000000],
+ [-0.26666667, -1.00000000, -0.40000000],
+ [-0.26666667, -1.20000000, -0.40000000],
+ [-0.20000000, -1.20000000, -0.40000000]],
+ [[-0.26666667, -0.60000000, -0.40000000],
+ [-0.33333333, -0.60000000, -0.40000000],
+ [-0.33333333, -0.80000000, -0.40000000],
+ [-0.26666667, -0.80000000, -0.40000000]],
+ [[-0.26666667, -0.80000000, -0.40000000],
+ [-0.33333333, -0.80000000, -0.40000000],
+ [-0.33333333, -1.00000000, -0.40000000],
+ [-0.26666667, -1.00000000, -0.40000000]],
+ [[-0.26666667, -1.00000000, -0.40000000],
+ [-0.33333333, -1.00000000, -0.40000000],
+ [-0.33333333, -1.20000000, -0.40000000],
+ [-0.26666667, -1.20000000, -0.40000000]],
+ [[-0.33333333, -0.60000000, -0.40000000],
+ [-0.40000000, -0.60000000, -0.40000000],
+ [-0.40000000, -0.80000000, -0.40000000],
+ [-0.33333333, -0.80000000, -0.40000000]],
+ [[-0.33333333, -0.80000000, -0.40000000],
+ [-0.40000000, -0.80000000, -0.40000000],
+ [-0.40000000, -1.00000000, -0.40000000],
+ [-0.33333333, -1.00000000, -0.40000000]],
+ [[-0.33333333, -1.00000000, -0.40000000],
+ [-0.40000000, -1.00000000, -0.40000000],
+ [-0.40000000, -1.20000000, -0.40000000],
+ [-0.33333333, -1.20000000, -0.40000000]],
+ [[-0.20000000, -0.60000000, -0.80000000],
+ [-0.26666667, -0.60000000, -0.80000000],
+ [-0.26666667, -0.80000000, -0.80000000],
+ [-0.20000000, -0.80000000, -0.80000000]],
+ [[-0.20000000, -0.80000000, -0.80000000],
+ [-0.26666667, -0.80000000, -0.80000000],
+ [-0.26666667, -1.00000000, -0.80000000],
+ [-0.20000000, -1.00000000, -0.80000000]],
+ [[-0.20000000, -1.00000000, -0.80000000],
+ [-0.26666667, -1.00000000, -0.80000000],
+ [-0.26666667, -1.20000000, -0.80000000],
+ [-0.20000000, -1.20000000, -0.80000000]],
+ [[-0.26666667, -0.60000000, -0.80000000],
+ [-0.33333333, -0.60000000, -0.80000000],
+ [-0.33333333, -0.80000000, -0.80000000],
+ [-0.26666667, -0.80000000, -0.80000000]],
+ [[-0.26666667, -0.80000000, -0.80000000],
+ [-0.33333333, -0.80000000, -0.80000000],
+ [-0.33333333, -1.00000000, -0.80000000],
+ [-0.26666667, -1.00000000, -0.80000000]],
+ [[-0.26666667, -1.00000000, -0.80000000],
+ [-0.33333333, -1.00000000, -0.80000000],
+ [-0.33333333, -1.20000000, -0.80000000],
+ [-0.26666667, -1.20000000, -0.80000000]],
+ [[-0.33333333, -0.60000000, -0.80000000],
+ [-0.40000000, -0.60000000, -0.80000000],
+ [-0.40000000, -0.80000000, -0.80000000],
+ [-0.33333333, -0.80000000, -0.80000000]],
+ [[-0.33333333, -0.80000000, -0.80000000],
+ [-0.40000000, -0.80000000, -0.80000000],
+ [-0.40000000, -1.00000000, -0.80000000],
+ [-0.33333333, -1.00000000, -0.80000000]],
+ [[-0.33333333, -1.00000000, -0.80000000],
+ [-0.40000000, -1.00000000, -0.80000000],
+ [-0.40000000, -1.20000000, -0.80000000],
+ [-0.33333333, -1.20000000, -0.80000000]],
+ [[-0.20000000, -0.60000000, -0.40000000],
+ [-0.26666667, -0.60000000, -0.40000000],
+ [-0.26666667, -0.60000000, -0.53333333],
+ [-0.20000000, -0.60000000, -0.53333333]],
+ [[-0.20000000, -0.60000000, -0.53333333],
+ [-0.26666667, -0.60000000, -0.53333333],
+ [-0.26666667, -0.60000000, -0.66666667],
+ [-0.20000000, -0.60000000, -0.66666667]],
+ [[-0.20000000, -0.60000000, -0.66666667],
+ [-0.26666667, -0.60000000, -0.66666667],
+ [-0.26666667, -0.60000000, -0.80000000],
+ [-0.20000000, -0.60000000, -0.80000000]],
+ [[-0.26666667, -0.60000000, -0.40000000],
+ [-0.33333333, -0.60000000, -0.40000000],
+ [-0.33333333, -0.60000000, -0.53333333],
+ [-0.26666667, -0.60000000, -0.53333333]],
+ [[-0.26666667, -0.60000000, -0.53333333],
+ [-0.33333333, -0.60000000, -0.53333333],
+ [-0.33333333, -0.60000000, -0.66666667],
+ [-0.26666667, -0.60000000, -0.66666667]],
+ [[-0.26666667, -0.60000000, -0.66666667],
+ [-0.33333333, -0.60000000, -0.66666667],
+ [-0.33333333, -0.60000000, -0.80000000],
+ [-0.26666667, -0.60000000, -0.80000000]],
+ [[-0.33333333, -0.60000000, -0.40000000],
+ [-0.40000000, -0.60000000, -0.40000000],
+ [-0.40000000, -0.60000000, -0.53333333],
+ [-0.33333333, -0.60000000, -0.53333333]],
+ [[-0.33333333, -0.60000000, -0.53333333],
+ [-0.40000000, -0.60000000, -0.53333333],
+ [-0.40000000, -0.60000000, -0.66666667],
+ [-0.33333333, -0.60000000, -0.66666667]],
+ [[-0.33333333, -0.60000000, -0.66666667],
+ [-0.40000000, -0.60000000, -0.66666667],
+ [-0.40000000, -0.60000000, -0.80000000],
+ [-0.33333333, -0.60000000, -0.80000000]],
+ [[-0.20000000, -1.20000000, -0.40000000],
+ [-0.26666667, -1.20000000, -0.40000000],
+ [-0.26666667, -1.20000000, -0.53333333],
+ [-0.20000000, -1.20000000, -0.53333333]],
+ [[-0.20000000, -1.20000000, -0.53333333],
+ [-0.26666667, -1.20000000, -0.53333333],
+ [-0.26666667, -1.20000000, -0.66666667],
+ [-0.20000000, -1.20000000, -0.66666667]],
+ [[-0.20000000, -1.20000000, -0.66666667],
+ [-0.26666667, -1.20000000, -0.66666667],
+ [-0.26666667, -1.20000000, -0.80000000],
+ [-0.20000000, -1.20000000, -0.80000000]],
+ [[-0.26666667, -1.20000000, -0.40000000],
+ [-0.33333333, -1.20000000, -0.40000000],
+ [-0.33333333, -1.20000000, -0.53333333],
+ [-0.26666667, -1.20000000, -0.53333333]],
+ [[-0.26666667, -1.20000000, -0.53333333],
+ [-0.33333333, -1.20000000, -0.53333333],
+ [-0.33333333, -1.20000000, -0.66666667],
+ [-0.26666667, -1.20000000, -0.66666667]],
+ [[-0.26666667, -1.20000000, -0.66666667],
+ [-0.33333333, -1.20000000, -0.66666667],
+ [-0.33333333, -1.20000000, -0.80000000],
+ [-0.26666667, -1.20000000, -0.80000000]],
+ [[-0.33333333, -1.20000000, -0.40000000],
+ [-0.40000000, -1.20000000, -0.40000000],
+ [-0.40000000, -1.20000000, -0.53333333],
+ [-0.33333333, -1.20000000, -0.53333333]],
+ [[-0.33333333, -1.20000000, -0.53333333],
+ [-0.40000000, -1.20000000, -0.53333333],
+ [-0.40000000, -1.20000000, -0.66666667],
+ [-0.33333333, -1.20000000, -0.66666667]],
+ [[-0.33333333, -1.20000000, -0.66666667],
+ [-0.40000000, -1.20000000, -0.66666667],
+ [-0.40000000, -1.20000000, -0.80000000],
+ [-0.33333333, -1.20000000, -0.80000000]],
+ [[-0.20000000, -0.60000000, -0.40000000],
+ [-0.20000000, -0.80000000, -0.40000000],
+ [-0.20000000, -0.80000000, -0.53333333],
+ [-0.20000000, -0.60000000, -0.53333333]],
+ [[-0.20000000, -0.60000000, -0.53333333],
+ [-0.20000000, -0.80000000, -0.53333333],
+ [-0.20000000, -0.80000000, -0.66666667],
+ [-0.20000000, -0.60000000, -0.66666667]],
+ [[-0.20000000, -0.60000000, -0.66666667],
+ [-0.20000000, -0.80000000, -0.66666667],
+ [-0.20000000, -0.80000000, -0.80000000],
+ [-0.20000000, -0.60000000, -0.80000000]],
+ [[-0.20000000, -0.80000000, -0.40000000],
+ [-0.20000000, -1.00000000, -0.40000000],
+ [-0.20000000, -1.00000000, -0.53333333],
+ [-0.20000000, -0.80000000, -0.53333333]],
+ [[-0.20000000, -0.80000000, -0.53333333],
+ [-0.20000000, -1.00000000, -0.53333333],
+ [-0.20000000, -1.00000000, -0.66666667],
+ [-0.20000000, -0.80000000, -0.66666667]],
+ [[-0.20000000, -0.80000000, -0.66666667],
+ [-0.20000000, -1.00000000, -0.66666667],
+ [-0.20000000, -1.00000000, -0.80000000],
+ [-0.20000000, -0.80000000, -0.80000000]],
+ [[-0.20000000, -1.00000000, -0.40000000],
+ [-0.20000000, -1.20000000, -0.40000000],
+ [-0.20000000, -1.20000000, -0.53333333],
+ [-0.20000000, -1.00000000, -0.53333333]],
+ [[-0.20000000, -1.00000000, -0.53333333],
+ [-0.20000000, -1.20000000, -0.53333333],
+ [-0.20000000, -1.20000000, -0.66666667],
+ [-0.20000000, -1.00000000, -0.66666667]],
+ [[-0.20000000, -1.00000000, -0.66666667],
+ [-0.20000000, -1.20000000, -0.66666667],
+ [-0.20000000, -1.20000000, -0.80000000],
+ [-0.20000000, -1.00000000, -0.80000000]],
+ [[-0.40000000, -0.60000000, -0.40000000],
+ [-0.40000000, -0.80000000, -0.40000000],
+ [-0.40000000, -0.80000000, -0.53333333],
+ [-0.40000000, -0.60000000, -0.53333333]],
+ [[-0.40000000, -0.60000000, -0.53333333],
+ [-0.40000000, -0.80000000, -0.53333333],
+ [-0.40000000, -0.80000000, -0.66666667],
+ [-0.40000000, -0.60000000, -0.66666667]],
+ [[-0.40000000, -0.60000000, -0.66666667],
+ [-0.40000000, -0.80000000, -0.66666667],
+ [-0.40000000, -0.80000000, -0.80000000],
+ [-0.40000000, -0.60000000, -0.80000000]],
+ [[-0.40000000, -0.80000000, -0.40000000],
+ [-0.40000000, -1.00000000, -0.40000000],
+ [-0.40000000, -1.00000000, -0.53333333],
+ [-0.40000000, -0.80000000, -0.53333333]],
+ [[-0.40000000, -0.80000000, -0.53333333],
+ [-0.40000000, -1.00000000, -0.53333333],
+ [-0.40000000, -1.00000000, -0.66666667],
+ [-0.40000000, -0.80000000, -0.66666667]],
+ [[-0.40000000, -0.80000000, -0.66666667],
+ [-0.40000000, -1.00000000, -0.66666667],
+ [-0.40000000, -1.00000000, -0.80000000],
+ [-0.40000000, -0.80000000, -0.80000000]],
+ [[-0.40000000, -1.00000000, -0.40000000],
+ [-0.40000000, -1.20000000, -0.40000000],
+ [-0.40000000, -1.20000000, -0.53333333],
+ [-0.40000000, -1.00000000, -0.53333333]],
+ [[-0.40000000, -1.00000000, -0.53333333],
+ [-0.40000000, -1.20000000, -0.53333333],
+ [-0.40000000, -1.20000000, -0.66666667],
+ [-0.40000000, -1.00000000, -0.66666667]],
+ [[-0.40000000, -1.00000000, -0.66666667],
+ [-0.40000000, -1.20000000, -0.66666667],
+ [-0.40000000, -1.20000000, -0.80000000],
+ [-0.40000000, -1.00000000, -0.80000000]]]),
+ decimal=7) # yapf: disable
if __name__ == '__main__':
diff --git a/colour/plotting/volume.py b/colour/plotting/volume.py
index 2554af7d45..d2570091dd 100644
--- a/colour/plotting/volume.py
+++ b/colour/plotting/volume.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Models Volume Plotting
=============================
@@ -19,18 +18,11 @@
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from colour.models import RGB_to_XYZ
-from colour.models.common import (
- COLOURSPACE_MODELS_LABELS,
- XYZ_to_colourspace_model)
-from colour.plotting import (
- DEFAULT_PLOTTING_ILLUMINANT,
- camera,
- cube,
- decorate,
- display,
- get_RGB_colourspace,
- get_cmfs,
- grid)
+from colour.models.common import (COLOURSPACE_MODELS_LABELS,
+ XYZ_to_colourspace_model)
+from colour.plotting import (DEFAULT_PLOTTING_ILLUMINANT, camera, cube,
+ decorate, display, get_RGB_colourspace, get_cmfs,
+ grid)
from colour.utilities import Structure, tsplit, tstack
__author__ = 'Colour Developers'
@@ -40,11 +32,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['common_colourspace_model_axis_reorder',
- 'nadir_grid',
- 'RGB_identity_cube',
- 'RGB_colourspaces_gamuts_plot',
- 'RGB_scatter_plot']
+__all__ = [
+ 'common_colourspace_model_axis_reorder', 'nadir_grid', 'RGB_identity_cube',
+ 'RGB_colourspaces_gamuts_plot', 'RGB_scatter_plot'
+]
def common_colourspace_model_axis_reorder(a, model=None):
@@ -204,68 +195,62 @@ def nadir_grid(limits=None, segments=10, labels=None, axes=None, **kwargs):
extent = np.max(np.abs(limits[..., 1] - limits[..., 0]))
- settings = Structure(
- **{'grid_face_colours': (0.25, 0.25, 0.25),
- 'grid_edge_colours': (0.50, 0.50, 0.50),
- 'grid_face_alpha': 0.1,
- 'grid_edge_alpha': 0.5,
- 'x_axis_colour': (0.0, 0.0, 0.0, 1.0),
- 'y_axis_colour': (0.0, 0.0, 0.0, 1.0),
- 'x_ticks_colour': (0.0, 0.0, 0.0, 0.85),
- 'y_ticks_colour': (0.0, 0.0, 0.0, 0.85),
- 'x_label_colour': (0.0, 0.0, 0.0, 0.85),
- 'y_label_colour': (0.0, 0.0, 0.0, 0.85),
- 'ticks_and_label_location': ('-x', '-y')})
+ settings = Structure(**{
+ 'grid_face_colours': (0.25, 0.25, 0.25),
+ 'grid_edge_colours': (0.50, 0.50, 0.50),
+ 'grid_face_alpha': 0.1,
+ 'grid_edge_alpha': 0.5,
+ 'x_axis_colour': (0.0, 0.0, 0.0, 1.0),
+ 'y_axis_colour': (0.0, 0.0, 0.0, 1.0),
+ 'x_ticks_colour': (0.0, 0.0, 0.0, 0.85),
+ 'y_ticks_colour': (0.0, 0.0, 0.0, 0.85),
+ 'x_label_colour': (0.0, 0.0, 0.0, 0.85),
+ 'y_label_colour': (0.0, 0.0, 0.0, 0.85),
+ 'ticks_and_label_location': ('-x', '-y')
+ })
settings.update(**kwargs)
# Outer grid.
- quads_g = grid(origin=(-extent / 2, -extent / 2),
- width=extent,
- height=extent,
- height_segments=segments,
- width_segments=segments)
+ quads_g = grid(
+ origin=(-extent / 2, -extent / 2),
+ width=extent,
+ height=extent,
+ height_segments=segments,
+ width_segments=segments)
RGB_g = np.ones((quads_g.shape[0], quads_g.shape[-1]))
RGB_gf = RGB_g * settings.grid_face_colours
- RGB_gf = np.hstack((RGB_gf,
- np.full((RGB_gf.shape[0], 1),
- settings.grid_face_alpha,
- np.float_)))
+ RGB_gf = np.hstack((RGB_gf, np.full((RGB_gf.shape[0], 1),
+ settings.grid_face_alpha, np.float_)))
RGB_ge = RGB_g * settings.grid_edge_colours
- RGB_ge = np.hstack((RGB_ge,
- np.full((RGB_ge.shape[0], 1),
- settings.grid_edge_alpha,
- np.float_)))
+ RGB_ge = np.hstack((RGB_ge, np.full((RGB_ge.shape[0], 1),
+ settings.grid_edge_alpha, np.float_)))
# Inner grid.
- quads_gs = grid(origin=(-extent / 2, -extent / 2),
- width=extent,
- height=extent,
- height_segments=segments * 2,
- width_segments=segments * 2)
+ quads_gs = grid(
+ origin=(-extent / 2, -extent / 2),
+ width=extent,
+ height=extent,
+ height_segments=segments * 2,
+ width_segments=segments * 2)
RGB_gs = np.ones((quads_gs.shape[0], quads_gs.shape[-1]))
RGB_gsf = RGB_gs * 0
- RGB_gsf = np.hstack((RGB_gsf,
- np.full((RGB_gsf.shape[0], 1), 0, np.float_)))
- RGB_gse = np.clip(RGB_gs *
- settings.grid_edge_colours * 1.5, 0, 1)
- RGB_gse = np.hstack((RGB_gse,
- np.full((RGB_gse.shape[0], 1),
- settings.grid_edge_alpha / 2,
- np.float_)))
+ RGB_gsf = np.hstack((RGB_gsf, np.full((RGB_gsf.shape[0], 1), 0,
+ np.float_)))
+ RGB_gse = np.clip(RGB_gs * settings.grid_edge_colours * 1.5, 0, 1)
+ RGB_gse = np.hstack((RGB_gse, np.full(
+ (RGB_gse.shape[0], 1), settings.grid_edge_alpha / 2, np.float_)))
# Axis.
thickness = extent / 1000
- quad_x = grid(origin=(limits[0, 0], -thickness / 2),
- width=extent,
- height=thickness)
+ quad_x = grid(
+ origin=(limits[0, 0], -thickness / 2), width=extent, height=thickness)
RGB_x = np.ones((quad_x.shape[0], quad_x.shape[-1] + 1))
RGB_x = RGB_x * settings.x_axis_colour
- quad_y = grid(origin=(-thickness / 2, limits[1, 0]),
- width=thickness,
- height=extent)
+ quad_y = grid(
+ origin=(-thickness / 2, limits[1, 0]), width=thickness, height=extent)
RGB_y = np.ones((quad_y.shape[0], quad_y.shape[-1] + 1))
RGB_y = RGB_y * settings.y_axis_colour
@@ -288,11 +273,16 @@ def nadir_grid(limits=None, segments=10, labels=None, axes=None, **kwargs):
tick = int(tick) if np.float_(tick).is_integer() else tick
c = settings['{0}_ticks_colour'.format(axis)]
- axes.text(x, y, 0, tick, 'x',
- horizontalalignment=h_a,
- verticalalignment=v_a,
- color=c,
- clip_on=True)
+ axes.text(
+ x,
+ y,
+ 0,
+ tick,
+ 'x',
+ horizontalalignment=h_a,
+ verticalalignment=v_a,
+ color=c,
+ clip_on=True)
# Labels.
for i, axis in enumerate('xy'):
@@ -306,12 +296,17 @@ def nadir_grid(limits=None, segments=10, labels=None, axes=None, **kwargs):
c = settings['{0}_label_colour'.format(axis)]
- axes.text(x, y, 0, labels[i], 'x',
- horizontalalignment=h_a,
- verticalalignment=v_a,
- color=c,
- size=20,
- clip_on=True)
+ axes.text(
+ x,
+ y,
+ 0,
+ labels[i],
+ 'x',
+ horizontalalignment=h_a,
+ verticalalignment=v_a,
+ color=c,
+ size=20,
+ clip_on=True)
quads = np.vstack((quads_g, quads_gs, quad_x, quad_y))
RGB_f = np.vstack((RGB_gf, RGB_gsf, RGB_x, RGB_y))
@@ -387,13 +382,14 @@ def RGB_identity_cube(plane=None,
[ 1. , 0.5, 0.5]])
"""
- quads = cube(plane=plane,
- width=1,
- height=1,
- depth=1,
- width_segments=width_segments,
- height_segments=height_segments,
- depth_segments=depth_segments)
+ quads = cube(
+ plane=plane,
+ width=1,
+ height=1,
+ depth=1,
+ width_segments=width_segments,
+ height_segments=height_segments,
+ depth_segments=depth_segments)
RGB = np.average(quads, axis=-2)
return quads, RGB
@@ -461,13 +457,15 @@ def RGB_colourspaces_gamuts_plot(colourspaces=None,
colourspaces = ('Rec. 709', 'ACEScg')
count_c = len(colourspaces)
- settings = Structure(
- **{'face_colours': [None] * count_c,
- 'edge_colours': [None] * count_c,
- 'face_alpha': [1] * count_c,
- 'edge_alpha': [1] * count_c,
- 'title': '{0} - {1} Reference Colourspace'.format(
- ', '.join(colourspaces), reference_colourspace)})
+ settings = Structure(**{
+ 'face_colours': [None] * count_c,
+ 'edge_colours': [None] * count_c,
+ 'face_alpha': [1] * count_c,
+ 'edge_alpha': [1] * count_c,
+ 'title':
+ '{0} - {1} Reference Colourspace'.format(', '.join(colourspaces),
+ reference_colourspace)
+ })
settings.update(kwargs)
figure = matplotlib.pyplot.figure()
@@ -481,62 +479,58 @@ def RGB_colourspaces_gamuts_plot(colourspaces=None,
XYZ = cmfs.values
points = common_colourspace_model_axis_reorder(
- XYZ_to_colourspace_model(
- XYZ, illuminant, reference_colourspace),
+ XYZ_to_colourspace_model(XYZ, illuminant, reference_colourspace),
reference_colourspace)
points[np.isnan(points)] = 0
c = ((0.0, 0.0, 0.0, 0.5)
- if spectral_locus_colour is None else
- spectral_locus_colour)
-
- pylab.plot(points[..., 0],
- points[..., 1],
- points[..., 2],
- color=c,
- linewidth=2,
- zorder=1)
- pylab.plot((points[-1][0], points[0][0]),
- (points[-1][1], points[0][1]),
- (points[-1][2], points[0][2]),
- color=c,
- linewidth=2,
- zorder=1)
+ if spectral_locus_colour is None else spectral_locus_colour)
+
+ pylab.plot(
+ points[..., 0],
+ points[..., 1],
+ points[..., 2],
+ color=c,
+ linewidth=2,
+ zorder=1)
+ pylab.plot(
+ (points[-1][0], points[0][0]), (points[-1][1], points[0][1]),
+ (points[-1][2], points[0][2]),
+ color=c,
+ linewidth=2,
+ zorder=1)
quads, RGB_f, RGB_e = [], [], []
for i, colourspace in enumerate(colourspaces):
colourspace = get_RGB_colourspace(colourspace)
- quads_c, RGB = RGB_identity_cube(width_segments=segments,
- height_segments=segments,
- depth_segments=segments)
+ quads_c, RGB = RGB_identity_cube(
+ width_segments=segments,
+ height_segments=segments,
+ depth_segments=segments)
- XYZ = RGB_to_XYZ(
- quads_c,
- colourspace.whitepoint,
- colourspace.whitepoint,
- colourspace.RGB_to_XYZ_matrix)
+ XYZ = RGB_to_XYZ(quads_c, colourspace.whitepoint,
+ colourspace.whitepoint, colourspace.RGB_to_XYZ_matrix)
- quads.extend(common_colourspace_model_axis_reorder(
- XYZ_to_colourspace_model(
- XYZ, colourspace.whitepoint, reference_colourspace),
- reference_colourspace))
+ quads.extend(
+ common_colourspace_model_axis_reorder(
+ XYZ_to_colourspace_model(XYZ, colourspace.whitepoint,
+ reference_colourspace),
+ reference_colourspace))
if settings.face_colours[i] is not None:
RGB = np.ones(RGB.shape) * settings.face_colours[i]
- RGB_f.extend(np.hstack(
- (RGB, np.full((RGB.shape[0], 1),
- settings.face_alpha[i],
- np.float_))))
+ RGB_f.extend(
+ np.hstack((RGB, np.full((RGB.shape[0], 1), settings.face_alpha[i],
+ np.float_))))
if settings.edge_colours[i] is not None:
RGB = np.ones(RGB.shape) * settings.edge_colours[i]
- RGB_e.extend(np.hstack(
- (RGB, np.full((RGB.shape[0], 1),
- settings.edge_alpha[i],
- np.float_))))
+ RGB_e.extend(
+ np.hstack((RGB, np.full((RGB.shape[0], 1), settings.edge_alpha[i],
+ np.float_))))
quads = np.asarray(quads)
quads[np.isnan(quads)] = 0
@@ -563,8 +557,8 @@ def RGB_colourspaces_gamuts_plot(colourspaces=None,
else:
limits = np.array([[-1.5, 1.5], [-1.5, 1.5]])
- quads_g, RGB_gf, RGB_ge = nadir_grid(
- limits, grid_segments, labels, axes, **settings)
+ quads_g, RGB_gf, RGB_ge = nadir_grid(limits, grid_segments, labels,
+ axes, **settings)
quads = np.vstack((quads_g, quads))
RGB_f = np.vstack((RGB_gf, RGB_f))
RGB_e = np.vstack((RGB_ge, RGB_e))
@@ -575,9 +569,7 @@ def RGB_colourspaces_gamuts_plot(colourspaces=None,
axes.add_collection3d(collection)
- settings.update({
- 'camera_aspect': 'equal',
- 'no_axes': True})
+ settings.update({'camera_aspect': 'equal', 'no_axes': True})
settings.update(kwargs)
camera(**settings)
@@ -648,15 +640,16 @@ def RGB_scatter_plot(RGB,
colourspace = get_RGB_colourspace(colourspace)
if colourspaces is None:
- colourspaces = (colourspace.name,)
+ colourspaces = (colourspace.name, )
count_c = len(colourspaces)
- settings = Structure(
- **{'face_colours': [None] * count_c,
- 'edge_colours': [(0.25, 0.25, 0.25)] * count_c,
- 'face_alpha': [0.0] * count_c,
- 'edge_alpha': [0.1] * count_c,
- 'standalone': False})
+ settings = Structure(**{
+ 'face_colours': [None] * count_c,
+ 'edge_colours': [(0.25, 0.25, 0.25)] * count_c,
+ 'face_alpha': [0.0] * count_c,
+ 'edge_alpha': [0.1] * count_c,
+ 'standalone': False
+ })
settings.update(kwargs)
RGB_colourspaces_gamuts_plot(
@@ -670,23 +663,20 @@ def RGB_scatter_plot(RGB,
cmfs=cmfs,
**settings)
- XYZ = RGB_to_XYZ(
- RGB,
- colourspace.whitepoint,
- colourspace.whitepoint,
- colourspace.RGB_to_XYZ_matrix)
+ XYZ = RGB_to_XYZ(RGB, colourspace.whitepoint, colourspace.whitepoint,
+ colourspace.RGB_to_XYZ_matrix)
points = common_colourspace_model_axis_reorder(
- XYZ_to_colourspace_model(
- XYZ, colourspace.whitepoint, reference_colourspace),
- reference_colourspace)
+ XYZ_to_colourspace_model(XYZ, colourspace.whitepoint,
+ reference_colourspace), reference_colourspace)
axes = matplotlib.pyplot.gca()
- axes.scatter(points[..., 0],
- points[..., 1],
- points[..., 2],
- color=np.reshape(RGB, (-1, 3)),
- s=points_size)
+ axes.scatter(
+ points[..., 0],
+ points[..., 1],
+ points[..., 2],
+ color=np.reshape(RGB, (-1, 3)),
+ s=points_size)
settings.update({'standalone': True})
settings.update(kwargs)
diff --git a/colour/quality/cqs.py b/colour/quality/cqs.py
index da52a3ebc3..2e7a564541 100644
--- a/colour/quality/cqs.py
+++ b/colour/quality/cqs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Quality Scale
====================
@@ -32,20 +31,11 @@
from colour.algebra import euclidean_distance
from colour.colorimetry import (
- ASTME30815_PRACTISE_SHAPE,
- D_illuminant_relative_spd,
- ILLUMINANTS,
- STANDARD_OBSERVERS_CMFS,
- blackbody_spd,
- spectral_to_XYZ)
+ ASTME30815_PRACTISE_SHAPE, D_illuminant_relative_spd, ILLUMINANTS,
+ STANDARD_OBSERVERS_CMFS, blackbody_spd, spectral_to_XYZ)
from colour.quality.dataset.vs import VS_INDEXES_TO_NAMES, VS_SPDS
-from colour.models import (
- Lab_to_LCHab,
- UCS_to_uv,
- XYZ_to_Lab,
- XYZ_to_UCS,
- XYZ_to_xy,
- xy_to_XYZ)
+from colour.models import (Lab_to_LCHab, UCS_to_uv, XYZ_to_Lab, XYZ_to_UCS,
+ XYZ_to_xy, xy_to_XYZ)
from colour.temperature import CCT_to_xy_CIE_D, uv_to_CCT_Ohno2013
from colour.adaptation import chromatic_adaptation_VonKries
from colour.utilities import tsplit
@@ -57,32 +47,26 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['D65_GAMUT_AREA',
- 'VS_ColorimetryData',
- 'VS_ColourQualityScaleData',
- 'CQS_Specification',
- 'colour_quality_scale',
- 'gamut_area',
- 'vs_colorimetry_data',
- 'CCT_factor',
- 'scale_conversion',
- 'delta_E_RMS',
- 'colour_quality_scales']
+__all__ = [
+ 'D65_GAMUT_AREA', 'VS_ColorimetryData', 'VS_ColourQualityScaleData',
+ 'CQS_Specification', 'colour_quality_scale', 'gamut_area',
+ 'vs_colorimetry_data', 'CCT_factor', 'scale_conversion', 'delta_E_RMS',
+ 'colour_quality_scales'
+]
D65_GAMUT_AREA = 8210
class VS_ColorimetryData(
- namedtuple('VS_ColorimetryData',
- ('name', 'XYZ', 'Lab', 'C'))):
+ namedtuple('VS_ColorimetryData', ('name', 'XYZ', 'Lab', 'C'))):
"""
Defines the the class storing *VS test colour samples* colorimetry data.
"""
class VS_ColourQualityScaleData(
- namedtuple('VS_ColourQualityScaleData',
- ('name', 'Q_a', 'D_C_ab', 'D_E_ab', 'D_Ep_ab'))):
+ namedtuple('VS_ColourQualityScaleData', ('name', 'Q_a', 'D_C_ab',
+ 'D_E_ab', 'D_Ep_ab'))):
"""
Defines the the class storing *VS test colour samples* colour quality
scale data.
@@ -90,16 +74,8 @@ class VS_ColourQualityScaleData(
class CQS_Specification(
- namedtuple(
- 'CQS_Specification',
- ('name',
- 'Q_a',
- 'Q_f',
- 'Q_p',
- 'Q_g',
- 'Q_d',
- 'Q_as',
- 'colorimetry_data'))):
+ namedtuple('CQS_Specification', ('name', 'Q_a', 'Q_f', 'Q_p', 'Q_g',
+ 'Q_d', 'Q_as', 'colorimetry_data'))):
"""
Defines the *Colour Quality Scale* (CQS) colour quality specification.
@@ -159,7 +135,7 @@ def colour_quality_scale(spd_test, additional_data=False):
cmfs = STANDARD_OBSERVERS_CMFS[
'CIE 1931 2 Degree Standard Observer'].clone().trim_wavelengths(
- ASTME30815_PRACTISE_SHAPE)
+ ASTME30815_PRACTISE_SHAPE)
shape = cmfs.shape
spd_test = spd_test.clone().align(shape)
@@ -177,24 +153,17 @@ def colour_quality_scale(spd_test, additional_data=False):
spd_reference.align(shape)
test_vs_colorimetry_data = vs_colorimetry_data(
- spd_test,
- spd_reference,
- vs_spds,
- cmfs,
- chromatic_adaptation=True)
+ spd_test, spd_reference, vs_spds, cmfs, chromatic_adaptation=True)
reference_vs_colorimetry_data = vs_colorimetry_data(
- spd_reference,
- spd_reference,
- vs_spds,
- cmfs)
+ spd_reference, spd_reference, vs_spds, cmfs)
XYZ_r = spectral_to_XYZ(spd_reference, cmfs)
XYZ_r /= XYZ_r[1]
CCT_f = CCT_factor(reference_vs_colorimetry_data, XYZ_r)
- Q_as = colour_quality_scales(
- test_vs_colorimetry_data, reference_vs_colorimetry_data, CCT_f)
+ Q_as = colour_quality_scales(test_vs_colorimetry_data,
+ reference_vs_colorimetry_data, CCT_f)
D_E_RMS = delta_E_RMS(Q_as, 'D_E_ab')
D_Ep_RMS = delta_E_RMS(Q_as, 'D_Ep_ab')
@@ -204,26 +173,19 @@ def colour_quality_scale(spd_test, additional_data=False):
p_delta_C = np.average(
[sample_data.D_C_ab if sample_data.D_C_ab > 0 else 0
- for sample_data in
- Q_as.values()])
+ for sample_data in Q_as.values()]) # yapf: disable
Q_p = 100 - 3.6 * (D_Ep_RMS - p_delta_C)
- G_t = gamut_area([vs_CQS_data.Lab
- for vs_CQS_data in test_vs_colorimetry_data])
- G_r = gamut_area([vs_CQS_data.Lab
- for vs_CQS_data in reference_vs_colorimetry_data])
+ G_t = gamut_area(
+ [vs_CQS_data.Lab for vs_CQS_data in test_vs_colorimetry_data])
+ G_r = gamut_area(
+ [vs_CQS_data.Lab for vs_CQS_data in reference_vs_colorimetry_data])
Q_g = G_t / D65_GAMUT_AREA * 100
Q_d = G_t / G_r * CCT_f * 100
if additional_data:
- return CQS_Specification(spd_test.name,
- Q_a,
- Q_f,
- Q_p,
- Q_g,
- Q_d,
- Q_as,
+ return CQS_Specification(spd_test.name, Q_a, Q_f, Q_p, Q_g, Q_d, Q_as,
(test_vs_colorimetry_data,
reference_vs_colorimetry_data))
else:
@@ -322,19 +284,13 @@ def vs_colorimetry_data(spd_test,
XYZ_vs /= 100
if chromatic_adaptation:
- XYZ_vs = chromatic_adaptation_VonKries(XYZ_vs,
- XYZ_t,
- XYZ_r,
- transform='CMCCAT2000')
+ XYZ_vs = chromatic_adaptation_VonKries(
+ XYZ_vs, XYZ_t, XYZ_r, transform='CMCCAT2000')
Lab_vs = XYZ_to_Lab(XYZ_vs, illuminant=xy_r)
_L_vs, C_vs, _Hab = Lab_to_LCHab(Lab_vs)
- vs_data.append(
- VS_ColorimetryData(spd_vs.name,
- XYZ_vs,
- Lab_vs,
- C_vs))
+ vs_data.append(VS_ColorimetryData(spd_vs.name, XYZ_vs, Lab_vs, C_vs))
return vs_data
@@ -362,10 +318,8 @@ def CCT_factor(reference_data, XYZ_r):
Labs = []
for vs_colorimetry_data_ in reference_data:
_name, XYZ, _Lab, _C = vs_colorimetry_data_
- XYZ_a = chromatic_adaptation_VonKries(XYZ,
- XYZ_r,
- XYZ_w,
- transform='CMCCAT2000')
+ XYZ_a = chromatic_adaptation_VonKries(
+ XYZ, XYZ_r, XYZ_w, transform='CMCCAT2000')
Lab = XYZ_to_Lab(XYZ_a, illuminant=xy_w)
Labs.append(Lab)
@@ -420,10 +374,9 @@ def delta_E_RMS(cqs_data, attribute):
Root-mean-square average.
"""
- return np.sqrt(1 / len(cqs_data) *
- np.sum([getattr(sample_data, attribute) ** 2
- for sample_data in
- cqs_data.values()]))
+ return np.sqrt(1 / len(cqs_data) * np.sum(
+ [getattr(sample_data, attribute) ** 2
+ for sample_data in cqs_data.values()])) # yapf: disable
def colour_quality_scales(test_data, reference_data, CCT_f):
@@ -458,6 +411,6 @@ def colour_quality_scales(test_data, reference_data, CCT_f):
Q_a = scale_conversion(D_Ep_ab, CCT_f)
- Q_as[i + 1] = VS_ColourQualityScaleData(
- test_data[i].name, Q_a, D_C_ab, D_E_ab, D_Ep_ab)
+ Q_as[i + 1] = VS_ColourQualityScaleData(test_data[i].name, Q_a, D_C_ab,
+ D_E_ab, D_Ep_ab)
return Q_as
diff --git a/colour/quality/cri.py b/colour/quality/cri.py
index 70c48dbd0e..ee0bd8774c 100644
--- a/colour/quality/cri.py
+++ b/colour/quality/cri.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Colour Rendering Index
======================
@@ -29,11 +28,8 @@
from colour.algebra import euclidean_distance
from colour.colorimetry import (
- ASTME30815_PRACTISE_SHAPE,
- D_illuminant_relative_spd,
- STANDARD_OBSERVERS_CMFS,
- blackbody_spd,
- spectral_to_XYZ)
+ ASTME30815_PRACTISE_SHAPE, D_illuminant_relative_spd,
+ STANDARD_OBSERVERS_CMFS, blackbody_spd, spectral_to_XYZ)
from colour.quality.dataset.tcs import TCS_INDEXES_TO_NAMES, TCS_SPDS
from colour.models import UCS_to_uv, XYZ_to_UCS, XYZ_to_xyY
from colour.temperature import CCT_to_xy_CIE_D, uv_to_CCT_Robertson1968
@@ -45,25 +41,22 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TCS_ColorimetryData',
- 'TCS_ColourQualityScaleData',
- 'CRI_Specification',
- 'colour_rendering_index',
- 'tcs_colorimetry_data',
- 'colour_rendering_indexes']
+__all__ = [
+ 'TCS_ColorimetryData', 'TCS_ColourQualityScaleData', 'CRI_Specification',
+ 'colour_rendering_index', 'tcs_colorimetry_data',
+ 'colour_rendering_indexes'
+]
class TCS_ColorimetryData(
- namedtuple('TCS_ColorimetryData',
- ('name', 'XYZ', 'uv', 'UVW'))):
+ namedtuple('TCS_ColorimetryData', ('name', 'XYZ', 'uv', 'UVW'))):
"""
Defines the the class storing *test colour samples* colorimetry data.
"""
class TCS_ColourQualityScaleData(
- namedtuple('TCS_ColourQualityScaleData',
- ('name', 'Q_a'))):
+ namedtuple('TCS_ColourQualityScaleData', ('name', 'Q_a'))):
"""
Defines the the class storing *test colour samples* colour rendering
index data.
@@ -71,9 +64,8 @@ class TCS_ColourQualityScaleData(
class CRI_Specification(
- namedtuple(
- 'CRI_Specification',
- ('name', 'Q_a', 'Q_as', 'colorimetry_data'))):
+ namedtuple('CRI_Specification', ('name', 'Q_a', 'Q_as',
+ 'colorimetry_data'))):
"""
Defines the *Colour Rendering Index* (CRI) colour quality specification.
@@ -117,12 +109,14 @@ def colour_rendering_index(spd_test, additional_data=False):
cmfs = STANDARD_OBSERVERS_CMFS[
'CIE 1931 2 Degree Standard Observer'].clone().trim_wavelengths(
- ASTME30815_PRACTISE_SHAPE)
+ ASTME30815_PRACTISE_SHAPE)
shape = cmfs.shape
spd_test = spd_test.clone().align(shape)
- tcs_spds = {spd.name: spd.clone().align(shape)
- for spd in TCS_SPDS.values()}
+ tcs_spds = {
+ spd.name: spd.clone().align(shape)
+ for spd in TCS_SPDS.values()
+ }
XYZ = spectral_to_XYZ(spd_test, cmfs)
uv = UCS_to_uv(XYZ_to_UCS(XYZ))
@@ -136,28 +130,19 @@ def colour_rendering_index(spd_test, additional_data=False):
spd_reference.align(shape)
test_tcs_colorimetry_data = tcs_colorimetry_data(
- spd_test,
- spd_reference,
- tcs_spds,
- cmfs,
- chromatic_adaptation=True)
+ spd_test, spd_reference, tcs_spds, cmfs, chromatic_adaptation=True)
reference_tcs_colorimetry_data = tcs_colorimetry_data(
- spd_reference,
- spd_reference,
- tcs_spds,
- cmfs)
+ spd_reference, spd_reference, tcs_spds, cmfs)
- Q_as = colour_rendering_indexes(
- test_tcs_colorimetry_data, reference_tcs_colorimetry_data)
+ Q_as = colour_rendering_indexes(test_tcs_colorimetry_data,
+ reference_tcs_colorimetry_data)
- Q_a = np.average([v.Q_a for k, v in Q_as.items()
- if k in (1, 2, 3, 4, 5, 6, 7, 8)])
+ Q_a = np.average(
+ [v.Q_a for k, v in Q_as.items() if k in (1, 2, 3, 4, 5, 6, 7, 8)])
if additional_data:
- return CRI_Specification(spd_test.name,
- Q_a,
- Q_as,
+ return CRI_Specification(spd_test.name, Q_a, Q_as,
(test_tcs_colorimetry_data,
reference_tcs_colorimetry_data))
else:
@@ -226,21 +211,18 @@ def d(x, y):
c_t, d_t = c(u_t, v_t), d(u_t, v_t)
c_r, d_r = c(u_r, v_r), d(u_r, v_r)
tcs_c, tcs_d = c(u_tcs, v_tcs), d(u_tcs, v_tcs)
- u_tcs = ((10.872 + 0.404 * c_r / c_t * tcs_c - 4 *
- d_r / d_t * tcs_d) /
- (16.518 + 1.481 * c_r / c_t * tcs_c -
- d_r / d_t * tcs_d))
- v_tcs = (5.52 / (16.518 + 1.481 * c_r / c_t * tcs_c -
- d_r / d_t * tcs_d))
+ u_tcs = ((
+ 10.872 + 0.404 * c_r / c_t * tcs_c - 4 * d_r / d_t * tcs_d) /
+ (16.518 + 1.481 * c_r / c_t * tcs_c - d_r / d_t * tcs_d))
+ v_tcs = (5.52 /
+ (16.518 + 1.481 * c_r / c_t * tcs_c - d_r / d_t * tcs_d))
W_tcs = 25 * xyY_tcs[-1] ** (1 / 3) - 17
U_tcs = 13 * W_tcs * (u_tcs - u_r)
V_tcs = 13 * W_tcs * (v_tcs - v_r)
tcs_data.append(
- TCS_ColorimetryData(spd_tcs.name,
- XYZ_tcs,
- uv_tcs,
+ TCS_ColorimetryData(spd_tcs.name, XYZ_tcs, uv_tcs,
np.array([U_tcs, V_tcs, W_tcs])))
return tcs_data
@@ -266,7 +248,6 @@ def colour_rendering_indexes(test_data, reference_data):
Q_as = {}
for i, _ in enumerate(test_data):
Q_as[i + 1] = TCS_ColourQualityScaleData(
- test_data[i].name,
- 100 - 4.6 * euclidean_distance(reference_data[i].UVW,
- test_data[i].UVW))
+ test_data[i].name, 100 -
+ 4.6 * euclidean_distance(reference_data[i].UVW, test_data[i].UVW))
return Q_as
diff --git a/colour/quality/dataset/tcs.py b/colour/quality/dataset/tcs.py
index 5683a1425b..942aaa3469 100644
--- a/colour/quality/dataset/tcs.py
+++ b/colour/quality/dataset/tcs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Test Colour Samples Spectral Power Distributions
================================================
@@ -37,9 +36,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TCS_APPROXIMATE_MUNSELL_NOTATIONS',
- 'TCS_SPDS_DATA',
- 'TCS_SPDS']
+__all__ = ['TCS_APPROXIMATE_MUNSELL_NOTATIONS', 'TCS_SPDS_DATA', 'TCS_SPDS']
TCS_INDEXES_TO_NAMES = {
1: 'TCS01',
@@ -55,28 +52,30 @@
11: 'TCS11',
12: 'TCS12',
13: 'TCS13',
- 14: 'TCS14'}
+ 14: 'TCS14'
+}
"""
Test colour samples indexes to names mapping.
TCS_INDEXES_TO_NAMES : dict
"""
-TCS_APPROXIMATE_MUNSELL_NOTATIONS = CaseInsensitiveMapping(
- {'TCS01': '7.5 R 6/4',
- 'TCS02': '5 Y 6/4',
- 'TCS03': '5 GY 6/8',
- 'TCS04': '2.5 G 6/6',
- 'TCS05': '10 BG 6/4',
- 'TCS06': '5 PB 6/8',
- 'TCS07': '2.5 P 6/8',
- 'TCS08': '10 P 6/8',
- 'TCS09': '4.5 R 4/13',
- 'TCS10': '5 Y 8/10',
- 'TCS11': '4.5 G 5/8',
- 'TCS12': '3 PB 3/11',
- 'TCS13': '5 YR 8/4',
- 'TCS14': '5 GY 4/4'})
+TCS_APPROXIMATE_MUNSELL_NOTATIONS = CaseInsensitiveMapping({
+ 'TCS01': '7.5 R 6/4',
+ 'TCS02': '5 Y 6/4',
+ 'TCS03': '5 GY 6/8',
+ 'TCS04': '2.5 G 6/6',
+ 'TCS05': '10 BG 6/4',
+ 'TCS06': '5 PB 6/8',
+ 'TCS07': '2.5 P 6/8',
+ 'TCS08': '10 P 6/8',
+ 'TCS09': '4.5 R 4/13',
+ 'TCS10': '5 Y 8/10',
+ 'TCS11': '4.5 G 5/8',
+ 'TCS12': '3 PB 3/11',
+ 'TCS13': '5 YR 8/4',
+ 'TCS14': '5 GY 4/4'
+})
"""
Test colour samples *Munsell* colour approximations.
@@ -179,7 +178,8 @@
815: 0.466,
820: 0.465,
825: 0.464,
- 830: 0.464},
+ 830: 0.464
+ },
'TCS02': {
360: 0.053,
365: 0.055,
@@ -275,7 +275,8 @@
815: 0.311,
820: 0.311,
825: 0.311,
- 830: 0.310},
+ 830: 0.310
+ },
'TCS03': {
360: 0.058,
365: 0.059,
@@ -371,7 +372,8 @@
815: 0.544,
820: 0.548,
825: 0.552,
- 830: 0.555},
+ 830: 0.555
+ },
'TCS04': {
360: 0.057,
365: 0.059,
@@ -467,7 +469,8 @@
815: 0.243,
820: 0.254,
825: 0.264,
- 830: 0.274},
+ 830: 0.274
+ },
'TCS05': {
360: 0.143,
365: 0.187,
@@ -563,7 +566,8 @@
815: 0.257,
820: 0.265,
825: 0.273,
- 830: 0.280},
+ 830: 0.280
+ },
'TCS06': {
360: 0.079,
365: 0.081,
@@ -659,7 +663,8 @@
815: 0.525,
820: 0.529,
825: 0.532,
- 830: 0.535},
+ 830: 0.535
+ },
'TCS07': {
360: 0.150,
365: 0.177,
@@ -755,7 +760,8 @@
815: 0.590,
820: 0.590,
825: 0.591,
- 830: 0.592},
+ 830: 0.592
+ },
'TCS08': {
360: 0.075,
365: 0.078,
@@ -851,7 +857,8 @@
815: 0.731,
820: 0.731,
825: 0.731,
- 830: 0.731},
+ 830: 0.731
+ },
'TCS09': {
360: 0.069,
365: 0.072,
@@ -947,7 +954,8 @@
815: 0.837,
820: 0.837,
825: 0.836,
- 830: 0.836},
+ 830: 0.836
+ },
'TCS10': {
360: 0.042,
365: 0.043,
@@ -1043,7 +1051,8 @@
815: 0.757,
820: 0.757,
825: 0.756,
- 830: 0.756},
+ 830: 0.756
+ },
'TCS11': {
360: 0.074,
365: 0.079,
@@ -1139,7 +1148,8 @@
815: 0.380,
820: 0.388,
825: 0.396,
- 830: 0.403},
+ 830: 0.403
+ },
'TCS12': {
360: 0.189,
365: 0.175,
@@ -1235,7 +1245,8 @@
815: 0.694,
820: 0.697,
825: 0.700,
- 830: 0.702},
+ 830: 0.702
+ },
'TCS13': {
360: 0.071,
365: 0.076,
@@ -1331,7 +1342,8 @@
815: 0.745,
820: 0.745,
825: 0.745,
- 830: 0.745},
+ 830: 0.745
+ },
'TCS14': {
360: 0.036,
365: 0.036,
@@ -1427,11 +1439,13 @@
815: 0.444,
820: 0.448,
825: 0.451,
- 830: 0.454}}
+ 830: 0.454
+ }
+}
TCS_SPDS = CaseInsensitiveMapping(
- dict((key, SpectralPowerDistribution(key, value)) for key, value in
- TCS_SPDS_DATA.items()))
+ dict((key, SpectralPowerDistribution(key, value))
+ for key, value in TCS_SPDS_DATA.items()))
"""
Test colour samples spectral power distributions.
diff --git a/colour/quality/dataset/vs.py b/colour/quality/dataset/vs.py
index 840cb61289..392d6bab59 100644
--- a/colour/quality/dataset/vs.py
+++ b/colour/quality/dataset/vs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
CQS Test Colour Samples Spectral Power Distributions
====================================================
@@ -38,9 +37,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['VS_APPROXIMATE_MUNSELL_NOTATIONS',
- 'VS_SPDS_DATA',
- 'VS_SPDS']
+__all__ = ['VS_APPROXIMATE_MUNSELL_NOTATIONS', 'VS_SPDS_DATA', 'VS_SPDS']
VS_INDEXES_TO_NAMES = {
1: 'VS1',
@@ -57,29 +54,31 @@
12: 'VS12',
13: 'VS13',
14: 'VS14',
- 15: 'VS15'}
+ 15: 'VS15'
+}
"""
CQS test colour samples indexes to names mapping.
VS_INDEXES_TO_NAMES : dict
"""
-VS_APPROXIMATE_MUNSELL_NOTATIONS = CaseInsensitiveMapping(
- {'VS1': '7.5P 4/10',
- 'VS2': '10PB 4/10',
- 'VS3': '5PB 4/2',
- 'VS4': '7.5B 5/10',
- 'VS5': '10B G6/8',
- 'VS6': '2.5BG 6/10',
- 'VS7': '2.5G 6/12',
- 'VS8': '7.5GY 7/10',
- 'VS9': '2.5GY 8/10',
- 'VS10': '5Y 8.5/12',
- 'VS11': '10YR 7/12',
- 'VS12': '5YR 7/12',
- 'VS13': '10R 6/12',
- 'VS14': '5R 4/14',
- 'VS15': '7.5RP 4/12'})
+VS_APPROXIMATE_MUNSELL_NOTATIONS = CaseInsensitiveMapping({
+ 'VS1': '7.5P 4/10',
+ 'VS2': '10PB 4/10',
+ 'VS3': '5PB 4/2',
+ 'VS4': '7.5B 5/10',
+ 'VS5': '10B G6/8',
+ 'VS6': '2.5BG 6/10',
+ 'VS7': '2.5G 6/12',
+ 'VS8': '7.5GY 7/10',
+ 'VS9': '2.5GY 8/10',
+ 'VS10': '5Y 8.5/12',
+ 'VS11': '10YR 7/12',
+ 'VS12': '5YR 7/12',
+ 'VS13': '10R 6/12',
+ 'VS14': '5R 4/14',
+ 'VS15': '7.5RP 4/12'
+})
"""
CQS test colour samples *Munsell* colour approximations.
@@ -178,7 +177,8 @@
815: 0.5191,
820: 0.5191,
825: 0.5191,
- 830: 0.5191},
+ 830: 0.5191
+ },
'VS2': {
380: 0.1053,
385: 0.1323,
@@ -270,7 +270,8 @@
815: 0.4537,
820: 0.4537,
825: 0.4537,
- 830: 0.4537},
+ 830: 0.4537
+ },
'VS3': {
380: 0.0858,
385: 0.0990,
@@ -362,7 +363,8 @@
815: 0.2338,
820: 0.2338,
825: 0.2338,
- 830: 0.2338},
+ 830: 0.2338
+ },
'VS4': {
380: 0.0790,
385: 0.0984,
@@ -454,7 +456,8 @@
815: 0.3512,
820: 0.3512,
825: 0.3512,
- 830: 0.3512},
+ 830: 0.3512
+ },
'VS5': {
380: 0.1167,
385: 0.1352,
@@ -546,7 +549,8 @@
815: 0.2269,
820: 0.2269,
825: 0.2269,
- 830: 0.2269},
+ 830: 0.2269
+ },
'VS6': {
380: 0.0872,
385: 0.1001,
@@ -638,7 +642,8 @@
815: 0.1646,
820: 0.1646,
825: 0.1646,
- 830: 0.1646},
+ 830: 0.1646
+ },
'VS7': {
380: 0.0726,
385: 0.0760,
@@ -730,7 +735,8 @@
815: 0.1393,
820: 0.1393,
825: 0.1393,
- 830: 0.1393},
+ 830: 0.1393
+ },
'VS8': {
380: 0.0652,
385: 0.0657,
@@ -822,7 +828,8 @@
815: 0.3239,
820: 0.3239,
825: 0.3239,
- 830: 0.3239},
+ 830: 0.3239
+ },
'VS9': {
380: 0.0643,
385: 0.0661,
@@ -914,7 +921,8 @@
815: 0.5450,
820: 0.5450,
825: 0.5450,
- 830: 0.5450},
+ 830: 0.5450
+ },
'VS10': {
380: 0.0540,
385: 0.0489,
@@ -1006,7 +1014,8 @@
815: 0.7789,
820: 0.7789,
825: 0.7789,
- 830: 0.7789},
+ 830: 0.7789
+ },
'VS11': {
380: 0.0482,
385: 0.0456,
@@ -1098,7 +1107,8 @@
815: 0.5953,
820: 0.5953,
825: 0.5953,
- 830: 0.5953},
+ 830: 0.5953
+ },
'VS12': {
380: 0.0691,
385: 0.0692,
@@ -1190,7 +1200,8 @@
815: 0.7158,
820: 0.7158,
825: 0.7158,
- 830: 0.7158},
+ 830: 0.7158
+ },
'VS13': {
380: 0.0829,
385: 0.0829,
@@ -1282,7 +1293,8 @@
815: 0.6813,
820: 0.6813,
825: 0.6813,
- 830: 0.6813},
+ 830: 0.6813
+ },
'VS14': {
380: 0.0530,
385: 0.0507,
@@ -1374,7 +1386,8 @@
815: 0.7683,
820: 0.7683,
825: 0.7683,
- 830: 0.7683},
+ 830: 0.7683
+ },
'VS15': {
380: 0.0908,
385: 0.1021,
@@ -1466,11 +1479,13 @@
815: 0.7075,
820: 0.7075,
825: 0.7075,
- 830: 0.7075}}
+ 830: 0.7075
+ }
+}
VS_SPDS = CaseInsensitiveMapping(
- dict((key, SpectralPowerDistribution(key, value)) for key, value in
- VS_SPDS_DATA.items()))
+ dict((key, SpectralPowerDistribution(key, value))
+ for key, value in VS_SPDS_DATA.items()))
"""
CQS test colour samples spectral power distributions.
diff --git a/colour/quality/tests/tests_cqs.py b/colour/quality/tests/tests_cqs.py
index 153f255bd6..417e4df0fb 100644
--- a/colour/quality/tests/tests_cqs.py
+++ b/colour/quality/tests/tests_cqs.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.quality.cqs` module.
"""
@@ -10,9 +9,8 @@
import unittest
from colour.quality import colour_quality_scale
-from colour.colorimetry import (
- ILLUMINANTS_RELATIVE_SPDS,
- LIGHT_SOURCES_RELATIVE_SPDS)
+from colour.colorimetry import (ILLUMINANTS_RELATIVE_SPDS,
+ LIGHT_SOURCES_RELATIVE_SPDS)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -36,14 +34,12 @@ def test_colour_quality_scale(self):
"""
self.assertAlmostEqual(
- colour_quality_scale(
- ILLUMINANTS_RELATIVE_SPDS['F1']),
+ colour_quality_scale(ILLUMINANTS_RELATIVE_SPDS['F1']),
75.342427844068794,
places=7)
self.assertAlmostEqual(
- colour_quality_scale(
- ILLUMINANTS_RELATIVE_SPDS['F2']),
+ colour_quality_scale(ILLUMINANTS_RELATIVE_SPDS['F2']),
64.686416902222192,
places=7)
diff --git a/colour/quality/tests/tests_cri.py b/colour/quality/tests/tests_cri.py
index 4b769b2e55..63645f0045 100644
--- a/colour/quality/tests/tests_cri.py
+++ b/colour/quality/tests/tests_cri.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.quality.cri` module.
"""
@@ -10,9 +9,8 @@
import unittest
from colour.quality import colour_rendering_index
-from colour.colorimetry import (
- ILLUMINANTS_RELATIVE_SPDS,
- SpectralPowerDistribution)
+from colour.colorimetry import (ILLUMINANTS_RELATIVE_SPDS,
+ SpectralPowerDistribution)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -104,7 +102,8 @@
765: 0.00340568,
770: 0.00261153,
775: 0.00258850,
- 780: 0.00293663}
+ 780: 0.00293663
+}
class TestColourRenderingIndex(unittest.TestCase):
@@ -129,9 +128,8 @@ def test_colour_rendering_index(self):
places=7)
self.assertAlmostEqual(
- colour_rendering_index(SpectralPowerDistribution(
- 'Sample',
- SAMPLE_SPD_DATA)),
+ colour_rendering_index(
+ SpectralPowerDistribution('Sample', SAMPLE_SPD_DATA)),
70.805386570659394,
places=7)
diff --git a/colour/recovery/__init__.py b/colour/recovery/__init__.py
index 2839c0afa3..3268a583c4 100644
--- a/colour/recovery/__init__.py
+++ b/colour/recovery/__init__.py
@@ -5,8 +5,10 @@
from .dataset import * # noqa
from . import dataset
+from .meng2015 import XYZ_to_spectral_Meng2015
from .smits1999 import RGB_to_spectral_Smits1999
__all__ = []
__all__ += dataset.__all__
+__all__ += ['XYZ_to_spectral_Meng2015']
__all__ += ['RGB_to_spectral_Smits1999']
diff --git a/colour/recovery/dataset/smits1999.py b/colour/recovery/dataset/smits1999.py
index 480df49997..a56963480a 100644
--- a/colour/recovery/dataset/smits1999.py
+++ b/colour/recovery/dataset/smits1999.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Smits (1999) - Reflectance Recovery Dataset
===========================================
@@ -26,8 +25,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SMITS_1999_SPDS_DATA',
- 'SMITS_1999_SPDS']
+__all__ = ['SMITS_1999_SPDS_DATA', 'SMITS_1999_SPDS']
SMITS_1999_SPDS_DATA = {
'white': {
@@ -40,7 +38,8 @@
606.6667: 1.0000,
644.4444: 1.0000,
682.2222: 1.0000,
- 720.0000: 1.0000},
+ 720.0000: 1.0000
+ },
'cyan': {
380.0000: 0.9710,
417.7778: 0.9426,
@@ -51,7 +50,8 @@
606.6667: 0.1564,
644.4444: 0.0000,
682.2222: 0.0000,
- 720.0000: 0.0000},
+ 720.0000: 0.0000
+ },
'magenta': {
380.0000: 1.0000,
417.7778: 1.0000,
@@ -62,7 +62,8 @@
606.6667: 0.8369,
644.4444: 1.0000,
682.2222: 1.0000,
- 720.0000: 0.9959},
+ 720.0000: 0.9959
+ },
'yellow': {
380.0000: 0.0001,
417.7778: 0.0000,
@@ -73,7 +74,8 @@
606.6667: 0.9996,
644.4444: 0.9586,
682.2222: 0.9685,
- 720.0000: 0.9840},
+ 720.0000: 0.9840
+ },
'red': {
380.0000: 0.1012,
417.7778: 0.0515,
@@ -84,7 +86,8 @@
606.6667: 0.8325,
644.4444: 1.0149,
682.2222: 1.0149,
- 720.0000: 1.0149},
+ 720.0000: 1.0149
+ },
'green': {
380.0000: 0.0000,
417.7778: 0.0000,
@@ -95,7 +98,8 @@
606.6667: 0.1719,
644.4444: 0.0000,
682.2222: 0.0000,
- 720.0000: 0.0025},
+ 720.0000: 0.0025
+ },
'blue': {
380.0000: 1.0000,
417.7778: 1.0000,
@@ -106,23 +110,26 @@
606.6667: 0.0003,
644.4444: 0.0369,
682.2222: 0.0483,
- 720.0000: 0.0496}}
+ 720.0000: 0.0496
+ }
+}
SMITS_1999_SPDS = CaseInsensitiveMapping({
- 'white': SpectralPowerDistribution(
- 'white', SMITS_1999_SPDS_DATA['white']),
- 'cyan': SpectralPowerDistribution(
- 'cyan', SMITS_1999_SPDS_DATA['cyan']),
- 'magenta': SpectralPowerDistribution(
- 'magenta', SMITS_1999_SPDS_DATA['magenta']),
- 'yellow': SpectralPowerDistribution(
- 'yellow', SMITS_1999_SPDS_DATA['yellow']),
- 'red': SpectralPowerDistribution(
- 'red', SMITS_1999_SPDS_DATA['red']),
- 'green': SpectralPowerDistribution(
- 'green', SMITS_1999_SPDS_DATA['green']),
- 'blue': SpectralPowerDistribution(
- 'blue', SMITS_1999_SPDS_DATA['blue'])})
+ 'white':
+ SpectralPowerDistribution('white', SMITS_1999_SPDS_DATA['white']),
+ 'cyan':
+ SpectralPowerDistribution('cyan', SMITS_1999_SPDS_DATA['cyan']),
+ 'magenta':
+ SpectralPowerDistribution('magenta', SMITS_1999_SPDS_DATA['magenta']),
+ 'yellow':
+ SpectralPowerDistribution('yellow', SMITS_1999_SPDS_DATA['yellow']),
+ 'red':
+ SpectralPowerDistribution('red', SMITS_1999_SPDS_DATA['red']),
+ 'green':
+ SpectralPowerDistribution('green', SMITS_1999_SPDS_DATA['green']),
+ 'blue':
+ SpectralPowerDistribution('blue', SMITS_1999_SPDS_DATA['blue'])
+})
"""
*Smits (1999)* spectral power distributions.
diff --git a/colour/recovery/meng2015.py b/colour/recovery/meng2015.py
new file mode 100644
index 0000000000..3ab78df851
--- /dev/null
+++ b/colour/recovery/meng2015.py
@@ -0,0 +1,136 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Meng et al. (2015) - Reflectance Recovery
+=========================================
+
+Defines objects for reflectance recovery using *Meng, Simon and Hanika (2015)*
+method:
+
+- :func:`XYZ_to_spectral_Meng2015`
+
+See Also
+--------
+`Meng et al. (2015) - Reflectance Recovery Jupyter Notebook
+`_
+
+References
+----------
+.. [1] Meng, J., Simon, F., & Hanika, J. (2015). Physically Meaningful
+ Rendering using Tristimulus Colours, 34(4). Retrieved from
+ http://jo.dreggn.org/home/2015_spectrum.pdf
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+from scipy.optimize import minimize
+
+from colour import (STANDARD_OBSERVERS_CMFS, SpectralPowerDistribution,
+ SpectralShape, ones_spd, spectral_to_XYZ_integration)
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['XYZ_to_spectral_Meng2015']
+
+
+def XYZ_to_spectral_Meng2015(
+ XYZ,
+ cmfs=STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer'],
+ interval=5,
+ tolerance=1e-10,
+ maximum_iterations=2000):
+ """
+ Recovers the spectral power distribution of given *CIE XYZ* tristimulus
+ values using *Meng et al. (2015)* method.
+
+ Parameters
+ ----------
+ XYZ : array_like, (3,)
+ *CIE XYZ* tristimulus values.
+ cmfs : XYZ_ColourMatchingFunctions
+ Standard observer colour matching functions.
+ interval : numeric, optional
+ Wavelength :math:`\lambda_{i}` range interval in nm. The smaller
+ `interval` is, the longer the computations will be.
+ tolerance : numeric, optional
+ Tolerance for termination. The lower `tolerance` is, the smoother
+ the recovered spectral power distribution will be.
+ maximum_iterations : int, optional
+ Maximum number of iterations to perform.
+
+ Returns
+ -------
+ SpectralPowerDistribution
+ Recovered spectral power distribution.
+
+ Notes
+ -----
+ - The definition used to convert spectrum to *CIE XYZ* tristimulus
+ values is :func:`colour.spectral_to_XYZ_integration` definition
+ because it processes any measurement interval opposed to
+ :func:`colour.spectral_to_XYZ_ASTME30815` definition that handles only
+ measurement interval of 1, 5, 10 or 20nm.
+
+ Examples
+ --------
+ >>> XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ >>> spd = XYZ_to_spectral_Meng2015(XYZ)
+ >>> print(spd)
+ SpectralPowerDistribution('Meng (2015) - \
+[ 0.07049534 0.1008 0.09558313]', (360.0, 830.0, 5.0))
+ >>> spectral_to_XYZ_integration(spd) # doctest: +ELLIPSIS
+ array([ 0.0704952..., 0.1007999..., 0.0955824...])
+ """
+
+ XYZ = np.asarray(XYZ)
+ shape = SpectralShape(cmfs.shape.start, cmfs.shape.end, interval)
+ cmfs = cmfs.clone().align(shape)
+ illuminant = ones_spd(shape)
+ spd = ones_spd(shape)
+
+ def function_objective(a):
+ """
+ Objective function.
+ """
+
+ return np.sum(np.diff(a) ** 2)
+
+ def function_constraint(a):
+ """
+ Function defining the constraint.
+ """
+
+ spd[:] = a
+ return spectral_to_XYZ_integration(
+ spd, cmfs=cmfs, illuminant=illuminant) - XYZ
+
+ wavelengths = spd.wavelengths
+ bins = wavelengths.size
+
+ constraints = {'type': 'eq', 'fun': function_constraint}
+
+ bounds = np.tile(np.array([0, 1000]), (bins, 1))
+
+ result = minimize(
+ function_objective,
+ spd.values,
+ method='SLSQP',
+ constraints=constraints,
+ bounds=bounds,
+ options={'ftol': tolerance,
+ 'maxiter': maximum_iterations})
+
+ if not result.success:
+ raise RuntimeError(
+ 'Optimization failed for {0} after {1} iterations: "{2}".'.format(
+ XYZ, result.nit, result.message))
+
+ return SpectralPowerDistribution('Meng (2015) - {0}'.format(XYZ),
+ dict(zip(wavelengths, result.x)))
diff --git a/colour/recovery/smits1999.py b/colour/recovery/smits1999.py
index f0f13bf914..b5b7c4d044 100644
--- a/colour/recovery/smits1999.py
+++ b/colour/recovery/smits1999.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Smits (1999) - Reflectance Recovery
===================================
@@ -25,10 +24,8 @@
import numpy as np
from colour.colorimetry import ILLUMINANTS, zeros_spd
-from colour.models import (
- XYZ_to_RGB,
- normalised_primary_matrix,
- sRGB_COLOURSPACE)
+from colour.models import (XYZ_to_RGB, normalised_primary_matrix,
+ sRGB_COLOURSPACE)
from colour.recovery import SMITS_1999_SPDS
__author__ = 'Colour Developers'
@@ -38,11 +35,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SMITS1999_PRIMARIES',
- 'SMITS1999_WHITEPOINT',
- 'SMITS1999_XYZ_TO_RGB_MATRIX',
- 'XYZ_to_RGB_Smits1999',
- 'RGB_to_spectral_Smits1999']
+__all__ = [
+ 'SMITS1999_PRIMARIES', 'SMITS1999_WHITEPOINT',
+ 'SMITS1999_XYZ_TO_RGB_MATRIX', 'XYZ_to_RGB_Smits1999',
+ 'RGB_to_spectral_Smits1999'
+]
SMITS1999_PRIMARIES = sRGB_COLOURSPACE.primaries
"""
@@ -101,12 +98,13 @@ def XYZ_to_RGB_Smits1999(XYZ, chromatic_adaptation_transform='Bradford'):
array([ 0.0214496..., 0.1315460..., 0.0928760...])
"""
- return XYZ_to_RGB(XYZ,
- SMITS1999_WHITEPOINT,
- SMITS1999_WHITEPOINT,
- SMITS1999_XYZ_TO_RGB_MATRIX,
- chromatic_adaptation_transform,
- encoding_cctf=None)
+ return XYZ_to_RGB(
+ XYZ,
+ SMITS1999_WHITEPOINT,
+ SMITS1999_WHITEPOINT,
+ SMITS1999_XYZ_TO_RGB_MATRIX,
+ chromatic_adaptation_transform,
+ encoding_cctf=None)
def RGB_to_spectral_Smits1999(RGB):
@@ -128,7 +126,8 @@ def RGB_to_spectral_Smits1999(RGB):
--------
>>> RGB = np.array([0.02144962, 0.13154603, 0.09287601])
>>> print(RGB_to_spectral_Smits1999(RGB)) # doctest: +ELLIPSIS
- SpectralPowerDistribution('0 Constant', (380.0, 720.0, 37.7777777...))
+ SpectralPowerDistribution('Smits (1999) - \
+[ 0.02144962 0.13154603 0.09287601]', (380.0, 720.0, 37.7777777...))
"""
white_spd = SMITS_1999_SPDS['white'].clone()
@@ -141,6 +140,7 @@ def RGB_to_spectral_Smits1999(RGB):
R, G, B = np.ravel(RGB)
spd = zeros_spd(SMITS_1999_SPDS['white'].shape)
+ spd.name = 'Smits (1999) - {0}'.format(RGB)
if R <= G and R <= B:
spd += white_spd * R
diff --git a/colour/recovery/tests/tests_meng2015.py b/colour/recovery/tests/tests_meng2015.py
new file mode 100644
index 0000000000..31515dd071
--- /dev/null
+++ b/colour/recovery/tests/tests_meng2015.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Defines unit tests for :mod:`colour.recovery.meng2015` module.
+"""
+
+from __future__ import division, unicode_literals
+
+import numpy as np
+import unittest
+
+from colour.colorimetry import (STANDARD_OBSERVERS_CMFS, SpectralShape,
+ spectral_to_XYZ_integration)
+from colour.recovery import XYZ_to_spectral_Meng2015
+
+__author__ = 'Colour Developers'
+__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
+__license__ = 'New BSD License - http://opensource.org/licenses/BSD-3-Clause'
+__maintainer__ = 'Colour Developers'
+__email__ = 'colour-science@googlegroups.com'
+__status__ = 'Production'
+
+__all__ = ['TestXYZ_to_spectral_Meng2015']
+
+
+class TestXYZ_to_spectral_Meng2015(unittest.TestCase):
+ """
+ Defines :func:`colour.recovery.meng2015.XYZ_to_spectral_Meng2015`
+ definition unit tests methods.
+ """
+
+ def test_XYZ_to_spectral_Meng2015(self):
+ """
+ Tests :func:`colour.recovery.meng2015.XYZ_to_spectral_Meng2015`
+ definition.
+ """
+
+ cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
+ shape = SpectralShape(cmfs.shape.start, cmfs.shape.end, 5)
+ cmfs_c = cmfs.clone().align(shape)
+
+ XYZ = np.array([0.07049534, 0.10080000, 0.09558313])
+ np.testing.assert_almost_equal(
+ spectral_to_XYZ_integration(
+ XYZ_to_spectral_Meng2015(XYZ), cmfs=cmfs_c),
+ XYZ,
+ decimal=7)
+
+ shape = SpectralShape(cmfs.shape.start, cmfs.shape.end, 10)
+ cmfs_c = cmfs.clone().align(shape)
+
+ np.testing.assert_almost_equal(
+ spectral_to_XYZ_integration(
+ XYZ_to_spectral_Meng2015(XYZ, interval=10), cmfs=cmfs_c),
+ XYZ,
+ decimal=7)
+
+ np.testing.assert_almost_equal(
+ spectral_to_XYZ_integration(
+ XYZ_to_spectral_Meng2015(XYZ, interval=10, tolerance=1e-3),
+ cmfs=cmfs_c),
+ XYZ,
+ decimal=7)
+
+ shape = SpectralShape(400, 700, 5)
+ cmfs_c = cmfs.clone().align(shape)
+ np.testing.assert_almost_equal(
+ spectral_to_XYZ_integration(
+ XYZ_to_spectral_Meng2015(XYZ, cmfs=cmfs_c), cmfs=cmfs_c),
+ XYZ,
+ decimal=7)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/colour/recovery/tests/tests_smits1999.py b/colour/recovery/tests/tests_smits1999.py
index b334f08692..21b0ec66f3 100644
--- a/colour/recovery/tests/tests_smits1999.py
+++ b/colour/recovery/tests/tests_smits1999.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.recovery.smits1999` module.
"""
@@ -37,47 +36,50 @@ def test_RGB_to_spectral_Smits1999(self):
np.testing.assert_almost_equal(
RGB_to_spectral_Smits1999(
np.array([0.45293517, 0.31732158, 0.26414773])).values,
- np.array([0.27787714,
- 0.27113183,
- 0.26990663,
- 0.29932875,
- 0.31711026,
- 0.31726875,
- 0.43019862,
- 0.45275442,
- 0.45328084,
- 0.45410503]),
- decimal=7)
+ np.array(
+ [0.27787714,
+ 0.27113183,
+ 0.26990663,
+ 0.29932875,
+ 0.31711026,
+ 0.31726875,
+ 0.43019862,
+ 0.45275442,
+ 0.45328084,
+ 0.45410503]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
RGB_to_spectral_Smits1999(
np.array([0.77875824, 0.57726450, 0.50453169])).values,
- np.array([0.52493013,
- 0.51490862,
- 0.51239457,
- 0.55255311,
- 0.57686087,
- 0.57716359,
- 0.74497895,
- 0.77874936,
- 0.77946941,
- 0.78059677]),
- decimal=7)
+ np.array(
+ [0.52493013,
+ 0.51490862,
+ 0.51239457,
+ 0.55255311,
+ 0.57686087,
+ 0.57716359,
+ 0.74497895,
+ 0.77874936,
+ 0.77946941,
+ 0.78059677]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
RGB_to_spectral_Smits1999(
np.array([0.35505307, 0.47995567, 0.61088035])).values,
- np.array([0.60725817,
- 0.60371094,
- 0.59674004,
- 0.52330084,
- 0.47975906,
- 0.47997209,
- 0.37462711,
- 0.35988419,
- 0.36137673,
- 0.36154693]),
- decimal=7)
+ np.array(
+ [0.60725817,
+ 0.60371094,
+ 0.59674004,
+ 0.52330084,
+ 0.47975906,
+ 0.47997209,
+ 0.37462711,
+ 0.35988419,
+ 0.36137673,
+ 0.36154693]),
+ decimal=7) # yapf: disable
if __name__ == '__main__':
diff --git a/colour/temperature/__init__.py b/colour/temperature/__init__.py
index 831fb323f5..186a36333f 100644
--- a/colour/temperature/__init__.py
+++ b/colour/temperature/__init__.py
@@ -5,28 +5,21 @@
from .cct import CCT_TO_UV_METHODS, UV_TO_CCT_METHODS
from .cct import CCT_to_uv
-from .cct import (
- CCT_to_uv_Ohno2013,
- CCT_to_uv_Robertson1968,
- CCT_to_uv_Krystek1985)
+from .cct import (CCT_to_uv_Ohno2013, CCT_to_uv_Robertson1968,
+ CCT_to_uv_Krystek1985)
from .cct import uv_to_CCT
-from .cct import (
- uv_to_CCT_Ohno2013,
- uv_to_CCT_Robertson1968)
+from .cct import (uv_to_CCT_Ohno2013, uv_to_CCT_Robertson1968)
from .cct import CCT_TO_XY_METHODS, XY_TO_CCT_METHODS
from .cct import CCT_to_xy
from .cct import CCT_to_xy_Kang2002, CCT_to_xy_CIE_D
from .cct import xy_to_CCT
from .cct import xy_to_CCT_McCamy1992, xy_to_CCT_Hernandez1999
-__all__ = ['CCT_TO_UV_METHODS', 'UV_TO_CCT_METHODS',
- 'CCT_to_uv',
- 'CCT_to_uv_Ohno2013',
- 'CCT_to_uv_Robertson1968',
- 'CCT_to_uv_Krystek1985',
- 'uv_to_CCT',
- 'uv_to_CCT_Ohno2013',
- 'uv_to_CCT_Robertson1968',
- 'CCT_TO_XY_METHODS', 'XY_TO_CCT_METHODS',
- 'CCT_to_xy', 'CCT_to_xy_Kang2002', 'CCT_to_xy_CIE_D',
- 'xy_to_CCT', 'xy_to_CCT_McCamy1992', 'xy_to_CCT_Hernandez1999']
+__all__ = [
+ 'CCT_TO_UV_METHODS', 'UV_TO_CCT_METHODS', 'CCT_to_uv',
+ 'CCT_to_uv_Ohno2013', 'CCT_to_uv_Robertson1968', 'CCT_to_uv_Krystek1985',
+ 'uv_to_CCT', 'uv_to_CCT_Ohno2013', 'uv_to_CCT_Robertson1968',
+ 'CCT_TO_XY_METHODS', 'XY_TO_CCT_METHODS', 'CCT_to_xy',
+ 'CCT_to_xy_Kang2002', 'CCT_to_xy_CIE_D', 'xy_to_CCT',
+ 'xy_to_CCT_McCamy1992', 'xy_to_CCT_Hernandez1999'
+]
diff --git a/colour/temperature/cct.py b/colour/temperature/cct.py
index 8d2eed32f7..7415e8aba6 100644
--- a/colour/temperature/cct.py
+++ b/colour/temperature/cct.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Correlated Colour Temperature :math:`T_{cp}`
============================================
@@ -53,19 +52,12 @@
import numpy as np
from collections import namedtuple
-from colour.colorimetry import (
- ASTME30815_PRACTISE_SHAPE,
- STANDARD_OBSERVERS_CMFS,
- blackbody_spd,
- spectral_to_XYZ)
+from colour.colorimetry import (ASTME30815_PRACTISE_SHAPE,
+ STANDARD_OBSERVERS_CMFS, blackbody_spd,
+ spectral_to_XYZ)
from colour.models import UCS_to_uv, XYZ_to_UCS
-from colour.utilities import (
- CaseInsensitiveMapping,
- as_numeric,
- filter_kwargs,
- tsplit,
- tstack,
- warning)
+from colour.utilities import (CaseInsensitiveMapping, as_numeric,
+ filter_kwargs, tsplit, tstack, warning)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -74,36 +66,20 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['PLANCKIAN_TABLE_TUVD',
- 'CCT_MINIMAL',
- 'CCT_MAXIMAL',
- 'CCT_SAMPLES',
- 'CCT_CALCULATION_ITERATIONS',
- 'ROBERTSON_ISOTEMPERATURE_LINES_DATA',
- 'ROBERTSON_ISOTEMPERATURE_LINES_RUVT',
- 'ROBERTSON_ISOTEMPERATURE_LINES',
- 'planckian_table',
- 'planckian_table_minimal_distance_index',
- 'uv_to_CCT_Ohno2013',
- 'CCT_to_uv_Ohno2013',
- 'uv_to_CCT_Robertson1968',
- 'CCT_to_uv_Robertson1968',
- 'CCT_to_uv_Krystek1985',
- 'UV_TO_CCT_METHODS',
- 'uv_to_CCT',
- 'CCT_TO_UV_METHODS',
- 'CCT_to_uv',
- 'xy_to_CCT_McCamy1992',
- 'xy_to_CCT_Hernandez1999',
- 'CCT_to_xy_Kang2002',
- 'CCT_to_xy_CIE_D',
- 'XY_TO_CCT_METHODS',
- 'xy_to_CCT',
- 'CCT_TO_XY_METHODS',
- 'CCT_to_xy']
-
-PLANCKIAN_TABLE_TUVD = namedtuple('PlanckianTable_Tuvdi',
- ('Ti', 'ui', 'vi', 'di'))
+__all__ = [
+ 'PLANCKIAN_TABLE_TUVD', 'CCT_MINIMAL', 'CCT_MAXIMAL', 'CCT_SAMPLES',
+ 'CCT_CALCULATION_ITERATIONS', 'ROBERTSON_ISOTEMPERATURE_LINES_DATA',
+ 'ROBERTSON_ISOTEMPERATURE_LINES_RUVT', 'ROBERTSON_ISOTEMPERATURE_LINES',
+ 'planckian_table', 'planckian_table_minimal_distance_index',
+ 'uv_to_CCT_Ohno2013', 'CCT_to_uv_Ohno2013', 'uv_to_CCT_Robertson1968',
+ 'CCT_to_uv_Robertson1968', 'CCT_to_uv_Krystek1985', 'UV_TO_CCT_METHODS',
+ 'uv_to_CCT', 'CCT_TO_UV_METHODS', 'CCT_to_uv', 'xy_to_CCT_McCamy1992',
+ 'xy_to_CCT_Hernandez1999', 'CCT_to_xy_Kang2002', 'CCT_to_xy_CIE_D',
+ 'XY_TO_CCT_METHODS', 'xy_to_CCT', 'CCT_TO_XY_METHODS', 'CCT_to_xy'
+]
+
+PLANCKIAN_TABLE_TUVD = namedtuple('PlanckianTable_Tuvdi', ('Ti', 'ui', 'vi',
+ 'di'))
CCT_MINIMAL = 1000
CCT_MAXIMAL = 100000
@@ -163,12 +139,13 @@
Formulae (p. 228). Wiley. ISBN:978-0471399186
"""
-ROBERTSON_ISOTEMPERATURE_LINES_RUVT = namedtuple(
- 'WyszeckiRobertson_ruvt', ('r', 'u', 'v', 't'))
+ROBERTSON_ISOTEMPERATURE_LINES_RUVT = namedtuple('WyszeckiRobertson_ruvt',
+ ('r', 'u', 'v', 't'))
ROBERTSON_ISOTEMPERATURE_LINES = [
ROBERTSON_ISOTEMPERATURE_LINES_RUVT(*x)
- for x in ROBERTSON_ISOTEMPERATURE_LINES_DATA]
+ for x in ROBERTSON_ISOTEMPERATURE_LINES_DATA
+]
def planckian_table(uv, cmfs, start, end, count):
@@ -367,8 +344,9 @@ def uv_to_CCT_Ohno2013(
a = (Tip * (din - di) + Ti * (dip - din) + Tin * (di - dip)) * X ** -1
b = (-(Tip ** 2 * (din - di) + Ti ** 2 * (dip - din) + Tin ** 2 *
(di - dip)) * X ** -1)
- c = (-(dip * (Tin - Ti) * Ti * Tin + di * (Tip - Tin) * Tip * Tin +
- din * (Ti - Tip) * Tip * Ti) * X ** -1)
+ c = (-(dip * (Tin - Ti) * Ti * Tin + di *
+ (Tip - Tin) * Tip * Tin + din *
+ (Ti - Tip) * Tip * Ti) * X ** -1)
T = -b / (2 * a)
@@ -649,9 +627,10 @@ def CCT_to_uv_Krystek1985(CCT):
return tstack((u, v))
-UV_TO_CCT_METHODS = CaseInsensitiveMapping(
- {'Ohno 2013': uv_to_CCT_Ohno2013,
- 'Robertson 1968': uv_to_CCT_Robertson1968})
+UV_TO_CCT_METHODS = CaseInsensitiveMapping({
+ 'Ohno 2013': uv_to_CCT_Ohno2013,
+ 'Robertson 1968': uv_to_CCT_Robertson1968
+})
"""
Supported *CIE UCS* colourspace *uv* chromaticity coordinates to correlated
colour temperature :math:`T_{cp}` computation methods.
@@ -721,10 +700,11 @@ def uv_to_CCT(uv, method='Ohno 2013', **kwargs):
return function(uv, **kwargs)
-CCT_TO_UV_METHODS = CaseInsensitiveMapping(
- {'Ohno 2013': CCT_to_uv_Ohno2013,
- 'Robertson 1968': CCT_to_uv_Robertson1968,
- 'Krystek 1985': CCT_to_uv_Krystek1985})
+CCT_TO_UV_METHODS = CaseInsensitiveMapping({
+ 'Ohno 2013': CCT_to_uv_Ohno2013,
+ 'Robertson 1968': CCT_to_uv_Robertson1968,
+ 'Krystek 1985': CCT_to_uv_Krystek1985
+})
"""
Supported correlated colour temperature :math:`T_{cp}` to *CIE UCS* colourspace
*uv* chromaticity coordinates computation methods.
@@ -854,19 +834,13 @@ def xy_to_CCT_Hernandez1999(xy):
x, y = tsplit(xy)
n = (x - 0.3366) / (y - 0.1735)
- CCT = (-949.86315 +
- 6253.80338 * np.exp(-n / 0.92159) +
- 28.70599 * np.exp(-n / 0.20039) +
- 0.00004 * np.exp(-n / 0.07125))
+ CCT = (-949.86315 + 6253.80338 * np.exp(-n / 0.92159) +
+ 28.70599 * np.exp(-n / 0.20039) + 0.00004 * np.exp(-n / 0.07125))
- n = np.where(CCT > 50000,
- (x - 0.3356) / (y - 0.1691),
- n)
+ n = np.where(CCT > 50000, (x - 0.3356) / (y - 0.1691), n)
- CCT = np.where(CCT > 50000,
- 36284.48953 + 0.00228 * np.exp(-n / 0.07861) +
- 5.4535e-36 * np.exp(-n / 0.01543),
- CCT)
+ CCT = np.where(CCT > 50000, 36284.48953 + 0.00228 * np.exp(-n / 0.07861) +
+ 5.4535e-36 * np.exp(-n / 0.01543), CCT)
return as_numeric(CCT)
@@ -911,31 +885,17 @@ def CCT_to_xy_Kang2002(CCT):
warning(('Correlated colour temperature must be in domain '
'[1667, 25000], unpredictable results may occur!'))
- x = np.where(CCT <= 4000,
- -0.2661239 * 10 ** 9 / CCT ** 3 -
- 0.2343589 * 10 ** 6 / CCT ** 2 +
- 0.8776956 * 10 ** 3 / CCT +
- 0.179910,
- -3.0258469 * 10 ** 9 / CCT ** 3 +
- 2.1070379 * 10 ** 6 / CCT ** 2 +
- 0.2226347 * 10 ** 3 / CCT +
- 0.24039)
-
- y = np.select([CCT <= 2222,
- np.logical_and(CCT > 2222, CCT <= 4000),
- CCT > 4000],
- [-1.1063814 * x ** 3 -
- 1.34811020 * x ** 2 +
- 2.18555832 * x -
- 0.20219683,
- -0.9549476 * x ** 3 -
- 1.37418593 * x ** 2 +
- 2.09137015 * x -
- 0.16748867,
- 3.0817580 * x ** 3 -
- 5.8733867 * x ** 2 +
- 3.75112997 * x -
- 0.37001483])
+ x = np.where(
+ CCT <= 4000, -0.2661239 * 10 ** 9 / CCT ** 3 -
+ 0.2343589 * 10 ** 6 / CCT ** 2 + 0.8776956 * 10 ** 3 / CCT + 0.179910,
+ -3.0258469 * 10 ** 9 / CCT ** 3 + 2.1070379 * 10 ** 6 / CCT ** 2 +
+ 0.2226347 * 10 ** 3 / CCT + 0.24039)
+
+ cnd_l = [CCT <= 2222, np.logical_and(CCT > 2222, CCT <= 4000), CCT > 4000]
+ i = -1.1063814 * x ** 3 - 1.34811020 * x ** 2 + 2.18555832 * x - 0.20219683
+ j = -0.9549476 * x ** 3 - 1.37418593 * x ** 2 + 2.09137015 * x - 0.16748867
+ k = 3.0817580 * x ** 3 - 5.8733867 * x ** 2 + 3.75112997 * x - 0.37001483
+ y = np.select(cnd_l, [i, j, k])
xy = tstack((x, y))
@@ -982,15 +942,10 @@ def CCT_to_xy_CIE_D(CCT):
warning(('Correlated colour temperature must be in domain '
'[4000, 25000], unpredictable results may occur!'))
- x = np.where(CCT <= 7000,
- -4.607 * 10 ** 9 / CCT ** 3 +
- 2.9678 * 10 ** 6 / CCT ** 2 +
- 0.09911 * 10 ** 3 / CCT +
- 0.244063,
- -2.0064 * 10 ** 9 / CCT ** 3 +
- 1.9018 * 10 ** 6 / CCT ** 2 +
- 0.24748 * 10 ** 3 / CCT +
- 0.23704)
+ x = np.where(
+ CCT <= 7000, -4.607 * 10 ** 9 / CCT ** 3 + 2.9678 * 10 ** 6 / CCT ** 2
+ + 0.09911 * 10 ** 3 / CCT + 0.244063, -2.0064 * 10 ** 9 / CCT ** 3 +
+ 1.9018 * 10 ** 6 / CCT ** 2 + 0.24748 * 10 ** 3 / CCT + 0.23704)
y = -3 * x ** 2 + 2.87 * x - 0.275
@@ -999,9 +954,10 @@ def CCT_to_xy_CIE_D(CCT):
return xy
-XY_TO_CCT_METHODS = CaseInsensitiveMapping(
- {'McCamy 1992': xy_to_CCT_McCamy1992,
- 'Hernandez 1999': xy_to_CCT_Hernandez1999})
+XY_TO_CCT_METHODS = CaseInsensitiveMapping({
+ 'McCamy 1992': xy_to_CCT_McCamy1992,
+ 'Hernandez 1999': xy_to_CCT_Hernandez1999
+})
"""
Supported *CIE XYZ* tristimulus values *xy* chromaticity coordinates to
correlated colour temperature :math:`T_{cp}` computation methods.
@@ -1041,9 +997,10 @@ def xy_to_CCT(xy, method='McCamy 1992'):
return XY_TO_CCT_METHODS.get(method)(xy)
-CCT_TO_XY_METHODS = CaseInsensitiveMapping(
- {'Kang 2002': CCT_to_xy_Kang2002,
- 'CIE Illuminant D Series': CCT_to_xy_CIE_D})
+CCT_TO_XY_METHODS = CaseInsensitiveMapping({
+ 'Kang 2002': CCT_to_xy_Kang2002,
+ 'CIE Illuminant D Series': CCT_to_xy_CIE_D
+})
"""
Supported correlated colour temperature :math:`T_{cp}` to *CIE XYZ* tristimulus
values *xy* chromaticity coordinates computation methods.
diff --git a/colour/temperature/tests/tests_cct.py b/colour/temperature/tests/tests_cct.py
index 18f19b82b5..83a702c9dd 100644
--- a/colour/temperature/tests/tests_cct.py
+++ b/colour/temperature/tests/tests_cct.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.temperature.cct` module.
"""
@@ -13,18 +12,11 @@
from colour.colorimetry import STANDARD_OBSERVERS_CMFS
from colour.temperature import (
- CCT_to_uv_Ohno2013,
- CCT_to_uv_Robertson1968,
- CCT_to_uv_Krystek1985,
- uv_to_CCT_Ohno2013,
- uv_to_CCT_Robertson1968,
- CCT_to_xy_Kang2002,
- CCT_to_xy_CIE_D,
- xy_to_CCT_McCamy1992,
- xy_to_CCT_Hernandez1999)
-from colour.temperature.cct import (
- planckian_table,
- planckian_table_minimal_distance_index)
+ CCT_to_uv_Ohno2013, CCT_to_uv_Robertson1968, CCT_to_uv_Krystek1985,
+ uv_to_CCT_Ohno2013, uv_to_CCT_Robertson1968, CCT_to_xy_Kang2002,
+ CCT_to_xy_CIE_D, xy_to_CCT_McCamy1992, xy_to_CCT_Hernandez1999)
+from colour.temperature.cct import (planckian_table,
+ planckian_table_minimal_distance_index)
from colour.utilities import ignore_numpy_errors
__author__ = 'Colour Developers'
@@ -34,29 +26,26 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestPlanckianTable',
- 'TestPlanckianTableMinimalDistanceIndex',
- 'Testuv_to_CCT_Ohno2013',
- 'TestCCT_to_uv_Ohno2013',
- 'Testuv_to_CCT_Robertson1968',
- 'TestCCT_to_uv_Robertson1968',
- 'TestCCT_to_uv_Krystek1985',
- 'Testxy_to_CCT_McCamy1992',
- 'Testxy_to_CCT_Hernandez1999',
- 'TestCCT_to_xy_Kang2002',
- 'TestCCT_to_xy_CIE_D']
-
-PLANCKIAN_TABLE = np.array([
- [1000.00000000, 0.44796288, 0.35462962, 0.25373557],
- [1001.11111111, 0.44770303, 0.35465214, 0.25348315],
- [1002.22222222, 0.44744348, 0.35467461, 0.25323104],
- [1003.33333333, 0.44718423, 0.35469704, 0.25297924],
- [1004.44444444, 0.44692529, 0.35471942, 0.25272774],
- [1005.55555556, 0.44666666, 0.35474175, 0.25247656],
- [1006.66666667, 0.44640833, 0.35476404, 0.25222569],
- [1007.77777778, 0.44615030, 0.35478628, 0.25197512],
- [1008.88888889, 0.44589258, 0.35480848, 0.25172487],
- [1010.00000000, 0.44563516, 0.35483063, 0.25147492]])
+__all__ = [
+ 'TestPlanckianTable', 'TestPlanckianTableMinimalDistanceIndex',
+ 'Testuv_to_CCT_Ohno2013', 'TestCCT_to_uv_Ohno2013',
+ 'Testuv_to_CCT_Robertson1968', 'TestCCT_to_uv_Robertson1968',
+ 'TestCCT_to_uv_Krystek1985', 'Testxy_to_CCT_McCamy1992',
+ 'Testxy_to_CCT_Hernandez1999', 'TestCCT_to_xy_Kang2002',
+ 'TestCCT_to_xy_CIE_D'
+]
+
+PLANCKIAN_TABLE = np.array(
+ [[1000.00000000, 0.44796288, 0.35462962, 0.25373557],
+ [1001.11111111, 0.44770303, 0.35465214, 0.25348315],
+ [1002.22222222, 0.44744348, 0.35467461, 0.25323104],
+ [1003.33333333, 0.44718423, 0.35469704, 0.25297924],
+ [1004.44444444, 0.44692529, 0.35471942, 0.25272774],
+ [1005.55555556, 0.44666666, 0.35474175, 0.25247656],
+ [1006.66666667, 0.44640833, 0.35476404, 0.25222569],
+ [1007.77777778, 0.44615030, 0.35478628, 0.25197512],
+ [1008.88888889, 0.44589258, 0.35480848, 0.25172487],
+ [1010.00000000, 0.44563516, 0.35483063, 0.25147492]]) # yapf: disable
TEMPERATURE_DUV_TO_UV = {
(2000, -0.0500): np.array([0.309448284638118, 0.309263824757947]),
@@ -158,7 +147,8 @@
(49500, -0.0250): np.array([0.205486370785934, 0.262018880883472]),
(49500, 0.0000): np.array([0.181345151515151, 0.268515151515151]),
(49500, 0.0250): np.array([0.157203932244369, 0.275011422146831]),
- (49500, 0.0500): np.array([0.133062712973587, 0.281507692778510])}
+ (49500, 0.0500): np.array([0.133062712973587, 0.281507692778510])
+}
class TestPlanckianTable(unittest.TestCase):
@@ -175,8 +165,9 @@ def test_planckian_table(self):
cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
np.testing.assert_almost_equal(
- [(x.Ti, x.ui, x.vi, x.di) for x in planckian_table(
- np.array([0.1978, 0.3122]), cmfs, 1000, 1010, 10)],
+ [(x.Ti, x.ui, x.vi, x.di)
+ for x in planckian_table(
+ np.array([0.1978, 0.3122]), cmfs, 1000, 1010, 10)],
PLANCKIAN_TABLE)
@@ -196,8 +187,7 @@ def test_planckian_table_minimal_distance_index(self):
self.assertEqual(
planckian_table_minimal_distance_index(
planckian_table(
- np.array([0.1978, 0.3122]), cmfs, 1000, 1010, 10)),
- 9)
+ np.array([0.1978, 0.3122]), cmfs, 1000, 1010, 10)), 9)
class Testuv_to_CCT_Ohno2013(unittest.TestCase):
@@ -241,20 +231,17 @@ def test_CCT_to_uv_Ohno2013(self):
cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
np.testing.assert_almost_equal(
- CCT_to_uv_Ohno2013(
- 6507.43422010, 0.003223690901513, cmfs),
+ CCT_to_uv_Ohno2013(6507.43422010, 0.003223690901513, cmfs),
np.array([0.19779990, 0.31220046]),
decimal=7)
np.testing.assert_almost_equal(
- CCT_to_uv_Ohno2013(
- 1041.84952461, -0.067377582728535, cmfs),
+ CCT_to_uv_Ohno2013(1041.84952461, -0.067377582728535, cmfs),
np.array([0.43276248, 0.28830361]),
decimal=7)
np.testing.assert_almost_equal(
- CCT_to_uv_Ohno2013(
- 2448.94890533, -0.084324704634693, cmfs),
+ CCT_to_uv_Ohno2013(2448.94890533, -0.084324704634693, cmfs),
np.array([0.29256477, 0.2722181]),
decimal=7)
@@ -273,9 +260,7 @@ def test_uv_to_CCT_Robertson1968(self):
for key, value in TEMPERATURE_DUV_TO_UV.items():
np.testing.assert_allclose(
- uv_to_CCT_Robertson1968(value),
- key,
- atol=0.25)
+ uv_to_CCT_Robertson1968(value), key, atol=0.25)
class TestCCT_to_uv_Robertson1968(unittest.TestCase):
@@ -292,9 +277,7 @@ def test_CCT_to_uv_Robertson1968(self):
for key, value in TEMPERATURE_DUV_TO_UV.items():
np.testing.assert_almost_equal(
- CCT_to_uv_Robertson1968(*key),
- value,
- decimal=7)
+ CCT_to_uv_Robertson1968(*key), value, decimal=7)
class TestCCT_to_uv_Krystek1985(unittest.TestCase):
@@ -332,23 +315,17 @@ def test_n_dimensional_CCT_to_uv_Krystek1985(self):
CCT = 7000
xy = np.array([0.183513095046506, 0.305827773965731])
np.testing.assert_almost_equal(
- CCT_to_uv_Krystek1985(CCT),
- xy,
- decimal=7)
+ CCT_to_uv_Krystek1985(CCT), xy, decimal=7)
CCT = np.tile(CCT, 6)
xy = np.tile(xy, (6, 1))
np.testing.assert_almost_equal(
- CCT_to_uv_Krystek1985(CCT),
- xy,
- decimal=7)
+ CCT_to_uv_Krystek1985(CCT), xy, decimal=7)
CCT = np.reshape(CCT, (2, 3))
xy = np.reshape(xy, (2, 3, 2))
np.testing.assert_almost_equal(
- CCT_to_uv_Krystek1985(CCT),
- xy,
- decimal=7)
+ CCT_to_uv_Krystek1985(CCT), xy, decimal=7)
@ignore_numpy_errors
def test_nan_CCT_to_uv_Krystek1985(self):
@@ -399,23 +376,17 @@ def test_n_dimensional_xy_to_CCT_McCamy1992(self):
xy = np.array([0.31270, 0.32900])
CCT = 6505.08059131
np.testing.assert_almost_equal(
- xy_to_CCT_McCamy1992(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_McCamy1992(xy), CCT, decimal=7)
xy = np.tile(xy, (6, 1))
CCT = np.tile(CCT, 6)
np.testing.assert_almost_equal(
- xy_to_CCT_McCamy1992(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_McCamy1992(xy), CCT, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
CCT = np.reshape(CCT, (2, 3))
np.testing.assert_almost_equal(
- xy_to_CCT_McCamy1992(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_McCamy1992(xy), CCT, decimal=7)
@ignore_numpy_errors
def test_nan_xy_to_CCT_McCamy1992(self):
@@ -466,23 +437,17 @@ def test_n_dimensional_xy_to_CCT_Hernandez1999(self):
xy = np.array([0.31270, 0.32900])
CCT = 6500.74204318
np.testing.assert_almost_equal(
- xy_to_CCT_Hernandez1999(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_Hernandez1999(xy), CCT, decimal=7)
xy = np.tile(xy, (6, 1))
CCT = np.tile(CCT, 6)
np.testing.assert_almost_equal(
- xy_to_CCT_Hernandez1999(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_Hernandez1999(xy), CCT, decimal=7)
xy = np.reshape(xy, (2, 3, 2))
CCT = np.reshape(CCT, (2, 3))
np.testing.assert_almost_equal(
- xy_to_CCT_Hernandez1999(xy),
- CCT,
- decimal=7)
+ xy_to_CCT_Hernandez1999(xy), CCT, decimal=7)
@ignore_numpy_errors
def test_nan_xy_to_CCT_Hernandez1999(self):
@@ -531,24 +496,15 @@ def test_n_dimensional_CCT_to_xy_Kang2002(self):
CCT = 4000
xy = np.array([0.380528282812500, 0.376733530961114])
- np.testing.assert_almost_equal(
- CCT_to_xy_Kang2002(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_Kang2002(CCT), xy, decimal=7)
CCT = np.tile(CCT, 6)
xy = np.tile(xy, (6, 1))
- np.testing.assert_almost_equal(
- CCT_to_xy_Kang2002(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_Kang2002(CCT), xy, decimal=7)
CCT = np.reshape(CCT, (2, 3))
xy = np.reshape(xy, (2, 3, 2))
- np.testing.assert_almost_equal(
- CCT_to_xy_Kang2002(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_Kang2002(CCT), xy, decimal=7)
@ignore_numpy_errors
def test_nan_CCT_to_xy_Kang2002(self):
@@ -597,24 +553,15 @@ def test_n_dimensional_CCT_to_xy_CIE_D(self):
CCT = 4000
xy = np.array([0.382343625000000, 0.383766261015578])
- np.testing.assert_almost_equal(
- CCT_to_xy_CIE_D(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_CIE_D(CCT), xy, decimal=7)
CCT = np.tile(CCT, 6)
xy = np.tile(xy, (6, 1))
- np.testing.assert_almost_equal(
- CCT_to_xy_CIE_D(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_CIE_D(CCT), xy, decimal=7)
CCT = np.reshape(CCT, (2, 3))
xy = np.reshape(xy, (2, 3, 2))
- np.testing.assert_almost_equal(
- CCT_to_xy_CIE_D(CCT),
- xy,
- decimal=7)
+ np.testing.assert_almost_equal(CCT_to_xy_CIE_D(CCT), xy, decimal=7)
@ignore_numpy_errors
def test_nan_CCT_to_xy_CIE_D(self):
diff --git a/colour/utilities/__init__.py b/colour/utilities/__init__.py
index 56ae4421dd..4d3f3ac2c1 100644
--- a/colour/utilities/__init__.py
+++ b/colour/utilities/__init__.py
@@ -3,71 +3,32 @@
from __future__ import absolute_import
-from .common import (
- handle_numpy_errors,
- ignore_numpy_errors,
- raise_numpy_errors,
- print_numpy_errors,
- warn_numpy_errors,
- ignore_python_warnings,
- batch,
- is_openimageio_installed,
- is_iterable,
- is_string,
- is_numeric,
- is_integer,
- filter_kwargs)
-from .array import (
- as_numeric,
- closest,
- normalise_maximum,
- interval,
- is_uniform,
- in_array,
- tstack,
- tsplit,
- row_as_diagonal,
- dot_vector,
- dot_matrix,
- orient,
- centroid,
- linear_conversion)
-from .data_structures import (
- ArbitraryPrecisionMapping,
- Lookup,
- Structure,
- CaseInsensitiveMapping)
+from .common import (handle_numpy_errors, ignore_numpy_errors,
+ raise_numpy_errors, print_numpy_errors, warn_numpy_errors,
+ ignore_python_warnings, batch, is_openimageio_installed,
+ is_iterable, is_string, is_numeric, is_integer,
+ filter_kwargs)
+from .array import (as_numeric, as_namedtuple, closest, normalise_maximum,
+ interval, is_uniform, in_array, tstack, tsplit,
+ row_as_diagonal, dot_vector, dot_matrix, orient, centroid,
+ linear_conversion)
+from .data_structures import (ArbitraryPrecisionMapping, Lookup, Structure,
+ CaseInsensitiveMapping)
from .verbose import ColourWarning, message_box, warning, filter_warnings
-__all__ = ['handle_numpy_errors',
- 'ignore_numpy_errors',
- 'raise_numpy_errors',
- 'print_numpy_errors',
- 'warn_numpy_errors',
- 'ignore_python_warnings',
- 'batch',
- 'is_openimageio_installed',
- 'is_iterable',
- 'is_string',
- 'is_numeric',
- 'is_integer',
- 'filter_kwargs']
-__all__ += ['as_numeric',
- 'closest',
- 'normalise_maximum',
- 'interval',
- 'is_uniform',
- 'in_array',
- 'tstack',
- 'tsplit',
- 'row_as_diagonal',
- 'dot_vector',
- 'dot_matrix',
- 'orient',
- 'centroid',
- 'linear_conversion']
-__all__ += ['ArbitraryPrecisionMapping',
- 'Lookup',
- 'Structure',
- 'CaseInsensitiveMapping']
+__all__ = [
+ 'handle_numpy_errors', 'ignore_numpy_errors', 'raise_numpy_errors',
+ 'print_numpy_errors', 'warn_numpy_errors', 'ignore_python_warnings',
+ 'batch', 'is_openimageio_installed', 'is_iterable', 'is_string',
+ 'is_numeric', 'is_integer', 'filter_kwargs'
+]
+__all__ += [
+ 'as_numeric', 'as_namedtuple', 'closest', 'normalise_maximum', 'interval',
+ 'is_uniform', 'in_array', 'tstack', 'tsplit', 'row_as_diagonal',
+ 'dot_vector', 'dot_matrix', 'orient', 'centroid', 'linear_conversion'
+]
+__all__ += [
+ 'ArbitraryPrecisionMapping', 'Lookup', 'Structure',
+ 'CaseInsensitiveMapping'
+]
__all__ += ['ColourWarning', 'message_box', 'warning', 'filter_warnings']
diff --git a/colour/utilities/array.py b/colour/utilities/array.py
index fa045d227e..175e661379 100644
--- a/colour/utilities/array.py
+++ b/colour/utilities/array.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Array Utilities
===============
@@ -11,6 +10,7 @@
from __future__ import division, unicode_literals
import numpy as np
+from collections import Mapping
from colour.constants import EPSILON
@@ -21,20 +21,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['as_numeric',
- 'closest',
- 'normalise_maximum',
- 'interval',
- 'is_uniform',
- 'in_array',
- 'tstack',
- 'tsplit',
- 'row_as_diagonal',
- 'dot_vector',
- 'dot_matrix',
- 'orient',
- 'centroid',
- 'linear_conversion']
+__all__ = [
+ 'as_numeric', 'as_namedtuple', 'closest', 'normalise_maximum', 'interval',
+ 'is_uniform', 'in_array', 'tstack', 'tsplit', 'row_as_diagonal',
+ 'dot_vector', 'dot_matrix', 'orient', 'centroid', 'linear_conversion'
+]
def as_numeric(a, type_=np.float_):
@@ -72,6 +63,53 @@ def as_numeric(a, type_=np.float_):
return a
+def as_namedtuple(a, named_tuple):
+ """
+ Converts given :math:`a` variable to given *namedtuple* class instance.
+
+ :math:`a` can be either a *Numpy* structured array, a *namedtuple*,
+ a *mapping*, or an *array_like* object. The definition will attempt to
+ convert it to given *namedtuple*.
+
+ Parameters
+ ----------
+ a : object
+ Variable to convert.
+ named_tuple : namedtuple
+ *namedtuple* class.
+
+ Returns
+ -------
+ namedtuple
+ math:`a` variable converted to *namedtuple*.
+
+ Examples
+ --------
+ >>> from collections import namedtuple
+ >>> a_a = 1
+ >>> a_b = 2
+ >>> a_c = 3
+ >>> NamedTuple = namedtuple('NamedTuple', 'a b c')
+ >>> as_namedtuple(NamedTuple(a=1, b=2, c=3), NamedTuple)
+ NamedTuple(a=1, b=2, c=3)
+ >>> as_namedtuple({'a': a_a, 'b': a_b, 'c': a_c}, NamedTuple)
+ NamedTuple(a=1, b=2, c=3)
+ >>> as_namedtuple([a_a, a_b, a_c], NamedTuple)
+ NamedTuple(a=1, b=2, c=3)
+ """
+
+ if isinstance(a, np.ndarray):
+ if a.dtype.fields is not None:
+ a = {field: a[field] for field in a.dtype.fields}
+
+ if isinstance(a, named_tuple):
+ return a
+ elif isinstance(a, Mapping):
+ return named_tuple(**a)
+ else:
+ return named_tuple(*a)
+
+
def closest(a, b):
"""
Returns closest :math:`a` variable element to reference :math:`b` variable.
@@ -638,5 +676,4 @@ def linear_conversion(a, old_range, new_range):
in_min, in_max = tsplit(old_range)
out_min, out_max = tsplit(new_range)
- return (((a - in_min) / (in_max - in_min)) *
- (out_max - out_min) + out_min)
+ return ((a - in_min) / (in_max - in_min)) * (out_max - out_min) + out_min
diff --git a/colour/utilities/common.py b/colour/utilities/common.py
index ae9645d757..8a33fabd2c 100644
--- a/colour/utilities/common.py
+++ b/colour/utilities/common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Common Utilities
================
@@ -26,19 +25,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['handle_numpy_errors',
- 'ignore_numpy_errors',
- 'raise_numpy_errors',
- 'print_numpy_errors',
- 'warn_numpy_errors',
- 'ignore_python_warnings',
- 'batch',
- 'is_openimageio_installed',
- 'is_iterable',
- 'is_string',
- 'is_numeric',
- 'is_integer',
- 'filter_kwargs']
+__all__ = [
+ 'handle_numpy_errors', 'ignore_numpy_errors', 'raise_numpy_errors',
+ 'print_numpy_errors', 'warn_numpy_errors', 'ignore_python_warnings',
+ 'batch', 'is_openimageio_installed', 'is_iterable', 'is_string',
+ 'is_numeric', 'is_integer', 'filter_kwargs'
+]
def handle_numpy_errors(**kwargs):
@@ -270,8 +262,8 @@ def is_numeric(a):
False
"""
- return isinstance(a, (int, float, complex,
- np.integer, np.floating, np.complex))
+ return isinstance(a, (int, float, complex, np.integer, np.floating,
+ np.complex))
def is_integer(a):
diff --git a/colour/utilities/data_structures.py b/colour/utilities/data_structures.py
index 35279d2c84..6993140fe3 100644
--- a/colour/utilities/data_structures.py
+++ b/colour/utilities/data_structures.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Data Structures
===============
@@ -27,10 +26,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ArbitraryPrecisionMapping',
- 'Structure',
- 'Lookup',
- 'CaseInsensitiveMapping']
+__all__ = [
+ 'ArbitraryPrecisionMapping', 'Structure', 'Lookup',
+ 'CaseInsensitiveMapping'
+]
class ArbitraryPrecisionMapping(MutableMapping):
@@ -140,7 +139,7 @@ def key_decimals(self, value):
if value is not None:
assert isinstance(value, int), (
'"{0}" attribute: "{1}" is not a "int" instance!').format(
- 'key_decimals', value)
+ 'key_decimals', value)
self._key_decimals = value
def _round(self, item):
diff --git a/colour/utilities/tests/tests_array.py b/colour/utilities/tests/tests_array.py
index 6e9740dc61..3eed8446b6 100644
--- a/colour/utilities/tests/tests_array.py
+++ b/colour/utilities/tests/tests_array.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.utilities.array` module.
"""
@@ -9,22 +8,12 @@
import numpy as np
import unittest
+from collections import namedtuple
from colour.utilities import (
- as_numeric,
- closest,
- normalise_maximum,
- interval,
- is_uniform,
- in_array,
- tstack,
- tsplit,
- row_as_diagonal,
- dot_vector,
- dot_matrix,
- orient,
- centroid,
- linear_conversion)
+ as_numeric, as_namedtuple, closest, normalise_maximum, interval,
+ is_uniform, in_array, tstack, tsplit, row_as_diagonal, dot_vector,
+ dot_matrix, orient, centroid, linear_conversion)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -33,20 +22,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestAsNumeric',
- 'TestClosest',
- 'TestNormaliseMaximum',
- 'TestInterval',
- 'TestIsUniform',
- 'TestInArray',
- 'TestTstack',
- 'TestTsplit',
- 'TestRowAsDiagonal',
- 'TestDotVector',
- 'TestDotMatrix',
- 'TestOrient',
- 'TestCentroid',
- 'TestLinearConversion']
+__all__ = [
+ 'TestAsNumeric', 'TestAsNametuple', 'TestClosest', 'TestNormaliseMaximum',
+ 'TestInterval', 'TestIsUniform', 'TestInArray', 'TestTstack', 'TestTsplit',
+ 'TestRowAsDiagonal', 'TestDotVector', 'TestDotMatrix', 'TestOrient',
+ 'TestCentroid', 'TestLinearConversion'
+]
class TestAsNumeric(unittest.TestCase):
@@ -64,14 +45,54 @@ def test_as_numeric(self):
self.assertEqual(as_numeric(np.array([1])), 1)
- np.testing.assert_almost_equal(as_numeric(np.array([1, 2, 3])),
- np.array([1, 2, 3]))
+ np.testing.assert_almost_equal(
+ as_numeric(np.array([1, 2, 3])), np.array([1, 2, 3]))
self.assertIsInstance(as_numeric(1), np.float_)
self.assertIsInstance(as_numeric(1, int), int)
+class TestAsNametuple(unittest.TestCase):
+ """
+ Defines :func:`colour.utilities.array.as_namedtuple` definition unit tests
+ methods.
+ """
+
+ def test_as_namedtuple(self):
+ """
+ Tests :func:`colour.utilities.array.as_namedtuple` definition.
+ """
+
+ NamedTuple = namedtuple('NamedTuple', 'a b c')
+
+ a_a = np.ones(3)
+ a_b = np.ones(3) + 1
+ a_c = np.ones(3) + 2
+
+ named_tuple = NamedTuple(a_a, a_b, a_c)
+
+ self.assertEqual(named_tuple, as_namedtuple(named_tuple, NamedTuple))
+
+ self.assertEqual(named_tuple,
+ as_namedtuple({
+ 'a': a_a,
+ 'b': a_b,
+ 'c': a_c
+ }, NamedTuple))
+
+ self.assertEqual(named_tuple,
+ as_namedtuple([a_a, a_b, a_c], NamedTuple))
+
+ a_r = np.array(
+ [tuple(a) for a in np.transpose((a_a, a_b, a_c)).tolist()],
+ dtype=[(str('a'), str('f8')),
+ (str('b'), str('f8')),
+ (str('c'), str('f8'))]) # yapf: disable
+ np.testing.assert_array_equal(
+ np.array(named_tuple), np.array(as_namedtuple(a_r, NamedTuple)))
+
+
class TestClosest(unittest.TestCase):
"""
Defines :func:`colour.utilities.array.closest` definition unit tests
@@ -83,12 +104,13 @@ def test_closest(self):
Tests :func:`colour.utilities.array.closest` definition.
"""
- a = np.array([24.31357115,
- 63.62396289,
- 55.71528816,
- 62.70988028,
- 46.84480573,
- 25.40026416])
+ a = np.array(
+ [24.31357115,
+ 63.62396289,
+ 55.71528816,
+ 62.70988028,
+ 46.84480573,
+ 25.40026416]) # yapf: disable
self.assertEqual(closest(a, 63.05), 62.70988028)
@@ -109,36 +131,38 @@ def test_normalise_maximum(self):
"""
np.testing.assert_almost_equal(
- normalise_maximum(
- np.array([0.11518475, 0.10080000, 0.05089373])),
+ normalise_maximum(np.array([0.11518475, 0.10080000, 0.05089373])),
np.array([1.00000000, 0.87511585, 0.4418443]),
decimal=7)
np.testing.assert_almost_equal(
normalise_maximum(
- np.array([[0.11518475, 0.10080000, 0.05089373],
- [0.07049534, 0.10080000, 0.09558313],
- [0.17501358, 0.38818795, 0.32161955]])),
- np.array([[0.29672418, 0.25966803, 0.13110589],
- [0.18160105, 0.25966803, 0.246229],
- [0.45084753, 1.00000000, 0.82851503]]),
- decimal=7)
+ np.array(
+ [[0.11518475, 0.10080000, 0.05089373],
+ [0.07049534, 0.10080000, 0.09558313],
+ [0.17501358, 0.38818795, 0.32161955]])),
+ np.array(
+ [[0.29672418, 0.25966803, 0.13110589],
+ [0.18160105, 0.25966803, 0.246229],
+ [0.45084753, 1.00000000, 0.82851503]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
normalise_maximum(
- np.array([[0.11518475, 0.10080000, 0.05089373],
- [0.07049534, 0.10080000, 0.09558313],
- [0.17501358, 0.38818795, 0.32161955]]),
+ np.array(
+ [[0.11518475, 0.10080000, 0.05089373],
+ [0.07049534, 0.10080000, 0.09558313],
+ [0.17501358, 0.38818795, 0.32161955]]),
axis=-1),
- np.array([[1.00000000, 0.87511585, 0.4418443],
- [0.69935852, 1.00000000, 0.94824533],
- [0.45084753, 1.00000000, 0.82851503]]),
- decimal=7)
+ np.array(
+ [[1.00000000, 0.87511585, 0.4418443],
+ [0.69935852, 1.00000000, 0.94824533],
+ [0.45084753, 1.00000000, 0.82851503]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
normalise_maximum(
- np.array([0.11518475, 0.10080000, 0.05089373]),
- factor=10),
+ np.array([0.11518475, 0.10080000, 0.05089373]), factor=10),
np.array([10.00000000, 8.75115850, 4.4184434]),
decimal=7)
@@ -150,8 +174,7 @@ def test_normalise_maximum(self):
np.testing.assert_almost_equal(
normalise_maximum(
- np.array([-0.11518475, -0.10080000, 0.05089373]),
- clip=False),
+ np.array([-0.11518475, -0.10080000, 0.05089373]), clip=False),
np.array([-2.26324048, -1.98059761, 1.00000000]),
decimal=7)
@@ -168,12 +191,10 @@ def test_interval(self):
"""
np.testing.assert_almost_equal(
- interval(range(0, 10, 2)),
- np.array([2]))
+ interval(range(0, 10, 2)), np.array([2]))
np.testing.assert_almost_equal(
- interval([1, 2, 3, 4, 6, 6.5]),
- np.array([0.5, 1, 2]))
+ interval([1, 2, 3, 4, 6, 6.5]), np.array([0.5, 1, 2]))
class TestIsUniform(unittest.TestCase):
@@ -205,20 +226,17 @@ def test_in_array(self):
self.assertTrue(
np.array_equal(
- in_array(np.array([0.50, 0.60]),
- np.linspace(0, 10, 101)),
+ in_array(np.array([0.50, 0.60]), np.linspace(0, 10, 101)),
np.array([True, True])))
self.assertFalse(
np.array_equal(
- in_array(np.array([0.50, 0.61]),
- np.linspace(0, 10, 101)),
+ in_array(np.array([0.50, 0.61]), np.linspace(0, 10, 101)),
np.array([True, True])))
self.assertTrue(
np.array_equal(
- in_array(np.array([[0.50], [0.60]]),
- np.linspace(0, 10, 101)),
+ in_array(np.array([[0.50], [0.60]]), np.linspace(0, 10, 101)),
np.array([[True], [True]])))
def test_n_dimensional_in_array(self):
@@ -228,18 +246,16 @@ def test_n_dimensional_in_array(self):
"""
np.testing.assert_almost_equal(
- in_array(np.array([0.50, 0.60]),
- np.linspace(0, 10, 101)).shape,
+ in_array(np.array([0.50, 0.60]), np.linspace(0, 10, 101)).shape,
np.array([2]))
np.testing.assert_almost_equal(
- in_array(np.array([[0.50, 0.60]]),
- np.linspace(0, 10, 101)).shape,
+ in_array(np.array([[0.50, 0.60]]), np.linspace(0, 10, 101)).shape,
np.array([1, 2]))
np.testing.assert_almost_equal(
- in_array(np.array([[0.50], [0.60]]),
- np.linspace(0, 10, 101)).shape,
+ in_array(np.array([[0.50], [0.60]]), np.linspace(0, 10,
+ 101)).shape,
np.array([2, 1]))
@@ -255,39 +271,40 @@ def test_tstack(self):
"""
a = 0
- np.testing.assert_almost_equal(
- tstack((a, a, a)),
- np.array([0, 0, 0]))
+ np.testing.assert_almost_equal(tstack((a, a, a)), np.array([0, 0, 0]))
a = np.arange(0, 6)
np.testing.assert_almost_equal(
tstack((a, a, a)),
- np.array([[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2],
- [3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]]))
+ np.array(
+ [[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2],
+ [3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]])) # yapf: disable
a = np.reshape(a, (1, 6))
np.testing.assert_almost_equal(
tstack((a, a, a)),
- np.array([[[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2],
- [3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]]]))
+ np.array(
+ [[[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2],
+ [3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]]])) # yapf: disable
a = np.reshape(a, (1, 2, 3))
np.testing.assert_almost_equal(
tstack((a, a, a)),
- np.array([[[[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2]],
- [[3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]]]]))
+ np.array(
+ [[[[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2]],
+ [[3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]]]])) # yapf: disable
class TestTsplit(unittest.TestCase):
@@ -302,46 +319,51 @@ def test_tsplit(self):
"""
a = np.array([0, 0, 0])
- np.testing.assert_almost_equal(tsplit(a),
- np.array([0, 0, 0]))
- a = np.array([[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2],
- [3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]])
+ np.testing.assert_almost_equal(tsplit(a), np.array([0, 0, 0]))
+ a = np.array(
+ [[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2],
+ [3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]]) # yapf: disable
np.testing.assert_almost_equal(
tsplit(a),
- np.array([[0, 1, 2, 3, 4, 5],
- [0, 1, 2, 3, 4, 5],
- [0, 1, 2, 3, 4, 5]]))
-
- a = np.array([[[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2],
- [3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]]])
+ np.array(
+ [[0, 1, 2, 3, 4, 5],
+ [0, 1, 2, 3, 4, 5],
+ [0, 1, 2, 3, 4, 5]])) # yapf: disable
+
+ a = np.array(
+ [[[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2],
+ [3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]]]) # yapf: disable
np.testing.assert_almost_equal(
tsplit(a),
- np.array([[[0, 1, 2, 3, 4, 5]],
- [[0, 1, 2, 3, 4, 5]],
- [[0, 1, 2, 3, 4, 5]]]))
-
- a = np.array([[[[0, 0, 0],
- [1, 1, 1],
- [2, 2, 2]],
- [[3, 3, 3],
- [4, 4, 4],
- [5, 5, 5]]]])
+ np.array(
+ [[[0, 1, 2, 3, 4, 5]],
+ [[0, 1, 2, 3, 4, 5]],
+ [[0, 1, 2, 3, 4, 5]]])) # yapf: disable
+
+ a = np.array(
+ [[[[0, 0, 0],
+ [1, 1, 1],
+ [2, 2, 2]],
+ [[3, 3, 3],
+ [4, 4, 4],
+ [5, 5, 5]]]]) # yapf: disable
np.testing.assert_almost_equal(
tsplit(a),
- np.array([[[[0, 1, 2],
- [3, 4, 5]]],
- [[[0, 1, 2],
- [3, 4, 5]]],
- [[[0, 1, 2],
- [3, 4, 5]]]]))
+ np.array(
+ [[[[0, 1, 2],
+ [3, 4, 5]]],
+ [[[0, 1, 2],
+ [3, 4, 5]]],
+ [[[0, 1, 2],
+ [3, 4, 5]]]])) # yapf: disable
class TestRowAsDiagonal(unittest.TestCase):
@@ -356,26 +378,28 @@ def test_row_as_diagonal(self):
"""
np.testing.assert_almost_equal(
- row_as_diagonal(np.array([[0.25891593, 0.07299478, 0.36586996],
- [0.30851087, 0.37131459, 0.16274825],
- [0.71061831, 0.67718718, 0.09562581],
- [0.71588836, 0.76772047, 0.15476079],
- [0.92985142, 0.22263399, 0.88027331]])),
- np.array([[[0.25891593, 0.00000000, 0.00000000],
- [0.00000000, 0.07299478, 0.00000000],
- [0.00000000, 0.00000000, 0.36586996]],
- [[0.30851087, 0.00000000, 0.00000000],
- [0.00000000, 0.37131459, 0.00000000],
- [0.00000000, 0.00000000, 0.16274825]],
- [[0.71061831, 0.00000000, 0.00000000],
- [0.00000000, 0.67718718, 0.00000000],
- [0.00000000, 0.00000000, 0.09562581]],
- [[0.71588836, 0.00000000, 0.00000000],
- [0.00000000, 0.76772047, 0.00000000],
- [0.00000000, 0.00000000, 0.15476079]],
- [[0.92985142, 0.00000000, 0.00000000],
- [0.00000000, 0.22263399, 0.00000000],
- [0.00000000, 0.00000000, 0.88027331]]]))
+ row_as_diagonal(np.array(
+ [[0.25891593, 0.07299478, 0.36586996],
+ [0.30851087, 0.37131459, 0.16274825],
+ [0.71061831, 0.67718718, 0.09562581],
+ [0.71588836, 0.76772047, 0.15476079],
+ [0.92985142, 0.22263399, 0.88027331]])),
+ np.array(
+ [[[0.25891593, 0.00000000, 0.00000000],
+ [0.00000000, 0.07299478, 0.00000000],
+ [0.00000000, 0.00000000, 0.36586996]],
+ [[0.30851087, 0.00000000, 0.00000000],
+ [0.00000000, 0.37131459, 0.00000000],
+ [0.00000000, 0.00000000, 0.16274825]],
+ [[0.71061831, 0.00000000, 0.00000000],
+ [0.00000000, 0.67718718, 0.00000000],
+ [0.00000000, 0.00000000, 0.09562581]],
+ [[0.71588836, 0.00000000, 0.00000000],
+ [0.00000000, 0.76772047, 0.00000000],
+ [0.00000000, 0.00000000, 0.15476079]],
+ [[0.92985142, 0.00000000, 0.00000000],
+ [0.00000000, 0.22263399, 0.00000000],
+ [0.00000000, 0.00000000, 0.88027331]]])) # yapf: disable
class TestDotVector(unittest.TestCase):
@@ -389,9 +413,10 @@ def test_dot_vector(self):
Tests :func:`colour.utilities.array.dot_vector` definition.
"""
- m = np.array([[0.7328, 0.4296, -0.1624],
- [-0.7036, 1.6975, 0.0061],
- [0.0030, 0.0136, 0.9834]])
+ m = np.array(
+ [[0.7328, 0.4296, -0.1624],
+ [-0.7036, 1.6975, 0.0061],
+ [0.0030, 0.0136, 0.9834]]) # yapf: disable
m = np.reshape(np.tile(m, (6, 1)), (6, 3, 3))
v = np.array([0.07049534, 0.10080000, 0.09558313])
@@ -399,13 +424,14 @@ def test_dot_vector(self):
np.testing.assert_almost_equal(
dot_vector(m, v),
- np.array([[0.07943996, 0.12209054, 0.09557882],
- [0.07943996, 0.12209054, 0.09557882],
- [0.07943996, 0.12209054, 0.09557882],
- [0.07943996, 0.12209054, 0.09557882],
- [0.07943996, 0.12209054, 0.09557882],
- [0.07943996, 0.12209054, 0.09557882]]),
- decimal=7)
+ np.array(
+ [[0.07943996, 0.12209054, 0.09557882],
+ [0.07943996, 0.12209054, 0.09557882],
+ [0.07943996, 0.12209054, 0.09557882],
+ [0.07943996, 0.12209054, 0.09557882],
+ [0.07943996, 0.12209054, 0.09557882],
+ [0.07943996, 0.12209054, 0.09557882]]),
+ decimal=7) # yapf: disable
class TestDotMatrix(unittest.TestCase):
@@ -419,34 +445,36 @@ def test_dot_matrix(self):
Tests :func:`colour.utilities.array.dot_matrix` definition.
"""
- a = np.array([[0.7328, 0.4296, -0.1624],
- [-0.7036, 1.6975, 0.0061],
- [0.0030, 0.0136, 0.9834]])
+ a = np.array(
+ [[0.7328, 0.4296, -0.1624],
+ [-0.7036, 1.6975, 0.0061],
+ [0.0030, 0.0136, 0.9834]]) # yapf: disable
a = np.reshape(np.tile(a, (6, 1)), (6, 3, 3))
b = a
np.testing.assert_almost_equal(
dot_matrix(a, b),
- np.array([[[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]],
- [[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]],
- [[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]],
- [[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]],
- [[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]],
- [[0.23424208, 1.04184824, -0.27609032],
- [-1.70994078, 2.57932265, 0.13061813],
- [-0.00442036, 0.03774904, 0.96667132]]]),
- decimal=7)
+ np.array(
+ [[[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]],
+ [[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]],
+ [[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]],
+ [[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]],
+ [[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]],
+ [[0.23424208, 1.04184824, -0.27609032],
+ [-1.70994078, 2.57932265, 0.13061813],
+ [-0.00442036, 0.03774904, 0.96667132]]]),
+ decimal=7) # yapf: disable
class TestOrient(unittest.TestCase):
@@ -462,55 +490,57 @@ def test_orient(self):
a = np.tile(np.arange(5), (5, 1))
- np.testing.assert_almost_equal(
- orient(a, 'Null'),
- a,
- decimal=7)
+ np.testing.assert_almost_equal(orient(a, 'Null'), a, decimal=7)
np.testing.assert_almost_equal(
orient(a, 'Flip'),
- np.array([[4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0]]),
- decimal=7)
+ np.array(
+ [[4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
orient(a, 'Flop'),
- np.array([[0, 1, 2, 3, 4],
- [0, 1, 2, 3, 4],
- [0, 1, 2, 3, 4],
- [0, 1, 2, 3, 4],
- [0, 1, 2, 3, 4]]),
- decimal=7)
+ np.array(
+ [[0, 1, 2, 3, 4],
+ [0, 1, 2, 3, 4],
+ [0, 1, 2, 3, 4],
+ [0, 1, 2, 3, 4],
+ [0, 1, 2, 3, 4]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
orient(a, '90 CW'),
- np.array([[0, 0, 0, 0, 0],
- [1, 1, 1, 1, 1],
- [2, 2, 2, 2, 2],
- [3, 3, 3, 3, 3],
- [4, 4, 4, 4, 4]]),
- decimal=7)
+ np.array(
+ [[0, 0, 0, 0, 0],
+ [1, 1, 1, 1, 1],
+ [2, 2, 2, 2, 2],
+ [3, 3, 3, 3, 3],
+ [4, 4, 4, 4, 4]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
orient(a, '90 CCW'),
- np.array([[4, 4, 4, 4, 4],
- [3, 3, 3, 3, 3],
- [2, 2, 2, 2, 2],
- [1, 1, 1, 1, 1],
- [0, 0, 0, 0, 0]]),
- decimal=7)
+ np.array(
+ [[4, 4, 4, 4, 4],
+ [3, 3, 3, 3, 3],
+ [2, 2, 2, 2, 2],
+ [1, 1, 1, 1, 1],
+ [0, 0, 0, 0, 0]]),
+ decimal=7) # yapf: disable
np.testing.assert_almost_equal(
orient(a, '180'),
- np.array([[4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0],
- [4, 3, 2, 1, 0]]),
- decimal=7)
+ np.array(
+ [[4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0],
+ [4, 3, 2, 1, 0]]),
+ decimal=7) # yapf: disable
class TestCentroid(unittest.TestCase):
@@ -525,24 +555,16 @@ def test_centroid(self):
"""
a = np.arange(5)
- np.testing.assert_array_equal(
- centroid(a),
- np.array([3]))
+ np.testing.assert_array_equal(centroid(a), np.array([3]))
a = np.tile(a, (5, 1))
- np.testing.assert_array_equal(
- centroid(a),
- np.array([2, 3]))
+ np.testing.assert_array_equal(centroid(a), np.array([2, 3]))
a = np.tile(np.linspace(0, 1, 10), (10, 1))
- np.testing.assert_array_equal(
- centroid(a),
- np.array([4, 6]))
+ np.testing.assert_array_equal(centroid(a), np.array([4, 6]))
a = tstack((a, a, a))
- np.testing.assert_array_equal(
- centroid(a),
- np.array([4, 6, 1]))
+ np.testing.assert_array_equal(centroid(a), np.array([4, 6, 1]))
class TestLinearConversion(unittest.TestCase):
@@ -560,10 +582,18 @@ def test_linear_conversion(self):
linear_conversion(np.linspace(0, 1, 10),
np.array([0, 1]),
np.array([1, np.pi])),
- np.array([1.00000000, 1.23795474, 1.47590948, 1.71386422,
- 1.95181896, 2.18977370, 2.42772844, 2.66568318,
- 2.90363791, 3.14159265]),
- decimal=8)
+ np.array(
+ [1.00000000,
+ 1.23795474,
+ 1.47590948,
+ 1.71386422,
+ 1.95181896,
+ 2.18977370,
+ 2.42772844,
+ 2.66568318,
+ 2.90363791,
+ 3.14159265]),
+ decimal=8) # yapf: disable
if __name__ == '__main__':
diff --git a/colour/utilities/tests/tests_common.py b/colour/utilities/tests/tests_common.py
index 750efc5ce7..5e73fa1e44 100644
--- a/colour/utilities/tests/tests_common.py
+++ b/colour/utilities/tests/tests_common.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.utilities.common` module.
"""
@@ -10,13 +9,8 @@
import numpy as np
import unittest
-from colour.utilities import (
- batch,
- is_iterable,
- is_string,
- is_numeric,
- is_integer,
- filter_kwargs)
+from colour.utilities import (batch, is_iterable, is_string, is_numeric,
+ is_integer, filter_kwargs)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -25,12 +19,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestBatch',
- 'TestIsIterable',
- 'TestIsString',
- 'TestIsNumeric',
- 'TestIsInteger',
- 'TestFilterKwargs']
+__all__ = [
+ 'TestBatch', 'TestIsIterable', 'TestIsString', 'TestIsNumeric',
+ 'TestIsInteger', 'TestFilterKwargs'
+]
class TestBatch(unittest.TestCase):
@@ -46,15 +38,16 @@ def test_batch(self):
self.assertListEqual(
list(batch(tuple(range(10)))),
- [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9,)])
+ [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9,)]) # yapf: disable
self.assertListEqual(
list(batch(tuple(range(10)), 5)),
- [(0, 1, 2, 3, 4), (5, 6, 7, 8, 9)])
+ [(0, 1, 2, 3, 4), (5, 6, 7, 8, 9)]) # yapf: disable
self.assertListEqual(
list(batch(tuple(range(10)), 1)),
- [(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)])
+ [(0,), (1,), (2,), (3,), (4,),
+ (5,), (6,), (7,), (8,), (9,)]) # yapf: disable
class TestIsIterable(unittest.TestCase):
@@ -124,7 +117,7 @@ def test_is_numeric(self):
self.assertTrue(is_numeric(complex(1)))
- self.assertFalse(is_numeric((1,)))
+ self.assertFalse(is_numeric((1, )))
self.assertFalse(is_numeric([1]))
@@ -180,17 +173,12 @@ def fn_c(a, b=0, c=0):
return a, b, c
- self.assertEqual(
- 1,
- fn_a(1, **filter_kwargs(fn_a, b=2, c=3)))
+ self.assertEqual(1, fn_a(1, **filter_kwargs(fn_a, b=2, c=3)))
- self.assertTupleEqual(
- (1, 2),
- fn_b(1, **filter_kwargs(fn_b, b=2, c=3)))
+ self.assertTupleEqual((1, 2), fn_b(1, **filter_kwargs(fn_b, b=2, c=3)))
- self.assertTupleEqual(
- (1, 2, 3),
- fn_c(1, **filter_kwargs(fn_c, b=2, c=3)))
+ self.assertTupleEqual((1, 2, 3),
+ fn_c(1, **filter_kwargs(fn_c, b=2, c=3)))
if __name__ == '__main__':
diff --git a/colour/utilities/tests/tests_data_structures.py b/colour/utilities/tests/tests_data_structures.py
index 4587eaf3a3..67e7772f88 100644
--- a/colour/utilities/tests/tests_data_structures.py
+++ b/colour/utilities/tests/tests_data_structures.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.utilities.data_structures` module.
"""
@@ -10,11 +9,8 @@
import pickle
import unittest
-from colour.utilities import (
- ArbitraryPrecisionMapping,
- Structure,
- Lookup,
- CaseInsensitiveMapping)
+from colour.utilities import (ArbitraryPrecisionMapping, Structure, Lookup,
+ CaseInsensitiveMapping)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2017 - Colour Developers'
@@ -23,10 +19,10 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestArbitraryPrecisionMapping',
- 'TestStructure',
- 'TestLookup',
- 'TestCaseInsensitiveMapping']
+__all__ = [
+ 'TestArbitraryPrecisionMapping', 'TestStructure', 'TestLookup',
+ 'TestCaseInsensitiveMapping'
+]
class TestArbitraryPrecisionMapping(unittest.TestCase):
@@ -40,7 +36,7 @@ def test_required_attributes(self):
Tests presence of required attributes.
"""
- required_attributes = ('key_decimals',)
+ required_attributes = ('key_decimals', )
for attribute in required_attributes:
self.assertIn(attribute, dir(ArbitraryPrecisionMapping))
@@ -50,12 +46,8 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__setitem__',
- '__getitem__',
- '__delitem__',
- '__contains__',
- '__iter__',
- '__len__')
+ required_methods = ('__setitem__', '__getitem__', '__delitem__',
+ '__contains__', '__iter__', '__len__')
for method in required_methods:
self.assertIn(method, dir(ArbitraryPrecisionMapping))
@@ -144,13 +136,12 @@ def test__iter__(self):
data = {0.1999999998: 'Nemo', 0.2000000000: 'John'}
mapping = ArbitraryPrecisionMapping(data, key_decimals=10)
- self.assertListEqual(sorted([item for item in mapping]),
- [0.1999999998, 0.2])
+ self.assertListEqual(
+ sorted([item for item in mapping]), [0.1999999998, 0.2])
mapping = ArbitraryPrecisionMapping(data, key_decimals=7)
- self.assertListEqual(sorted([item for item in mapping]),
- [0.2])
+ self.assertListEqual(sorted([item for item in mapping]), [0.2])
def test__len__(self):
"""
@@ -179,9 +170,7 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__getattr__',
- '__setattr__',
- '__delattr__',
+ required_methods = ('__getattr__', '__setattr__', '__delattr__',
'update')
for method in required_methods:
@@ -250,8 +239,7 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('first_key_from_value',
- 'keys_from_value')
+ required_methods = ('first_key_from_value', 'keys_from_value')
for method in required_methods:
self.assertIn(method, dir(Lookup))
@@ -272,8 +260,8 @@ def test_keys_from_value(self):
"""
lookup = Lookup(John='Doe', Jane='Doe', Luke='Skywalker')
- self.assertListEqual(sorted(['Jane', 'John']),
- sorted(lookup.keys_from_value('Doe')))
+ self.assertListEqual(
+ sorted(['Jane', 'John']), sorted(lookup.keys_from_value('Doe')))
class TestCaseInsensitiveMapping(unittest.TestCase):
@@ -287,17 +275,9 @@ def test_required_methods(self):
Tests presence of required methods.
"""
- required_methods = ('__setitem__',
- '__getitem__',
- '__delitem__',
- '__contains__',
- '__iter__',
- '__len__',
- '__eq__',
- '__ne__',
- '__repr__',
- 'copy',
- 'lower_items')
+ required_methods = ('__setitem__', '__getitem__', '__delitem__',
+ '__contains__', '__iter__', '__len__', '__eq__',
+ '__ne__', '__repr__', 'copy', 'lower_items')
for method in required_methods:
self.assertIn(method, dir(CaseInsensitiveMapping))
@@ -368,8 +348,8 @@ def test__iter__(self):
"""
mapping = CaseInsensitiveMapping(John='Doe', Jane='Doe')
- self.assertListEqual(sorted([item for item in mapping]),
- ['Jane', 'John'])
+ self.assertListEqual(
+ sorted([item for item in mapping]), ['Jane', 'John'])
def test__len__(self):
"""
@@ -379,8 +359,8 @@ def test__len__(self):
self.assertEqual(len(CaseInsensitiveMapping()), 0)
- self.assertEqual(len(CaseInsensitiveMapping(John='Doe', Jane='Doe')),
- 2)
+ self.assertEqual(
+ len(CaseInsensitiveMapping(John='Doe', Jane='Doe')), 2)
def test__eq__(self):
"""
@@ -428,8 +408,9 @@ def test_lower_items(self):
mapping = CaseInsensitiveMapping(John='Doe', Jane='Doe')
- self.assertListEqual(sorted([item for item in mapping.lower_items()]),
- [('jane', 'Doe'), ('john', 'Doe')])
+ self.assertListEqual(
+ sorted([item for item in mapping.lower_items()]),
+ [('jane', 'Doe'), ('john', 'Doe')])
if __name__ == '__main__':
diff --git a/colour/utilities/verbose.py b/colour/utilities/verbose.py
index 8cc3877fc3..2bb48677c4 100644
--- a/colour/utilities/verbose.py
+++ b/colour/utilities/verbose.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Verbose
=======
@@ -21,10 +20,7 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['ColourWarning',
- 'message_box',
- 'warning',
- 'filter_warnings']
+__all__ = ['ColourWarning', 'message_box', 'warning', 'filter_warnings']
class ColourWarning(Warning):
diff --git a/colour/volume/__init__.py b/colour/volume/__init__.py
index 72f6c7b1e8..5c1a57bc78 100644
--- a/colour/volume/__init__.py
+++ b/colour/volume/__init__.py
@@ -9,12 +9,10 @@
from .mesh import is_within_mesh_volume
from .pointer_gamut import is_within_pointer_gamut
from .spectrum import is_within_visible_spectrum
-from .rgb import (
- RGB_colourspace_limits,
- RGB_colourspace_volume_MonteCarlo,
- RGB_colourspace_volume_coverage_MonteCarlo,
- RGB_colourspace_pointer_gamut_coverage_MonteCarlo,
- RGB_colourspace_visible_spectrum_coverage_MonteCarlo)
+from .rgb import (RGB_colourspace_limits, RGB_colourspace_volume_MonteCarlo,
+ RGB_colourspace_volume_coverage_MonteCarlo,
+ RGB_colourspace_pointer_gamut_coverage_MonteCarlo,
+ RGB_colourspace_visible_spectrum_coverage_MonteCarlo)
__all__ = []
__all__ += dataset.__all__
@@ -22,8 +20,9 @@
__all__ += ['is_within_mesh_volume']
__all__ += ['is_within_pointer_gamut']
__all__ += ['is_within_visible_spectrum']
-__all__ += ['RGB_colourspace_limits',
- 'RGB_colourspace_volume_MonteCarlo',
- 'RGB_colourspace_volume_coverage_MonteCarlo',
- 'RGB_colourspace_pointer_gamut_coverage_MonteCarlo',
- 'RGB_colourspace_visible_spectrum_coverage_MonteCarlo']
+__all__ += [
+ 'RGB_colourspace_limits', 'RGB_colourspace_volume_MonteCarlo',
+ 'RGB_colourspace_volume_coverage_MonteCarlo',
+ 'RGB_colourspace_pointer_gamut_coverage_MonteCarlo',
+ 'RGB_colourspace_visible_spectrum_coverage_MonteCarlo'
+]
diff --git a/colour/volume/dataset/optimal_colour_stimuli.py b/colour/volume/dataset/optimal_colour_stimuli.py
index e4dbeabd1e..b5b10a7f8a 100644
--- a/colour/volume/dataset/optimal_colour_stimuli.py
+++ b/colour/volume/dataset/optimal_colour_stimuli.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Optimal Colour Stimuli
======================
@@ -43,234 +42,234 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['A_OPTIMAL_COLOUR_STIMULI',
- 'C_OPTIMAL_COLOUR_STIMULI',
- 'D65_OPTIMAL_COLOUR_STIMULI',
- 'ILLUMINANTS_OPTIMAL_COLOUR_STIMULI']
+__all__ = [
+ 'A_OPTIMAL_COLOUR_STIMULI', 'C_OPTIMAL_COLOUR_STIMULI',
+ 'D65_OPTIMAL_COLOUR_STIMULI', 'ILLUMINANTS_OPTIMAL_COLOUR_STIMULI'
+]
-A_OPTIMAL_COLOUR_STIMULI = np.array([
- [0.0000, 0.0000, 0],
- [0.1120, 0.1985, 10],
- [0.0859, 0.2957, 10],
- [0.0549, 0.4593, 10],
- [0.0433, 0.5548, 10],
- [0.0386, 0.6764, 10],
- [0.0441, 0.7368, 10],
- [0.0578, 0.7834, 10],
- [0.0786, 0.8102, 10],
- [0.1030, 0.8188, 10],
- [0.1276, 0.8151, 10],
- [0.1510, 0.8054, 10],
- [0.7188, 0.2812, 10],
- [0.7112, 0.2773, 10],
- [0.6506, 0.2469, 10],
- [0.6015, 0.2228, 10],
- [0.5604, 0.2032, 10],
- [0.5179, 0.1839, 10],
- [0.4590, 0.1606, 10],
- [0.4302, 0.1526, 10],
- [0.3946, 0.1488, 10],
- [0.3514, 0.1519, 10],
- [0.2949, 0.1610, 10],
- [0.2452, 0.1706, 10],
- [0.2009, 0.1797, 10],
- [0.1197, 0.3185, 20],
- [0.0977, 0.4993, 20],
- [0.0929, 0.6609, 20],
- [0.1073, 0.7534, 20],
- [0.1187, 0.7744, 20],
- [0.1335, 0.7863, 20],
- [0.1505, 0.7896, 20],
- [0.1683, 0.7863, 20],
- [0.2028, 0.7690, 20],
- [0.3641, 0.6326, 20],
- [0.4206, 0.5776, 20],
- [0.7008, 0.2991, 20],
- [0.6726, 0.2834, 20],
- [0.6350, 0.2629, 20],
- [0.6020, 0.2454, 20],
- [0.5601, 0.2246, 20],
- [0.5005, 0.2027, 20],
- [0.4823, 0.2013, 20],
- [0.4532, 0.2053, 20],
- [0.4281, 0.2118, 20],
- [0.3651, 0.2320, 20],
- [0.3070, 0.2521, 20],
- [0.2500, 0.2721, 20],
- [0.1828, 0.2960, 20],
- [0.1442, 0.3923, 30],
- [0.1407, 0.4547, 30],
- [0.1393, 0.4995, 30],
- [0.1390, 0.5533, 30],
- [0.1402, 0.6008, 30],
- [0.1439, 0.6546, 30],
- [0.1535, 0.7106, 30],
- [0.1667, 0.7410, 30],
- [0.1763, 0.7503, 30],
- [0.2002, 0.7548, 30],
- [0.2403, 0.7366, 30],
- [0.6800, 0.3198, 30],
- [0.6759, 0.3173, 30],
- [0.6488, 0.3006, 30],
- [0.6208, 0.2837, 30],
- [0.5863, 0.2637, 30],
- [0.5606, 0.2500, 30],
- [0.5382, 0.2402, 30],
- [0.5168, 0.2358, 30],
- [0.4791, 0.2435, 30],
- [0.4295, 0.2636, 30],
- [0.3905, 0.2807, 30],
- [0.3290, 0.3083, 30],
- [0.2202, 0.3576, 30],
- [0.1769, 0.4360, 40],
- [0.1800, 0.5225, 40],
- [0.1881, 0.6104, 40],
- [0.1958, 0.6562, 40],
- [0.2019, 0.6791, 40],
- [0.2106, 0.6997, 40],
- [0.2314, 0.7173, 40],
- [0.2405, 0.7178, 40],
- [0.2607, 0.7118, 40],
- [0.3023, 0.6839, 40],
- [0.5021, 0.4968, 40],
- [0.6570, 0.3427, 40],
- [0.2151, 0.4588, 50],
- [0.2202, 0.5035, 50],
- [0.2303, 0.5698, 50],
- [0.2392, 0.6119, 50],
- [0.2507, 0.6483, 50],
- [0.2574, 0.6615, 50],
- [0.2660, 0.6720, 50],
- [0.2842, 0.6781, 50],
- [0.2994, 0.6742, 50],
- [0.3244, 0.6595, 50],
- [0.5025, 0.4961, 50],
- [0.6332, 0.3664, 50],
- [0.6296, 0.3635, 50],
- [0.6054, 0.3447, 50],
- [0.5803, 0.3257, 50],
- [0.5600, 0.3111, 50],
- [0.5350, 0.2957, 50],
- [0.5207, 0.2913, 50],
- [0.4996, 0.2960, 50],
- [0.4503, 0.3221, 50],
- [0.4000, 0.3511, 50],
- [0.3587, 0.3751, 50],
- [0.3105, 0.4031, 50],
- [0.2546, 0.4358, 50],
- [0.2576, 0.4662, 60],
- [0.2656, 0.5051, 60],
- [0.2702, 0.5247, 60],
- [0.2806, 0.5633, 60],
- [0.2898, 0.5910, 60],
- [0.3000, 0.6140, 60],
- [0.3192, 0.6345, 60],
- [0.3400, 0.6339, 60],
- [0.3797, 0.6090, 60],
- [0.4252, 0.5692, 60],
- [0.4923, 0.5056, 60],
- [0.5995, 0.3999, 60],
- [0.6065, 0.3871, 60],
- [0.5751, 0.3606, 60],
- [0.5508, 0.3403, 60],
- [0.5252, 0.3217, 60],
- [0.5139, 0.3168, 60],
- [0.5005, 0.3178, 60],
- [0.4761, 0.3301, 60],
- [0.4496, 0.3461, 60],
- [0.4103, 0.3705, 60],
- [0.3375, 0.4161, 60],
- [0.3124, 0.4318, 60],
- [0.2634, 0.4626, 60],
- [0.3038, 0.4616, 70],
- [0.3105, 0.4832, 70],
- [0.3202, 0.5119, 70],
- [0.3255, 0.5258, 70],
- [0.3395, 0.5580, 70],
- [0.3537, 0.5806, 70],
- [0.3810, 0.5916, 70],
- [0.3900, 0.5886, 70],
- [0.3999, 0.5835, 70],
- [0.5005, 0.4967, 70],
- [0.5690, 0.4300, 70],
- [0.5849, 0.4143, 70],
- [0.5812, 0.4106, 70],
- [0.5776, 0.4070, 70],
- [0.5706, 0.4001, 70],
- [0.5351, 0.3661, 70],
- [0.5202, 0.3530, 70],
- [0.5004, 0.3407, 70],
- [0.4904, 0.3412, 70],
- [0.4794, 0.3466, 70],
- [0.4703, 0.3519, 70],
- [0.3706, 0.4174, 70],
- [0.3501, 0.4310, 70],
- [0.3219, 0.4497, 70],
- [0.3527, 0.4480, 80],
- [0.3603, 0.4657, 80],
- [0.3803, 0.5061, 80],
- [0.4100, 0.5440, 80],
- [0.4299, 0.5467, 80],
- [0.4402, 0.5426, 80],
- [0.4598, 0.5298, 80],
- [0.4803, 0.5130, 80],
- [0.5000, 0.4954, 80],
- [0.5218, 0.4750, 80],
- [0.5419, 0.4559, 80],
- [0.5603, 0.4380, 80],
- [0.5566, 0.4338, 80],
- [0.5457, 0.4217, 80],
- [0.5190, 0.3928, 80],
- [0.5004, 0.3744, 80],
- [0.4916, 0.3672, 80],
- [0.4799, 0.3636, 80],
- [0.4751, 0.3652, 80],
- [0.4698, 0.3679, 80],
- [0.4560, 0.3767, 80],
- [0.4011, 0.4146, 80],
- [0.3805, 0.4289, 80],
- [0.3704, 0.4358, 80],
- [0.4016, 0.4288, 90],
- [0.4033, 0.4319, 90],
- [0.4081, 0.4402, 90],
- [0.4158, 0.4531, 90],
- [0.4308, 0.4756, 90],
- [0.4458, 0.4935, 90],
- [0.4552, 0.5011, 90],
- [0.4658, 0.5049, 90],
- [0.4854, 0.4999, 90],
- [0.5081, 0.4842, 90],
- [0.5228, 0.4717, 90],
- [0.5343, 0.4614, 90],
- [0.5304, 0.4565, 90],
- [0.5158, 0.4381, 90],
- [0.4987, 0.4173, 90],
- [0.4827, 0.3990, 90],
- [0.4656, 0.3859, 90],
- [0.4562, 0.3900, 90],
- [0.4420, 0.3999, 90],
- [0.4275, 0.4103, 90],
- [0.4079, 0.4244, 90],
- [0.4024, 0.4283, 90],
- [0.4250, 0.4183, 95],
- [0.4276, 0.4223, 95],
- [0.4351, 0.4339, 95],
- [0.4447, 0.4476, 95],
- [0.4550, 0.4607, 95],
- [0.4660, 0.4728, 95],
- [0.4787, 0.4823, 95],
- [0.4921, 0.4849, 95],
- [0.5032, 0.4816, 95],
- [0.5189, 0.4719, 95],
- [0.5151, 0.4667, 95],
- [0.4901, 0.4334, 95],
- [0.4740, 0.4131, 95],
- [0.4588, 0.3975, 95],
- [0.4504, 0.3999, 95],
- [0.4392, 0.4080, 95],
- [0.4294, 0.4151, 95],
- [0.4254, 0.4180, 95],
- [0.4475, 0.4075, 100]])
+A_OPTIMAL_COLOUR_STIMULI = np.array(
+ [[0.0000, 0.0000, 0],
+ [0.1120, 0.1985, 10],
+ [0.0859, 0.2957, 10],
+ [0.0549, 0.4593, 10],
+ [0.0433, 0.5548, 10],
+ [0.0386, 0.6764, 10],
+ [0.0441, 0.7368, 10],
+ [0.0578, 0.7834, 10],
+ [0.0786, 0.8102, 10],
+ [0.1030, 0.8188, 10],
+ [0.1276, 0.8151, 10],
+ [0.1510, 0.8054, 10],
+ [0.7188, 0.2812, 10],
+ [0.7112, 0.2773, 10],
+ [0.6506, 0.2469, 10],
+ [0.6015, 0.2228, 10],
+ [0.5604, 0.2032, 10],
+ [0.5179, 0.1839, 10],
+ [0.4590, 0.1606, 10],
+ [0.4302, 0.1526, 10],
+ [0.3946, 0.1488, 10],
+ [0.3514, 0.1519, 10],
+ [0.2949, 0.1610, 10],
+ [0.2452, 0.1706, 10],
+ [0.2009, 0.1797, 10],
+ [0.1197, 0.3185, 20],
+ [0.0977, 0.4993, 20],
+ [0.0929, 0.6609, 20],
+ [0.1073, 0.7534, 20],
+ [0.1187, 0.7744, 20],
+ [0.1335, 0.7863, 20],
+ [0.1505, 0.7896, 20],
+ [0.1683, 0.7863, 20],
+ [0.2028, 0.7690, 20],
+ [0.3641, 0.6326, 20],
+ [0.4206, 0.5776, 20],
+ [0.7008, 0.2991, 20],
+ [0.6726, 0.2834, 20],
+ [0.6350, 0.2629, 20],
+ [0.6020, 0.2454, 20],
+ [0.5601, 0.2246, 20],
+ [0.5005, 0.2027, 20],
+ [0.4823, 0.2013, 20],
+ [0.4532, 0.2053, 20],
+ [0.4281, 0.2118, 20],
+ [0.3651, 0.2320, 20],
+ [0.3070, 0.2521, 20],
+ [0.2500, 0.2721, 20],
+ [0.1828, 0.2960, 20],
+ [0.1442, 0.3923, 30],
+ [0.1407, 0.4547, 30],
+ [0.1393, 0.4995, 30],
+ [0.1390, 0.5533, 30],
+ [0.1402, 0.6008, 30],
+ [0.1439, 0.6546, 30],
+ [0.1535, 0.7106, 30],
+ [0.1667, 0.7410, 30],
+ [0.1763, 0.7503, 30],
+ [0.2002, 0.7548, 30],
+ [0.2403, 0.7366, 30],
+ [0.6800, 0.3198, 30],
+ [0.6759, 0.3173, 30],
+ [0.6488, 0.3006, 30],
+ [0.6208, 0.2837, 30],
+ [0.5863, 0.2637, 30],
+ [0.5606, 0.2500, 30],
+ [0.5382, 0.2402, 30],
+ [0.5168, 0.2358, 30],
+ [0.4791, 0.2435, 30],
+ [0.4295, 0.2636, 30],
+ [0.3905, 0.2807, 30],
+ [0.3290, 0.3083, 30],
+ [0.2202, 0.3576, 30],
+ [0.1769, 0.4360, 40],
+ [0.1800, 0.5225, 40],
+ [0.1881, 0.6104, 40],
+ [0.1958, 0.6562, 40],
+ [0.2019, 0.6791, 40],
+ [0.2106, 0.6997, 40],
+ [0.2314, 0.7173, 40],
+ [0.2405, 0.7178, 40],
+ [0.2607, 0.7118, 40],
+ [0.3023, 0.6839, 40],
+ [0.5021, 0.4968, 40],
+ [0.6570, 0.3427, 40],
+ [0.2151, 0.4588, 50],
+ [0.2202, 0.5035, 50],
+ [0.2303, 0.5698, 50],
+ [0.2392, 0.6119, 50],
+ [0.2507, 0.6483, 50],
+ [0.2574, 0.6615, 50],
+ [0.2660, 0.6720, 50],
+ [0.2842, 0.6781, 50],
+ [0.2994, 0.6742, 50],
+ [0.3244, 0.6595, 50],
+ [0.5025, 0.4961, 50],
+ [0.6332, 0.3664, 50],
+ [0.6296, 0.3635, 50],
+ [0.6054, 0.3447, 50],
+ [0.5803, 0.3257, 50],
+ [0.5600, 0.3111, 50],
+ [0.5350, 0.2957, 50],
+ [0.5207, 0.2913, 50],
+ [0.4996, 0.2960, 50],
+ [0.4503, 0.3221, 50],
+ [0.4000, 0.3511, 50],
+ [0.3587, 0.3751, 50],
+ [0.3105, 0.4031, 50],
+ [0.2546, 0.4358, 50],
+ [0.2576, 0.4662, 60],
+ [0.2656, 0.5051, 60],
+ [0.2702, 0.5247, 60],
+ [0.2806, 0.5633, 60],
+ [0.2898, 0.5910, 60],
+ [0.3000, 0.6140, 60],
+ [0.3192, 0.6345, 60],
+ [0.3400, 0.6339, 60],
+ [0.3797, 0.6090, 60],
+ [0.4252, 0.5692, 60],
+ [0.4923, 0.5056, 60],
+ [0.5995, 0.3999, 60],
+ [0.6065, 0.3871, 60],
+ [0.5751, 0.3606, 60],
+ [0.5508, 0.3403, 60],
+ [0.5252, 0.3217, 60],
+ [0.5139, 0.3168, 60],
+ [0.5005, 0.3178, 60],
+ [0.4761, 0.3301, 60],
+ [0.4496, 0.3461, 60],
+ [0.4103, 0.3705, 60],
+ [0.3375, 0.4161, 60],
+ [0.3124, 0.4318, 60],
+ [0.2634, 0.4626, 60],
+ [0.3038, 0.4616, 70],
+ [0.3105, 0.4832, 70],
+ [0.3202, 0.5119, 70],
+ [0.3255, 0.5258, 70],
+ [0.3395, 0.5580, 70],
+ [0.3537, 0.5806, 70],
+ [0.3810, 0.5916, 70],
+ [0.3900, 0.5886, 70],
+ [0.3999, 0.5835, 70],
+ [0.5005, 0.4967, 70],
+ [0.5690, 0.4300, 70],
+ [0.5849, 0.4143, 70],
+ [0.5812, 0.4106, 70],
+ [0.5776, 0.4070, 70],
+ [0.5706, 0.4001, 70],
+ [0.5351, 0.3661, 70],
+ [0.5202, 0.3530, 70],
+ [0.5004, 0.3407, 70],
+ [0.4904, 0.3412, 70],
+ [0.4794, 0.3466, 70],
+ [0.4703, 0.3519, 70],
+ [0.3706, 0.4174, 70],
+ [0.3501, 0.4310, 70],
+ [0.3219, 0.4497, 70],
+ [0.3527, 0.4480, 80],
+ [0.3603, 0.4657, 80],
+ [0.3803, 0.5061, 80],
+ [0.4100, 0.5440, 80],
+ [0.4299, 0.5467, 80],
+ [0.4402, 0.5426, 80],
+ [0.4598, 0.5298, 80],
+ [0.4803, 0.5130, 80],
+ [0.5000, 0.4954, 80],
+ [0.5218, 0.4750, 80],
+ [0.5419, 0.4559, 80],
+ [0.5603, 0.4380, 80],
+ [0.5566, 0.4338, 80],
+ [0.5457, 0.4217, 80],
+ [0.5190, 0.3928, 80],
+ [0.5004, 0.3744, 80],
+ [0.4916, 0.3672, 80],
+ [0.4799, 0.3636, 80],
+ [0.4751, 0.3652, 80],
+ [0.4698, 0.3679, 80],
+ [0.4560, 0.3767, 80],
+ [0.4011, 0.4146, 80],
+ [0.3805, 0.4289, 80],
+ [0.3704, 0.4358, 80],
+ [0.4016, 0.4288, 90],
+ [0.4033, 0.4319, 90],
+ [0.4081, 0.4402, 90],
+ [0.4158, 0.4531, 90],
+ [0.4308, 0.4756, 90],
+ [0.4458, 0.4935, 90],
+ [0.4552, 0.5011, 90],
+ [0.4658, 0.5049, 90],
+ [0.4854, 0.4999, 90],
+ [0.5081, 0.4842, 90],
+ [0.5228, 0.4717, 90],
+ [0.5343, 0.4614, 90],
+ [0.5304, 0.4565, 90],
+ [0.5158, 0.4381, 90],
+ [0.4987, 0.4173, 90],
+ [0.4827, 0.3990, 90],
+ [0.4656, 0.3859, 90],
+ [0.4562, 0.3900, 90],
+ [0.4420, 0.3999, 90],
+ [0.4275, 0.4103, 90],
+ [0.4079, 0.4244, 90],
+ [0.4024, 0.4283, 90],
+ [0.4250, 0.4183, 95],
+ [0.4276, 0.4223, 95],
+ [0.4351, 0.4339, 95],
+ [0.4447, 0.4476, 95],
+ [0.4550, 0.4607, 95],
+ [0.4660, 0.4728, 95],
+ [0.4787, 0.4823, 95],
+ [0.4921, 0.4849, 95],
+ [0.5032, 0.4816, 95],
+ [0.5189, 0.4719, 95],
+ [0.5151, 0.4667, 95],
+ [0.4901, 0.4334, 95],
+ [0.4740, 0.4131, 95],
+ [0.4588, 0.3975, 95],
+ [0.4504, 0.3999, 95],
+ [0.4392, 0.4080, 95],
+ [0.4294, 0.4151, 95],
+ [0.4254, 0.4180, 95],
+ [0.4475, 0.4075, 100]]) # yapf: disable
"""
*CIE Standard Illuminant A* *Optimal Colour Stimuli*.
@@ -283,206 +282,206 @@
Wiley. ISBN:978-0471399186
"""
-C_OPTIMAL_COLOUR_STIMULI = np.array([
- [0.0000, 0.0000, 0],
- [0.1363, 0.0692, 10],
- [0.1308, 0.0792, 10],
- [0.0808, 0.2132, 10],
- [0.0371, 0.4135, 10],
- [0.0251, 0.5007, 10],
- [0.0181, 0.5893, 10],
- [0.0181, 0.6718, 10],
- [0.0276, 0.7416, 10],
- [0.0434, 0.7890, 10],
- [0.0687, 0.8178, 10],
- [0.0996, 0.8252, 10],
- [0.7040, 0.2946, 10],
- [0.5126, 0.1913, 10],
- [0.3424, 0.1028, 10],
- [0.2813, 0.0771, 10],
- [0.2518, 0.0693, 10],
- [0.2378, 0.0674, 10],
- [0.2230, 0.0663, 10],
- [0.1868, 0.0664, 10],
- [0.1628, 0.0676, 10],
- [0.1289, 0.1268, 20],
- [0.1230, 0.1438, 20],
- [0.1027, 0.2152, 20],
- [0.0762, 0.3420, 20],
- [0.0572, 0.4775, 20],
- [0.0500, 0.6250, 20],
- [0.0637, 0.7410, 20],
- [0.0787, 0.7747, 20],
- [0.0992, 0.7975, 20],
- [0.1239, 0.8055, 20],
- [0.1518, 0.7983, 20],
- [0.6717, 0.3273, 20],
- [0.5542, 0.2513, 20],
- [0.4077, 0.1603, 20],
- [0.3463, 0.1263, 20],
- [0.3195, 0.1150, 20],
- [0.3075, 0.1122, 20],
- [0.2968, 0.1104, 20],
- [0.2586, 0.1104, 20],
- [0.1918, 0.1182, 20],
- [0.1302, 0.1764, 30],
- [0.1255, 0.1980, 30],
- [0.1092, 0.2845, 30],
- [0.0909, 0.4178, 30],
- [0.0855, 0.5500, 30],
- [0.0836, 0.6110, 30],
- [0.0911, 0.6700, 30],
- [0.0975, 0.7140, 30],
- [0.1100, 0.7487, 30],
- [0.1294, 0.7700, 30],
- [0.1462, 0.7806, 30],
- [0.1698, 0.7793, 30],
- [0.1957, 0.7696, 30],
- [0.6390, 0.3613, 30],
- [0.5530, 0.2950, 30],
- [0.4300, 0.2040, 30],
- [0.3733, 0.1658, 30],
- [0.3485, 0.1528, 30],
- [0.3300, 0.1462, 30],
- [0.3140, 0.1443, 30],
- [0.3045, 0.1447, 30],
- [0.2643, 0.1503, 30],
- [0.1383, 0.2180, 40],
- [0.1350, 0.2425, 40],
- [0.1246, 0.3363, 40],
- [0.1179, 0.4720, 40],
- [0.1343, 0.6800, 40],
- [0.1596, 0.7377, 40],
- [0.1766, 0.7470, 40],
- [0.1952, 0.7500, 40],
- [0.2437, 0.7305, 40],
- [0.2964, 0.6903, 40],
- [0.3200, 0.6357, 40],
- [0.6065, 0.3925, 40],
- [0.5395, 0.3320, 40],
- [0.4347, 0.2410, 40],
- [0.3833, 0.2000, 40],
- [0.3607, 0.1851, 40],
- [0.3527, 0.1807, 40],
- [0.3453, 0.1777, 40],
- [0.3325, 0.1752, 40],
- [0.3260, 0.1750, 40],
- [0.3003, 0.1783, 40],
- [0.2727, 0.1844, 40],
- [0.2276, 0.1955, 40],
- [0.1510, 0.2520, 50],
- [0.1497, 0.2785, 50],
- [0.1462, 0.3736, 50],
- [0.1490, 0.5017, 50],
- [0.1589, 0.5990, 50],
- [0.1677, 0.6411, 50],
- [0.1782, 0.6750, 50],
- [0.1913, 0.6980, 50],
- [0.2222, 0.7185, 50],
- [0.2867, 0.6936, 50],
- [0.3412, 0.6493, 50],
- [0.4066, 0.5890, 50],
- [0.5759, 0.4231, 50],
- [0.5207, 0.3655, 50],
- [0.4304, 0.2737, 50],
- [0.3844, 0.2309, 50],
- [0.3489, 0.2071, 50],
- [0.3347, 0.2026, 50],
- [0.3175, 0.2046, 50],
- [0.3000, 0.2092, 50],
- [0.2746, 0.2162, 50],
- [0.2024, 0.2373, 50],
- [0.1694, 0.2797, 60],
- [0.1698, 0.3065, 60],
- [0.1732, 0.3995, 60],
- [0.1847, 0.5156, 60],
- [0.2011, 0.5982, 60],
- [0.2117, 0.6316, 60],
- [0.2238, 0.6567, 60],
- [0.2525, 0.6823, 60],
- [0.2694, 0.6840, 60],
- [0.3344, 0.6502, 60],
- [0.3908, 0.6016, 60],
- [0.4605, 0.5364, 60],
- [0.5470, 0.4514, 60],
- [0.5004, 0.3963, 60],
- [0.4217, 0.3042, 60],
- [0.3803, 0.2593, 60],
- [0.3500, 0.2330, 60],
- [0.3376, 0.2284, 60],
- [0.3238, 0.2294, 60],
- [0.3132, 0.2322, 60],
- [0.2593, 0.2497, 60],
- [0.1932, 0.3005, 70],
- [0.1953, 0.3263, 70],
- [0.2064, 0.4136, 70],
- [0.2261, 0.5163, 70],
- [0.2495, 0.5835, 70],
- [0.2733, 0.6282, 70],
- [0.3063, 0.6432, 70],
- [0.3213, 0.6415, 70],
- [0.3408, 0.6316, 70],
- [0.3876, 0.5999, 70],
- [0.5187, 0.4780, 70],
- [0.4795, 0.4243, 70],
- [0.4107, 0.3319, 70],
- [0.3566, 0.2675, 70],
- [0.3460, 0.2578, 70],
- [0.3356, 0.2525, 70],
- [0.3185, 0.2544, 70],
- [0.2875, 0.2651, 70],
- [0.2290, 0.2868, 70],
- [0.2236, 0.3120, 80],
- [0.2282, 0.3382, 80],
- [0.2465, 0.4183, 80],
- [0.2743, 0.5056, 80],
- [0.2991, 0.5591, 80],
- [0.3136, 0.5784, 80],
- [0.3284, 0.5913, 80],
- [0.3570, 0.5932, 80],
- [0.3785, 0.5912, 80],
- [0.4493, 0.5433, 80],
- [0.4901, 0.5038, 80],
- [0.4562, 0.4505, 80],
- [0.3966, 0.3584, 80],
- [0.3631, 0.3103, 80],
- [0.3391, 0.2815, 80],
- [0.3304, 0.2754, 80],
- [0.3229, 0.2756, 80],
- [0.3035, 0.2802, 80],
- [0.2747, 0.2926, 80],
- [0.2276, 0.3119, 80],
- [0.2631, 0.3192, 90],
- [0.2697, 0.3410, 90],
- [0.2956, 0.4111, 90],
- [0.3302, 0.4827, 90],
- [0.3590, 0.5232, 90],
- [0.3742, 0.5364, 90],
- [0.3896, 0.5438, 90],
- [0.4020, 0.5493, 90],
- [0.4221, 0.5430, 90],
- [0.4397, 0.5350, 90],
- [0.4555, 0.5235, 90],
- [0.4295, 0.4741, 90],
- [0.3330, 0.3080, 90],
- [0.3230, 0.2975, 90],
- [0.3180, 0.2958, 90],
- [0.2980, 0.3030, 90],
- [0.2813, 0.3106, 90],
- [0.2857, 0.3185, 95],
- [0.2943, 0.3395, 95],
- [0.3226, 0.4055, 95],
- [0.3608, 0.4679, 95],
- [0.3907, 0.5025, 95],
- [0.4055, 0.5126, 95],
- [0.4209, 0.5180, 95],
- [0.4300, 0.5195, 95],
- [0.4070, 0.4720, 95],
- [0.3630, 0.3855, 95],
- [0.3270, 0.3172, 95],
- [0.3160, 0.3069, 95],
- [0.3053, 0.3096, 95],
- [0.31006, 0.31616, 100]])
+C_OPTIMAL_COLOUR_STIMULI = np.array(
+ [[0.0000, 0.0000, 0],
+ [0.1363, 0.0692, 10],
+ [0.1308, 0.0792, 10],
+ [0.0808, 0.2132, 10],
+ [0.0371, 0.4135, 10],
+ [0.0251, 0.5007, 10],
+ [0.0181, 0.5893, 10],
+ [0.0181, 0.6718, 10],
+ [0.0276, 0.7416, 10],
+ [0.0434, 0.7890, 10],
+ [0.0687, 0.8178, 10],
+ [0.0996, 0.8252, 10],
+ [0.7040, 0.2946, 10],
+ [0.5126, 0.1913, 10],
+ [0.3424, 0.1028, 10],
+ [0.2813, 0.0771, 10],
+ [0.2518, 0.0693, 10],
+ [0.2378, 0.0674, 10],
+ [0.2230, 0.0663, 10],
+ [0.1868, 0.0664, 10],
+ [0.1628, 0.0676, 10],
+ [0.1289, 0.1268, 20],
+ [0.1230, 0.1438, 20],
+ [0.1027, 0.2152, 20],
+ [0.0762, 0.3420, 20],
+ [0.0572, 0.4775, 20],
+ [0.0500, 0.6250, 20],
+ [0.0637, 0.7410, 20],
+ [0.0787, 0.7747, 20],
+ [0.0992, 0.7975, 20],
+ [0.1239, 0.8055, 20],
+ [0.1518, 0.7983, 20],
+ [0.6717, 0.3273, 20],
+ [0.5542, 0.2513, 20],
+ [0.4077, 0.1603, 20],
+ [0.3463, 0.1263, 20],
+ [0.3195, 0.1150, 20],
+ [0.3075, 0.1122, 20],
+ [0.2968, 0.1104, 20],
+ [0.2586, 0.1104, 20],
+ [0.1918, 0.1182, 20],
+ [0.1302, 0.1764, 30],
+ [0.1255, 0.1980, 30],
+ [0.1092, 0.2845, 30],
+ [0.0909, 0.4178, 30],
+ [0.0855, 0.5500, 30],
+ [0.0836, 0.6110, 30],
+ [0.0911, 0.6700, 30],
+ [0.0975, 0.7140, 30],
+ [0.1100, 0.7487, 30],
+ [0.1294, 0.7700, 30],
+ [0.1462, 0.7806, 30],
+ [0.1698, 0.7793, 30],
+ [0.1957, 0.7696, 30],
+ [0.6390, 0.3613, 30],
+ [0.5530, 0.2950, 30],
+ [0.4300, 0.2040, 30],
+ [0.3733, 0.1658, 30],
+ [0.3485, 0.1528, 30],
+ [0.3300, 0.1462, 30],
+ [0.3140, 0.1443, 30],
+ [0.3045, 0.1447, 30],
+ [0.2643, 0.1503, 30],
+ [0.1383, 0.2180, 40],
+ [0.1350, 0.2425, 40],
+ [0.1246, 0.3363, 40],
+ [0.1179, 0.4720, 40],
+ [0.1343, 0.6800, 40],
+ [0.1596, 0.7377, 40],
+ [0.1766, 0.7470, 40],
+ [0.1952, 0.7500, 40],
+ [0.2437, 0.7305, 40],
+ [0.2964, 0.6903, 40],
+ [0.3200, 0.6357, 40],
+ [0.6065, 0.3925, 40],
+ [0.5395, 0.3320, 40],
+ [0.4347, 0.2410, 40],
+ [0.3833, 0.2000, 40],
+ [0.3607, 0.1851, 40],
+ [0.3527, 0.1807, 40],
+ [0.3453, 0.1777, 40],
+ [0.3325, 0.1752, 40],
+ [0.3260, 0.1750, 40],
+ [0.3003, 0.1783, 40],
+ [0.2727, 0.1844, 40],
+ [0.2276, 0.1955, 40],
+ [0.1510, 0.2520, 50],
+ [0.1497, 0.2785, 50],
+ [0.1462, 0.3736, 50],
+ [0.1490, 0.5017, 50],
+ [0.1589, 0.5990, 50],
+ [0.1677, 0.6411, 50],
+ [0.1782, 0.6750, 50],
+ [0.1913, 0.6980, 50],
+ [0.2222, 0.7185, 50],
+ [0.2867, 0.6936, 50],
+ [0.3412, 0.6493, 50],
+ [0.4066, 0.5890, 50],
+ [0.5759, 0.4231, 50],
+ [0.5207, 0.3655, 50],
+ [0.4304, 0.2737, 50],
+ [0.3844, 0.2309, 50],
+ [0.3489, 0.2071, 50],
+ [0.3347, 0.2026, 50],
+ [0.3175, 0.2046, 50],
+ [0.3000, 0.2092, 50],
+ [0.2746, 0.2162, 50],
+ [0.2024, 0.2373, 50],
+ [0.1694, 0.2797, 60],
+ [0.1698, 0.3065, 60],
+ [0.1732, 0.3995, 60],
+ [0.1847, 0.5156, 60],
+ [0.2011, 0.5982, 60],
+ [0.2117, 0.6316, 60],
+ [0.2238, 0.6567, 60],
+ [0.2525, 0.6823, 60],
+ [0.2694, 0.6840, 60],
+ [0.3344, 0.6502, 60],
+ [0.3908, 0.6016, 60],
+ [0.4605, 0.5364, 60],
+ [0.5470, 0.4514, 60],
+ [0.5004, 0.3963, 60],
+ [0.4217, 0.3042, 60],
+ [0.3803, 0.2593, 60],
+ [0.3500, 0.2330, 60],
+ [0.3376, 0.2284, 60],
+ [0.3238, 0.2294, 60],
+ [0.3132, 0.2322, 60],
+ [0.2593, 0.2497, 60],
+ [0.1932, 0.3005, 70],
+ [0.1953, 0.3263, 70],
+ [0.2064, 0.4136, 70],
+ [0.2261, 0.5163, 70],
+ [0.2495, 0.5835, 70],
+ [0.2733, 0.6282, 70],
+ [0.3063, 0.6432, 70],
+ [0.3213, 0.6415, 70],
+ [0.3408, 0.6316, 70],
+ [0.3876, 0.5999, 70],
+ [0.5187, 0.4780, 70],
+ [0.4795, 0.4243, 70],
+ [0.4107, 0.3319, 70],
+ [0.3566, 0.2675, 70],
+ [0.3460, 0.2578, 70],
+ [0.3356, 0.2525, 70],
+ [0.3185, 0.2544, 70],
+ [0.2875, 0.2651, 70],
+ [0.2290, 0.2868, 70],
+ [0.2236, 0.3120, 80],
+ [0.2282, 0.3382, 80],
+ [0.2465, 0.4183, 80],
+ [0.2743, 0.5056, 80],
+ [0.2991, 0.5591, 80],
+ [0.3136, 0.5784, 80],
+ [0.3284, 0.5913, 80],
+ [0.3570, 0.5932, 80],
+ [0.3785, 0.5912, 80],
+ [0.4493, 0.5433, 80],
+ [0.4901, 0.5038, 80],
+ [0.4562, 0.4505, 80],
+ [0.3966, 0.3584, 80],
+ [0.3631, 0.3103, 80],
+ [0.3391, 0.2815, 80],
+ [0.3304, 0.2754, 80],
+ [0.3229, 0.2756, 80],
+ [0.3035, 0.2802, 80],
+ [0.2747, 0.2926, 80],
+ [0.2276, 0.3119, 80],
+ [0.2631, 0.3192, 90],
+ [0.2697, 0.3410, 90],
+ [0.2956, 0.4111, 90],
+ [0.3302, 0.4827, 90],
+ [0.3590, 0.5232, 90],
+ [0.3742, 0.5364, 90],
+ [0.3896, 0.5438, 90],
+ [0.4020, 0.5493, 90],
+ [0.4221, 0.5430, 90],
+ [0.4397, 0.5350, 90],
+ [0.4555, 0.5235, 90],
+ [0.4295, 0.4741, 90],
+ [0.3330, 0.3080, 90],
+ [0.3230, 0.2975, 90],
+ [0.3180, 0.2958, 90],
+ [0.2980, 0.3030, 90],
+ [0.2813, 0.3106, 90],
+ [0.2857, 0.3185, 95],
+ [0.2943, 0.3395, 95],
+ [0.3226, 0.4055, 95],
+ [0.3608, 0.4679, 95],
+ [0.3907, 0.5025, 95],
+ [0.4055, 0.5126, 95],
+ [0.4209, 0.5180, 95],
+ [0.4300, 0.5195, 95],
+ [0.4070, 0.4720, 95],
+ [0.3630, 0.3855, 95],
+ [0.3270, 0.3172, 95],
+ [0.3160, 0.3069, 95],
+ [0.3053, 0.3096, 95],
+ [0.31006, 0.31616, 100]]) # yapf: disable
"""
*CIE Illuminant C* *Optimal Colour Stimuli*.
@@ -494,249 +493,249 @@
[. Opt. Soc. Am., 25(11], 361–367. doi:10.1364/JOSA.25.000361
"""
-D65_OPTIMAL_COLOUR_STIMULI = np.array([
- [0.0000, 0.0000, 0],
- [0.1346, 0.0747, 10],
- [0.0990, 0.1607, 10],
- [0.0751, 0.2403, 10],
- [0.0391, 0.4074, 10],
- [0.0211, 0.5490, 10],
- [0.0177, 0.6693, 10],
- [0.0344, 0.7732, 10],
- [0.0516, 0.8055, 10],
- [0.0727, 0.8223, 10],
- [0.0959, 0.8261, 10],
- [0.1188, 0.8213, 10],
- [0.7035, 0.2965, 10],
- [0.6832, 0.2853, 10],
- [0.6470, 0.2653, 10],
- [0.5517, 0.2132, 10],
- [0.5309, 0.2019, 10],
- [0.4346, 0.1504, 10],
- [0.3999, 0.1324, 10],
- [0.3549, 0.1101, 10],
- [0.3207, 0.0945, 10],
- [0.2989, 0.0857, 10],
- [0.2852, 0.0808, 10],
- [0.2660, 0.0755, 10],
- [0.2186, 0.0707, 10],
- [0.1268, 0.1365, 20],
- [0.1081, 0.1984, 20],
- [0.0894, 0.2766, 20],
- [0.0660, 0.4074, 20],
- [0.0549, 0.4971, 20],
- [0.0479, 0.6227, 20],
- [0.0565, 0.7312, 20],
- [0.0927, 0.8005, 20],
- [0.1289, 0.8078, 20],
- [0.1479, 0.8026, 20],
- [0.1664, 0.7941, 20],
- [0.6708, 0.3289, 20],
- [0.6591, 0.3213, 20],
- [0.5988, 0.2820, 20],
- [0.5514, 0.2513, 20],
- [0.5018, 0.2197, 20],
- [0.4502, 0.1874, 20],
- [0.4045, 0.1601, 20],
- [0.3762, 0.1443, 20],
- [0.3440, 0.1284, 20],
- [0.3185, 0.1196, 20],
- [0.2935, 0.1164, 20],
- [0.2528, 0.1189, 20],
- [0.2205, 0.1229, 20],
- [0.1282, 0.1889, 30],
- [0.1067, 0.3003, 30],
- [0.0990, 0.3535, 30],
- [0.0929, 0.4041, 30],
- [0.0846, 0.5028, 30],
- [0.0819, 0.6020, 30],
- [0.0836, 0.6491, 30],
- [0.1004, 0.7433, 30],
- [0.1481, 0.7857, 30],
- [0.1799, 0.7787, 30],
- [0.2119, 0.7609, 30],
- [0.6368, 0.3628, 30],
- [0.6281, 0.3561, 30],
- [0.5682, 0.3098, 30],
- [0.5271, 0.2784, 30],
- [0.4977, 0.2562, 30],
- [0.4504, 0.2212, 30],
- [0.4219, 0.2008, 30],
- [0.3999, 0.1859, 30],
- [0.3801, 0.1732, 30],
- [0.3491, 0.1574, 30],
- [0.3350, 0.1536, 30],
- [0.3197, 0.1526, 30],
- [0.2021, 0.1732, 30],
- [0.1360, 0.2324, 40],
- [0.1266, 0.3030, 40],
- [0.1219, 0.3504, 40],
- [0.1183, 0.3985, 40],
- [0.1155, 0.4509, 40],
- [0.1141, 0.5055, 40],
- [0.1312, 0.7047, 40],
- [0.1516, 0.7454, 40],
- [0.1853, 0.7587, 40],
- [0.2129, 0.7510, 40],
- [0.2415, 0.7344, 40],
- [0.6041, 0.3954, 40],
- [0.5969, 0.3888, 40],
- [0.5524, 0.3484, 40],
- [0.5257, 0.3244, 40],
- [0.4980, 0.2997, 40],
- [0.4598, 0.2661, 40],
- [0.3696, 0.1949, 40],
- [0.3603, 0.1898, 40],
- [0.3501, 0.1859, 40],
- [0.3375, 0.1841, 40],
- [0.2581, 0.2001, 40],
- [0.2220, 0.2095, 40],
- [0.1771, 0.2214, 40],
- [0.1491, 0.2679, 50],
- [0.1441, 0.3511, 50],
- [0.1429, 0.4025, 50],
- [0.1429, 0.4479, 50],
- [0.1472, 0.5522, 50],
- [0.1548, 0.6201, 50],
- [0.1621, 0.6570, 50],
- [0.1790, 0.7035, 50],
- [0.1929, 0.7201, 50],
- [0.2114, 0.7277, 50],
- [0.2991, 0.6851, 50],
- [0.5731, 0.4262, 50],
- [0.5668, 0.4195, 50],
- [0.5492, 0.4009, 50],
- [0.4795, 0.3281, 50],
- [0.4514, 0.2994, 50],
- [0.4113, 0.2600, 50],
- [0.3897, 0.2401, 50],
- [0.3509, 0.2139, 50],
- [0.3391, 0.2126, 50],
- [0.3211, 0.2155, 50],
- [0.3042, 0.2200, 50],
- [0.2466, 0.2374, 50],
- [0.2041, 0.2507, 50],
- [0.1674, 0.2959, 60],
- [0.1677, 0.3520, 60],
- [0.1700, 0.4130, 60],
- [0.1749, 0.4782, 60],
- [0.1801, 0.5257, 60],
- [0.1873, 0.5730, 60],
- [0.1994, 0.6257, 60],
- [0.2088, 0.6523, 60],
- [0.2506, 0.6927, 60],
- [0.3703, 0.6900, 60],
- [0.2930, 0.6798, 60],
- [0.5435, 0.4552, 60],
- [0.5379, 0.4483, 60],
- [0.4775, 0.3751, 60],
- [0.4522, 0.3450, 60],
- [0.4138, 0.3005, 60],
- [0.3611, 0.2472, 60],
- [0.3497, 0.2405, 60],
- [0.3395, 0.2388, 60],
- [0.3195, 0.2429, 60],
- [0.2963, 0.2505, 60],
- [0.2701, 0.2595, 60],
- [0.2270, 0.2747, 60],
- [0.2037, 0.2830, 60],
- [0.1916, 0.3164, 70],
- [0.1958, 0.3656, 70],
- [0.2003, 0.4069, 70],
- [0.2065, 0.4485, 70],
- [0.2150, 0.4963, 70],
- [0.2221, 0.5295, 70],
- [0.2298, 0.5597, 70],
- [0.2402, 0.5918, 70],
- [0.2550, 0.6237, 70],
- [0.2784, 0.6484, 70],
- [0.3000, 0.6521, 70],
- [0.5148, 0.4825, 70],
- [0.5097, 0.4753, 70],
- [0.4776, 0.4304, 70],
- [0.4508, 0.3933, 70],
- [0.4192, 0.3505, 70],
- [0.4005, 0.3259, 70],
- [0.3706, 0.2890, 70],
- [0.3663, 0.2842, 70],
- [0.3517, 0.2699, 70],
- [0.3364, 0.2634, 70],
- [0.3194, 0.2671, 70],
- [0.3007, 0.2739, 70],
- [0.2664, 0.2872, 70],
- [0.2232, 0.3290, 80],
- [0.2404, 0.4145, 80],
- [0.2496, 0.4504, 80],
- [0.2583, 0.4801, 80],
- [0.2760, 0.5308, 80],
- [0.3023, 0.5809, 80],
- [0.3092, 0.5892, 80],
- [0.3318, 0.6041, 80],
- [0.3515, 0.6048, 80],
- [0.3679, 0.5995, 80],
- [0.4080, 0.5750, 80],
- [0.4858, 0.5081, 80],
- [0.4811, 0.5005, 80],
- [0.4634, 0.4719, 80],
- [0.4514, 0.4526, 80],
- [0.4299, 0.4158, 80],
- [0.4001, 0.3720, 80],
- [0.3732, 0.3319, 80],
- [0.3603, 0.3139, 80],
- [0.3500, 0.3009, 80],
- [0.3307, 0.2866, 80],
- [0.2730, 0.3080, 80],
- [0.2519, 0.3169, 80],
- [0.2400, 0.3219, 80],
- [0.2639, 0.3331, 90],
- [0.2801, 0.3832, 90],
- [0.2864, 0.4008, 90],
- [0.3059, 0.4486, 90],
- [0.3182, 0.4746, 90],
- [0.3317, 0.4994, 90],
- [0.3513, 0.5278, 90],
- [0.3657, 0.5421, 90],
- [0.3946, 0.5537, 90],
- [0.4126, 0.5510, 90],
- [0.4354, 0.5406, 90],
- [0.4530, 0.5293, 90],
- [0.4486, 0.5210, 90],
- [0.4444, 0.5131, 90],
- [0.4325, 0.4906, 90],
- [0.4215, 0.4700, 90],
- [0.3990, 0.4284, 90],
- [0.3749, 0.3849, 90],
- [0.3504, 0.3431, 90],
- [0.3349, 0.3196, 90],
- [0.3217, 0.3084, 90],
- [0.3099, 0.3124, 90],
- [0.2852, 0.3235, 90],
- [0.2711, 0.3299, 90],
- [0.2875, 0.3320, 95],
- [0.2949, 0.3513, 95],
- [0.3067, 0.3800, 95],
- [0.3230, 0.4150, 95],
- [0.3368, 0.4415, 95],
- [0.3508, 0.4654, 95],
- [0.3644, 0.4856, 95],
- [0.3765, 0.5007, 95],
- [0.3887, 0.5126, 95],
- [0.4003, 0.5206, 95],
- [0.4108, 0.5251, 95],
- [0.4281, 0.5268, 95],
- [0.4204, 0.5109, 95],
- [0.4132, 0.4959, 95],
- [0.4031, 0.4751, 95],
- [0.3697, 0.4076, 95],
- [0.3498, 0.3692, 95],
- [0.3401, 0.3513, 95],
- [0.3295, 0.3331, 95],
- [0.3167, 0.3189, 95],
- [0.3148, 0.3195, 95],
- [0.3103, 0.3214, 95],
- [0.3006, 0.3259, 95],
- [0.2900, 0.3308, 95],
- [0.3127, 0.3290, 100]])
+D65_OPTIMAL_COLOUR_STIMULI = np.array(
+ [[0.0000, 0.0000, 0],
+ [0.1346, 0.0747, 10],
+ [0.0990, 0.1607, 10],
+ [0.0751, 0.2403, 10],
+ [0.0391, 0.4074, 10],
+ [0.0211, 0.5490, 10],
+ [0.0177, 0.6693, 10],
+ [0.0344, 0.7732, 10],
+ [0.0516, 0.8055, 10],
+ [0.0727, 0.8223, 10],
+ [0.0959, 0.8261, 10],
+ [0.1188, 0.8213, 10],
+ [0.7035, 0.2965, 10],
+ [0.6832, 0.2853, 10],
+ [0.6470, 0.2653, 10],
+ [0.5517, 0.2132, 10],
+ [0.5309, 0.2019, 10],
+ [0.4346, 0.1504, 10],
+ [0.3999, 0.1324, 10],
+ [0.3549, 0.1101, 10],
+ [0.3207, 0.0945, 10],
+ [0.2989, 0.0857, 10],
+ [0.2852, 0.0808, 10],
+ [0.2660, 0.0755, 10],
+ [0.2186, 0.0707, 10],
+ [0.1268, 0.1365, 20],
+ [0.1081, 0.1984, 20],
+ [0.0894, 0.2766, 20],
+ [0.0660, 0.4074, 20],
+ [0.0549, 0.4971, 20],
+ [0.0479, 0.6227, 20],
+ [0.0565, 0.7312, 20],
+ [0.0927, 0.8005, 20],
+ [0.1289, 0.8078, 20],
+ [0.1479, 0.8026, 20],
+ [0.1664, 0.7941, 20],
+ [0.6708, 0.3289, 20],
+ [0.6591, 0.3213, 20],
+ [0.5988, 0.2820, 20],
+ [0.5514, 0.2513, 20],
+ [0.5018, 0.2197, 20],
+ [0.4502, 0.1874, 20],
+ [0.4045, 0.1601, 20],
+ [0.3762, 0.1443, 20],
+ [0.3440, 0.1284, 20],
+ [0.3185, 0.1196, 20],
+ [0.2935, 0.1164, 20],
+ [0.2528, 0.1189, 20],
+ [0.2205, 0.1229, 20],
+ [0.1282, 0.1889, 30],
+ [0.1067, 0.3003, 30],
+ [0.0990, 0.3535, 30],
+ [0.0929, 0.4041, 30],
+ [0.0846, 0.5028, 30],
+ [0.0819, 0.6020, 30],
+ [0.0836, 0.6491, 30],
+ [0.1004, 0.7433, 30],
+ [0.1481, 0.7857, 30],
+ [0.1799, 0.7787, 30],
+ [0.2119, 0.7609, 30],
+ [0.6368, 0.3628, 30],
+ [0.6281, 0.3561, 30],
+ [0.5682, 0.3098, 30],
+ [0.5271, 0.2784, 30],
+ [0.4977, 0.2562, 30],
+ [0.4504, 0.2212, 30],
+ [0.4219, 0.2008, 30],
+ [0.3999, 0.1859, 30],
+ [0.3801, 0.1732, 30],
+ [0.3491, 0.1574, 30],
+ [0.3350, 0.1536, 30],
+ [0.3197, 0.1526, 30],
+ [0.2021, 0.1732, 30],
+ [0.1360, 0.2324, 40],
+ [0.1266, 0.3030, 40],
+ [0.1219, 0.3504, 40],
+ [0.1183, 0.3985, 40],
+ [0.1155, 0.4509, 40],
+ [0.1141, 0.5055, 40],
+ [0.1312, 0.7047, 40],
+ [0.1516, 0.7454, 40],
+ [0.1853, 0.7587, 40],
+ [0.2129, 0.7510, 40],
+ [0.2415, 0.7344, 40],
+ [0.6041, 0.3954, 40],
+ [0.5969, 0.3888, 40],
+ [0.5524, 0.3484, 40],
+ [0.5257, 0.3244, 40],
+ [0.4980, 0.2997, 40],
+ [0.4598, 0.2661, 40],
+ [0.3696, 0.1949, 40],
+ [0.3603, 0.1898, 40],
+ [0.3501, 0.1859, 40],
+ [0.3375, 0.1841, 40],
+ [0.2581, 0.2001, 40],
+ [0.2220, 0.2095, 40],
+ [0.1771, 0.2214, 40],
+ [0.1491, 0.2679, 50],
+ [0.1441, 0.3511, 50],
+ [0.1429, 0.4025, 50],
+ [0.1429, 0.4479, 50],
+ [0.1472, 0.5522, 50],
+ [0.1548, 0.6201, 50],
+ [0.1621, 0.6570, 50],
+ [0.1790, 0.7035, 50],
+ [0.1929, 0.7201, 50],
+ [0.2114, 0.7277, 50],
+ [0.2991, 0.6851, 50],
+ [0.5731, 0.4262, 50],
+ [0.5668, 0.4195, 50],
+ [0.5492, 0.4009, 50],
+ [0.4795, 0.3281, 50],
+ [0.4514, 0.2994, 50],
+ [0.4113, 0.2600, 50],
+ [0.3897, 0.2401, 50],
+ [0.3509, 0.2139, 50],
+ [0.3391, 0.2126, 50],
+ [0.3211, 0.2155, 50],
+ [0.3042, 0.2200, 50],
+ [0.2466, 0.2374, 50],
+ [0.2041, 0.2507, 50],
+ [0.1674, 0.2959, 60],
+ [0.1677, 0.3520, 60],
+ [0.1700, 0.4130, 60],
+ [0.1749, 0.4782, 60],
+ [0.1801, 0.5257, 60],
+ [0.1873, 0.5730, 60],
+ [0.1994, 0.6257, 60],
+ [0.2088, 0.6523, 60],
+ [0.2506, 0.6927, 60],
+ [0.3703, 0.6900, 60],
+ [0.2930, 0.6798, 60],
+ [0.5435, 0.4552, 60],
+ [0.5379, 0.4483, 60],
+ [0.4775, 0.3751, 60],
+ [0.4522, 0.3450, 60],
+ [0.4138, 0.3005, 60],
+ [0.3611, 0.2472, 60],
+ [0.3497, 0.2405, 60],
+ [0.3395, 0.2388, 60],
+ [0.3195, 0.2429, 60],
+ [0.2963, 0.2505, 60],
+ [0.2701, 0.2595, 60],
+ [0.2270, 0.2747, 60],
+ [0.2037, 0.2830, 60],
+ [0.1916, 0.3164, 70],
+ [0.1958, 0.3656, 70],
+ [0.2003, 0.4069, 70],
+ [0.2065, 0.4485, 70],
+ [0.2150, 0.4963, 70],
+ [0.2221, 0.5295, 70],
+ [0.2298, 0.5597, 70],
+ [0.2402, 0.5918, 70],
+ [0.2550, 0.6237, 70],
+ [0.2784, 0.6484, 70],
+ [0.3000, 0.6521, 70],
+ [0.5148, 0.4825, 70],
+ [0.5097, 0.4753, 70],
+ [0.4776, 0.4304, 70],
+ [0.4508, 0.3933, 70],
+ [0.4192, 0.3505, 70],
+ [0.4005, 0.3259, 70],
+ [0.3706, 0.2890, 70],
+ [0.3663, 0.2842, 70],
+ [0.3517, 0.2699, 70],
+ [0.3364, 0.2634, 70],
+ [0.3194, 0.2671, 70],
+ [0.3007, 0.2739, 70],
+ [0.2664, 0.2872, 70],
+ [0.2232, 0.3290, 80],
+ [0.2404, 0.4145, 80],
+ [0.2496, 0.4504, 80],
+ [0.2583, 0.4801, 80],
+ [0.2760, 0.5308, 80],
+ [0.3023, 0.5809, 80],
+ [0.3092, 0.5892, 80],
+ [0.3318, 0.6041, 80],
+ [0.3515, 0.6048, 80],
+ [0.3679, 0.5995, 80],
+ [0.4080, 0.5750, 80],
+ [0.4858, 0.5081, 80],
+ [0.4811, 0.5005, 80],
+ [0.4634, 0.4719, 80],
+ [0.4514, 0.4526, 80],
+ [0.4299, 0.4158, 80],
+ [0.4001, 0.3720, 80],
+ [0.3732, 0.3319, 80],
+ [0.3603, 0.3139, 80],
+ [0.3500, 0.3009, 80],
+ [0.3307, 0.2866, 80],
+ [0.2730, 0.3080, 80],
+ [0.2519, 0.3169, 80],
+ [0.2400, 0.3219, 80],
+ [0.2639, 0.3331, 90],
+ [0.2801, 0.3832, 90],
+ [0.2864, 0.4008, 90],
+ [0.3059, 0.4486, 90],
+ [0.3182, 0.4746, 90],
+ [0.3317, 0.4994, 90],
+ [0.3513, 0.5278, 90],
+ [0.3657, 0.5421, 90],
+ [0.3946, 0.5537, 90],
+ [0.4126, 0.5510, 90],
+ [0.4354, 0.5406, 90],
+ [0.4530, 0.5293, 90],
+ [0.4486, 0.5210, 90],
+ [0.4444, 0.5131, 90],
+ [0.4325, 0.4906, 90],
+ [0.4215, 0.4700, 90],
+ [0.3990, 0.4284, 90],
+ [0.3749, 0.3849, 90],
+ [0.3504, 0.3431, 90],
+ [0.3349, 0.3196, 90],
+ [0.3217, 0.3084, 90],
+ [0.3099, 0.3124, 90],
+ [0.2852, 0.3235, 90],
+ [0.2711, 0.3299, 90],
+ [0.2875, 0.3320, 95],
+ [0.2949, 0.3513, 95],
+ [0.3067, 0.3800, 95],
+ [0.3230, 0.4150, 95],
+ [0.3368, 0.4415, 95],
+ [0.3508, 0.4654, 95],
+ [0.3644, 0.4856, 95],
+ [0.3765, 0.5007, 95],
+ [0.3887, 0.5126, 95],
+ [0.4003, 0.5206, 95],
+ [0.4108, 0.5251, 95],
+ [0.4281, 0.5268, 95],
+ [0.4204, 0.5109, 95],
+ [0.4132, 0.4959, 95],
+ [0.4031, 0.4751, 95],
+ [0.3697, 0.4076, 95],
+ [0.3498, 0.3692, 95],
+ [0.3401, 0.3513, 95],
+ [0.3295, 0.3331, 95],
+ [0.3167, 0.3189, 95],
+ [0.3148, 0.3195, 95],
+ [0.3103, 0.3214, 95],
+ [0.3006, 0.3259, 95],
+ [0.2900, 0.3308, 95],
+ [0.3127, 0.3290, 100]]) # yapf: disable
"""
*CIE Standard Illuminant D Series D65* *Optimal Colour Stimuli*.
@@ -749,10 +748,11 @@
Wiley. ISBN:978-0471399186
"""
-ILLUMINANTS_OPTIMAL_COLOUR_STIMULI = CaseInsensitiveMapping(
- {'A': A_OPTIMAL_COLOUR_STIMULI,
- 'C': C_OPTIMAL_COLOUR_STIMULI,
- 'D65': D65_OPTIMAL_COLOUR_STIMULI})
+ILLUMINANTS_OPTIMAL_COLOUR_STIMULI = CaseInsensitiveMapping({
+ 'A': A_OPTIMAL_COLOUR_STIMULI,
+ 'C': C_OPTIMAL_COLOUR_STIMULI,
+ 'D65': D65_OPTIMAL_COLOUR_STIMULI
+})
"""
Illuminants *Optimal Colour Stimuli*.
diff --git a/colour/volume/macadam_limits.py b/colour/volume/macadam_limits.py
index 0707e031e3..64fc170414 100644
--- a/colour/volume/macadam_limits.py
+++ b/colour/volume/macadam_limits.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Optimal Colour Stimuli - MacAdam Limits
=======================================
@@ -53,10 +52,10 @@ def _XYZ_optimal_colour_stimuli(illuminant):
optimal_colour_stimuli = ILLUMINANTS_OPTIMAL_COLOUR_STIMULI.get(illuminant)
if optimal_colour_stimuli is None:
- raise KeyError(
- '"{0}" not found in factory '
- '"Optimal Colour Stimuli": "{1}".'.format(
- illuminant, sorted(ILLUMINANTS_OPTIMAL_COLOUR_STIMULI.keys())))
+ raise KeyError('"{0}" not found in factory '
+ '"Optimal Colour Stimuli": "{1}".'.format(
+ illuminant,
+ sorted(ILLUMINANTS_OPTIMAL_COLOUR_STIMULI.keys())))
cached_ocs = _XYZ_OPTIMAL_COLOUR_STIMULI_CACHE.get(illuminant)
if cached_ocs is None:
diff --git a/colour/volume/mesh.py b/colour/volume/mesh.py
index 4033482924..45a03baeca 100644
--- a/colour/volume/mesh.py
+++ b/colour/volume/mesh.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Mesh Volume Computations Helpers
================================
diff --git a/colour/volume/pointer_gamut.py b/colour/volume/pointer_gamut.py
index 3342bf6d59..9ab1863452 100644
--- a/colour/volume/pointer_gamut.py
+++ b/colour/volume/pointer_gamut.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Pointer's Gamut Volume Computations
===================================
@@ -16,11 +15,8 @@
from __future__ import division, unicode_literals
-from colour.models import (
- Lab_to_XYZ,
- LCHab_to_Lab,
- POINTER_GAMUT_DATA,
- POINTER_GAMUT_ILLUMINANT)
+from colour.models import (Lab_to_XYZ, LCHab_to_Lab, POINTER_GAMUT_DATA,
+ POINTER_GAMUT_ILLUMINANT)
from colour.volume import is_within_mesh_volume
__author__ = 'Colour Developers'
@@ -65,7 +61,7 @@ def is_within_pointer_gamut(XYZ, tolerance=None):
array([ True, False], dtype=bool)
"""
- XYZ_p = Lab_to_XYZ(LCHab_to_Lab(POINTER_GAMUT_DATA),
- POINTER_GAMUT_ILLUMINANT)
+ XYZ_p = Lab_to_XYZ(
+ LCHab_to_Lab(POINTER_GAMUT_DATA), POINTER_GAMUT_ILLUMINANT)
return is_within_mesh_volume(XYZ, XYZ_p, tolerance)
diff --git a/colour/volume/rgb.py b/colour/volume/rgb.py
index 557716a6f3..cdf348e0cf 100644
--- a/colour/volume/rgb.py
+++ b/colour/volume/rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
RGB Colourspace Volume Computation
==================================
@@ -27,11 +26,7 @@
from colour.algebra import random_triplet_generator
from colour.colorimetry import ILLUMINANTS
-from colour.models import (
- Lab_to_XYZ,
- RGB_to_XYZ,
- XYZ_to_Lab,
- XYZ_to_RGB)
+from colour.models import (Lab_to_XYZ, RGB_to_XYZ, XYZ_to_Lab, XYZ_to_RGB)
from colour.volume import is_within_pointer_gamut, is_within_visible_spectrum
__author__ = 'Colour Developers'
@@ -41,11 +36,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['sample_RGB_colourspace_volume_MonteCarlo',
- 'RGB_colourspace_limits',
- 'RGB_colourspace_volume_MonteCarlo',
- 'RGB_colourspace_pointer_gamut_coverage_MonteCarlo',
- 'RGB_colourspace_visible_spectrum_coverage_MonteCarlo']
+__all__ = [
+ 'sample_RGB_colourspace_volume_MonteCarlo', 'RGB_colourspace_limits',
+ 'RGB_colourspace_volume_MonteCarlo',
+ 'RGB_colourspace_pointer_gamut_coverage_MonteCarlo',
+ 'RGB_colourspace_visible_spectrum_coverage_MonteCarlo'
+]
def _wrapper_RGB_colourspace_volume_MonteCarlo(args):
@@ -56,7 +52,7 @@ def _wrapper_RGB_colourspace_volume_MonteCarlo(args):
Parameters
----------
- args : list, optional
+ args : array_like, optional
Arguments.
Returns
@@ -72,8 +68,8 @@ def sample_RGB_colourspace_volume_MonteCarlo(
colourspace,
samples=10e6,
limits=np.array([[0, 100], [-150, 150], [-150, 150]]),
- illuminant_Lab=ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'],
+ illuminant_Lab=ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
+ 'D50'],
chromatic_adaptation_method='CAT02',
random_generator=random_triplet_generator,
random_state=None):
@@ -129,18 +125,17 @@ def sample_RGB_colourspace_volume_MonteCarlo(
"""
random_state = (random_state
- if random_state is not None else
- np.random.RandomState())
+ if random_state is not None else np.random.RandomState())
Lab = np.asarray(list(random_generator(samples, limits, random_state)))
- RGB = XYZ_to_RGB(Lab_to_XYZ(Lab, illuminant_Lab),
- illuminant_Lab,
- colourspace.whitepoint,
- colourspace.XYZ_to_RGB_matrix,
- chromatic_adaptation_transform=(
- chromatic_adaptation_method))
- RGB_w = RGB[np.logical_and(np.min(RGB, axis=-1) >= 0,
- np.max(RGB, axis=-1) <= 1)]
+ RGB = XYZ_to_RGB(
+ Lab_to_XYZ(Lab, illuminant_Lab),
+ illuminant_Lab,
+ colourspace.whitepoint,
+ colourspace.XYZ_to_RGB_matrix,
+ chromatic_adaptation_transform=(chromatic_adaptation_method))
+ RGB_w = RGB[np.logical_and(
+ np.min(RGB, axis=-1) >= 0, np.max(RGB, axis=-1) <= 1)]
return len(RGB_w)
@@ -173,10 +168,10 @@ def RGB_colourspace_limits(
Lab = []
for combination in list(itertools.product([0, 1], repeat=3)):
- Lab.append(XYZ_to_Lab(RGB_to_XYZ(combination,
- colourspace.whitepoint,
- illuminant,
- colourspace.RGB_to_XYZ_matrix)))
+ Lab.append(
+ XYZ_to_Lab(
+ RGB_to_XYZ(combination, colourspace.whitepoint, illuminant,
+ colourspace.RGB_to_XYZ_matrix)))
Lab = np.array(Lab)
limits = []
@@ -190,8 +185,8 @@ def RGB_colourspace_volume_MonteCarlo(
colourspace,
samples=10e6,
limits=np.array([[0, 100], [-150, 150], [-150, 150]]),
- illuminant_Lab=ILLUMINANTS[
- 'CIE 1931 2 Degree Standard Observer']['D50'],
+ illuminant_Lab=ILLUMINANTS['CIE 1931 2 Degree Standard Observer'][
+ 'D50'],
chromatic_adaptation_method='CAT02',
random_generator=random_triplet_generator,
random_state=None,
@@ -256,13 +251,8 @@ def RGB_colourspace_volume_MonteCarlo(
process_samples = int(np.round(samples / cpu_count))
- arguments = [colourspace,
- process_samples,
- limits,
- illuminant_Lab,
- chromatic_adaptation_method,
- random_generator,
- random_state]
+ arguments = (colourspace, process_samples, limits, illuminant_Lab,
+ chromatic_adaptation_method, random_generator, random_state)
results = pool.map(_wrapper_RGB_colourspace_volume_MonteCarlo,
[arguments for _ in range(cpu_count)])
@@ -313,21 +303,18 @@ def RGB_colourspace_volume_coverage_MonteCarlo(
"""
random_state = (random_state
- if random_state is not None else
- np.random.RandomState())
+ if random_state is not None else np.random.RandomState())
# TODO: Investigate for generator yielding directly a ndarray.
- XYZ = np.asarray(list(random_generator(
- samples, random_state=random_state)))
+ XYZ = np.asarray(
+ list(random_generator(samples, random_state=random_state)))
XYZ_vs = XYZ[coverage_sampler(XYZ)]
- RGB = XYZ_to_RGB(XYZ_vs,
- colourspace.whitepoint,
- colourspace.whitepoint,
+ RGB = XYZ_to_RGB(XYZ_vs, colourspace.whitepoint, colourspace.whitepoint,
colourspace.XYZ_to_RGB_matrix)
- RGB_c = RGB[np.logical_and(np.min(RGB, axis=-1) >= 0,
- np.max(RGB, axis=-1) <= 1)]
+ RGB_c = RGB[np.logical_and(
+ np.min(RGB, axis=-1) >= 0, np.max(RGB, axis=-1) <= 1)]
return 100 * RGB_c.size / XYZ_vs.size
@@ -370,10 +357,7 @@ def RGB_colourspace_pointer_gamut_coverage_MonteCarlo(
"""
return RGB_colourspace_volume_coverage_MonteCarlo(
- colourspace,
- is_within_pointer_gamut,
- samples,
- random_generator,
+ colourspace, is_within_pointer_gamut, samples, random_generator,
random_state)
@@ -415,8 +399,5 @@ def RGB_colourspace_visible_spectrum_coverage_MonteCarlo(
"""
return RGB_colourspace_volume_coverage_MonteCarlo(
- colourspace,
- is_within_visible_spectrum,
- samples,
- random_generator,
+ colourspace, is_within_visible_spectrum, samples, random_generator,
random_state)
diff --git a/colour/volume/spectrum.py b/colour/volume/spectrum.py
index 34207d667f..bb4d47e647 100644
--- a/colour/volume/spectrum.py
+++ b/colour/volume/spectrum.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Visible Spectrum Volume Computations
====================================
diff --git a/colour/volume/tests/tests_macadam_limits.py b/colour/volume/tests/tests_macadam_limits.py
index 91f58f5288..f6784d3f02 100644
--- a/colour/volume/tests/tests_macadam_limits.py
+++ b/colour/volume/tests/tests_macadam_limits.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.volume.macadam_limits` module.
"""
@@ -56,21 +55,15 @@ def test_n_dimensional_is_within_macadam_limits(self):
a = np.array([0.3205, 0.4131, 0.5100])
b = np.array([True])
- np.testing.assert_almost_equal(
- is_within_macadam_limits(a, 'A'),
- b)
+ np.testing.assert_almost_equal(is_within_macadam_limits(a, 'A'), b)
a = np.tile(a, (6, 1))
b = np.tile(b, 6)
- np.testing.assert_almost_equal(
- is_within_macadam_limits(a, 'A'),
- b)
+ np.testing.assert_almost_equal(is_within_macadam_limits(a, 'A'), b)
a = np.reshape(a, (2, 3, 3))
b = np.reshape(b, (2, 3))
- np.testing.assert_almost_equal(
- is_within_macadam_limits(a, 'A'),
- b)
+ np.testing.assert_almost_equal(is_within_macadam_limits(a, 'A'), b)
@ignore_numpy_errors
def test_nan_is_within_macadam_limits(self):
diff --git a/colour/volume/tests/tests_mesh.py b/colour/volume/tests/tests_mesh.py
index 7d1d27b5dd..e6243b56dc 100644
--- a/colour/volume/tests/tests_mesh.py
+++ b/colour/volume/tests/tests_mesh.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.volume.mesh` module.
"""
@@ -35,11 +34,12 @@ def setUp(self):
Initialises common tests attributes.
"""
- self._mesh = np.array([[-1.0, -1.0, 1.0],
- [1.0, -1.0, 1.0],
- [1.0, -1.0, -1.0],
- [-1.0, -1.0, -1.0],
- [0.0, 1.0, 0.0]])
+ self._mesh = np.array(
+ [[-1.0, -1.0, 1.0],
+ [1.0, -1.0, 1.0],
+ [1.0, -1.0, -1.0],
+ [-1.0, -1.0, -1.0],
+ [0.0, 1.0, 0.0]]) # yapf: disable
def test_is_within_mesh_volume(self):
"""
@@ -47,20 +47,20 @@ def test_is_within_mesh_volume(self):
"""
self.assertTrue(
- is_within_mesh_volume(np.array([0.0005, 0.0031, 0.0010]),
- self._mesh))
+ is_within_mesh_volume(
+ np.array([0.0005, 0.0031, 0.0010]), self._mesh))
self.assertFalse(
- is_within_mesh_volume(np.array([0.3205, 0.4131, 0.5100]),
- self._mesh))
+ is_within_mesh_volume(
+ np.array([0.3205, 0.4131, 0.5100]), self._mesh))
self.assertTrue(
- is_within_mesh_volume(np.array([0.0025, 0.0088, 0.0340]),
- self._mesh))
+ is_within_mesh_volume(
+ np.array([0.0025, 0.0088, 0.0340]), self._mesh))
self.assertFalse(
- is_within_mesh_volume(np.array([0.4325, 0.3788, 0.1034]),
- self._mesh))
+ is_within_mesh_volume(
+ np.array([0.4325, 0.3788, 0.1034]), self._mesh))
def test_n_dimensional_is_within_mesh_volume(self):
"""
@@ -70,21 +70,15 @@ def test_n_dimensional_is_within_mesh_volume(self):
a = np.array([0.0005, 0.0031, 0.0010])
b = np.array([True])
- np.testing.assert_almost_equal(
- is_within_mesh_volume(a, self._mesh),
- b)
+ np.testing.assert_almost_equal(is_within_mesh_volume(a, self._mesh), b)
a = np.tile(a, (6, 1))
b = np.tile(b, 6)
- np.testing.assert_almost_equal(
- is_within_mesh_volume(a, self._mesh),
- b)
+ np.testing.assert_almost_equal(is_within_mesh_volume(a, self._mesh), b)
a = np.reshape(a, (2, 3, 3))
b = np.reshape(b, (2, 3))
- np.testing.assert_almost_equal(
- is_within_mesh_volume(a, self._mesh),
- b)
+ np.testing.assert_almost_equal(is_within_mesh_volume(a, self._mesh), b)
@ignore_numpy_errors
def test_nan_is_within_mesh_volume(self):
diff --git a/colour/volume/tests/tests_pointer_gamut.py b/colour/volume/tests/tests_pointer_gamut.py
index 779d2b98e1..ec3c3b40e1 100644
--- a/colour/volume/tests/tests_pointer_gamut.py
+++ b/colour/volume/tests/tests_pointer_gamut.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.volume.pointer_gamut` module.
"""
@@ -56,21 +55,15 @@ def test_n_dimensional_is_within_pointer_gamut(self):
a = np.array([0.3205, 0.4131, 0.5100])
b = np.array([True])
- np.testing.assert_almost_equal(
- is_within_pointer_gamut(a),
- b)
+ np.testing.assert_almost_equal(is_within_pointer_gamut(a), b)
a = np.tile(a, (6, 1))
b = np.tile(b, 6)
- np.testing.assert_almost_equal(
- is_within_pointer_gamut(a),
- b)
+ np.testing.assert_almost_equal(is_within_pointer_gamut(a), b)
a = np.reshape(a, (2, 3, 3))
b = np.reshape(b, (2, 3))
- np.testing.assert_almost_equal(
- is_within_pointer_gamut(a),
- b)
+ np.testing.assert_almost_equal(is_within_pointer_gamut(a), b)
@ignore_numpy_errors
def test_nan_is_within_pointer_gamut(self):
diff --git a/colour/volume/tests/tests_rgb.py b/colour/volume/tests/tests_rgb.py
index c2fb8b2876..8e7c383c0b 100644
--- a/colour/volume/tests/tests_rgb.py
+++ b/colour/volume/tests/tests_rgb.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.volume.rgb` module.
@@ -25,13 +24,10 @@
import numpy as np
import unittest
-from colour.models import (
- ACES_2065_1_COLOURSPACE,
- REC_2020_COLOURSPACE,
- REC_709_COLOURSPACE)
+from colour.models import (ACES_2065_1_COLOURSPACE, REC_2020_COLOURSPACE,
+ REC_709_COLOURSPACE)
from colour.volume import (
- RGB_colourspace_limits,
- RGB_colourspace_volume_MonteCarlo,
+ RGB_colourspace_limits, RGB_colourspace_volume_MonteCarlo,
RGB_colourspace_volume_coverage_MonteCarlo,
RGB_colourspace_pointer_gamut_coverage_MonteCarlo,
RGB_colourspace_visible_spectrum_coverage_MonteCarlo,
@@ -44,11 +40,12 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['TestRGB_colourspaceLimits',
- 'TestRGB_colourspaceVolumeMonteCarlo',
- 'TestRGB_colourspace_volume_coverage_MonteCarlo',
- 'TestRGB_colourspacePointerGamutCoverageMonteCarlo',
- 'TestRGB_colourspaceVisibleSpectrumCoverageMonteCarlo']
+__all__ = [
+ 'TestRGB_colourspaceLimits', 'TestRGB_colourspaceVolumeMonteCarlo',
+ 'TestRGB_colourspace_volume_coverage_MonteCarlo',
+ 'TestRGB_colourspacePointerGamutCoverageMonteCarlo',
+ 'TestRGB_colourspaceVisibleSpectrumCoverageMonteCarlo'
+]
class TestRGB_colourspaceLimits(unittest.TestCase):
@@ -64,22 +61,21 @@ def test_RGB_colourspace_limits(self):
np.testing.assert_almost_equal(
RGB_colourspace_limits(REC_709_COLOURSPACE),
- np.array([[0.00000000, 100.00000000],
- [-79.21854477, 94.65669508],
+ np.array([[0.00000000, 100.00000000], [-79.21854477, 94.65669508],
[-114.78759841, 96.72026446]]),
decimal=7)
np.testing.assert_almost_equal(
RGB_colourspace_limits(REC_2020_COLOURSPACE),
- np.array([[0.00000000, 100.00000000],
- [-159.59726205, 127.32669335],
+ np.array([[0.00000000,
+ 100.00000000], [-159.59726205, 127.32669335],
[-129.74325643, 142.13784519]]),
decimal=7)
np.testing.assert_almost_equal(
RGB_colourspace_limits(ACES_2065_1_COLOURSPACE),
- np.array([[-79.45116285, 103.30589122],
- [-461.76531700, 176.36321555],
+ np.array([[-79.45116285,
+ 103.30589122], [-461.76531700, 176.36321555],
[-309.68548384, 184.82616441]]),
decimal=7)
@@ -101,8 +97,7 @@ def test_RGB_colourspace_volume_MonteCarlo(self):
REC_709_COLOURSPACE,
10e3,
random_state=np.random.RandomState(2),
- processes=1),
- 858600.0)
+ processes=1), 858600.0)
class TestRGB_colourspace_volume_coverage_MonteCarlo(unittest.TestCase):
diff --git a/colour/volume/tests/tests_spectrum.py b/colour/volume/tests/tests_spectrum.py
index 8d2f1df839..62016454e9 100644
--- a/colour/volume/tests/tests_spectrum.py
+++ b/colour/volume/tests/tests_spectrum.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Defines unit tests for :mod:`colour.volume.spectrum` module.
"""
@@ -56,21 +55,15 @@ def test_n_dimensional_is_within_visible_spectrum(self):
a = np.array([0.3205, 0.4131, 0.5100])
b = np.array([True])
- np.testing.assert_almost_equal(
- is_within_visible_spectrum(a),
- b)
+ np.testing.assert_almost_equal(is_within_visible_spectrum(a), b)
a = np.tile(a, (6, 1))
b = np.tile(b, 6)
- np.testing.assert_almost_equal(
- is_within_visible_spectrum(a),
- b)
+ np.testing.assert_almost_equal(is_within_visible_spectrum(a), b)
a = np.reshape(a, (2, 3, 3))
b = np.reshape(b, (2, 3))
- np.testing.assert_almost_equal(
- is_within_visible_spectrum(a),
- b)
+ np.testing.assert_almost_equal(is_within_visible_spectrum(a), b)
@ignore_numpy_errors
def test_nan_is_within_visible_spectrum(self):
diff --git a/docs/colour.adaptation.cie1994.rst b/docs/colour.adaptation.cie1994.rst
index 049e24c690..6d3d58a2bf 100644
--- a/docs/colour.adaptation.cie1994.rst
+++ b/docs/colour.adaptation.cie1994.rst
@@ -1,5 +1,5 @@
-colour.adaptation.cie1994 Module
-================================
+colour\.adaptation\.cie1994 Module
+==================================
.. automodule:: colour.adaptation.cie1994
:members:
diff --git a/docs/colour.adaptation.cmccat2000.rst b/docs/colour.adaptation.cmccat2000.rst
index e6e3fbfc61..9bbd63bc77 100644
--- a/docs/colour.adaptation.cmccat2000.rst
+++ b/docs/colour.adaptation.cmccat2000.rst
@@ -1,5 +1,5 @@
-colour.adaptation.cmccat2000 Module
-===================================
+colour\.adaptation\.cmccat2000 Module
+=====================================
.. automodule:: colour.adaptation.cmccat2000
:members:
diff --git a/docs/colour.adaptation.dataset.cat.rst b/docs/colour.adaptation.dataset.cat.rst
index cc45656d87..2a246c5d0b 100644
--- a/docs/colour.adaptation.dataset.cat.rst
+++ b/docs/colour.adaptation.dataset.cat.rst
@@ -1,5 +1,5 @@
-colour.adaptation.dataset.cat Module
-====================================
+colour\.adaptation\.dataset\.cat Module
+=======================================
.. automodule:: colour.adaptation.dataset.cat
:members:
diff --git a/docs/colour.adaptation.dataset.rst b/docs/colour.adaptation.dataset.rst
index 484515190c..fd5ba97427 100644
--- a/docs/colour.adaptation.dataset.rst
+++ b/docs/colour.adaptation.dataset.rst
@@ -1,5 +1,5 @@
-colour.adaptation.dataset Package
-=================================
+colour\.adaptation\.dataset Package
+===================================
Sub-Modules
-----------
diff --git a/docs/colour.adaptation.fairchild1990.rst b/docs/colour.adaptation.fairchild1990.rst
index 1b93dc4d72..81006f6174 100644
--- a/docs/colour.adaptation.fairchild1990.rst
+++ b/docs/colour.adaptation.fairchild1990.rst
@@ -1,5 +1,5 @@
-colour.adaptation.fairchild1990 Module
-======================================
+colour\.adaptation\.fairchild1990 Module
+========================================
.. automodule:: colour.adaptation.fairchild1990
:members:
diff --git a/docs/colour.adaptation.rst b/docs/colour.adaptation.rst
index fb766fe4bb..95d8697e34 100644
--- a/docs/colour.adaptation.rst
+++ b/docs/colour.adaptation.rst
@@ -1,5 +1,5 @@
-colour.adaptation Package
-=========================
+colour\.adaptation Package
+==========================
Sub-Packages
------------
diff --git a/docs/colour.adaptation.vonkries.rst b/docs/colour.adaptation.vonkries.rst
index c49278d8bf..b3d72cd051 100644
--- a/docs/colour.adaptation.vonkries.rst
+++ b/docs/colour.adaptation.vonkries.rst
@@ -1,5 +1,5 @@
-colour.adaptation.vonkries Module
-=================================
+colour\.adaptation\.vonkries Module
+===================================
.. automodule:: colour.adaptation.vonkries
:members:
diff --git a/docs/colour.algebra.coordinates.rst b/docs/colour.algebra.coordinates.rst
index 10d81330dd..874a8204da 100644
--- a/docs/colour.algebra.coordinates.rst
+++ b/docs/colour.algebra.coordinates.rst
@@ -1,5 +1,5 @@
-colour.algebra.coordinates Package
-==================================
+colour\.algebra\.coordinates Package
+====================================
Sub-Modules
-----------
diff --git a/docs/colour.algebra.coordinates.transformations.rst b/docs/colour.algebra.coordinates.transformations.rst
index 9986b64306..2a00550ac5 100644
--- a/docs/colour.algebra.coordinates.transformations.rst
+++ b/docs/colour.algebra.coordinates.transformations.rst
@@ -1,5 +1,5 @@
-colour.algebra.coordinates.transformations Module
-=================================================
+colour\.algebra\.coordinates\.transformations Module
+====================================================
.. automodule:: colour.algebra.coordinates.transformations
:members:
diff --git a/docs/colour.algebra.extrapolation.rst b/docs/colour.algebra.extrapolation.rst
index fd4eff1b58..d3188b8f78 100644
--- a/docs/colour.algebra.extrapolation.rst
+++ b/docs/colour.algebra.extrapolation.rst
@@ -1,5 +1,5 @@
-colour.algebra.extrapolation Module
-===================================
+colour\.algebra\.extrapolation Module
+=====================================
.. automodule:: colour.algebra.extrapolation
:members:
diff --git a/docs/colour.algebra.geometry.rst b/docs/colour.algebra.geometry.rst
index 5b6a9bed46..738eb155fa 100644
--- a/docs/colour.algebra.geometry.rst
+++ b/docs/colour.algebra.geometry.rst
@@ -1,5 +1,5 @@
-colour.algebra.geometry Module
-==============================
+colour\.algebra\.geometry Module
+================================
.. automodule:: colour.algebra.geometry
:members:
diff --git a/docs/colour.algebra.interpolation.rst b/docs/colour.algebra.interpolation.rst
index c10cd9613e..aa39bcbb93 100644
--- a/docs/colour.algebra.interpolation.rst
+++ b/docs/colour.algebra.interpolation.rst
@@ -1,5 +1,5 @@
-colour.algebra.interpolation Module
-===================================
+colour\.algebra\.interpolation Module
+=====================================
.. automodule:: colour.algebra.interpolation
:members:
diff --git a/docs/colour.algebra.matrix.rst b/docs/colour.algebra.matrix.rst
index f6a86752a0..eeb947b28f 100644
--- a/docs/colour.algebra.matrix.rst
+++ b/docs/colour.algebra.matrix.rst
@@ -1,5 +1,5 @@
-colour.algebra.matrix Module
-============================
+colour\.algebra\.matrix Module
+==============================
.. automodule:: colour.algebra.matrix
:members:
diff --git a/docs/colour.algebra.random.rst b/docs/colour.algebra.random.rst
index b77013087a..a7d094e392 100644
--- a/docs/colour.algebra.random.rst
+++ b/docs/colour.algebra.random.rst
@@ -1,5 +1,5 @@
-colour.algebra.random Module
-============================
+colour\.algebra\.random Module
+==============================
.. automodule:: colour.algebra.random
:members:
diff --git a/docs/colour.algebra.rst b/docs/colour.algebra.rst
index 320cf40d79..d81008d7cb 100644
--- a/docs/colour.algebra.rst
+++ b/docs/colour.algebra.rst
@@ -1,5 +1,5 @@
-colour.algebra Package
-======================
+colour\.algebra Package
+=======================
Sub-Packages
------------
diff --git a/docs/colour.appearance.atd95.rst b/docs/colour.appearance.atd95.rst
index 06b3a677ac..273a4d7e3d 100644
--- a/docs/colour.appearance.atd95.rst
+++ b/docs/colour.appearance.atd95.rst
@@ -1,5 +1,5 @@
-colour.appearance.atd95 Module
-==============================
+colour\.appearance\.atd95 Module
+================================
.. automodule:: colour.appearance.atd95
:members:
diff --git a/docs/colour.appearance.ciecam02.rst b/docs/colour.appearance.ciecam02.rst
index d62c34848a..550df1c4fa 100644
--- a/docs/colour.appearance.ciecam02.rst
+++ b/docs/colour.appearance.ciecam02.rst
@@ -1,5 +1,5 @@
-colour.appearance.ciecam02 Module
-=================================
+colour\.appearance\.ciecam02 Module
+===================================
.. automodule:: colour.appearance.ciecam02
:members:
diff --git a/docs/colour.appearance.hunt.rst b/docs/colour.appearance.hunt.rst
index aa79c5eb4a..f73b8e94ac 100644
--- a/docs/colour.appearance.hunt.rst
+++ b/docs/colour.appearance.hunt.rst
@@ -1,5 +1,5 @@
-colour.appearance.hunt Module
-=============================
+colour\.appearance\.hunt Module
+===============================
.. automodule:: colour.appearance.hunt
:members:
diff --git a/docs/colour.appearance.llab.rst b/docs/colour.appearance.llab.rst
index 78c8fd8114..ae2e155ac6 100644
--- a/docs/colour.appearance.llab.rst
+++ b/docs/colour.appearance.llab.rst
@@ -1,5 +1,5 @@
-colour.appearance.llab Module
-=============================
+colour\.appearance\.llab Module
+===============================
.. automodule:: colour.appearance.llab
:members:
diff --git a/docs/colour.appearance.nayatani95.rst b/docs/colour.appearance.nayatani95.rst
index a663453528..6b0716395b 100644
--- a/docs/colour.appearance.nayatani95.rst
+++ b/docs/colour.appearance.nayatani95.rst
@@ -1,5 +1,5 @@
-colour.appearance.nayatani95 Module
-===================================
+colour\.appearance\.nayatani95 Module
+=====================================
.. automodule:: colour.appearance.nayatani95
:members:
diff --git a/docs/colour.appearance.rlab.rst b/docs/colour.appearance.rlab.rst
index d7ca5b72d8..2ac42bde5e 100644
--- a/docs/colour.appearance.rlab.rst
+++ b/docs/colour.appearance.rlab.rst
@@ -1,5 +1,5 @@
-colour.appearance.rlab Module
-=============================
+colour\.appearance\.rlab Module
+===============================
.. automodule:: colour.appearance.rlab
:members:
diff --git a/docs/colour.appearance.rst b/docs/colour.appearance.rst
index f866f68acc..854fdb8535 100644
--- a/docs/colour.appearance.rst
+++ b/docs/colour.appearance.rst
@@ -1,5 +1,5 @@
-colour.appearance Package
-=========================
+colour\.appearance Package
+==========================
Sub-Modules
-----------
diff --git a/docs/colour.biochemistry.michaelis_menten.rst b/docs/colour.biochemistry.michaelis_menten.rst
new file mode 100644
index 0000000000..99881cfbf9
--- /dev/null
+++ b/docs/colour.biochemistry.michaelis_menten.rst
@@ -0,0 +1,7 @@
+colour\.biochemistry\.michaelis\_menten Module
+==============================================
+
+.. automodule:: colour.biochemistry.michaelis_menten
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.biochemistry.rst b/docs/colour.biochemistry.rst
new file mode 100644
index 0000000000..7cac1caf64
--- /dev/null
+++ b/docs/colour.biochemistry.rst
@@ -0,0 +1,17 @@
+colour\.biochemistry Package
+============================
+
+Sub-Modules
+-----------
+
+.. toctree::
+
+ colour.biochemistry.michaelis_menten
+
+Module Contents
+---------------
+
+.. automodule:: colour.biochemistry
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.characterisation.cameras.rst b/docs/colour.characterisation.cameras.rst
index 0f7a3ed19b..bc3a2ce576 100644
--- a/docs/colour.characterisation.cameras.rst
+++ b/docs/colour.characterisation.cameras.rst
@@ -1,5 +1,5 @@
-colour.characterisation.cameras Module
-======================================
+colour\.characterisation\.cameras Module
+========================================
.. automodule:: colour.characterisation.cameras
:members:
diff --git a/docs/colour.characterisation.dataset.cameras.dslr.rst b/docs/colour.characterisation.dataset.cameras.dslr.rst
index 66df8935fe..346bf6b668 100644
--- a/docs/colour.characterisation.dataset.cameras.dslr.rst
+++ b/docs/colour.characterisation.dataset.cameras.dslr.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.cameras.dslr Package
-====================================================
+colour\.characterisation\.dataset\.cameras\.dslr Package
+========================================================
Sub-Modules
-----------
diff --git a/docs/colour.characterisation.dataset.cameras.dslr.spectral_sensitivities.rst b/docs/colour.characterisation.dataset.cameras.dslr.spectral_sensitivities.rst
index d45c7a607f..7406d27fbc 100644
--- a/docs/colour.characterisation.dataset.cameras.dslr.spectral_sensitivities.rst
+++ b/docs/colour.characterisation.dataset.cameras.dslr.spectral_sensitivities.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.cameras.dslr.spectral_sensitivities Module
-==========================================================================
+colour\.characterisation\.dataset\.cameras\.dslr\.spectral\_sensitivities Module
+================================================================================
.. automodule:: colour.characterisation.dataset.cameras.dslr.spectral_sensitivities
:members:
diff --git a/docs/colour.characterisation.dataset.cameras.rst b/docs/colour.characterisation.dataset.cameras.rst
index c7dc91ddd0..428f3889ed 100644
--- a/docs/colour.characterisation.dataset.cameras.rst
+++ b/docs/colour.characterisation.dataset.cameras.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.cameras Package
-===============================================
+colour\.characterisation\.dataset\.cameras Package
+==================================================
Sub-Packages
------------
diff --git a/docs/colour.characterisation.dataset.colour_checkers.chromaticity_coordinates.rst b/docs/colour.characterisation.dataset.colour_checkers.chromaticity_coordinates.rst
index ecfba97354..1a32afd4fd 100644
--- a/docs/colour.characterisation.dataset.colour_checkers.chromaticity_coordinates.rst
+++ b/docs/colour.characterisation.dataset.colour_checkers.chromaticity_coordinates.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.colour_checkers.chromaticity_coordinates Module
-===============================================================================
+colour\.characterisation\.dataset\.colour\_checkers\.chromaticity\_coordinates Module
+=====================================================================================
.. automodule:: colour.characterisation.dataset.colour_checkers.chromaticity_coordinates
:members:
diff --git a/docs/colour.characterisation.dataset.colour_checkers.rst b/docs/colour.characterisation.dataset.colour_checkers.rst
index 7b98278c9a..96e84a25ec 100644
--- a/docs/colour.characterisation.dataset.colour_checkers.rst
+++ b/docs/colour.characterisation.dataset.colour_checkers.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.colour_checkers Package
-=======================================================
+colour\.characterisation\.dataset\.colour\_checkers Package
+===========================================================
Sub-Modules
-----------
diff --git a/docs/colour.characterisation.dataset.colour_checkers.spds.rst b/docs/colour.characterisation.dataset.colour_checkers.spds.rst
index 0996e0ab7d..56a83d0bf5 100644
--- a/docs/colour.characterisation.dataset.colour_checkers.spds.rst
+++ b/docs/colour.characterisation.dataset.colour_checkers.spds.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.colour_checkers.spds Module
-===========================================================
+colour\.characterisation\.dataset\.colour\_checkers\.spds Module
+================================================================
.. automodule:: colour.characterisation.dataset.colour_checkers.spds
:members:
diff --git a/docs/colour.characterisation.dataset.displays.crt.rgb_primaries.rst b/docs/colour.characterisation.dataset.displays.crt.rgb_primaries.rst
index 2f866d3bb6..19033c3930 100644
--- a/docs/colour.characterisation.dataset.displays.crt.rgb_primaries.rst
+++ b/docs/colour.characterisation.dataset.displays.crt.rgb_primaries.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.displays.crt.rgb_primaries Module
-=================================================================
+colour\.characterisation\.dataset\.displays\.crt\.rgb\_primaries Module
+=======================================================================
.. automodule:: colour.characterisation.dataset.displays.crt.rgb_primaries
:members:
diff --git a/docs/colour.characterisation.dataset.displays.crt.rst b/docs/colour.characterisation.dataset.displays.crt.rst
index 72d65cb875..7c23d8701e 100644
--- a/docs/colour.characterisation.dataset.displays.crt.rst
+++ b/docs/colour.characterisation.dataset.displays.crt.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.displays.crt Package
-====================================================
+colour\.characterisation\.dataset\.displays\.crt Package
+========================================================
Sub-Modules
-----------
diff --git a/docs/colour.characterisation.dataset.displays.lcd.rgb_primaries.rst b/docs/colour.characterisation.dataset.displays.lcd.rgb_primaries.rst
index fd6e673b7a..8865451404 100644
--- a/docs/colour.characterisation.dataset.displays.lcd.rgb_primaries.rst
+++ b/docs/colour.characterisation.dataset.displays.lcd.rgb_primaries.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.displays.lcd.rgb_primaries Module
-=================================================================
+colour\.characterisation\.dataset\.displays\.lcd\.rgb\_primaries Module
+=======================================================================
.. automodule:: colour.characterisation.dataset.displays.lcd.rgb_primaries
:members:
diff --git a/docs/colour.characterisation.dataset.displays.lcd.rst b/docs/colour.characterisation.dataset.displays.lcd.rst
index 45a7f78bb4..a84a81cb79 100644
--- a/docs/colour.characterisation.dataset.displays.lcd.rst
+++ b/docs/colour.characterisation.dataset.displays.lcd.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.displays.lcd Package
-====================================================
+colour\.characterisation\.dataset\.displays\.lcd Package
+========================================================
Sub-Modules
-----------
diff --git a/docs/colour.characterisation.dataset.displays.rst b/docs/colour.characterisation.dataset.displays.rst
index 12d534baef..051e19d472 100644
--- a/docs/colour.characterisation.dataset.displays.rst
+++ b/docs/colour.characterisation.dataset.displays.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset.displays Package
-================================================
+colour\.characterisation\.dataset\.displays Package
+===================================================
Sub-Packages
------------
diff --git a/docs/colour.characterisation.dataset.rst b/docs/colour.characterisation.dataset.rst
index f4a626c9ce..936f8542e3 100644
--- a/docs/colour.characterisation.dataset.rst
+++ b/docs/colour.characterisation.dataset.rst
@@ -1,5 +1,5 @@
-colour.characterisation.dataset Package
-=======================================
+colour\.characterisation\.dataset Package
+=========================================
Sub-Packages
------------
diff --git a/docs/colour.characterisation.displays.rst b/docs/colour.characterisation.displays.rst
index 75399fb57a..aca7b8b030 100644
--- a/docs/colour.characterisation.displays.rst
+++ b/docs/colour.characterisation.displays.rst
@@ -1,5 +1,5 @@
-colour.characterisation.displays Module
-=======================================
+colour\.characterisation\.displays Module
+=========================================
.. automodule:: colour.characterisation.displays
:members:
diff --git a/docs/colour.characterisation.fitting.rst b/docs/colour.characterisation.fitting.rst
index d108673619..2fa0e86cf4 100644
--- a/docs/colour.characterisation.fitting.rst
+++ b/docs/colour.characterisation.fitting.rst
@@ -1,5 +1,5 @@
-colour.characterisation.fitting Module
-======================================
+colour\.characterisation\.fitting Module
+========================================
.. automodule:: colour.characterisation.fitting
:members:
diff --git a/docs/colour.characterisation.rst b/docs/colour.characterisation.rst
index 178e287d01..094d23a060 100644
--- a/docs/colour.characterisation.rst
+++ b/docs/colour.characterisation.rst
@@ -1,5 +1,5 @@
-colour.characterisation Package
-===============================
+colour\.characterisation Package
+================================
Sub-Packages
------------
diff --git a/docs/colour.colorimetry.blackbody.rst b/docs/colour.colorimetry.blackbody.rst
index c618dcd3c7..5a57fccfb1 100644
--- a/docs/colour.colorimetry.blackbody.rst
+++ b/docs/colour.colorimetry.blackbody.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.blackbody Module
-===================================
+colour\.colorimetry\.blackbody Module
+=====================================
.. automodule:: colour.colorimetry.blackbody
:members:
diff --git a/docs/colour.colorimetry.cmfs.rst b/docs/colour.colorimetry.cmfs.rst
index 565036d160..fbff701238 100644
--- a/docs/colour.colorimetry.cmfs.rst
+++ b/docs/colour.colorimetry.cmfs.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.cmfs Module
-==============================
+colour\.colorimetry\.cmfs Module
+================================
.. automodule:: colour.colorimetry.cmfs
:members:
diff --git a/docs/colour.colorimetry.correction.rst b/docs/colour.colorimetry.correction.rst
index e9d596e176..a0aa24d0d4 100644
--- a/docs/colour.colorimetry.correction.rst
+++ b/docs/colour.colorimetry.correction.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.correction Module
-====================================
+colour\.colorimetry\.correction Module
+======================================
.. automodule:: colour.colorimetry.correction
:members:
diff --git a/docs/colour.colorimetry.dataset.cmfs.rst b/docs/colour.colorimetry.dataset.cmfs.rst
index ce6d688bfa..0daa12d81c 100644
--- a/docs/colour.colorimetry.dataset.cmfs.rst
+++ b/docs/colour.colorimetry.dataset.cmfs.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.cmfs Module
-======================================
+colour\.colorimetry\.dataset\.cmfs Module
+=========================================
.. automodule:: colour.colorimetry.dataset.cmfs
:members:
diff --git a/docs/colour.colorimetry.dataset.illuminants.chromaticity_coordinates.rst b/docs/colour.colorimetry.dataset.illuminants.chromaticity_coordinates.rst
index fc023ca741..fc01612cb5 100644
--- a/docs/colour.colorimetry.dataset.illuminants.chromaticity_coordinates.rst
+++ b/docs/colour.colorimetry.dataset.illuminants.chromaticity_coordinates.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.illuminants.chromaticity_coordinates Module
-======================================================================
+colour\.colorimetry\.dataset\.illuminants\.chromaticity\_coordinates Module
+===========================================================================
.. automodule:: colour.colorimetry.dataset.illuminants.chromaticity_coordinates
:members:
diff --git a/docs/colour.colorimetry.dataset.illuminants.d_illuminants_s_spds.rst b/docs/colour.colorimetry.dataset.illuminants.d_illuminants_s_spds.rst
index 03e4ac0a20..3e541b96c7 100644
--- a/docs/colour.colorimetry.dataset.illuminants.d_illuminants_s_spds.rst
+++ b/docs/colour.colorimetry.dataset.illuminants.d_illuminants_s_spds.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.illuminants.d_illuminants_s_spds Module
-==================================================================
+colour\.colorimetry\.dataset\.illuminants\.d\_illuminants\_s\_spds Module
+=========================================================================
.. automodule:: colour.colorimetry.dataset.illuminants.d_illuminants_s_spds
:members:
diff --git a/docs/colour.colorimetry.dataset.illuminants.hunterlab.rst b/docs/colour.colorimetry.dataset.illuminants.hunterlab.rst
index 13e5c74656..b33dfab5a7 100644
--- a/docs/colour.colorimetry.dataset.illuminants.hunterlab.rst
+++ b/docs/colour.colorimetry.dataset.illuminants.hunterlab.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.illuminants.hunterlab Module
-=======================================================
+colour\.colorimetry\.dataset\.illuminants\.hunterlab Module
+===========================================================
.. automodule:: colour.colorimetry.dataset.illuminants.hunterlab
:members:
diff --git a/docs/colour.colorimetry.dataset.illuminants.rst b/docs/colour.colorimetry.dataset.illuminants.rst
index 0afc8233b9..a8e68ce1b5 100644
--- a/docs/colour.colorimetry.dataset.illuminants.rst
+++ b/docs/colour.colorimetry.dataset.illuminants.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.illuminants Package
-==============================================
+colour\.colorimetry\.dataset\.illuminants Package
+=================================================
Sub-Modules
-----------
diff --git a/docs/colour.colorimetry.dataset.illuminants.spds.rst b/docs/colour.colorimetry.dataset.illuminants.spds.rst
index 2abac14f3e..fb57eb1174 100644
--- a/docs/colour.colorimetry.dataset.illuminants.spds.rst
+++ b/docs/colour.colorimetry.dataset.illuminants.spds.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.illuminants.spds Module
-==================================================
+colour\.colorimetry\.dataset\.illuminants\.spds Module
+======================================================
.. automodule:: colour.colorimetry.dataset.illuminants.spds
:members:
diff --git a/docs/colour.colorimetry.dataset.lefs.rst b/docs/colour.colorimetry.dataset.lefs.rst
index 33d345829a..22c22bc2bc 100644
--- a/docs/colour.colorimetry.dataset.lefs.rst
+++ b/docs/colour.colorimetry.dataset.lefs.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.lefs Module
-======================================
+colour\.colorimetry\.dataset\.lefs Module
+=========================================
.. automodule:: colour.colorimetry.dataset.lefs
:members:
diff --git a/docs/colour.colorimetry.dataset.light_sources.chromaticity_coordinates.rst b/docs/colour.colorimetry.dataset.light_sources.chromaticity_coordinates.rst
index 507824a380..f786375187 100644
--- a/docs/colour.colorimetry.dataset.light_sources.chromaticity_coordinates.rst
+++ b/docs/colour.colorimetry.dataset.light_sources.chromaticity_coordinates.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.light_sources.chromaticity_coordinates Module
-========================================================================
+colour\.colorimetry\.dataset\.light\_sources\.chromaticity\_coordinates Module
+==============================================================================
.. automodule:: colour.colorimetry.dataset.light_sources.chromaticity_coordinates
:members:
diff --git a/docs/colour.colorimetry.dataset.light_sources.rst b/docs/colour.colorimetry.dataset.light_sources.rst
index 112533cda2..9ae13bb6f9 100644
--- a/docs/colour.colorimetry.dataset.light_sources.rst
+++ b/docs/colour.colorimetry.dataset.light_sources.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.light_sources Package
-================================================
+colour\.colorimetry\.dataset\.light\_sources Package
+====================================================
Sub-Modules
-----------
diff --git a/docs/colour.colorimetry.dataset.light_sources.spds.rst b/docs/colour.colorimetry.dataset.light_sources.spds.rst
index 4d813007ce..5e31d0633d 100644
--- a/docs/colour.colorimetry.dataset.light_sources.spds.rst
+++ b/docs/colour.colorimetry.dataset.light_sources.spds.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset.light_sources.spds Module
-====================================================
+colour\.colorimetry\.dataset\.light\_sources\.spds Module
+=========================================================
.. automodule:: colour.colorimetry.dataset.light_sources.spds
:members:
diff --git a/docs/colour.colorimetry.dataset.rst b/docs/colour.colorimetry.dataset.rst
index 9fe80e5598..88d684f707 100644
--- a/docs/colour.colorimetry.dataset.rst
+++ b/docs/colour.colorimetry.dataset.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dataset Package
-==================================
+colour\.colorimetry\.dataset Package
+====================================
Sub-Packages
------------
diff --git a/docs/colour.colorimetry.dominant.rst b/docs/colour.colorimetry.dominant.rst
index 73095ed1d5..0751a95e72 100644
--- a/docs/colour.colorimetry.dominant.rst
+++ b/docs/colour.colorimetry.dominant.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.dominant Module
-==================================
+colour\.colorimetry\.dominant Module
+====================================
.. automodule:: colour.colorimetry.dominant
:members:
diff --git a/docs/colour.colorimetry.illuminants.rst b/docs/colour.colorimetry.illuminants.rst
index 08a5098735..9617c6c2c5 100644
--- a/docs/colour.colorimetry.illuminants.rst
+++ b/docs/colour.colorimetry.illuminants.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.illuminants Module
-=====================================
+colour\.colorimetry\.illuminants Module
+=======================================
.. automodule:: colour.colorimetry.illuminants
:members:
diff --git a/docs/colour.colorimetry.lefs.rst b/docs/colour.colorimetry.lefs.rst
index a7c790e0f9..58d3cc7017 100644
--- a/docs/colour.colorimetry.lefs.rst
+++ b/docs/colour.colorimetry.lefs.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.lefs Module
-==============================
+colour\.colorimetry\.lefs Module
+================================
.. automodule:: colour.colorimetry.lefs
:members:
diff --git a/docs/colour.colorimetry.lightness.rst b/docs/colour.colorimetry.lightness.rst
index 953c9c4ec6..80d7788c0b 100644
--- a/docs/colour.colorimetry.lightness.rst
+++ b/docs/colour.colorimetry.lightness.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.lightness Module
-===================================
+colour\.colorimetry\.lightness Module
+=====================================
.. automodule:: colour.colorimetry.lightness
:members:
diff --git a/docs/colour.colorimetry.luminance.rst b/docs/colour.colorimetry.luminance.rst
index 4648fc29d6..95ab8d4ce3 100644
--- a/docs/colour.colorimetry.luminance.rst
+++ b/docs/colour.colorimetry.luminance.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.luminance Module
-===================================
+colour\.colorimetry\.luminance Module
+=====================================
.. automodule:: colour.colorimetry.luminance
:members:
diff --git a/docs/colour.colorimetry.photometry.rst b/docs/colour.colorimetry.photometry.rst
index d2bd3ab5fa..c5369803fa 100644
--- a/docs/colour.colorimetry.photometry.rst
+++ b/docs/colour.colorimetry.photometry.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.photometry Module
-====================================
+colour\.colorimetry\.photometry Module
+======================================
.. automodule:: colour.colorimetry.photometry
:members:
diff --git a/docs/colour.colorimetry.rst b/docs/colour.colorimetry.rst
index 27363d53e1..545bd1c29a 100644
--- a/docs/colour.colorimetry.rst
+++ b/docs/colour.colorimetry.rst
@@ -1,5 +1,5 @@
-colour.colorimetry Package
-==========================
+colour\.colorimetry Package
+===========================
Sub-Packages
------------
@@ -26,6 +26,7 @@ Sub-Modules
colour.colorimetry.transformations
colour.colorimetry.tristimulus
colour.colorimetry.whiteness
+ colour.colorimetry.yellowness
Module Contents
---------------
diff --git a/docs/colour.colorimetry.spectrum.rst b/docs/colour.colorimetry.spectrum.rst
index e1d225f2d0..340cf38b21 100644
--- a/docs/colour.colorimetry.spectrum.rst
+++ b/docs/colour.colorimetry.spectrum.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.spectrum Module
-==================================
+colour\.colorimetry\.spectrum Module
+====================================
.. automodule:: colour.colorimetry.spectrum
:members:
diff --git a/docs/colour.colorimetry.transformations.rst b/docs/colour.colorimetry.transformations.rst
index 456ad1cd48..49f32ff720 100644
--- a/docs/colour.colorimetry.transformations.rst
+++ b/docs/colour.colorimetry.transformations.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.transformations Module
-=========================================
+colour\.colorimetry\.transformations Module
+===========================================
.. automodule:: colour.colorimetry.transformations
:members:
diff --git a/docs/colour.colorimetry.tristimulus.rst b/docs/colour.colorimetry.tristimulus.rst
index 5ca7feed02..8b0e6959fa 100644
--- a/docs/colour.colorimetry.tristimulus.rst
+++ b/docs/colour.colorimetry.tristimulus.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.tristimulus Module
-=====================================
+colour\.colorimetry\.tristimulus Module
+=======================================
.. automodule:: colour.colorimetry.tristimulus
:members:
diff --git a/docs/colour.colorimetry.whiteness.rst b/docs/colour.colorimetry.whiteness.rst
index bfd3e2a599..b7c5047c6e 100644
--- a/docs/colour.colorimetry.whiteness.rst
+++ b/docs/colour.colorimetry.whiteness.rst
@@ -1,5 +1,5 @@
-colour.colorimetry.whiteness Module
-===================================
+colour\.colorimetry\.whiteness Module
+=====================================
.. automodule:: colour.colorimetry.whiteness
:members:
diff --git a/docs/colour.colorimetry.yellowness.rst b/docs/colour.colorimetry.yellowness.rst
new file mode 100644
index 0000000000..ba70989c88
--- /dev/null
+++ b/docs/colour.colorimetry.yellowness.rst
@@ -0,0 +1,7 @@
+colour\.colorimetry\.yellowness Module
+======================================
+
+.. automodule:: colour.colorimetry.yellowness
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.constants.cie.rst b/docs/colour.constants.cie.rst
index 37e53837aa..0ef1edac35 100644
--- a/docs/colour.constants.cie.rst
+++ b/docs/colour.constants.cie.rst
@@ -1,5 +1,5 @@
-colour.constants.cie Module
-===========================
+colour\.constants\.cie Module
+=============================
.. automodule:: colour.constants.cie
:members:
diff --git a/docs/colour.constants.codata.rst b/docs/colour.constants.codata.rst
index 32ffe79c64..8ce70af832 100644
--- a/docs/colour.constants.codata.rst
+++ b/docs/colour.constants.codata.rst
@@ -1,5 +1,5 @@
-colour.constants.codata Module
-==============================
+colour\.constants\.codata Module
+================================
.. automodule:: colour.constants.codata
:members:
diff --git a/docs/colour.constants.common.rst b/docs/colour.constants.common.rst
index a8089c95aa..a51f333fcb 100644
--- a/docs/colour.constants.common.rst
+++ b/docs/colour.constants.common.rst
@@ -1,5 +1,5 @@
-colour.constants.common Module
-==============================
+colour\.constants\.common Module
+================================
.. automodule:: colour.constants.common
:members:
diff --git a/docs/colour.constants.rst b/docs/colour.constants.rst
index 5607be9874..a4be3c6f17 100644
--- a/docs/colour.constants.rst
+++ b/docs/colour.constants.rst
@@ -1,5 +1,5 @@
-colour.constants Package
-========================
+colour\.constants Package
+=========================
Sub-Modules
-----------
diff --git a/docs/colour.corresponding.dataset.corresponding_chromaticities.rst b/docs/colour.corresponding.dataset.corresponding_chromaticities.rst
index 1763180fb4..43920bdac4 100644
--- a/docs/colour.corresponding.dataset.corresponding_chromaticities.rst
+++ b/docs/colour.corresponding.dataset.corresponding_chromaticities.rst
@@ -1,5 +1,5 @@
-colour.corresponding.dataset.corresponding_chromaticities Module
-================================================================
+colour\.corresponding\.dataset\.corresponding\_chromaticities Module
+====================================================================
.. automodule:: colour.corresponding.dataset.corresponding_chromaticities
:members:
diff --git a/docs/colour.corresponding.dataset.rst b/docs/colour.corresponding.dataset.rst
index e752d8cfa2..98dfb35897 100644
--- a/docs/colour.corresponding.dataset.rst
+++ b/docs/colour.corresponding.dataset.rst
@@ -1,5 +1,5 @@
-colour.corresponding.dataset Package
-====================================
+colour\.corresponding\.dataset Package
+======================================
Sub-Modules
-----------
diff --git a/docs/colour.corresponding.prediction.rst b/docs/colour.corresponding.prediction.rst
index 38e3634add..0b01669a40 100644
--- a/docs/colour.corresponding.prediction.rst
+++ b/docs/colour.corresponding.prediction.rst
@@ -1,5 +1,5 @@
-colour.corresponding.prediction Module
-======================================
+colour\.corresponding\.prediction Module
+========================================
.. automodule:: colour.corresponding.prediction
:members:
diff --git a/docs/colour.corresponding.rst b/docs/colour.corresponding.rst
index 150b3d326a..edf4581adc 100644
--- a/docs/colour.corresponding.rst
+++ b/docs/colour.corresponding.rst
@@ -1,5 +1,5 @@
-colour.corresponding Package
-============================
+colour\.corresponding Package
+=============================
Sub-Packages
------------
diff --git a/docs/colour.difference.delta_e.rst b/docs/colour.difference.delta_e.rst
index bf706fa049..2fbb9854cf 100644
--- a/docs/colour.difference.delta_e.rst
+++ b/docs/colour.difference.delta_e.rst
@@ -1,5 +1,5 @@
-colour.difference.delta_e Module
-================================
+colour\.difference\.delta\_e Module
+===================================
.. automodule:: colour.difference.delta_e
:members:
diff --git a/docs/colour.difference.delta_e_luo2006.rst b/docs/colour.difference.delta_e_luo2006.rst
index 321d9465e1..0d88c8317a 100644
--- a/docs/colour.difference.delta_e_luo2006.rst
+++ b/docs/colour.difference.delta_e_luo2006.rst
@@ -1,5 +1,5 @@
-colour.difference.delta_e_luo2006 Module
-========================================
+colour\.difference\.delta\_e\_luo2006 Module
+============================================
.. automodule:: colour.difference.delta_e_luo2006
:members:
diff --git a/docs/colour.difference.rst b/docs/colour.difference.rst
index 59f095414c..f7ff90fcc1 100644
--- a/docs/colour.difference.rst
+++ b/docs/colour.difference.rst
@@ -1,5 +1,5 @@
-colour.difference Package
-=========================
+colour\.difference Package
+==========================
Sub-Modules
-----------
diff --git a/docs/colour.io.common.rst b/docs/colour.io.common.rst
index 9911a370eb..c3756bb17e 100644
--- a/docs/colour.io.common.rst
+++ b/docs/colour.io.common.rst
@@ -1,5 +1,5 @@
-colour.io.common Module
-=======================
+colour\.io\.common Module
+=========================
.. automodule:: colour.io.common
:members:
diff --git a/docs/colour.io.ies_tm2714.rst b/docs/colour.io.ies_tm2714.rst
index 116283818c..cfaf79dabf 100644
--- a/docs/colour.io.ies_tm2714.rst
+++ b/docs/colour.io.ies_tm2714.rst
@@ -1,5 +1,5 @@
-colour.io.ies_tm2714 Module
-===========================
+colour\.io\.ies\_tm2714 Module
+==============================
.. automodule:: colour.io.ies_tm2714
:members:
diff --git a/docs/colour.io.image.rst b/docs/colour.io.image.rst
index ce07a74979..cd4e11b9c6 100644
--- a/docs/colour.io.image.rst
+++ b/docs/colour.io.image.rst
@@ -1,5 +1,5 @@
-colour.io.image Module
-======================
+colour\.io\.image Module
+========================
.. automodule:: colour.io.image
:members:
diff --git a/docs/colour.io.rst b/docs/colour.io.rst
index cfa4f17795..661208531c 100644
--- a/docs/colour.io.rst
+++ b/docs/colour.io.rst
@@ -1,5 +1,5 @@
-colour.io Package
-=================
+colour\.io Package
+==================
Sub-Modules
-----------
diff --git a/docs/colour.io.tabular.rst b/docs/colour.io.tabular.rst
index f7f5b5d57c..732b4c4650 100644
--- a/docs/colour.io.tabular.rst
+++ b/docs/colour.io.tabular.rst
@@ -1,5 +1,5 @@
-colour.io.tabular Module
-========================
+colour\.io\.tabular Module
+==========================
.. automodule:: colour.io.tabular
:members:
diff --git a/docs/colour.io.xrite.rst b/docs/colour.io.xrite.rst
index 5f089a5b63..983000edfd 100644
--- a/docs/colour.io.xrite.rst
+++ b/docs/colour.io.xrite.rst
@@ -1,5 +1,5 @@
-colour.io.xrite Module
-======================
+colour\.io\.xrite Module
+========================
.. automodule:: colour.io.xrite
:members:
diff --git a/docs/colour.models.cie_lab.rst b/docs/colour.models.cie_lab.rst
index 1e09dc14c2..1f2f8b8a4d 100644
--- a/docs/colour.models.cie_lab.rst
+++ b/docs/colour.models.cie_lab.rst
@@ -1,5 +1,5 @@
-colour.models.cie_lab Module
-============================
+colour\.models\.cie\_lab Module
+===============================
.. automodule:: colour.models.cie_lab
:members:
diff --git a/docs/colour.models.cie_luv.rst b/docs/colour.models.cie_luv.rst
index e31c104c57..7eeb776dec 100644
--- a/docs/colour.models.cie_luv.rst
+++ b/docs/colour.models.cie_luv.rst
@@ -1,5 +1,5 @@
-colour.models.cie_luv Module
-============================
+colour\.models\.cie\_luv Module
+===============================
.. automodule:: colour.models.cie_luv
:members:
diff --git a/docs/colour.models.cie_ucs.rst b/docs/colour.models.cie_ucs.rst
index 7ec888d0b9..0fd368fc31 100644
--- a/docs/colour.models.cie_ucs.rst
+++ b/docs/colour.models.cie_ucs.rst
@@ -1,5 +1,5 @@
-colour.models.cie_ucs Module
-============================
+colour\.models\.cie\_ucs Module
+===============================
.. automodule:: colour.models.cie_ucs
:members:
diff --git a/docs/colour.models.cie_uvw.rst b/docs/colour.models.cie_uvw.rst
index 9dceb34b7b..a9bc109fb4 100644
--- a/docs/colour.models.cie_uvw.rst
+++ b/docs/colour.models.cie_uvw.rst
@@ -1,5 +1,5 @@
-colour.models.cie_uvw Module
-============================
+colour\.models\.cie\_uvw Module
+===============================
.. automodule:: colour.models.cie_uvw
:members:
diff --git a/docs/colour.models.cie_xyy.rst b/docs/colour.models.cie_xyy.rst
index 4a81739499..82466b92bf 100644
--- a/docs/colour.models.cie_xyy.rst
+++ b/docs/colour.models.cie_xyy.rst
@@ -1,5 +1,5 @@
-colour.models.cie_xyy Module
-============================
+colour\.models\.cie\_xyy Module
+===============================
.. automodule:: colour.models.cie_xyy
:members:
diff --git a/docs/colour.models.common.rst b/docs/colour.models.common.rst
index 76593cd552..d9793117be 100644
--- a/docs/colour.models.common.rst
+++ b/docs/colour.models.common.rst
@@ -1,5 +1,5 @@
-colour.models.common Module
-===========================
+colour\.models\.common Module
+=============================
.. automodule:: colour.models.common
:members:
diff --git a/docs/colour.models.dataset.pointer_gamut.rst b/docs/colour.models.dataset.pointer_gamut.rst
index d8ad381128..97df227572 100644
--- a/docs/colour.models.dataset.pointer_gamut.rst
+++ b/docs/colour.models.dataset.pointer_gamut.rst
@@ -1,5 +1,5 @@
-colour.models.dataset.pointer_gamut Module
-==========================================
+colour\.models\.dataset\.pointer\_gamut Module
+==============================================
.. automodule:: colour.models.dataset.pointer_gamut
:members:
diff --git a/docs/colour.models.dataset.rst b/docs/colour.models.dataset.rst
index 310b278530..c9d2150639 100644
--- a/docs/colour.models.dataset.rst
+++ b/docs/colour.models.dataset.rst
@@ -1,5 +1,5 @@
-colour.models.dataset Package
-=============================
+colour\.models\.dataset Package
+===============================
Sub-Modules
-----------
diff --git a/docs/colour.models.hdr_cie_lab.rst b/docs/colour.models.hdr_cie_lab.rst
new file mode 100644
index 0000000000..9f3213af27
--- /dev/null
+++ b/docs/colour.models.hdr_cie_lab.rst
@@ -0,0 +1,7 @@
+colour\.models\.hdr\_cie\_lab Module
+====================================
+
+.. automodule:: colour.models.hdr_cie_lab
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.hdr_ipt.rst b/docs/colour.models.hdr_ipt.rst
new file mode 100644
index 0000000000..a2bcf33354
--- /dev/null
+++ b/docs/colour.models.hdr_ipt.rst
@@ -0,0 +1,7 @@
+colour\.models\.hdr\_ipt Module
+===============================
+
+.. automodule:: colour.models.hdr_ipt
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.hunter_lab.rst b/docs/colour.models.hunter_lab.rst
index 1e520945f6..829484fd07 100644
--- a/docs/colour.models.hunter_lab.rst
+++ b/docs/colour.models.hunter_lab.rst
@@ -1,5 +1,5 @@
-colour.models.hunter_lab Module
-===============================
+colour\.models\.hunter\_lab Module
+==================================
.. automodule:: colour.models.hunter_lab
:members:
diff --git a/docs/colour.models.hunter_rdab.rst b/docs/colour.models.hunter_rdab.rst
index 82b5be8c4e..8c146b7077 100644
--- a/docs/colour.models.hunter_rdab.rst
+++ b/docs/colour.models.hunter_rdab.rst
@@ -1,5 +1,5 @@
-colour.models.hunter_rdab Module
-================================
+colour\.models\.hunter\_rdab Module
+===================================
.. automodule:: colour.models.hunter_rdab
:members:
diff --git a/docs/colour.models.ipt.rst b/docs/colour.models.ipt.rst
index 8ee85f892f..bbdab9db3a 100644
--- a/docs/colour.models.ipt.rst
+++ b/docs/colour.models.ipt.rst
@@ -1,5 +1,5 @@
-colour.models.ipt Module
-========================
+colour\.models\.ipt Module
+==========================
.. automodule:: colour.models.ipt
:members:
diff --git a/docs/colour.models.rgb.aces_it.rst b/docs/colour.models.rgb.aces_it.rst
index ed5a106b6a..5b9084bfd9 100644
--- a/docs/colour.models.rgb.aces_it.rst
+++ b/docs/colour.models.rgb.aces_it.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.aces_it Module
-================================
+colour\.models\.rgb\.aces\_it Module
+====================================
.. automodule:: colour.models.rgb.aces_it
:members:
diff --git a/docs/colour.models.rgb.common.rst b/docs/colour.models.rgb.common.rst
index 8ad56ae84c..785dfc2a2a 100644
--- a/docs/colour.models.rgb.common.rst
+++ b/docs/colour.models.rgb.common.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.common Module
-===============================
+colour\.models\.rgb\.common Module
+==================================
.. automodule:: colour.models.rgb.common
:members:
diff --git a/docs/colour.models.rgb.dataset.aces.rst b/docs/colour.models.rgb.dataset.aces.rst
index a04a5c898d..df5d2b1657 100644
--- a/docs/colour.models.rgb.dataset.aces.rst
+++ b/docs/colour.models.rgb.dataset.aces.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.aces Module
-=====================================
+colour\.models\.rgb\.dataset\.aces Module
+=========================================
.. automodule:: colour.models.rgb.dataset.aces
:members:
diff --git a/docs/colour.models.rgb.dataset.aces_it.rst b/docs/colour.models.rgb.dataset.aces_it.rst
index ce87978e0a..ef35ce669b 100644
--- a/docs/colour.models.rgb.dataset.aces_it.rst
+++ b/docs/colour.models.rgb.dataset.aces_it.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.aces_it Module
-========================================
+colour\.models\.rgb\.dataset\.aces\_it Module
+=============================================
.. automodule:: colour.models.rgb.dataset.aces_it
:members:
diff --git a/docs/colour.models.rgb.dataset.adobe_rgb_1998.rst b/docs/colour.models.rgb.dataset.adobe_rgb_1998.rst
index 806a20034b..5ed26c58ff 100644
--- a/docs/colour.models.rgb.dataset.adobe_rgb_1998.rst
+++ b/docs/colour.models.rgb.dataset.adobe_rgb_1998.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.adobe_rgb_1998 Module
-===============================================
+colour\.models\.rgb\.dataset\.adobe\_rgb\_1998 Module
+=====================================================
.. automodule:: colour.models.rgb.dataset.adobe_rgb_1998
:members:
diff --git a/docs/colour.models.rgb.dataset.adobe_wide_gamut_rgb.rst b/docs/colour.models.rgb.dataset.adobe_wide_gamut_rgb.rst
index cc48adf6a5..aafe996027 100644
--- a/docs/colour.models.rgb.dataset.adobe_wide_gamut_rgb.rst
+++ b/docs/colour.models.rgb.dataset.adobe_wide_gamut_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.adobe_wide_gamut_rgb Module
-=====================================================
+colour\.models\.rgb\.dataset\.adobe\_wide\_gamut\_rgb Module
+============================================================
.. automodule:: colour.models.rgb.dataset.adobe_wide_gamut_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.alexa_wide_gamut_rgb.rst b/docs/colour.models.rgb.dataset.alexa_wide_gamut_rgb.rst
index 0705e3e574..1bc9b985af 100644
--- a/docs/colour.models.rgb.dataset.alexa_wide_gamut_rgb.rst
+++ b/docs/colour.models.rgb.dataset.alexa_wide_gamut_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.alexa_wide_gamut_rgb Module
-=====================================================
+colour\.models\.rgb\.dataset\.alexa\_wide\_gamut\_rgb Module
+============================================================
.. automodule:: colour.models.rgb.dataset.alexa_wide_gamut_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.apple_rgb.rst b/docs/colour.models.rgb.dataset.apple_rgb.rst
index df78710b8f..82b5dbd845 100644
--- a/docs/colour.models.rgb.dataset.apple_rgb.rst
+++ b/docs/colour.models.rgb.dataset.apple_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.apple_rgb Module
-==========================================
+colour\.models\.rgb\.dataset\.apple\_rgb Module
+===============================================
.. automodule:: colour.models.rgb.dataset.apple_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.best_rgb.rst b/docs/colour.models.rgb.dataset.best_rgb.rst
index 936522cb11..ddea5e9caf 100644
--- a/docs/colour.models.rgb.dataset.best_rgb.rst
+++ b/docs/colour.models.rgb.dataset.best_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.best_rgb Module
-=========================================
+colour\.models\.rgb\.dataset\.best\_rgb Module
+==============================================
.. automodule:: colour.models.rgb.dataset.best_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.beta_rgb.rst b/docs/colour.models.rgb.dataset.beta_rgb.rst
index b796baddce..f79d190448 100644
--- a/docs/colour.models.rgb.dataset.beta_rgb.rst
+++ b/docs/colour.models.rgb.dataset.beta_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.beta_rgb Module
-=========================================
+colour\.models\.rgb\.dataset\.beta\_rgb Module
+==============================================
.. automodule:: colour.models.rgb.dataset.beta_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.cie_rgb.rst b/docs/colour.models.rgb.dataset.cie_rgb.rst
index ef8342c3a9..e5f69e1c67 100644
--- a/docs/colour.models.rgb.dataset.cie_rgb.rst
+++ b/docs/colour.models.rgb.dataset.cie_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.cie_rgb Module
-========================================
+colour\.models\.rgb\.dataset\.cie\_rgb Module
+=============================================
.. automodule:: colour.models.rgb.dataset.cie_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.cinema_gamut.rst b/docs/colour.models.rgb.dataset.cinema_gamut.rst
index 4411f91ec3..82e0c7b04b 100644
--- a/docs/colour.models.rgb.dataset.cinema_gamut.rst
+++ b/docs/colour.models.rgb.dataset.cinema_gamut.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.cinema_gamut Module
-=============================================
+colour\.models\.rgb\.dataset\.cinema\_gamut Module
+==================================================
.. automodule:: colour.models.rgb.dataset.cinema_gamut
:members:
diff --git a/docs/colour.models.rgb.dataset.color_match_rgb.rst b/docs/colour.models.rgb.dataset.color_match_rgb.rst
index aa07e8fc93..071f66a531 100644
--- a/docs/colour.models.rgb.dataset.color_match_rgb.rst
+++ b/docs/colour.models.rgb.dataset.color_match_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.color_match_rgb Module
-================================================
+colour\.models\.rgb\.dataset\.color\_match\_rgb Module
+======================================================
.. automodule:: colour.models.rgb.dataset.color_match_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.dci_p3.rst b/docs/colour.models.rgb.dataset.dci_p3.rst
index 084fa65500..29a3e593db 100644
--- a/docs/colour.models.rgb.dataset.dci_p3.rst
+++ b/docs/colour.models.rgb.dataset.dci_p3.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.dci_p3 Module
-=======================================
+colour\.models\.rgb\.dataset\.dci\_p3 Module
+============================================
.. automodule:: colour.models.rgb.dataset.dci_p3
:members:
diff --git a/docs/colour.models.rgb.dataset.don_rgb_4.rst b/docs/colour.models.rgb.dataset.don_rgb_4.rst
index 90382f7f4f..75af7d9fc8 100644
--- a/docs/colour.models.rgb.dataset.don_rgb_4.rst
+++ b/docs/colour.models.rgb.dataset.don_rgb_4.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.don_rgb_4 Module
-==========================================
+colour\.models\.rgb\.dataset\.don\_rgb\_4 Module
+================================================
.. automodule:: colour.models.rgb.dataset.don_rgb_4
:members:
diff --git a/docs/colour.models.rgb.dataset.eci_rgb_v2.rst b/docs/colour.models.rgb.dataset.eci_rgb_v2.rst
index eb3a134628..43b74548cb 100644
--- a/docs/colour.models.rgb.dataset.eci_rgb_v2.rst
+++ b/docs/colour.models.rgb.dataset.eci_rgb_v2.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.eci_rgb_v2 Module
-===========================================
+colour\.models\.rgb\.dataset\.eci\_rgb\_v2 Module
+=================================================
.. automodule:: colour.models.rgb.dataset.eci_rgb_v2
:members:
diff --git a/docs/colour.models.rgb.dataset.ekta_space_ps5.rst b/docs/colour.models.rgb.dataset.ekta_space_ps5.rst
index 628b7c9845..7726ec018f 100644
--- a/docs/colour.models.rgb.dataset.ekta_space_ps5.rst
+++ b/docs/colour.models.rgb.dataset.ekta_space_ps5.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.ekta_space_ps5 Module
-===============================================
+colour\.models\.rgb\.dataset\.ekta\_space\_ps5 Module
+=====================================================
.. automodule:: colour.models.rgb.dataset.ekta_space_ps5
:members:
diff --git a/docs/colour.models.rgb.dataset.gopro.rst b/docs/colour.models.rgb.dataset.gopro.rst
new file mode 100644
index 0000000000..a6cd2fa939
--- /dev/null
+++ b/docs/colour.models.rgb.dataset.gopro.rst
@@ -0,0 +1,7 @@
+colour\.models\.rgb\.dataset\.gopro Module
+==========================================
+
+.. automodule:: colour.models.rgb.dataset.gopro
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.rgb.dataset.max_rgb.rst b/docs/colour.models.rgb.dataset.max_rgb.rst
index 6dacd3d0b8..5da26e6a46 100644
--- a/docs/colour.models.rgb.dataset.max_rgb.rst
+++ b/docs/colour.models.rgb.dataset.max_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.max_rgb Module
-========================================
+colour\.models\.rgb\.dataset\.max\_rgb Module
+=============================================
.. automodule:: colour.models.rgb.dataset.max_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.ntsc_rgb.rst b/docs/colour.models.rgb.dataset.ntsc_rgb.rst
index 4964eeed3f..7c05e2133a 100644
--- a/docs/colour.models.rgb.dataset.ntsc_rgb.rst
+++ b/docs/colour.models.rgb.dataset.ntsc_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.ntsc_rgb Module
-=========================================
+colour\.models\.rgb\.dataset\.ntsc\_rgb Module
+==============================================
.. automodule:: colour.models.rgb.dataset.ntsc_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.pal_secam_rgb.rst b/docs/colour.models.rgb.dataset.pal_secam_rgb.rst
index dd0d61edd4..f5ac9197fa 100644
--- a/docs/colour.models.rgb.dataset.pal_secam_rgb.rst
+++ b/docs/colour.models.rgb.dataset.pal_secam_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.pal_secam_rgb Module
-==============================================
+colour\.models\.rgb\.dataset\.pal\_secam\_rgb Module
+====================================================
.. automodule:: colour.models.rgb.dataset.pal_secam_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.rec_2020.rst b/docs/colour.models.rgb.dataset.rec_2020.rst
index 5d6f5a6a09..5c29d9a5a4 100644
--- a/docs/colour.models.rgb.dataset.rec_2020.rst
+++ b/docs/colour.models.rgb.dataset.rec_2020.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.rec_2020 Module
-=========================================
+colour\.models\.rgb\.dataset\.rec\_2020 Module
+==============================================
.. automodule:: colour.models.rgb.dataset.rec_2020
:members:
diff --git a/docs/colour.models.rgb.dataset.rec_709.rst b/docs/colour.models.rgb.dataset.rec_709.rst
index 1f7b26ccc9..110c841f5d 100644
--- a/docs/colour.models.rgb.dataset.rec_709.rst
+++ b/docs/colour.models.rgb.dataset.rec_709.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.rec_709 Module
-========================================
+colour\.models\.rgb\.dataset\.rec\_709 Module
+=============================================
.. automodule:: colour.models.rgb.dataset.rec_709
:members:
diff --git a/docs/colour.models.rgb.dataset.red.rst b/docs/colour.models.rgb.dataset.red.rst
index 93a58e0949..4206bcf414 100644
--- a/docs/colour.models.rgb.dataset.red.rst
+++ b/docs/colour.models.rgb.dataset.red.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.red Module
-====================================
+colour\.models\.rgb\.dataset\.red Module
+========================================
.. automodule:: colour.models.rgb.dataset.red
:members:
diff --git a/docs/colour.models.rgb.dataset.rimm_romm_rgb.rst b/docs/colour.models.rgb.dataset.rimm_romm_rgb.rst
index 3c8e7862ba..d4213cebe5 100644
--- a/docs/colour.models.rgb.dataset.rimm_romm_rgb.rst
+++ b/docs/colour.models.rgb.dataset.rimm_romm_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.rimm_romm_rgb Module
-==============================================
+colour\.models\.rgb\.dataset\.rimm\_romm\_rgb Module
+====================================================
.. automodule:: colour.models.rgb.dataset.rimm_romm_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.rst b/docs/colour.models.rgb.dataset.rst
index 493643bf32..54395d8ff8 100644
--- a/docs/colour.models.rgb.dataset.rst
+++ b/docs/colour.models.rgb.dataset.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset Package
-=================================
+colour\.models\.rgb\.dataset Package
+====================================
Sub-Modules
-----------
@@ -21,6 +21,7 @@ Sub-Modules
colour.models.rgb.dataset.don_rgb_4
colour.models.rgb.dataset.eci_rgb_v2
colour.models.rgb.dataset.ekta_space_ps5
+ colour.models.rgb.dataset.gopro
colour.models.rgb.dataset.max_rgb
colour.models.rgb.dataset.ntsc_rgb
colour.models.rgb.dataset.pal_secam_rgb
diff --git a/docs/colour.models.rgb.dataset.russell_rgb.rst b/docs/colour.models.rgb.dataset.russell_rgb.rst
index 3f32bc9de7..898cf9863f 100644
--- a/docs/colour.models.rgb.dataset.russell_rgb.rst
+++ b/docs/colour.models.rgb.dataset.russell_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.russell_rgb Module
-============================================
+colour\.models\.rgb\.dataset\.russell\_rgb Module
+=================================================
.. automodule:: colour.models.rgb.dataset.russell_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.smptec_rgb.rst b/docs/colour.models.rgb.dataset.smptec_rgb.rst
index 50801c105a..77ed46f203 100644
--- a/docs/colour.models.rgb.dataset.smptec_rgb.rst
+++ b/docs/colour.models.rgb.dataset.smptec_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.smptec_rgb Module
-===========================================
+colour\.models\.rgb\.dataset\.smptec\_rgb Module
+================================================
.. automodule:: colour.models.rgb.dataset.smptec_rgb
:members:
diff --git a/docs/colour.models.rgb.dataset.sony.rst b/docs/colour.models.rgb.dataset.sony.rst
index eca42fb596..19790053e4 100644
--- a/docs/colour.models.rgb.dataset.sony.rst
+++ b/docs/colour.models.rgb.dataset.sony.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.sony Module
-=====================================
+colour\.models\.rgb\.dataset\.sony Module
+=========================================
.. automodule:: colour.models.rgb.dataset.sony
:members:
diff --git a/docs/colour.models.rgb.dataset.srgb.rst b/docs/colour.models.rgb.dataset.srgb.rst
index 51ea3dad38..46c344260a 100644
--- a/docs/colour.models.rgb.dataset.srgb.rst
+++ b/docs/colour.models.rgb.dataset.srgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.srgb Module
-=====================================
+colour\.models\.rgb\.dataset\.srgb Module
+=========================================
.. automodule:: colour.models.rgb.dataset.srgb
:members:
diff --git a/docs/colour.models.rgb.dataset.v_gamut.rst b/docs/colour.models.rgb.dataset.v_gamut.rst
index 704e232973..c2d7fe5ac2 100644
--- a/docs/colour.models.rgb.dataset.v_gamut.rst
+++ b/docs/colour.models.rgb.dataset.v_gamut.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.v_gamut Module
-========================================
+colour\.models\.rgb\.dataset\.v\_gamut Module
+=============================================
.. automodule:: colour.models.rgb.dataset.v_gamut
:members:
diff --git a/docs/colour.models.rgb.dataset.xtreme_rgb.rst b/docs/colour.models.rgb.dataset.xtreme_rgb.rst
index 63943f77f3..af3f702486 100644
--- a/docs/colour.models.rgb.dataset.xtreme_rgb.rst
+++ b/docs/colour.models.rgb.dataset.xtreme_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.dataset.xtreme_rgb Module
-===========================================
+colour\.models\.rgb\.dataset\.xtreme\_rgb Module
+================================================
.. automodule:: colour.models.rgb.dataset.xtreme_rgb
:members:
diff --git a/docs/colour.models.rgb.deprecated.rst b/docs/colour.models.rgb.deprecated.rst
index b0b271326b..32e2726ab5 100644
--- a/docs/colour.models.rgb.deprecated.rst
+++ b/docs/colour.models.rgb.deprecated.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.deprecated Module
-===================================
+colour\.models\.rgb\.deprecated Module
+======================================
.. automodule:: colour.models.rgb.deprecated
:members:
diff --git a/docs/colour.models.rgb.derivation.rst b/docs/colour.models.rgb.derivation.rst
index 0c1515557a..65b82263e1 100644
--- a/docs/colour.models.rgb.derivation.rst
+++ b/docs/colour.models.rgb.derivation.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.derivation Module
-===================================
+colour\.models\.rgb\.derivation Module
+======================================
.. automodule:: colour.models.rgb.derivation
:members:
diff --git a/docs/colour.models.rgb.ictcp.rst b/docs/colour.models.rgb.ictcp.rst
index 4d8224ad62..11d76d570a 100644
--- a/docs/colour.models.rgb.ictcp.rst
+++ b/docs/colour.models.rgb.ictcp.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.ictcp Module
-==============================
+colour\.models\.rgb\.ictcp Module
+=================================
.. automodule:: colour.models.rgb.ictcp
:members:
diff --git a/docs/colour.models.rgb.prismatic.rst b/docs/colour.models.rgb.prismatic.rst
new file mode 100644
index 0000000000..53fd88a4ab
--- /dev/null
+++ b/docs/colour.models.rgb.prismatic.rst
@@ -0,0 +1,7 @@
+colour\.models\.rgb\.prismatic Module
+=====================================
+
+.. automodule:: colour.models.rgb.prismatic
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.rgb.rgb_colourspace.rst b/docs/colour.models.rgb.rgb_colourspace.rst
index 1fb14e09a4..adb784fd08 100644
--- a/docs/colour.models.rgb.rgb_colourspace.rst
+++ b/docs/colour.models.rgb.rgb_colourspace.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.rgb_colourspace Module
-========================================
+colour\.models\.rgb\.rgb\_colourspace Module
+============================================
.. automodule:: colour.models.rgb.rgb_colourspace
:members:
diff --git a/docs/colour.models.rgb.rst b/docs/colour.models.rgb.rst
index d73ca78630..71d4e4b16b 100644
--- a/docs/colour.models.rgb.rst
+++ b/docs/colour.models.rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb Package
-=========================
+colour\.models\.rgb Package
+===========================
Sub-Packages
------------
@@ -19,6 +19,7 @@ Sub-Modules
colour.models.rgb.deprecated
colour.models.rgb.derivation
colour.models.rgb.ictcp
+ colour.models.rgb.prismatic
colour.models.rgb.rgb_colourspace
colour.models.rgb.ycbcr
diff --git a/docs/colour.models.rgb.transfer_functions.aces.rst b/docs/colour.models.rgb.transfer_functions.aces.rst
index 6d270f696f..f87ae5f439 100644
--- a/docs/colour.models.rgb.transfer_functions.aces.rst
+++ b/docs/colour.models.rgb.transfer_functions.aces.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.aces Module
-================================================
+colour\.models\.rgb\.transfer\_functions\.aces Module
+=====================================================
.. automodule:: colour.models.rgb.transfer_functions.aces
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.alexa_log_c.rst b/docs/colour.models.rgb.transfer_functions.alexa_log_c.rst
index bb4a735428..f0a445d895 100644
--- a/docs/colour.models.rgb.transfer_functions.alexa_log_c.rst
+++ b/docs/colour.models.rgb.transfer_functions.alexa_log_c.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.alexa_log_c Module
-=======================================================
+colour\.models\.rgb\.transfer\_functions\.alexa\_log\_c Module
+==============================================================
.. automodule:: colour.models.rgb.transfer_functions.alexa_log_c
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.arib_std_b67.rst b/docs/colour.models.rgb.transfer_functions.arib_std_b67.rst
new file mode 100644
index 0000000000..5ed6b36b7f
--- /dev/null
+++ b/docs/colour.models.rgb.transfer_functions.arib_std_b67.rst
@@ -0,0 +1,7 @@
+colour\.models\.rgb\.transfer\_functions\.arib\_std\_b67 Module
+===============================================================
+
+.. automodule:: colour.models.rgb.transfer_functions.arib_std_b67
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.rgb.transfer_functions.bt_1886.rst b/docs/colour.models.rgb.transfer_functions.bt_1886.rst
index 3edf5169de..efccdb9259 100644
--- a/docs/colour.models.rgb.transfer_functions.bt_1886.rst
+++ b/docs/colour.models.rgb.transfer_functions.bt_1886.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.bt_1886 Module
-===================================================
+colour\.models\.rgb\.transfer\_functions\.bt\_1886 Module
+=========================================================
.. automodule:: colour.models.rgb.transfer_functions.bt_1886
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.bt_2020.rst b/docs/colour.models.rgb.transfer_functions.bt_2020.rst
index 60eed78c91..f3310ef43f 100644
--- a/docs/colour.models.rgb.transfer_functions.bt_2020.rst
+++ b/docs/colour.models.rgb.transfer_functions.bt_2020.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.bt_2020 Module
-===================================================
+colour\.models\.rgb\.transfer\_functions\.bt\_2020 Module
+=========================================================
.. automodule:: colour.models.rgb.transfer_functions.bt_2020
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.bt_709.rst b/docs/colour.models.rgb.transfer_functions.bt_709.rst
index 2db95fe54e..263f773e1a 100644
--- a/docs/colour.models.rgb.transfer_functions.bt_709.rst
+++ b/docs/colour.models.rgb.transfer_functions.bt_709.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.bt_709 Module
-==================================================
+colour\.models\.rgb\.transfer\_functions\.bt\_709 Module
+========================================================
.. automodule:: colour.models.rgb.transfer_functions.bt_709
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.canon_log.rst b/docs/colour.models.rgb.transfer_functions.canon_log.rst
index 233f418dfe..02e9d05a95 100644
--- a/docs/colour.models.rgb.transfer_functions.canon_log.rst
+++ b/docs/colour.models.rgb.transfer_functions.canon_log.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.canon_log Module
-=====================================================
+colour\.models\.rgb\.transfer\_functions\.canon\_log Module
+===========================================================
.. automodule:: colour.models.rgb.transfer_functions.canon_log
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.cineon.rst b/docs/colour.models.rgb.transfer_functions.cineon.rst
index 37a95c9c4c..aafb035bfc 100644
--- a/docs/colour.models.rgb.transfer_functions.cineon.rst
+++ b/docs/colour.models.rgb.transfer_functions.cineon.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.cineon Module
-==================================================
+colour\.models\.rgb\.transfer\_functions\.cineon Module
+=======================================================
.. automodule:: colour.models.rgb.transfer_functions.cineon
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.dci_p3.rst b/docs/colour.models.rgb.transfer_functions.dci_p3.rst
index b1905d5159..dedf57e6eb 100644
--- a/docs/colour.models.rgb.transfer_functions.dci_p3.rst
+++ b/docs/colour.models.rgb.transfer_functions.dci_p3.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.dci_p3 Module
-==================================================
+colour\.models\.rgb\.transfer\_functions\.dci\_p3 Module
+========================================================
.. automodule:: colour.models.rgb.transfer_functions.dci_p3
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.dicom_gsdf.rst b/docs/colour.models.rgb.transfer_functions.dicom_gsdf.rst
new file mode 100644
index 0000000000..dd2c7c516a
--- /dev/null
+++ b/docs/colour.models.rgb.transfer_functions.dicom_gsdf.rst
@@ -0,0 +1,7 @@
+colour\.models\.rgb\.transfer\_functions\.dicom\_gsdf Module
+============================================================
+
+.. automodule:: colour.models.rgb.transfer_functions.dicom_gsdf
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.rgb.transfer_functions.gamma.rst b/docs/colour.models.rgb.transfer_functions.gamma.rst
index d1141d647e..9f6064e7ab 100644
--- a/docs/colour.models.rgb.transfer_functions.gamma.rst
+++ b/docs/colour.models.rgb.transfer_functions.gamma.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.gamma Module
-=================================================
+colour\.models\.rgb\.transfer\_functions\.gamma Module
+======================================================
.. automodule:: colour.models.rgb.transfer_functions.gamma
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.gopro.rst b/docs/colour.models.rgb.transfer_functions.gopro.rst
new file mode 100644
index 0000000000..f55c2c6cf0
--- /dev/null
+++ b/docs/colour.models.rgb.transfer_functions.gopro.rst
@@ -0,0 +1,7 @@
+colour\.models\.rgb\.transfer\_functions\.gopro Module
+======================================================
+
+.. automodule:: colour.models.rgb.transfer_functions.gopro
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.models.rgb.transfer_functions.linear.rst b/docs/colour.models.rgb.transfer_functions.linear.rst
index f20fedbd34..7ad6a2b596 100644
--- a/docs/colour.models.rgb.transfer_functions.linear.rst
+++ b/docs/colour.models.rgb.transfer_functions.linear.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.linear Module
-==================================================
+colour\.models\.rgb\.transfer\_functions\.linear Module
+=======================================================
.. automodule:: colour.models.rgb.transfer_functions.linear
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.panalog.rst b/docs/colour.models.rgb.transfer_functions.panalog.rst
index 84cb782a1d..115ca1c52b 100644
--- a/docs/colour.models.rgb.transfer_functions.panalog.rst
+++ b/docs/colour.models.rgb.transfer_functions.panalog.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.panalog Module
-===================================================
+colour\.models\.rgb\.transfer\_functions\.panalog Module
+========================================================
.. automodule:: colour.models.rgb.transfer_functions.panalog
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.panasonic_vlog.rst b/docs/colour.models.rgb.transfer_functions.panasonic_vlog.rst
index 7478f7a79d..26fa78f8a0 100644
--- a/docs/colour.models.rgb.transfer_functions.panasonic_vlog.rst
+++ b/docs/colour.models.rgb.transfer_functions.panasonic_vlog.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.panasonic_vlog Module
-==========================================================
+colour\.models\.rgb\.transfer\_functions\.panasonic\_vlog Module
+================================================================
.. automodule:: colour.models.rgb.transfer_functions.panasonic_vlog
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.pivoted_log.rst b/docs/colour.models.rgb.transfer_functions.pivoted_log.rst
index a6e6d9d29f..4947eadca4 100644
--- a/docs/colour.models.rgb.transfer_functions.pivoted_log.rst
+++ b/docs/colour.models.rgb.transfer_functions.pivoted_log.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.pivoted_log Module
-=======================================================
+colour\.models\.rgb\.transfer\_functions\.pivoted\_log Module
+=============================================================
.. automodule:: colour.models.rgb.transfer_functions.pivoted_log
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.red_log.rst b/docs/colour.models.rgb.transfer_functions.red_log.rst
index ce6498afbd..e5e59afe8c 100644
--- a/docs/colour.models.rgb.transfer_functions.red_log.rst
+++ b/docs/colour.models.rgb.transfer_functions.red_log.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.red_log Module
-===================================================
+colour\.models\.rgb\.transfer\_functions\.red\_log Module
+=========================================================
.. automodule:: colour.models.rgb.transfer_functions.red_log
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.rimm_romm_rgb.rst b/docs/colour.models.rgb.transfer_functions.rimm_romm_rgb.rst
index 6efec3ba6b..332b6e6afd 100644
--- a/docs/colour.models.rgb.transfer_functions.rimm_romm_rgb.rst
+++ b/docs/colour.models.rgb.transfer_functions.rimm_romm_rgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.rimm_romm_rgb Module
-=========================================================
+colour\.models\.rgb\.transfer\_functions\.rimm\_romm\_rgb Module
+================================================================
.. automodule:: colour.models.rgb.transfer_functions.rimm_romm_rgb
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.rst b/docs/colour.models.rgb.transfer_functions.rst
index c33ae28257..39ad242423 100644
--- a/docs/colour.models.rgb.transfer_functions.rst
+++ b/docs/colour.models.rgb.transfer_functions.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions Package
-============================================
+colour\.models\.rgb\.transfer\_functions Package
+================================================
Sub-Modules
-----------
@@ -8,13 +8,16 @@ Sub-Modules
colour.models.rgb.transfer_functions.aces
colour.models.rgb.transfer_functions.alexa_log_c
+ colour.models.rgb.transfer_functions.arib_std_b67
colour.models.rgb.transfer_functions.bt_1886
colour.models.rgb.transfer_functions.bt_2020
colour.models.rgb.transfer_functions.bt_709
colour.models.rgb.transfer_functions.canon_log
colour.models.rgb.transfer_functions.cineon
colour.models.rgb.transfer_functions.dci_p3
+ colour.models.rgb.transfer_functions.dicom_gsdf
colour.models.rgb.transfer_functions.gamma
+ colour.models.rgb.transfer_functions.gopro
colour.models.rgb.transfer_functions.linear
colour.models.rgb.transfer_functions.panalog
colour.models.rgb.transfer_functions.panasonic_vlog
diff --git a/docs/colour.models.rgb.transfer_functions.sony_slog.rst b/docs/colour.models.rgb.transfer_functions.sony_slog.rst
index 7c7296aa1c..169bc4230b 100644
--- a/docs/colour.models.rgb.transfer_functions.sony_slog.rst
+++ b/docs/colour.models.rgb.transfer_functions.sony_slog.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.sony_slog Module
-=====================================================
+colour\.models\.rgb\.transfer\_functions\.sony\_slog Module
+===========================================================
.. automodule:: colour.models.rgb.transfer_functions.sony_slog
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.srgb.rst b/docs/colour.models.rgb.transfer_functions.srgb.rst
index 7ceed7d7d3..c015108bb1 100644
--- a/docs/colour.models.rgb.transfer_functions.srgb.rst
+++ b/docs/colour.models.rgb.transfer_functions.srgb.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.srgb Module
-================================================
+colour\.models\.rgb\.transfer\_functions\.srgb Module
+=====================================================
.. automodule:: colour.models.rgb.transfer_functions.srgb
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.st_2084.rst b/docs/colour.models.rgb.transfer_functions.st_2084.rst
index cb7666655a..350c0e7d84 100644
--- a/docs/colour.models.rgb.transfer_functions.st_2084.rst
+++ b/docs/colour.models.rgb.transfer_functions.st_2084.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.st_2084 Module
-===================================================
+colour\.models\.rgb\.transfer\_functions\.st\_2084 Module
+=========================================================
.. automodule:: colour.models.rgb.transfer_functions.st_2084
:members:
diff --git a/docs/colour.models.rgb.transfer_functions.viper_log.rst b/docs/colour.models.rgb.transfer_functions.viper_log.rst
index b67bbd0e9d..3f4562bc17 100644
--- a/docs/colour.models.rgb.transfer_functions.viper_log.rst
+++ b/docs/colour.models.rgb.transfer_functions.viper_log.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.transfer_functions.viper_log Module
-=====================================================
+colour\.models\.rgb\.transfer\_functions\.viper\_log Module
+===========================================================
.. automodule:: colour.models.rgb.transfer_functions.viper_log
:members:
diff --git a/docs/colour.models.rgb.ycbcr.rst b/docs/colour.models.rgb.ycbcr.rst
index 002535f30b..e2f01164e1 100644
--- a/docs/colour.models.rgb.ycbcr.rst
+++ b/docs/colour.models.rgb.ycbcr.rst
@@ -1,5 +1,5 @@
-colour.models.rgb.ycbcr Module
-==============================
+colour\.models\.rgb\.ycbcr Module
+=================================
.. automodule:: colour.models.rgb.ycbcr
:members:
diff --git a/docs/colour.models.rst b/docs/colour.models.rst
index f50c6ca4bb..c6a2bc772d 100644
--- a/docs/colour.models.rst
+++ b/docs/colour.models.rst
@@ -1,5 +1,5 @@
-colour.models Package
-=====================
+colour\.models Package
+======================
Sub-Packages
------------
@@ -20,6 +20,8 @@ Sub-Modules
colour.models.cie_uvw
colour.models.cie_xyy
colour.models.common
+ colour.models.hdr_cie_lab
+ colour.models.hdr_ipt
colour.models.hunter_lab
colour.models.hunter_rdab
colour.models.ipt
diff --git a/docs/colour.models.ucs_luo2006.rst b/docs/colour.models.ucs_luo2006.rst
index 03413ed512..b0d3eee00c 100644
--- a/docs/colour.models.ucs_luo2006.rst
+++ b/docs/colour.models.ucs_luo2006.rst
@@ -1,5 +1,5 @@
-colour.models.ucs_luo2006 Module
-================================
+colour\.models\.ucs\_luo2006 Module
+===================================
.. automodule:: colour.models.ucs_luo2006
:members:
diff --git a/docs/colour.notation.dataset.munsell.all.rst b/docs/colour.notation.dataset.munsell.all.rst
index 26f3482399..02a3bd18e5 100644
--- a/docs/colour.notation.dataset.munsell.all.rst
+++ b/docs/colour.notation.dataset.munsell.all.rst
@@ -1,5 +1,5 @@
-colour.notation.dataset.munsell.all Module
-==========================================
+colour\.notation\.dataset\.munsell\.all Module
+==============================================
.. automodule:: colour.notation.dataset.munsell.all
:members:
diff --git a/docs/colour.notation.dataset.munsell.experimental.rst b/docs/colour.notation.dataset.munsell.experimental.rst
index 0838e8dc9f..1de41d76f1 100644
--- a/docs/colour.notation.dataset.munsell.experimental.rst
+++ b/docs/colour.notation.dataset.munsell.experimental.rst
@@ -1,5 +1,5 @@
-colour.notation.dataset.munsell.experimental Module
-===================================================
+colour\.notation\.dataset\.munsell\.experimental Module
+=======================================================
.. automodule:: colour.notation.dataset.munsell.experimental
:members:
diff --git a/docs/colour.notation.dataset.munsell.real.rst b/docs/colour.notation.dataset.munsell.real.rst
index a8108f3eaf..02908ab445 100644
--- a/docs/colour.notation.dataset.munsell.real.rst
+++ b/docs/colour.notation.dataset.munsell.real.rst
@@ -1,5 +1,5 @@
-colour.notation.dataset.munsell.real Module
-===========================================
+colour\.notation\.dataset\.munsell\.real Module
+===============================================
.. automodule:: colour.notation.dataset.munsell.real
:members:
diff --git a/docs/colour.notation.dataset.munsell.rst b/docs/colour.notation.dataset.munsell.rst
index e706aefb89..d91d644cf7 100644
--- a/docs/colour.notation.dataset.munsell.rst
+++ b/docs/colour.notation.dataset.munsell.rst
@@ -1,5 +1,5 @@
-colour.notation.dataset.munsell Package
-=======================================
+colour\.notation\.dataset\.munsell Package
+==========================================
Sub-Modules
-----------
diff --git a/docs/colour.notation.dataset.rst b/docs/colour.notation.dataset.rst
index 44d28e8b5e..405b09fdd3 100644
--- a/docs/colour.notation.dataset.rst
+++ b/docs/colour.notation.dataset.rst
@@ -1,5 +1,5 @@
-colour.notation.dataset Package
-===============================
+colour\.notation\.dataset Package
+=================================
Sub-Packages
------------
diff --git a/docs/colour.notation.munsell.rst b/docs/colour.notation.munsell.rst
index 48f38d6fce..539c267be1 100644
--- a/docs/colour.notation.munsell.rst
+++ b/docs/colour.notation.munsell.rst
@@ -1,5 +1,5 @@
-colour.notation.munsell Module
-==============================
+colour\.notation\.munsell Module
+================================
.. automodule:: colour.notation.munsell
:members:
diff --git a/docs/colour.notation.rst b/docs/colour.notation.rst
index 5fc7607c7c..f19ce65cf4 100644
--- a/docs/colour.notation.rst
+++ b/docs/colour.notation.rst
@@ -1,5 +1,5 @@
-colour.notation Package
-=======================
+colour\.notation Package
+========================
Sub-Packages
------------
diff --git a/docs/colour.notation.triplet.rst b/docs/colour.notation.triplet.rst
index 0ee88941c6..e066725390 100644
--- a/docs/colour.notation.triplet.rst
+++ b/docs/colour.notation.triplet.rst
@@ -1,5 +1,5 @@
-colour.notation.triplet Module
-==============================
+colour\.notation\.triplet Module
+================================
.. automodule:: colour.notation.triplet
:members:
diff --git a/docs/colour.phenomenons.rayleigh.rst b/docs/colour.phenomenons.rayleigh.rst
index cfadaca1a5..530eab5a09 100644
--- a/docs/colour.phenomenons.rayleigh.rst
+++ b/docs/colour.phenomenons.rayleigh.rst
@@ -1,5 +1,5 @@
-colour.phenomenons.rayleigh Module
-==================================
+colour\.phenomenons\.rayleigh Module
+====================================
.. automodule:: colour.phenomenons.rayleigh
:members:
diff --git a/docs/colour.phenomenons.rst b/docs/colour.phenomenons.rst
index cbc3da5a01..1be79d9d38 100644
--- a/docs/colour.phenomenons.rst
+++ b/docs/colour.phenomenons.rst
@@ -1,5 +1,5 @@
-colour.phenomenons Package
-==========================
+colour\.phenomenons Package
+===========================
Sub-Modules
-----------
diff --git a/docs/colour.plotting.characterisation.rst b/docs/colour.plotting.characterisation.rst
index c4e5f2a670..6f6bce18b9 100644
--- a/docs/colour.plotting.characterisation.rst
+++ b/docs/colour.plotting.characterisation.rst
@@ -1,5 +1,5 @@
-colour.plotting.characterisation Module
-=======================================
+colour\.plotting\.characterisation Module
+=========================================
.. automodule:: colour.plotting.characterisation
:members:
diff --git a/docs/colour.plotting.colorimetry.rst b/docs/colour.plotting.colorimetry.rst
index aff70e41c6..48cb3e7cf1 100644
--- a/docs/colour.plotting.colorimetry.rst
+++ b/docs/colour.plotting.colorimetry.rst
@@ -1,5 +1,5 @@
-colour.plotting.colorimetry Module
-==================================
+colour\.plotting\.colorimetry Module
+====================================
.. automodule:: colour.plotting.colorimetry
:members:
diff --git a/docs/colour.plotting.common.rst b/docs/colour.plotting.common.rst
index 870a90e275..0c59d43797 100644
--- a/docs/colour.plotting.common.rst
+++ b/docs/colour.plotting.common.rst
@@ -1,5 +1,5 @@
-colour.plotting.common Module
-=============================
+colour\.plotting\.common Module
+===============================
.. automodule:: colour.plotting.common
:members:
diff --git a/docs/colour.plotting.corresponding.rst b/docs/colour.plotting.corresponding.rst
index 8d577a1ea1..1371d1b1c7 100644
--- a/docs/colour.plotting.corresponding.rst
+++ b/docs/colour.plotting.corresponding.rst
@@ -1,5 +1,5 @@
-colour.plotting.corresponding Module
-====================================
+colour\.plotting\.corresponding Module
+======================================
.. automodule:: colour.plotting.corresponding
:members:
diff --git a/docs/colour.plotting.dataset.astm_g_173.rst b/docs/colour.plotting.dataset.astm_g_173.rst
index cea639e4c0..078db4b078 100644
--- a/docs/colour.plotting.dataset.astm_g_173.rst
+++ b/docs/colour.plotting.dataset.astm_g_173.rst
@@ -1,5 +1,5 @@
-colour.plotting.dataset.astm_g_173 Module
-=========================================
+colour\.plotting\.dataset\.astm\_g\_173 Module
+==============================================
.. automodule:: colour.plotting.dataset.astm_g_173
:members:
diff --git a/docs/colour.plotting.dataset.rst b/docs/colour.plotting.dataset.rst
index 41c0de5eb6..6aaabf19df 100644
--- a/docs/colour.plotting.dataset.rst
+++ b/docs/colour.plotting.dataset.rst
@@ -1,5 +1,5 @@
-colour.plotting.dataset Package
-===============================
+colour\.plotting\.dataset Package
+=================================
Sub-Modules
-----------
diff --git a/docs/colour.plotting.diagrams.rst b/docs/colour.plotting.diagrams.rst
index a690313ba2..71b83bd55c 100644
--- a/docs/colour.plotting.diagrams.rst
+++ b/docs/colour.plotting.diagrams.rst
@@ -1,5 +1,5 @@
-colour.plotting.diagrams Module
-===============================
+colour\.plotting\.diagrams Module
+=================================
.. automodule:: colour.plotting.diagrams
:members:
diff --git a/docs/colour.plotting.geometry.rst b/docs/colour.plotting.geometry.rst
index e49fa89b46..8d7a47ec8f 100644
--- a/docs/colour.plotting.geometry.rst
+++ b/docs/colour.plotting.geometry.rst
@@ -1,5 +1,5 @@
-colour.plotting.geometry Module
-===============================
+colour\.plotting\.geometry Module
+=================================
.. automodule:: colour.plotting.geometry
:members:
diff --git a/docs/colour.plotting.models.rst b/docs/colour.plotting.models.rst
index ae18dfb04b..897e78141f 100644
--- a/docs/colour.plotting.models.rst
+++ b/docs/colour.plotting.models.rst
@@ -1,5 +1,5 @@
-colour.plotting.models Module
-=============================
+colour\.plotting\.models Module
+===============================
.. automodule:: colour.plotting.models
:members:
diff --git a/docs/colour.plotting.notation.rst b/docs/colour.plotting.notation.rst
index f58da7b970..be84ba7197 100644
--- a/docs/colour.plotting.notation.rst
+++ b/docs/colour.plotting.notation.rst
@@ -1,5 +1,5 @@
-colour.plotting.notation Module
-===============================
+colour\.plotting\.notation Module
+=================================
.. automodule:: colour.plotting.notation
:members:
diff --git a/docs/colour.plotting.phenomenon.rst b/docs/colour.plotting.phenomenon.rst
index a4d4c1aefd..706ca03e76 100644
--- a/docs/colour.plotting.phenomenon.rst
+++ b/docs/colour.plotting.phenomenon.rst
@@ -1,5 +1,5 @@
-colour.plotting.phenomenon Module
-=================================
+colour\.plotting\.phenomenon Module
+===================================
.. automodule:: colour.plotting.phenomenon
:members:
diff --git a/docs/colour.plotting.quality.rst b/docs/colour.plotting.quality.rst
index 5b8addf386..67ac8b171b 100644
--- a/docs/colour.plotting.quality.rst
+++ b/docs/colour.plotting.quality.rst
@@ -1,5 +1,5 @@
-colour.plotting.quality Module
-==============================
+colour\.plotting\.quality Module
+================================
.. automodule:: colour.plotting.quality
:members:
diff --git a/docs/colour.plotting.rst b/docs/colour.plotting.rst
index 49fb22a160..ba8a6ea4d9 100644
--- a/docs/colour.plotting.rst
+++ b/docs/colour.plotting.rst
@@ -1,5 +1,5 @@
-colour.plotting Package
-=======================
+colour\.plotting Package
+========================
Sub-Packages
------------
diff --git a/docs/colour.plotting.temperature.rst b/docs/colour.plotting.temperature.rst
index 32ed14d2f2..e30f6df462 100644
--- a/docs/colour.plotting.temperature.rst
+++ b/docs/colour.plotting.temperature.rst
@@ -1,5 +1,5 @@
-colour.plotting.temperature Module
-==================================
+colour\.plotting\.temperature Module
+====================================
.. automodule:: colour.plotting.temperature
:members:
diff --git a/docs/colour.plotting.volume.rst b/docs/colour.plotting.volume.rst
index ce188632df..6f0130bc30 100644
--- a/docs/colour.plotting.volume.rst
+++ b/docs/colour.plotting.volume.rst
@@ -1,5 +1,5 @@
-colour.plotting.volume Module
-=============================
+colour\.plotting\.volume Module
+===============================
.. automodule:: colour.plotting.volume
:members:
diff --git a/docs/colour.quality.cqs.rst b/docs/colour.quality.cqs.rst
index 004086b434..b85411d0fd 100644
--- a/docs/colour.quality.cqs.rst
+++ b/docs/colour.quality.cqs.rst
@@ -1,5 +1,5 @@
-colour.quality.cqs Module
-=========================
+colour\.quality\.cqs Module
+===========================
.. automodule:: colour.quality.cqs
:members:
diff --git a/docs/colour.quality.cri.rst b/docs/colour.quality.cri.rst
index a9008c8380..b275bf5289 100644
--- a/docs/colour.quality.cri.rst
+++ b/docs/colour.quality.cri.rst
@@ -1,5 +1,5 @@
-colour.quality.cri Module
-=========================
+colour\.quality\.cri Module
+===========================
.. automodule:: colour.quality.cri
:members:
diff --git a/docs/colour.quality.dataset.rst b/docs/colour.quality.dataset.rst
index ec5e290dee..2a5dbba0e4 100644
--- a/docs/colour.quality.dataset.rst
+++ b/docs/colour.quality.dataset.rst
@@ -1,5 +1,5 @@
-colour.quality.dataset Package
-==============================
+colour\.quality\.dataset Package
+================================
Sub-Modules
-----------
diff --git a/docs/colour.quality.dataset.tcs.rst b/docs/colour.quality.dataset.tcs.rst
index 980304bc0b..2f7ab67df5 100644
--- a/docs/colour.quality.dataset.tcs.rst
+++ b/docs/colour.quality.dataset.tcs.rst
@@ -1,5 +1,5 @@
-colour.quality.dataset.tcs Module
-=================================
+colour\.quality\.dataset\.tcs Module
+====================================
.. automodule:: colour.quality.dataset.tcs
:members:
diff --git a/docs/colour.quality.dataset.vs.rst b/docs/colour.quality.dataset.vs.rst
index 37082726f0..42973320cd 100644
--- a/docs/colour.quality.dataset.vs.rst
+++ b/docs/colour.quality.dataset.vs.rst
@@ -1,5 +1,5 @@
-colour.quality.dataset.vs Module
-================================
+colour\.quality\.dataset\.vs Module
+===================================
.. automodule:: colour.quality.dataset.vs
:members:
diff --git a/docs/colour.quality.rst b/docs/colour.quality.rst
index afb8c38314..997c5af1b6 100644
--- a/docs/colour.quality.rst
+++ b/docs/colour.quality.rst
@@ -1,5 +1,5 @@
-colour.quality Package
-======================
+colour\.quality Package
+=======================
Sub-Packages
------------
diff --git a/docs/colour.recovery.dataset.rst b/docs/colour.recovery.dataset.rst
index e8cf7053c1..49ce35da79 100644
--- a/docs/colour.recovery.dataset.rst
+++ b/docs/colour.recovery.dataset.rst
@@ -1,5 +1,5 @@
-colour.recovery.dataset Package
-===============================
+colour\.recovery\.dataset Package
+=================================
Sub-Modules
-----------
diff --git a/docs/colour.recovery.dataset.smits1999.rst b/docs/colour.recovery.dataset.smits1999.rst
index eb9f99bd99..a080259ff0 100644
--- a/docs/colour.recovery.dataset.smits1999.rst
+++ b/docs/colour.recovery.dataset.smits1999.rst
@@ -1,5 +1,5 @@
-colour.recovery.dataset.smits1999 Module
-========================================
+colour\.recovery\.dataset\.smits1999 Module
+===========================================
.. automodule:: colour.recovery.dataset.smits1999
:members:
diff --git a/docs/colour.recovery.meng2015.rst b/docs/colour.recovery.meng2015.rst
new file mode 100644
index 0000000000..f4a38d57aa
--- /dev/null
+++ b/docs/colour.recovery.meng2015.rst
@@ -0,0 +1,7 @@
+colour\.recovery\.meng2015 Module
+=================================
+
+.. automodule:: colour.recovery.meng2015
+ :members:
+ :undoc-members:
+ :show-inheritance:
diff --git a/docs/colour.recovery.rst b/docs/colour.recovery.rst
index c5a9e1417b..636738f25c 100644
--- a/docs/colour.recovery.rst
+++ b/docs/colour.recovery.rst
@@ -1,5 +1,5 @@
-colour.recovery Package
-=======================
+colour\.recovery Package
+========================
Sub-Packages
------------
@@ -13,6 +13,7 @@ Sub-Modules
.. toctree::
+ colour.recovery.meng2015
colour.recovery.smits1999
Module Contents
diff --git a/docs/colour.recovery.smits1999.rst b/docs/colour.recovery.smits1999.rst
index 6ca904af33..1c8f8d6f85 100644
--- a/docs/colour.recovery.smits1999.rst
+++ b/docs/colour.recovery.smits1999.rst
@@ -1,5 +1,5 @@
-colour.recovery.smits1999 Module
-================================
+colour\.recovery\.smits1999 Module
+==================================
.. automodule:: colour.recovery.smits1999
:members:
diff --git a/docs/colour.rst b/docs/colour.rst
index a45280ca6f..d7bdb85d84 100644
--- a/docs/colour.rst
+++ b/docs/colour.rst
@@ -9,6 +9,7 @@ Sub-Packages
colour.adaptation
colour.algebra
colour.appearance
+ colour.biochemistry
colour.characterisation
colour.colorimetry
colour.constants
diff --git a/docs/colour.temperature.cct.rst b/docs/colour.temperature.cct.rst
index c44792e7f0..d0dd65da31 100644
--- a/docs/colour.temperature.cct.rst
+++ b/docs/colour.temperature.cct.rst
@@ -1,5 +1,5 @@
-colour.temperature.cct Module
-=============================
+colour\.temperature\.cct Module
+===============================
.. automodule:: colour.temperature.cct
:members:
diff --git a/docs/colour.temperature.rst b/docs/colour.temperature.rst
index 025850f3db..2d20c3901d 100644
--- a/docs/colour.temperature.rst
+++ b/docs/colour.temperature.rst
@@ -1,5 +1,5 @@
-colour.temperature Package
-==========================
+colour\.temperature Package
+===========================
Sub-Modules
-----------
diff --git a/docs/colour.utilities.array.rst b/docs/colour.utilities.array.rst
index ee25a3919f..7b4692bada 100644
--- a/docs/colour.utilities.array.rst
+++ b/docs/colour.utilities.array.rst
@@ -1,5 +1,5 @@
-colour.utilities.array Module
-=============================
+colour\.utilities\.array Module
+===============================
.. automodule:: colour.utilities.array
:members:
diff --git a/docs/colour.utilities.common.rst b/docs/colour.utilities.common.rst
index 9a6e1d81ea..9a0cbb9f23 100644
--- a/docs/colour.utilities.common.rst
+++ b/docs/colour.utilities.common.rst
@@ -1,5 +1,5 @@
-colour.utilities.common Module
-==============================
+colour\.utilities\.common Module
+================================
.. automodule:: colour.utilities.common
:members:
diff --git a/docs/colour.utilities.data_structures.rst b/docs/colour.utilities.data_structures.rst
index 4336075dd0..2f6d95d572 100644
--- a/docs/colour.utilities.data_structures.rst
+++ b/docs/colour.utilities.data_structures.rst
@@ -1,5 +1,5 @@
-colour.utilities.data_structures Module
-=======================================
+colour\.utilities\.data\_structures Module
+==========================================
.. automodule:: colour.utilities.data_structures
:members:
diff --git a/docs/colour.utilities.rst b/docs/colour.utilities.rst
index 7d40e20f91..131cf1f35f 100644
--- a/docs/colour.utilities.rst
+++ b/docs/colour.utilities.rst
@@ -1,5 +1,5 @@
-colour.utilities Package
-========================
+colour\.utilities Package
+=========================
Sub-Modules
-----------
diff --git a/docs/colour.utilities.verbose.rst b/docs/colour.utilities.verbose.rst
index 32ef472146..2f6330c5a2 100644
--- a/docs/colour.utilities.verbose.rst
+++ b/docs/colour.utilities.verbose.rst
@@ -1,5 +1,5 @@
-colour.utilities.verbose Module
-===============================
+colour\.utilities\.verbose Module
+=================================
.. automodule:: colour.utilities.verbose
:members:
diff --git a/docs/colour.volume.dataset.optimal_colour_stimuli.rst b/docs/colour.volume.dataset.optimal_colour_stimuli.rst
index af1af0b724..5320d2c17e 100644
--- a/docs/colour.volume.dataset.optimal_colour_stimuli.rst
+++ b/docs/colour.volume.dataset.optimal_colour_stimuli.rst
@@ -1,5 +1,5 @@
-colour.volume.dataset.optimal_colour_stimuli Module
-===================================================
+colour\.volume\.dataset\.optimal\_colour\_stimuli Module
+========================================================
.. automodule:: colour.volume.dataset.optimal_colour_stimuli
:members:
diff --git a/docs/colour.volume.dataset.rst b/docs/colour.volume.dataset.rst
index 3f44191588..9a9d7f9e0e 100644
--- a/docs/colour.volume.dataset.rst
+++ b/docs/colour.volume.dataset.rst
@@ -1,5 +1,5 @@
-colour.volume.dataset Package
-=============================
+colour\.volume\.dataset Package
+===============================
Sub-Modules
-----------
diff --git a/docs/colour.volume.macadam_limits.rst b/docs/colour.volume.macadam_limits.rst
index 1c8e7dd0bf..717579b0af 100644
--- a/docs/colour.volume.macadam_limits.rst
+++ b/docs/colour.volume.macadam_limits.rst
@@ -1,5 +1,5 @@
-colour.volume.macadam_limits Module
-===================================
+colour\.volume\.macadam\_limits Module
+======================================
.. automodule:: colour.volume.macadam_limits
:members:
diff --git a/docs/colour.volume.mesh.rst b/docs/colour.volume.mesh.rst
index faeaa21a71..42e299726e 100644
--- a/docs/colour.volume.mesh.rst
+++ b/docs/colour.volume.mesh.rst
@@ -1,5 +1,5 @@
-colour.volume.mesh Module
-=========================
+colour\.volume\.mesh Module
+===========================
.. automodule:: colour.volume.mesh
:members:
diff --git a/docs/colour.volume.pointer_gamut.rst b/docs/colour.volume.pointer_gamut.rst
index f9b649f292..3fb0644402 100644
--- a/docs/colour.volume.pointer_gamut.rst
+++ b/docs/colour.volume.pointer_gamut.rst
@@ -1,5 +1,5 @@
-colour.volume.pointer_gamut Module
-==================================
+colour\.volume\.pointer\_gamut Module
+=====================================
.. automodule:: colour.volume.pointer_gamut
:members:
diff --git a/docs/colour.volume.rgb.rst b/docs/colour.volume.rgb.rst
index 80ccddf74b..dd98dae370 100644
--- a/docs/colour.volume.rgb.rst
+++ b/docs/colour.volume.rgb.rst
@@ -1,5 +1,5 @@
-colour.volume.rgb Module
-========================
+colour\.volume\.rgb Module
+==========================
.. automodule:: colour.volume.rgb
:members:
diff --git a/docs/colour.volume.rst b/docs/colour.volume.rst
index 91d946a573..1e95805ae9 100644
--- a/docs/colour.volume.rst
+++ b/docs/colour.volume.rst
@@ -1,5 +1,5 @@
-colour.volume Package
-=====================
+colour\.volume Package
+======================
Sub-Packages
------------
diff --git a/docs/colour.volume.spectrum.rst b/docs/colour.volume.spectrum.rst
index 650893160d..e180451630 100644
--- a/docs/colour.volume.spectrum.rst
+++ b/docs/colour.volume.spectrum.rst
@@ -1,5 +1,5 @@
-colour.volume.spectrum Module
-=============================
+colour\.volume\.spectrum Module
+===============================
.. automodule:: colour.volume.spectrum
:members:
diff --git a/docs/conf.py b/docs/conf.py
index df209d582b..be4f331674 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -20,22 +20,11 @@
import mock
# Mock modules for *readthedocs.org*.
-MOCK_MODULES = (
- 'matplotlib',
- 'matplotlib.cm',
- 'matplotlib.image',
- 'matplotlib.path',
- 'matplotlib.pyplot',
- 'matplotlib.ticker',
- 'mpl_toolkits',
- 'mpl_toolkits.mplot3d',
- 'mpl_toolkits.mplot3d.art3d',
- 'pylab',
- 'scipy',
- 'scipy.interpolate',
- 'scipy.ndimage',
- 'scipy.spatial',
- 'scipy.spatial.distance')
+MOCK_MODULES = ('matplotlib', 'matplotlib.cm', 'matplotlib.image',
+ 'matplotlib.path', 'matplotlib.pyplot', 'matplotlib.ticker',
+ 'mpl_toolkits.mplot3d', 'mpl_toolkits.mplot3d.art3d', 'pylab',
+ 'scipy', 'scipy.interpolate', 'scipy.ndimage',
+ 'scipy.optimize', 'scipy.spatial', 'scipy.spatial.distance')
for module in MOCK_MODULES:
sys.modules[module] = mock.Mock()
@@ -58,15 +47,10 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.intersphinx',
- 'sphinx.ext.todo',
- 'sphinx.ext.coverage',
- 'sphinx.ext.ifconfig',
- 'sphinx.ext.viewcode',
- 'sphinx.ext.autosummary',
- 'sphinx.ext.napoleon',
- 'sphinx.ext.mathjax']
+ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
+ 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode',
+ 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.mathjax'
+]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -91,7 +75,7 @@
# The short X.Y version.
version = '0.3'
# The full version, including alpha/beta/rc tags.
-release = '0.3.9'
+release = '0.3.10'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -131,7 +115,6 @@
# If true, keep warnings as 'system message' paragraphs in the built documents.
# keep_warnings = False
-
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -235,8 +218,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'Colour.tex', u'Colour Documentation',
- u'Colour Developers', 'manual'),
+ ('index', 'Colour.tex', u'Colour Documentation', u'Colour Developers',
+ 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -259,29 +242,24 @@
# If false, no module index is generated.
# latex_domain_indices = True
-
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
-man_pages = [
- ('index', 'Colour', u'Colour Documentation',
- [u'Colour Developers'], 1)
-]
+man_pages = [('index', 'Colour', u'Colour Documentation',
+ [u'Colour Developers'], 1)]
# If true, show URL addresses after external links.
# man_show_urls = False
-
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'Colour', u'Colour Documentation',
- u'Colour Developers', 'Colour', 'One line description of project.',
- 'Miscellaneous'),
+ ('index', 'Colour', u'Colour Documentation', u'Colour Developers',
+ 'Colour', 'One line description of project.', 'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
@@ -296,7 +274,6 @@
# If true, do not generate a @detailmenu in the 'Top' node's menu.
# texinfo_no_detailmenu = False
-
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
@@ -370,7 +347,6 @@
intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)}
-
# def _autodoc_process_docstring(app,
# what,
# name,
@@ -405,8 +381,7 @@
# offset[0] += len(references)
-def _autodoc_process_docstring(
- app, what, name, obj, options, lines):
+def _autodoc_process_docstring(app, what, name, obj, options, lines):
"""
Process the docstrings to remove the *# noqa* *flake8* pragma.
"""
diff --git a/docs/index.rst b/docs/index.rst
index e96e37b0e3..2ffbbd4041 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -20,12 +20,27 @@ and collection of objects, please see the
Installation
------------
-The installation procedure is described in the
+The detailed installation procedure is described in the
`Installation Guide `_.
+`Anaconda `_ from *Continuum Analytics*
+is the Python distribution we use to develop **Colour**:
+it ships all the scientific dependencies we require and is easily deployed
+cross-platform.
+
+This *asciicast* demonstrates how to generate a pristine Python *conda*
+environment for Colour:
+
+.. image:: https://raw.githubusercontent.com/colour-science/colour-branding/master/screencasts/Colour_Conda_Installation.gif
+
Usage
-----
+At its most basic, `Colour `_ only requires
+to be imported:
+
+.. image:: https://raw.githubusercontent.com/colour-science/colour-branding/master/screencasts/Colour_Science_for_Python.gif
+
The two main references for `Colour `_
usage are the complete Sphinx `API Reference `_
and the `Jupyter Notebooks `_
diff --git a/setup.py b/setup.py
index 71f14d1114..887cfe4412 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Pypi Setup
==========
@@ -21,12 +20,11 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['SHORT_DESCRIPTION',
- 'LONG_DESCRIPTION',
- 'INSTALLATION_REQUIREMENTS',
- 'PLOTTING_REQUIREMENTS',
- 'DOCS_REQUIREMENTS',
- 'TESTS_REQUIREMENTS']
+__all__ = [
+ 'SHORT_DESCRIPTION', 'LONG_DESCRIPTION', 'INSTALLATION_REQUIREMENTS',
+ 'PLOTTING_REQUIREMENTS', 'DOCS_REQUIREMENTS', 'TESTS_REQUIREMENTS',
+ 'OPTIONAL_REQUIREMENTS'
+]
SHORT_DESCRIPTION = 'Colour Science for Python'
@@ -38,9 +36,9 @@
DOCS_REQUIREMENTS = ['sphinx>=1.2.2']
-TESTS_REQUIREMENTS = ['coverage>=3.7.1',
- 'flake8>=2.1.0',
- 'nose>=1.3.4']
+TESTS_REQUIREMENTS = ['coverage>=3.7.1', 'flake8>=2.1.0', 'nose>=1.3.4']
+
+OPTIONAL_REQUIREMENTS = ['yapf']
if sys.version_info[:2] <= (3, 2):
TESTS_REQUIREMENTS += ['mock']
@@ -48,30 +46,31 @@
if os.environ.get('READTHEDOCS') == 'True':
INSTALLATION_REQUIREMENTS = ['numpy>=1.8.1', 'mock']
-setup(name='colour-science',
- version='0.3.9',
- author=__author__,
- author_email=__email__,
- include_package_data=True,
- packages=find_packages(),
- scripts=[],
- url='http://github.com/colour-science/colour',
- license='',
- description=SHORT_DESCRIPTION,
- long_description=LONG_DESCRIPTION,
- install_requires=INSTALLATION_REQUIREMENTS,
- extras_require={
- 'docs': DOCS_REQUIREMENTS,
- 'plotting': PLOTTING_REQUIREMENTS,
- 'tests': TESTS_REQUIREMENTS},
- classifiers=['Development Status :: 3 - Alpha',
- 'Environment :: Console',
- 'Intended Audience :: Developers',
- 'Intended Audience :: Science/Research',
- 'License :: OSI Approved',
- 'Natural Language :: English',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3',
- 'Topic :: Scientific/Engineering',
- 'Topic :: Software Development'])
+setup(
+ name='colour-science',
+ version='0.3.10',
+ author=__author__,
+ author_email=__email__,
+ include_package_data=True,
+ packages=find_packages(),
+ scripts=[],
+ url='http://github.com/colour-science/colour',
+ license='',
+ description=SHORT_DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
+ install_requires=INSTALLATION_REQUIREMENTS,
+ extras_require={
+ 'docs': DOCS_REQUIREMENTS,
+ 'optional': OPTIONAL_REQUIREMENTS,
+ 'plotting': PLOTTING_REQUIREMENTS,
+ 'tests': TESTS_REQUIREMENTS
+ },
+ classifiers=[
+ 'Development Status :: 3 - Alpha', 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: Science/Research', 'License :: OSI Approved',
+ 'Natural Language :: English', 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Topic :: Scientific/Engineering', 'Topic :: Software Development'
+ ])
diff --git a/utilities/citations_scraping.py b/utilities/citations_scraping.py
index 546d535614..6c71538a53 100644
--- a/utilities/citations_scraping.py
+++ b/utilities/citations_scraping.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
"""
Citations Scraping Utility
==========================
@@ -22,18 +21,17 @@
__email__ = 'colour-science@googlegroups.com'
__status__ = 'Production'
-__all__ = ['CITATION_PATTERN',
- 'PREFIX_CITATION_PATTERN',
- 'API_TO_APA_SUBSTITUTIONS',
- 'citations_from_token',
- 'citations_from_module',
- 'citations_from_directory']
+__all__ = [
+ 'CITATION_PATTERN', 'PREFIX_CITATION_PATTERN', 'API_TO_APA_SUBSTITUTIONS',
+ 'citations_from_token', 'citations_from_module', 'citations_from_directory'
+]
CITATION_PATTERN = '^\s*\.\.\s+\[\d+\]\s+'
PREFIX_CITATION_PATTERN = '^\s*\.\.\s+'
-API_TO_APA_SUBSTITUTIONS = (('\*+', ''),
- # ('\[\d+\]\s+', ''),
- ('# noqa', ''))
+API_TO_APA_SUBSTITUTIONS = (
+ ('\*+', ''),
+ # ('\[\d+\]\s+', ''),
+ ('# noqa', ''))
def citations_from_token(token_info):
@@ -63,8 +61,8 @@ def citations_from_token(token_info):
if in_citation:
if not re.match(CITATION_PATTERN, line):
- citations[-1] = '{0} {1}'.format(
- citations[-1], line.strip())
+ citations[-1] = '{0} {1}'.format(citations[-1],
+ line.strip())
else:
citations.append(
re.sub(PREFIX_CITATION_PATTERN, '', line.strip()))
@@ -89,9 +87,9 @@ def citations_from_module(module):
Citations from given module.
"""
- module = BytesIO(codecs.open(module,
- encoding='utf-8',
- errors='ignore').read().encode('utf-8'))
+ module = BytesIO(
+ codecs.open(module, encoding='utf-8', errors='ignore').read().encode(
+ 'utf-8'))
citations = []
for token in tokenize(module.readline):