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
# -*- coding: utf-8 -*-
"""
Mock for Colour
===============
Defines various objects for mocking to use with
`Colour <https://github.com/colour-science/colour>`_.
References
----------
@KelSolaar
KelSolaar / Dockerfile
Last active July 17, 2019 23:59
ociolutimage - Docker Wrapper
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y \
build-essential \
git \
freeglut3-dev \
libglew-dev \
libilmbase-dev \

The reStructuredText Cheat Sheet: Syntax Reminders

Info

See <http://docutils.sf.net/rst.html> for introductory docs.

Author

David Goodger <goodger@python.org>

Date

$Date: 2013-02-20 01:10:53 +0000 (Wed, 20 Feb 2013) $

Revision

$Revision: 7612 $

Description

This is a "docinfo block", or bibliographic field list

Note

If you are reading this as HTML, please read

@KelSolaar
KelSolaar / Pinboard.scpt
Created March 9, 2019 19:20 — forked from itst/Pinboard.scpt
Import and update your Pinboard bookmarks to DEVONthink
(* Import and update your Pinboard bookmarks to DEVONthink
Based on work done by Christian Grunenberg on Mon Jan 23 2006,
Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010 and
Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished.
By Sascha A. Carlin <https://sascha.carlin.de/> on 2018-03-07 to set the creation date of new record, show progress bar, use Pinboard Auth Token, use modification date of folder to fetch only recent items
Copyright (c) 2018. All rights reserved. *)
use framework "Foundation"
@KelSolaar
KelSolaar / barten.py
Created January 31, 2019 19:38
Contrast Sensitivity Function - Barten (1999)
# https://pure.tue.nl/ws/files/1613279/9901043.pdf
#http://car.france3.mars.free.fr/Formation%20INA%20HD/HDTV/HDTV%20%202007%20v35/SMPTE%20normes%20et%20confs/Contrastm.pdf
# %%
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
from colour.utilities import as_float_array
from colour.plotting import colour_style, plot_single_function
@KelSolaar
KelSolaar / add_labels.py
Created January 24, 2019 08:52
LaTeX - Add Labels
import codecs
import fnmatch
import os
import re
def _sanitize_filename(filename):
"""
Sanitizes given filename.
Parameters
@KelSolaar
KelSolaar / inkscape.py
Last active October 10, 2021 06:42
Inkscape - macOs - Absolute Path Wrapper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Inkscape - macOs - Absolute Path Wrapper
========================================
On *macOs*, *Inkscape* requires absolute paths to work::
https://answers.launchpad.net/inkscape/+question/280575
@KelSolaar
KelSolaar / colour-0.4.5-current-changes.md
Last active June 1, 2024 21:34
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 / colour_examples_and_unit_tests_recommended_values.py
Last active June 27, 2019 11:58
Recommended Values for Use in Colour Examples and Unit Tests
@KelSolaar
KelSolaar / mitsuba_export_spds.py
Last active October 12, 2018 19:05
Mitsuba - Shader Balls
for name, spd in SPDS.items():
prefix = ''.join([token.title() for token in spd.name.split()])
prefix = prefix.replace('.', '_')
prefix = prefix.replace('(', '_')
prefix = prefix.replace(')', '_')
filename = '/Users/kelsolaar/Google Drive/Cinematic Color Update/Supporting Documents/Spectral/ShaderBalls/ColorChecker N Ohta/{0}.spd'.format(prefix)
colour.write_spds_to_csv_file({spd.name: spd}, filename, delimiter=' ')
with open(filename, 'r') as csv_file: