Skip to content

Commit

Permalink
Merge branch 'release/v0.3.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Aug 9, 2015
2 parents 0df2ae3 + 8c8b5d0 commit 4956422
Show file tree
Hide file tree
Showing 122 changed files with 6,136 additions and 1,562 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sudo: false
language: python

matrix:
Expand Down Expand Up @@ -45,11 +46,10 @@ before_install:
install:
- conda create --yes --quiet -n colour-test ${PACKAGES} pip setuptools nose
- source activate colour-test
- pip install coverage coveralls flake8 mock
- pip install backports.functools_lru_cache
- pip install coverage coveralls flake8 mock==1.0.1

script:
- flake8 --exit-zero colour
- flake8 colour
- nosetests --nocapture --with-doctest --doctest-options=+ELLIPSIS,+NORMALIZE_WHITESPACE --with-coverage --cover-package=colour -exclude-dir=

after_success:
Expand Down
927 changes: 497 additions & 430 deletions BIBLIOGRAPHY.bib

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions BIBLIOGRAPHY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Bibliography
- Hettinger, R. (n.d.). Python hashable dicts. Retrieved August 08, 2014, from http://stackoverflow.com/a/16162138/931625
- Hewlett-Packard Development Company. (2009). Understanding the HP DreamColor LP2480zx DCI-P3 Emulation Color Space. Retrieved from http://www.hp.com/united-states/campaigns/workstations/pdfs/lp2480zx-dci--p3-emulation.pdf
- Holmes, J. (n.d.). Ekta Space PS 5. Retrieved from http://www.josephholmes.com/Ekta_Space.zip
- Houston, J. (2015). Private Discussion with Mansencal, T.
- Hunt, R. W. G. (2004). The Reproduction of Colour (6th ed.). Wiley. ISBN:978-0-470-02425-6
- HutchColor. (n.d.). BestRGB (4 K). Retrieved from http://www.hutchcolor.com/profiles/BestRGB.zip
- HutchColor. (n.d.). DonRGB4 (4 K). Retrieved from http://www.hutchcolor.com/profiles/DonRGB4.zip
Expand Down Expand Up @@ -133,13 +134,15 @@ Bibliography
- 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
- 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
- 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
- SMPTE. (1993). Derivation of Basic Television Color Equations. In RP 177:1993 (Vol. RP 177:199). doi:10.5594/S9781614821915
- SMPTE. (2004). SMPTE C Color Monitor Colorimetry. In RP 145:2004 (Vol. RP 145:200). doi:10.5594/S9781614821649
- Sony Corporation. (n.d.). S-Log Whitepaper. Retrieved from http://www.theodoropoulos.info/attachments/076_on S-Log.pdf
- Sony Corporation. (n.d.). Technical Summary for S-Gamut3.Cine/S-Log3 and S-Gamut3/S-Log3. Retrieved from 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
- Sony Imageworks. (2012). make.py. Retrieved November 27, 2014, from https://github.com/imageworks/OpenColorIO-Configs/blob/master/nuke-default/make.py
- Spiker, N. (2015). Private Discussion with Mansencal, T. Retrieved from http://www.repairfaq.org/sam/repspec/
- Stearns, E. I., & Stearns, R. E. (1988). An example of a method for correcting radiance data for Bandpass error. Color Research & Application, 13(4), 257–259. doi:10.1002/col.5080130410
- The Academy of Motion Picture Arts and Sciences, Science and Technology Council, & Academy Color Encoding System (ACES) Project Subcommittee. (2014). Specification S-2013-001 - ACESproxy , an Integer Log Encoding of ACES Image Data. Retrieved from https://github.com/ampas/aces-dev/tree/master/documents
- The Academy of Motion Picture Arts and Sciences, Science and Technology Council, & Academy Color Encoding System (ACES) Project Subcommittee. (2014). Specification S-2014-003 - ACEScc , A Logarithmic Encoding of ACES Data for use within Color Grading Systems. Retrieved from https://github.com/ampas/aces-dev/tree/master/documents
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors
Development & Technical Support
-------------------------------

- **Thomas Mansencal**, *Visual Effects Artist*
- **Thomas Mansencal**, *Visual Effects Artist @ Weta Digital*

Project coordination, overall development.

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
.. image:: https://badge.waffle.io/colour-science/colour.svg?label=ready&title=Ready
:target: https://waffle.io/colour-science/colour
:alt: 'Stories in Ready'
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.17370.png
:target: http://dx.doi.org/10.5281/zenodo.17370
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.27234.png
:target: http://dx.doi.org/10.5281/zenodo.27234

