

Colour Science for Python - ctrijueque
http://www.colorpipe.org/colour-science-for-python/

======
leni536
Nice. Everybody who programs something that involves calculations with colours
in any way should learn some colour science. It's not hard in any way but
lot's of stuff are missed in most applications.

One of the most missed feature is the lack of using a linear colourspace when
it is necessary, like scaling (especially scaling down) images [1] or
calculating physical models (like the Phong model [2]) that implicitly imply a
linear colourspace. Iceweasel 35 still doesn't use a linear colourspace for
scaling, there is a simple example image showing that [3] (try to zoom out).
Last time I checked their SVG engine's Phong model implementation (yes, SVG
supports bump maps with custom lighting settings) was broken too. It was a
long time ago, I submitted a bug report for it but somehow it was marked as a
duplicate for a "fixed" bug so I do not think that it got fixed since then.

[1]
[http://www.4p8.com/eric.brasseur/gamma.html](http://www.4p8.com/eric.brasseur/gamma.html)

[2]
[http://en.m.wikipedia.org/wiki/Phong_reflection_model](http://en.m.wikipedia.org/wiki/Phong_reflection_model)

[3]
[http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png](http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png)

edit: formatting

edit: Found the reference renderings of the feDiffuseLighting filter [4]. In
my Iceweasel 35 the SVG images are much darker than the prerendered png.

[4]
[http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObj...](http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/filters-
diffuse-01-f.html)

------
rprospero
I've used the ColorPy
([http://markkness.net/colorpy/ColorPy.html](http://markkness.net/colorpy/ColorPy.html))
a bit before and had some good luck with it. Anyone know who colorpipe
compares?

~~~
kelsolaar
I haven't checked precisely but we do support all the relevant computations
colorpy does, it is an excellent project by the way.

~~~
vanattab
Do you guys support the LMS colorspace i.e. where L,M,S is the stimulation of
the long, med, short cones in the human eye.

~~~
kelsolaar
We do have support for quite a few chromatic adaptation transforms to cones
space ([https://github.com/colour-
science/colour/blob/develop/colour...](https://github.com/colour-
science/colour/blob/develop/colour/adaptation/dataset/cat.py)) some cones
space transformation are directly tied to the various chromatic adaptation
models ([https://github.com/colour-
science/colour/tree/develop/colour...](https://github.com/colour-
science/colour/tree/develop/colour/adaptation)) or colour appearance models
([https://github.com/colour-
science/colour/tree/develop/colour...](https://github.com/colour-
science/colour/tree/develop/colour/appearance)) we have implemented.

We also have the Stockman & Sharpe Cone Fundamentals for 2 and 10 degree
observers ([https://github.com/colour-
science/colour/blob/develop/colour...](https://github.com/colour-
science/colour/blob/develop/colour/colorimetry/dataset/cmfs.py#L90)) and the
code to convert those cone fundamentals cmfs to the corresponding XYZ cmfs
([https://github.com/colour-
science/colour/blob/develop/colour...](https://github.com/colour-
science/colour/blob/develop/colour/colorimetry/transformations.py#L229))
although it is more educational than anything else because often, the
resulting cmfs are manually adjusted (I would have to check if it is the case
with the XYZ cmfs resulting from the LMS cmfs).

------
canavandl
Also, check out [http://colour-science.org/](http://colour-science.org/)

It has python implementations of a ton of colorspaces and transforms. Also
some cool support for spectral data.

