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 / multi_spectral_to_XYZ_integration.py
Created March 21, 2018 06:12
Multi-Spectral to XYZ - Integration
#%%
import glob
import numpy as np
import colour
from colour import (DEFAULT_SPECTRAL_SHAPE, STANDARD_OBSERVERS_CMFS, ones_spd,
read_image)
from colour.utilities import tsplit, tstack, warning
from colour.plotting import image_plot
@KelSolaar
KelSolaar / matplotlib-imshow-clip-path-limits.ipynb
Created February 19, 2018 08:45
Matplotlib - imshow, Clip Path and Limits
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KelSolaar
KelSolaar / image_sequence_to_chromaticity_diagram.py
Created January 12, 2018 23:10
Image Sequence to Chromaticity Diagram
import glob
import os
import colour
from colour.plotting import RGB_chromaticity_coordinates_chromaticity_diagram_plot_CIE1931
def image_sequence_to_chromaticity_diagram(images,
output_directory,
input_colourspace='sRGB',
@KelSolaar
KelSolaar / cie_lab_to_munsell_colour.py
Created December 4, 2017 20:45
CIE L*a*b* to Munsell Colour
import colour
import numpy as np
# CIE L*a*b* input data
Lab = np.array([79.57, -1.61, 13.05])
# Assumed illuminant used for CIE L*a*b* measurements, could be D65.
illuminant_t = colour.ILLUMINANTS[
'CIE 1931 2 Degree Standard Observer']['D50']
# Munsell Renotation System illuminant.
@KelSolaar
KelSolaar / RGB_colourspaces_planckian_locus_CIE_1931_chromaticity_diagram_plot.png
Last active February 19, 2023 18:32
RGB Colourspaces - Planckian Locus CIE 1931 Chromaticity Diagram Plot
RGB_colourspaces_planckian_locus_CIE_1931_chromaticity_diagram_plot.png
@KelSolaar
KelSolaar / object_inherit.py
Created November 19, 2017 06:04
Object Inherit
# %%
class Foo():
def __init__(self):
print('Foo')
class Bar(Foo):
def __init__(self):
super(Bar, self).__init__()
print('Bar')
@KelSolaar
KelSolaar / cie_lab_colour_difference.py
Created October 13, 2017 22:20
CIE Lab - Colour Difference
import colour
# The two RGB triplets we want to measure the colour difference:
RGB = [(0.26, 0.42, 0.78), (0.25, 0.41, 0.79)]
# The reference illuminant/whitepoint.
D65 = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
# Assuming sRGB IEC61966-2.1 encoded colours.
# - sRGB/BT.709 Primaries
@KelSolaar
KelSolaar / hdri_probe_normalisation.nkp
Created July 25, 2017 08:32
HDRI Probe - Normalisation
set cut_paste_input [stack 0]
version 10.5 v2
Read {
inputs 0
file /Users/kelsolaar/Downloads/grace_probe.hdr
format "1000 1000 0 0 1000 1000 1 "
origset true
name grace_probe_Read
label http://www.pauldebevec.com/Probes/grace_probe.hdr
selected true
@KelSolaar
KelSolaar / taskpaper2org.py
Last active February 22, 2025 15:47
Omnifocus Taskpaper Export to Org-Mode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Converts from *Omnifocus* *taskpaper* export to *org-mode*.
Examples
--------
> python taskpaper2org.py omnifocus.txt > omnifocus.org
Notes
@KelSolaar
KelSolaar / diagram_plot.py
Created June 19, 2017 11:29
CIE 1976 UCS Chromaticity Diagram - CIE 1964 10 Degree Standard Observer - Trimmed
%matplotlib inline
import colour
from colour.plotting.diagrams import *
colour.CMFS['CIE 1964 10 Degree Standard Observer - Trimmed'] = colour.CMFS['CIE 1964 10 Degree Standard Observer'].clone().align(colour.SpectralShape(400, 700, 1))
CIE_1976_UCS_chromaticity_diagram_colours_plot(
samples=1024,
standalone=False,