Colour Science for Python
=========================
Expand Down
78 changes: 42 additions & 36 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,77 @@ Colour - TODO
TODO
----

- colour (17 items in 11 files)
- colour (18 items in 12 files)

- algebra (1 item in 1 file)
- algebra (1 item in 1 file)

- interpolation.py
- interpolation.py

- (236, 15) # TODO: Implements proper wrapper to ensure return values consistency and avoid having to cast to numeric in :meth:`SpectralPowerDistribution.interpolate` method.
- (236, 15) # TODO: Implements proper wrapper to ensure return values consistency and avoid having to cast to numeric in :meth:`SpectralPowerDistribution.interpolate` method.

- appearance (8 items in 5 files)
- appearance (8 items in 5 files)

- ciecam02.py
- ciecam02.py

- (257, 7) # TODO: Compute hue composition.
- (684, 7) # TODO: Check for negative values and their handling.
- (257, 7) # TODO: Compute hue composition.
- (684, 7) # TODO: Check for negative values and their handling.

- hunt.py
- hunt.py

- (406, 7) # TODO: Implement hue quadrature & composition computation.
- (438, 7) # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.
- (406, 7) # TODO: Implement hue quadrature & composition computation.
- (438, 7) # TODO: Implement whiteness-blackness :math:`Q_{wb}` computation.

- llab.py
- llab.py

- (303, 7) # TODO: Implement hue composition computation.
- (303, 7) # TODO: Implement hue composition computation.

- nayatani95.py
- nayatani95.py

- (267, 7) # TODO: Implement hue quadrature & composition computation.
- (286, 7) # TODO: Investigate components usage.
- (267, 7) # TODO: Implement hue quadrature & composition computation.
- (286, 7) # TODO: Investigate components usage.

- rlab.py
- rlab.py

- (252, 7) # TODO: Implement hue composition computation.
- (252, 7) # TODO: Implement hue composition computation.

- colorimetry (1 item in 1 file)
- colorimetry (1 item in 1 file)

- spectrum.py
- spectrum.py

- (1559, 11) # TODO: Provide support for fractional steps like 0.1, etc...
- (1559, 11) # TODO: Provide support for fractional steps like 0.1, etc...

- models (2 item in 2 file)
- models (2 item in 2 file)

- tests (1 item in 1 file)
- tests (1 item in 1 file)

- tests_derivation.py
- tests_derivation.py

- (123, 15) # TODO: Simplify that monster.
- (123, 15) # TODO: Simplify that monster.

- derivation.py
- derivation.py

- (153, 7) # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together.
- (153, 7) # TODO: Investigate if we return an ndarray here with primaries and whitepoint stacked together.

- notation (5 items in 2 files)
- notation (5 items in 2 files)

- tests (3 items in 1 file)
- tests (3 items in 1 file)

- tests_munsell.py
- tests_munsell.py

- (98, 3) # TODO: Investigate if tests can be simplified by using a common valid set of specifications.
- (4162, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
- (4208, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
- (98, 3) # TODO: Investigate if tests can be simplified by using a common valid set of specifications.
- (4162, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?
- (4208, 11) # TODO: This test is covered by the previous class, do we need a dedicated one?

- munsell.py
- munsell.py

- (828, 11) # TODO: Consider refactoring implementation.
- (1172, 11) # TODO: Should raise KeyError, need to check the tests.
- (828, 11) # TODO: Consider refactoring implementation.
- (1172, 11) # TODO: Should raise KeyError, need to check the tests.

- volume (1 item in 1 file)

- rgb.py

- (323, 11) # TODO: Investigate for generator yielding directly a ndarray.

About
-----
Expand Down
13 changes: 10 additions & 3 deletions colour/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from . import appearance
from .colorimetry import * # noqa
from . import colorimetry
from .constants import *
from .constants import * # noqa
from . import constants
from .difference import * # noqa
from . import difference
Expand All @@ -80,7 +80,7 @@
from .volume import * # noqa
from . import volume
from .utilities import * # noqa
from . import utilities
from . import utilities # noqa

__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013 - 2015 - Colour Developers'
Expand Down Expand Up @@ -111,7 +111,14 @@

__major_version__ = '0'
__minor_version__ = '3'
__change_version__ = '5'
__change_version__ = '6'
__version__ = '.'.join((__major_version__,
__minor_version__,
__change_version__))

if sys.version_info[0] == 2 and sys.version_info[1] == 6:
import warnings

warnings.warn(
'"{0} {1}" is the last API version to support "Python 2.6.x".'.format(
__application_name__, '0.3.6'), DeprecationWarning)
2 changes: 1 addition & 1 deletion colour/adaptation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from __future__ import absolute_import

from .dataset import *
from .dataset import * # noqa
from . import dataset
from .vonkries import (
chromatic_adaptation_matrix_VonKries,
Expand Down
6 changes: 4 additions & 2 deletions colour/adaptation/cie1994.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def chromatic_adaptation_CIE1994(XYZ_1,
>>> Y_o = 20
>>> E_o1 = 1000
>>> E_o2 = 1000
>>> chromatic_adaptation_CIE1994(XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2) # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_CIE1994( # doctest: +ELLIPSIS
... XYZ_1, xy_o1, xy_o2, Y_o, E_o1, E_o2)
array([ 24.0337952..., 21.1562121..., 17.6430119...])
"""

Expand Down Expand Up @@ -456,7 +457,8 @@ def corresponding_colour(RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K, n=1):
>>> bRGB_o2 = np.array([3.68102374, 3.68102256, 3.56557351])
>>> Y_o = 20
>>> K = 1.0
>>> corresponding_colour(RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K) # noqa # doctest: +ELLIPSIS
>>> corresponding_colour( # doctest: +ELLIPSIS
... RGB_1, xez_1, xez_2, bRGB_o1, bRGB_o2, Y_o, K)
array([ 23.1636901..., 20.0211948..., 16.2001664...])
"""

Expand Down
14 changes: 9 additions & 5 deletions colour/adaptation/cmccat2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def CMCCAT2000_forward(XYZ,
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> CMCCAT2000_forward(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2) # noqa # doctest: +ELLIPSIS
>>> CMCCAT2000_forward( # doctest: +ELLIPSIS
... XYZ, XYZ_w, XYZ_wr, L_A1, L_A2)
array([ 19.5269832..., 23.0683396..., 24.9717522...])
"""

Expand Down Expand Up @@ -209,7 +210,8 @@ def CMCCAT2000_reverse(XYZ_c,
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> CMCCAT2000_reverse(XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2) # noqa # doctest: +ELLIPSIS
>>> CMCCAT2000_reverse( # doctest: +ELLIPSIS
... XYZ_c, XYZ_w, XYZ_wr, L_A1, L_A2)
array([ 22.4839876..., 22.7419485..., 8.5393392...])
"""

Expand Down Expand Up @@ -269,7 +271,7 @@ def chromatic_adaptation_CMCCAT2000(
surround : CMCCAT2000_InductionFactors, optional
Surround viewing conditions induction factors.
method : unicode, optional
{'Forward', 'Reverse'}
**{'Forward', 'Reverse'}**,
Chromatic adaptation method.
Returns
Expand All @@ -294,7 +296,8 @@ def chromatic_adaptation_CMCCAT2000(
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> chromatic_adaptation_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Forward') # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_CMCCAT2000( # doctest: +ELLIPSIS
... XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Forward')
array([ 19.5269832..., 23.0683396..., 24.9717522...])
Using the CMCCAT2000 reverse model:
Expand All @@ -304,7 +307,8 @@ def chromatic_adaptation_CMCCAT2000(
>>> XYZ_wr = np.array([94.81, 100.00, 107.30])
>>> L_A1 = 200
>>> L_A2 = 200
>>> chromatic_adaptation_CMCCAT2000(XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Reverse') # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_CMCCAT2000( # doctest: +ELLIPSIS
... XYZ, XYZ_w, XYZ_wr, L_A1, L_A2, method='Reverse')
array([ 22.48, 22.74, 8.54])
"""

Expand Down
4 changes: 2 additions & 2 deletions colour/adaptation/dataset/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,6 @@
Supported chromatic adaptation transforms.
CHROMATIC_ADAPTATION_TRANSFORMS : CaseInsensitiveMapping
{'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp', 'CMCCAT97', 'CMCCAT2000',
'Fairchild, 'CAT02', 'CAT02_BRILL_CAT', 'Bianco', 'Bianco PC'}
**{'CAT02', 'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp', 'Fairchild,
'CMCCAT97', 'CMCCAT2000', 'CAT02_BRILL_CAT', 'Bianco', 'Bianco PC'}**
"""
3 changes: 2 additions & 1 deletion colour/adaptation/fairchild1990.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def chromatic_adaptation_Fairchild1990(XYZ_1,
>>> XYZ_n = np.array([111.15, 100.00, 35.20])
>>> XYZ_r = np.array([94.81, 100.00, 107.30])
>>> Y_n = 200
>>> chromatic_adaptation_Fairchild1990(XYZ_1, XYZ_n, XYZ_r, Y_n) # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_Fairchild1990( # doctest: +ELLIPSIS
... XYZ_1, XYZ_n, XYZ_r, Y_n)
array([ 23.3252634..., 23.3245581..., 76.1159375...])
"""

Expand Down
19 changes: 12 additions & 7 deletions colour/adaptation/vonkries.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr, transform='CAT02'):
XYZ_wr : array_like
Reference viewing condition *CIE XYZ* tristimulus values of whitepoint.
transform : unicode, optional
{'CAT02', 'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp', 'Fairchild,
'CMCCAT97', 'CMCCAT2000', 'CAT02_BRILL_CAT', 'Bianco', 'Bianco PC'},
**{'CAT02', 'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp',
'Fairchild, 'CMCCAT97', 'CMCCAT2000', 'CAT02_BRILL_CAT', 'Bianco',
'Bianco PC'}**,
Chromatic adaptation transform.
Returns
Expand All @@ -69,7 +70,8 @@ def chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr, transform='CAT02'):
--------
>>> XYZ_w = np.array([1.09846607, 1.00000000, 0.35582280])
>>> XYZ_wr = np.array([0.95042855, 1.00000000, 1.08890037])
>>> chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr) # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_matrix_VonKries( # doctest: +ELLIPSIS
... XYZ_w, XYZ_wr)
array([[ 0.8687653..., -0.1416539..., 0.3871961...],
[-0.1030072..., 1.0584014..., 0.1538646...],
[ 0.0078167..., 0.0267875..., 2.9608177...]])
Expand All @@ -79,7 +81,8 @@ def chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr, transform='CAT02'):
>>> XYZ_w = np.array([1.09846607, 1.00000000, 0.35582280])
>>> XYZ_wr = np.array([0.95042855, 1.00000000, 1.08890037])
>>> method = 'Bradford'
>>> chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr, method) # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_matrix_VonKries( # doctest: +ELLIPSIS
... XYZ_w, XYZ_wr, method)
array([[ 0.8446794..., -0.1179355..., 0.3948940...],
[-0.1366408..., 1.1041236..., 0.1291981...],
[ 0.0798671..., -0.1349315..., 3.1928829...]])
Expand Down Expand Up @@ -120,8 +123,9 @@ def chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr, transform='CAT02'):
XYZ_wr : array_like
Reference viewing condition *CIE XYZ* tristimulus values of whitepoint.
transform : unicode, optional
{'CAT02', 'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp', 'Fairchild,
'CMCCAT97', 'CMCCAT2000', 'CAT02_BRILL_CAT', 'Bianco', 'Bianco PC'},
**{'CAT02', 'XYZ Scaling', 'Von Kries', 'Bradford', 'Sharp',
'Fairchild, 'CMCCAT97', 'CMCCAT2000', 'CAT02_BRILL_CAT', 'Bianco',
'Bianco PC'}**,
Chromatic adaptation transform.
Returns
Expand All @@ -143,7 +147,8 @@ def chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr, transform='CAT02'):
>>> XYZ_w = np.array([1.09846607, 1.00000000, 0.35582280])
>>> XYZ_wr = np.array([0.95042855, 1.00000000, 1.08890037])
>>> method = 'Bradford'
>>> chromatic_adaptation_VonKries(XYZ, XYZ_w, XYZ_wr, method) # noqa # doctest: +ELLIPSIS
>>> chromatic_adaptation_VonKries( # doctest: +ELLIPSIS
... XYZ, XYZ_w, XYZ_wr, method)
array([ 0.0854032..., 0.1140122..., 0.2972149...])
"""

Expand Down
14 changes: 8 additions & 6 deletions colour/algebra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
from .coordinates import * # noqa
from . import coordinates
from .extrapolation import Extrapolator1d
from .interpolation import (LinearInterpolator1d,
SplineInterpolator,
SpragueInterpolator)
from .interpolation import (LinearInterpolator,
SpragueInterpolator,
CubicSplineInterpolator,
PchipInterpolator)
from .matrix import is_identity
from .random import random_triplet_generator

__all__ = []
__all__ += coordinates.__all__
__all__ += ['Extrapolator1d']
__all__ += ['LinearInterpolator1d',
'SplineInterpolator',
'SpragueInterpolator']
__all__ += ['LinearInterpolator',
'SpragueInterpolator',
'CubicSplineInterpolator',
'PchipInterpolator']
__all__ += ['is_identity']
__all__ += ['random_triplet_generator']
Loading

0 comments on commit 4956422

Please sign in to comment.