Last active
June 27, 2019 11:58
-
-
Save KelSolaar/2ca5f4107a8ae05ec57a55a9ae2f3a13 to your computer and use it in GitHub Desktop.
Recommended Values for Use in Colour Examples and Unit Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import colour | |
np.set_printoptions(formatter={'float': '{:0.8f}'.format}, threshold=np.nan) | |
print('Recommended Values for Use in Colour Examples and Unit Tests') | |
print() | |
print('Illuminants "xy"') | |
print() | |
print('D65', ':', | |
repr(colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'])) | |
print('D50', ':', | |
repr(colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50'])) | |
print('A', ':', | |
repr(colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['A'])) | |
print('E', ':', | |
repr(colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['E'])) | |
print('F2', ':', | |
repr(colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['F2'])) | |
print('CC I', ':', repr(colour.COLOURCHECKERS['ColorChecker 2005'].illuminant)) | |
print() | |
print() | |
D65 = colour.xy_to_XYZ( | |
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']) | |
D50 = colour.xy_to_XYZ( | |
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']) | |
A = colour.xy_to_XYZ( | |
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['A']) | |
F2 = colour.xy_to_XYZ( | |
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['F2']) | |
E = colour.xy_to_XYZ( | |
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['E']) | |
CC_I = colour.xy_to_XYZ(colour.COLOURCHECKERS['ColorChecker 2005'].illuminant) | |
print('Illuminants "XYZ"') | |
print() | |
print('D65', ':', repr(D65)) | |
print('D50', ':', repr(D50)) | |
print('A', ':', repr(A)) | |
print('F2', ':', repr(F2)) | |
print('E', ':', repr(E)) | |
print('CC I', ':', repr(CC_I)) | |
print() | |
print() | |
for name, illuminant in { | |
'D65': D65, | |
'D50': D50, | |
'A': A, | |
'E': E, | |
'F2': F2 | |
}.items(): | |
print('ColorChecker 2005 "XYZ" Adapted to "{0}"'.format(name)) | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
print(swatch, ':', | |
repr(colour.chromatic_adaptation(XYZ, CC_I, illuminant))) | |
print() | |
print() | |
for name, illuminant in { | |
'D65': D65, | |
'D50': D50, | |
'A': A, | |
'E': E, | |
'F2': F2 | |
}.items(): | |
print('Luminance "XYZ" Adapted to "{0}"'.format(name)) | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
print(swatch, ':', '{:0.8f}'.format( | |
colour.chromatic_adaptation(XYZ, CC_I, illuminant)[1] * 100)) | |
print() | |
print() | |
for name, illuminant in {'D65': D65}.items(): | |
print('ColorChecker 2005 "sRGB - Linear" under "{0}"'.format(name)) | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
print(swatch, ':', | |
repr( | |
colour.XYZ_to_sRGB( | |
XYZ, | |
colour.COLOURCHECKERS['ColorChecker 2005'].illuminant, | |
apply_encoding_cctf=False))) | |
print() | |
print() | |
for name, illuminant in {'D65': D65}.items(): | |
print('ColorChecker 2005 "sRGB - OETF" under "{0}"'.format(name)) | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
print(swatch, ':', | |
repr( | |
colour.XYZ_to_sRGB( | |
XYZ, | |
colour.COLOURCHECKERS['ColorChecker 2005'].illuminant))) | |
print() | |
print() | |
for name, illuminant in {'D65': D65}.items(): | |
print('ColorChecker 2005 "Munsell Value"') | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
XYZ = colour.chromatic_adaptation( | |
XYZ, D50, | |
colour.xy_to_XYZ( | |
colour.notation.munsell. | |
MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES)) | |
xyY = colour.XYZ_to_xyY(XYZ) | |
print(swatch, ':', '{:0.8f}'.format( | |
colour.munsell_value(xyY[-1] * 100))) | |
print() | |
print() | |
for name, illuminant in {'D65': D65}.items(): | |
print('ColorChecker 2005 "ASTM D1535-08e1 Luminance"') | |
print() | |
for swatch in [ | |
'red', | |
'green', | |
'blue', | |
'cyan', | |
'yellow', | |
'magenta', | |
'neutral 5 (.70 D)', | |
]: | |
XYZ = colour.xyY_to_XYZ( | |
colour.COLOURCHECKERS['ColorChecker 2005'].data[swatch]) | |
XYZ = colour.chromatic_adaptation( | |
XYZ, D50, | |
colour.xy_to_XYZ( | |
colour.notation.munsell. | |
MUNSELL_DEFAULT_ILLUMINANT_CHROMATICITY_COORDINATES)) | |
xyY = colour.XYZ_to_xyY(XYZ) | |
print(swatch, ':', '{:0.8f}'.format( | |
colour.colorimetry.luminance_ASTMD153508( | |
colour.munsell_value(xyY[-1] * 100)))) | |
print() | |
print() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recommended Values for Use in Colour Examples and Unit Tests | |
Illuminants "xy" | |
D65 : array([0.31270000, 0.32900000]) | |
D50 : array([0.34570000, 0.35850000]) | |
A : array([0.44757000, 0.40745000]) | |
E : array([0.33333333, 0.33333333]) | |
F2 : array([0.37208000, 0.37529000]) | |
CC I : array([0.34570000, 0.35850000]) | |
Illuminants "XYZ" | |
D65 : array([0.95045593, 1.00000000, 1.08905775]) | |
D50 : array([0.96429568, 1.00000000, 0.82510460]) | |
A : array([1.09846607, 1.00000000, 0.35582280]) | |
F2 : array([0.99144661, 1.00000000, 0.67315942]) | |
E : array([1.00000000, 1.00000000, 1.00000000]) | |
CC I : array([0.96429568, 1.00000000, 0.82510460]) | |
ColorChecker 2005 "XYZ" Adapted to "D65" | |
red : array([0.20654008, 0.12197225, 0.05136952]) | |
green : array([0.14222010, 0.23042768, 0.10495772]) | |
blue : array([0.07818780, 0.06157201, 0.28099326]) | |
cyan : array([0.14525849, 0.19799077, 0.40724370]) | |
yellow : array([0.55676530, 0.58671628, 0.09785344]) | |
magenta : array([0.30795495, 0.20024152, 0.31071274]) | |
neutral 5 (.70 D) : array([0.18182171, 0.19153665, 0.21009620]) | |
ColorChecker 2005 "XYZ" Adapted to "D50" | |
red : array([0.21638819, 0.12570000, 0.03847493]) | |
green : array([0.14985004, 0.23180000, 0.07900179]) | |
blue : array([0.06857861, 0.05750000, 0.21375591]) | |
cyan : array([0.13605127, 0.19300000, 0.30938736]) | |
yellow : array([0.59342537, 0.59810000, 0.07188823]) | |
magenta : array([0.31084193, 0.20090000, 0.23565391]) | |
neutral 5 (.70 D) : array([0.18438363, 0.19150000, 0.15918203]) | |
ColorChecker 2005 "XYZ" Adapted to "A" | |
red : array([0.25330530, 0.13765139, 0.01543307]) | |
green : array([0.18673833, 0.23111171, 0.03285972]) | |
blue : array([0.05610693, 0.04992541, 0.09429057]) | |
cyan : array([0.13623492, 0.18062024, 0.13553082]) | |
yellow : array([0.73088905, 0.62177441, 0.02548927]) | |
magenta : array([0.34280970, 0.20770559, 0.10214220]) | |
neutral 5 (.70 D) : array([0.20988974, 0.19141324, 0.06866269]) | |
ColorChecker 2005 "XYZ" Adapted to "E" | |
red : array([0.21781186, 0.12541048, 0.04697113]) | |
green : array([0.15434689, 0.22960951, 0.09620221]) | |
blue : array([0.07683480, 0.06006092, 0.25833845]) | |
cyan : array([0.14893167, 0.19487065, 0.37427698]) | |
yellow : array([0.59874058, 0.59196415, 0.08899633]) | |
magenta : array([0.31991986, 0.20277158, 0.28536138]) | |
neutral 5 (.70 D) : array([0.19126715, 0.19151544, 0.19291812]) | |
ColorChecker 2005 "XYZ" Adapted to "F2" | |
red : array([0.22545552, 0.12877805, 0.03103172]) | |
green : array([0.15832594, 0.23204226, 0.06406107]) | |
blue : array([0.06385467, 0.05509729, 0.17506386]) | |
cyan : array([0.13364947, 0.18951306, 0.25307753]) | |
yellow : array([0.62718558, 0.60525456, 0.05690008]) | |
magenta : array([0.31720246, 0.20226568, 0.19243480]) | |
neutral 5 (.70 D) : array([0.18952683, 0.19147512, 0.12987334]) | |
Luminance "XYZ" Adapted to "D65" | |
red : 12.19722535 | |
green : 23.04276781 | |
blue : 6.15720079 | |
cyan : 19.79907683 | |
yellow : 58.67162787 | |
magenta : 20.02415243 | |
neutral 5 (.70 D) : 19.15366501 | |
Luminance "XYZ" Adapted to "D50" | |
red : 12.57000000 | |
green : 23.18000000 | |
blue : 5.75000000 | |
cyan : 19.30000000 | |
yellow : 59.81000000 | |
magenta : 20.09000000 | |
neutral 5 (.70 D) : 19.15000000 | |
Luminance "XYZ" Adapted to "A" | |
red : 13.76513858 | |
green : 23.11117127 | |
blue : 4.99254109 | |
cyan : 18.06202404 | |
yellow : 62.17744084 | |
magenta : 20.77055938 | |
neutral 5 (.70 D) : 19.14132354 | |
Luminance "XYZ" Adapted to "E" | |
red : 12.54104823 | |
green : 22.96095053 | |
blue : 6.00609174 | |
cyan : 19.48706483 | |
yellow : 59.19641488 | |
magenta : 20.27715822 | |
neutral 5 (.70 D) : 19.15154358 | |
Luminance "XYZ" Adapted to "F2" | |
red : 12.87780528 | |
green : 23.20422641 | |
blue : 5.50972884 | |
cyan : 18.95130571 | |
yellow : 60.52545632 | |
magenta : 20.22656850 | |
neutral 5 (.70 D) : 19.14751195 | |
ColorChecker 2005 "sRGB - Linear" under "D65" | |
red : array([0.45620519, 0.03081071, 0.04091952]) | |
green : array([0.05433312, 0.29879493, 0.07185472]) | |
blue : array([0.01862364, 0.05140184, 0.28880425]) | |
cyan : array([-0.03667845, 0.24755074, 0.39815738]) | |
yellow : array([0.85356364, 0.56517342, 0.01475279]) | |
magenta : array([0.53522616, 0.09013008, 0.30472718]) | |
neutral 5 (.70 D) : array([0.19002735, 0.19183638, 0.19312568]) | |
ColorChecker 2005 "sRGB - OETF" under "D65" | |
red : array([0.70573936, 0.19248268, 0.22354168]) | |
green : array([0.25847007, 0.58276101, 0.29718877]) | |
blue : array([0.14565317, 0.25130933, 0.57378757]) | |
cyan : array([-0.47388561, 0.53467479, 0.66380090]) | |
yellow : array([0.93264474, 0.77675390, 0.12708884]) | |
magenta : array([0.75809823, 0.33206288, 0.58800664]) | |
neutral 5 (.70 D) : array([0.47315229, 0.47524148, 0.47672343]) | |
ColorChecker 2005 "Munsell Value" | |
red : 4.08244375 | |
green : 5.39132685 | |
blue : 2.97619312 | |
cyan : 5.06675596 | |
yellow : 8.04387670 | |
magenta : 5.10225899 | |
neutral 5 (.70 D) : 4.98656896 | |
ColorChecker 2005 "ASTM D1535-08e1 Luminance" | |
red : 12.23634268 | |
green : 22.89399987 | |
blue : 6.29022535 | |
cyan : 19.86282567 | |
yellow : 58.37987916 | |
magenta : 20.18160934 | |
neutral 5 (.70 D) : 19.15426585 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment