Skip to content

Instantly share code, notes, and snippets.

View KelSolaar's full-sized avatar
🔅
Bending Light

Thomas Mansencal KelSolaar

🔅
Bending Light
View GitHub Profile
@KelSolaar
KelSolaar / rgb_luminance.py
Created June 13, 2015 11:20
RGB Luminance
# https://github.com/colour-science/colour/blob/develop/colour/models/derivation.py#L158
import colour
sRGB = colour.RGB_COLOURSPACES['sRGB']
colour.RGB_luminance_equation(sRGB.primaries, sRGB.whitepoint)
# u'Y = 0.212636821677(R) + 0.715182981841(G) + 0.0721801964814(B)'
@KelSolaar
KelSolaar / aces_xyz_matrices.ipynb
Last active September 1, 2015 20:13
ACES - XYZ Matrices
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KelSolaar
KelSolaar / hl_recovery.ipynb
Created October 21, 2015 08:07
Highlights Recovery
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KelSolaar
KelSolaar / colorchecker_2005_-_conversion.ipynb
Created December 15, 2015 22:42
ColorChecker 2005 - Conversion
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KelSolaar
KelSolaar / ACEScc_OECF.spi1d
Created December 16, 2015 02:00
Colour - Spi1d
Version 1
From 0 1
Length 1024
Components 1
{
-0.358447488584475
-0.015901280236606
0.041176345334171
0.074564615923278
0.098253970904947
@KelSolaar
KelSolaar / dominant_wavelength.ipynb
Created January 4, 2016 10:29
Dominant Wavelength
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KelSolaar
KelSolaar / munsell_to_srgb.py
Last active February 20, 2022 17:27
Munsell Colour to sRGB
import numpy as np
import colour
xyY = np.asarray(colour.MUNSELL_COLOURS_REAL[2000][1])
# Munsell Renotation System uses C illuminant.
# Luminance is in range [0-100], so we need to scale it
# back to [0-1].
XYZ = colour.xyY_to_XYZ(xyY)
RGB = colour.XYZ_to_sRGB(
@KelSolaar
KelSolaar / secondary_chromaticities_computation.py
Created March 4, 2016 08:23
Secondary Chromaticity Coordinates Computation
P = np.array(
[[0.6650, 0.3220],
[0.2950, 0.6070],
[0.1500, 0.0600]])
W = np.array([0.3127, 0.3290])
NPM = colour.normalised_primary_matrix(P, W)
NPM_i = np.linalg.inv(NPM)
@KelSolaar
KelSolaar / raytracing.py
Created June 7, 2016 07:30 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
import numpy as np
import matplotlib.pyplot as plt
w = 400
h = 300
def normalize(x):
x /= np.linalg.norm(x)
return x
@KelSolaar
KelSolaar / keybase.md
Created July 10, 2016 21:10
Thomas Mansencal - keybase.io

Keybase proof

I hereby claim:

  • I am kelsolaar on github.
  • I am thomasmansencal (https://keybase.io/thomasmansencal) on keybase.
  • I have a public key whose fingerprint is 2331 CA52 9DDA 0A42 6B76 37E1 502D 5DCA A231 FF22

To claim this, I am signing this object: