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 math | |
diagonal = lambda w, h: math.sqrt(w ** 2 + h ** 2) | |
wr = 36. # Reference 24mm * 36mm sensor. | |
hr = 24. | |
dr = diagonal(wr, hr) | |
w = 7.6 # Current sensor: http://en.wikipedia.org/wiki/Image_sensor_format | |
h = 5.7 |
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
BACKGROUND_CODES = (("bBlack", "40m"), | |
("bRed", "41m"), | |
("bGreen", "42m"), | |
("bYellow", "43m"), | |
("bBlue", "44m"), | |
("bPurple", "45m"), | |
("bCyan", "46m"), | |
("bWhite", "47m"), | |
("bHighBlack", "100m"), | |
("bHighRed", "101m"), |
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
# PyCharm will complain the the parameters are missing in docstrings with | |
# Numpy style docstrings. | |
def XYZ_to_CIECAM02(XYZ, | |
XYZw, | |
LA, | |
Yb, | |
surround=CIECAM02_VIEWING_CONDITIONS.get( | |
'Average'), | |
discount_illuminant=False): | |
""" |
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
{'dark skin': np.array([0.07049534, 0.1008, 0.09558313]), | |
'light skin': np.array([0.4709771, 0.3495, 0.11301649]), | |
'blue sky': np.array([0.37187544, 0.1836, 0.05327788]), | |
'foliage': np.array([0.07439008, 0.1325, 0.08761981]), | |
'blue flower': np.array([0.55702667, 0.2304, 0.01929602]), | |
'bluish green': np.array([0.72072938, 0.4178, -0.0702604]), | |
'orange': np.array([0.14092656, 0.3118, 0.31620069]), | |
'purplish blue': np.array([0.3568546, 0.1126, 0.06520827]), | |
'moderate red': np.array([0.22536132, 0.1938, 0.172956]), | |
'purple': np.array([0.10628412, 0.0637, 0.08666374]), |
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
from pprint import pprint | |
pr = corresponding_chromaticities_prediction_vonkries(2, 'Bradford') | |
pr = [(p.uvp_m, p.uvp_p) for p in pr] | |
pprint(pr) # doctest: +ELLIPSIS | |
[((0.20..., 0.48...), (0.2082014..., 0.4722922...)), | |
((0.44..., 0.51...), (0.4489102..., 0.5071602...)), | |
((0.26..., 0.50...), (0.2643545..., 0.4959631...)), | |
((0.32..., 0.54...), (0.3348730..., 0.5471220...)), | |
((0.31..., 0.53...), (0.3248758..., 0.5390589...)), | |
((0.26..., 0.55...), (0.2733105..., 0.5555028...)), |
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 | |
from colour.utilities.verbose import message_box | |
name, data, illuminant = colour.COLOURCHECKERS['ColorChecker 2005'] | |
sRGB_w = colour.sRGB_COLOURSPACE.whitepoint | |
sRGB_XYZ_to_RGB = colour.sRGB_COLOURSPACE.to_RGB | |
sRGB_RGB_to_XYZ = colour.sRGB_COLOURSPACE.to_XYZ | |
adobe98_w = colour.ADOBE_RGB_1998_COLOURSPACE.whitepoint |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
for c in sorted(colour.RGB_COLOURSPACES.values()): | |
samples = np.linspace(0, 1, 1000) | |
samples_tf = [c.transfer_function(sample) for sample in samples] | |
samples_itf = [c.inverse_transfer_function(sample) for sample in samples_tf] | |
try: | |
np.testing.assert_almost_equal(samples, samples_itf, decimal=4) | |
except: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
set cut_paste_input [stack 0] | |
version 8.0 v1 | |
Read { | |
inputs 0 | |
file /Users/kelsolaar/Downloads/SonyF35.StillLife.dpx | |
format "1920 1080 0 0 1920 1080 1 HD" | |
origset true | |
colorspace linear | |
raw true | |
timecode 02:14:20:19 |
OlderNewer