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 / colour-0.4.5-current-changes.md
Last active April 22, 2024 08:22
Colour 0.4.5 - Current Changes

Colour 0.4.5 - Alpha Milestone

Features

Environment (#1239, @KelSolaar)

It is now possible to create a ~/.colour-science/colour-science.jenv JSON file from which Colour will load environment variables from:

{
@KelSolaar
KelSolaar / taskpaper2org.py
Last active February 19, 2024 22:24
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 / cie_lab.py
Last active October 21, 2023 07:59
CIE Lab to CIE XYZ - Mojo
from algorithm import parallelize
from benchmark import Benchmark
from math import min
from math.limit import inf
from python import Python
from tensor import Tensor, TensorSpec, TensorShape
from random import rand
from time import now
from utils.index import Index
@KelSolaar
KelSolaar / plasa_ansi_e154.py
Created August 19, 2023 23:14
PLASA ANSI E1.54 - Whitepoint Derivation
# Standard claims at https://webstore.ansi.org/preview-pages/ESTA/preview_ANSI+E1.54-2015.pdf gives [0.4254, 0.4044]
import colour
# Blackbody: 360, 780, 1nm
# CIE 1931 2 Degree Standard Observer: 360, 780, 1nm
# Method: ASTM E308
print(
colour.XYZ_to_xy(
colour.sd_to_XYZ(
@KelSolaar
KelSolaar / BuildProject.xml
Created July 31, 2023 03:58 — forked from regner/BuildProject.xml
A sample BuildGraph script for building, cooking, and packaging an Unreal project.
<?xml version='1.0' ?>
<!--
Why is this one giant script instead of a bunch of smaller scripts?
Mostly this comes down to BuildGraph and personal preference. As the language BuildGraph isn't
really much of a programming language there is no easy way to use an IDE and jump between
includes, find usages of variables, and just generally quickly search things. It was found to
be easier to have a single large file that a developer can quickly jump up and down in when
trying to understand what the BuildGraph script is doing.
@KelSolaar
KelSolaar / aided_atlas.py
Last active April 3, 2023 07:55
AideDD - Atlas
#!/usr/bin/env python
"""
AideDD - Atlas
==============
This Python module extracts the map data from
`AideDD Atlas <https://www.aidedd.org/public/atlas>`__
The following packages are required:
@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 / katanaHotRender.py
Created September 12, 2012 14:53
Katana - Hotrender
import NodegraphAPI
from Katana import RenderManager
from Katana import Nodes3DAPI
renderNode = NodegraphAPI.GetNode("default")
camera = "/root/world/cam/render_Camera"
for frame in range(1001, 1072):
NodegraphAPI.GetNode("rootNode").getParameter("currentTime").setValue(frame,0)
Nodes3DAPI.RenderNodeUtil.SyncOutputPorts(renderNode)
RenderManager.StartRender(node=renderNode, hotRender=True, frame=frame, views=[camera], ignoreROI=True, asynch=False, interactive=False)
@KelSolaar
KelSolaar / pyproject.toml
Created February 22, 2022 06:48
Colour - pyproject.toml
[tool.poetry]
name = "colour"
version = "0.4.0"
description = "Colour Science for Python"
license = "BSD-3-Clause"
authors = [ "Colour Developers <colour-developers@colour-science.org>" ]
maintainers = [ "Colour Developers <colour-developers@colour-science.org>" ]
readme = 'README.rst'
repository = "https://github.com/colour-science/colour"
homepage = "https://www.colour-science.org/"
@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(