
Colour 0.3.11 is available - kelsolaar
https://github.com/colour-science/colour/releases/tag/v0.3.11
======
teilo
Glad to see this. Python needs better color tools. There is the colormath
module, but it is missing a lot of essential functionality, especially for
anyone trying to use it for printing. It's useless for CMYK work.

Nothing out there can do true color management in pure python. I just wrote a
library to handle basic single-color conversion through arbitrary ICC profiles
using the lcms ctypes wrapper around littlecms. That was my first foray into
ctypes in Python. He no idea what a PITA it would be.

~~~
kelvin0
I've used colormath package to convert RGB to LAB and do some DeltaE
calculations. What is your use case? You mention print and color profiles?
I've been running into those lately and am having trouble understanding the
whole 'printing' application I'm not familiar with at all.

~~~
foolrush
> I've used colormath package to convert RGB to LAB and do some DeltaE
> calculations.

Reading this makes my stomach sore.

Remember that _RGB is not a colour space_. Neither is CMYK. Colour encoding
models do not necessarily imply a colour space as outlined by the definition
of an RGB colour space via ISO 22028-1.

Even Lab encodings will vary based upon the assumed white point.

~~~
kelvin0
Care to propose a solution or to elaborate on that? I am quite opened to
anything you propose.

~~~
foolrush
RGB, much like CMYK, are merely colour encoding models. In the case of RGB, it
represents three lights at arbitrary intensities. In the case of CMYK, it more
commonly references a series of four inks subject to some arbitrary density
scaling. That is, both RGB / CMYK are to cups as resulting colour is to
fluids.

What _is not_ expressed in saying "RGB" or "CMYK" are the other critical
facets that define what they are referencing. In RGB, what are the colours of
the three lights and what is the combined white point? In CMYK, what are the
colours of the inks, the paper colour / type, and the illuminant in question?
The mixture of the unsaid contexts are what define how colours result to a
standard observer.

In the case of Lab, one must take care to assert that the same formulation has
taken place before comparing values. For example, it isn't enough to just say
"RGB" because of the facets above. What are the colours of primary lights in
the source RGB space? The destination you are comparing? What are the white
points? What is the white point assumed in the formulation for the Lab
conversion?

Only when all of the contexts are identical do the values take on meaning, and
a valid comparison within the limits of the encoding model is possible.

TL;DR:

* Make sure you are aware of the primaries of the RGB spaces being compared with Lab.

* Make sure your white points are aligned on the RGB spaces being compared with Lab.

* Make sure your RGB spaces are aligned to the white point of the Lab formulation in question.

* Make sure you are linearising your RGB spaces correctly before converting to Lab; every RGB space typically has a unique transfer function.

* Be well aware of the limitations of Lab, such as red turns yellow and blue turns purple hue nonlinearity etc.

* Be using an appropriate model for the intensities of light being compared. Lab, for example, is not well suited for anything beyond diffuse white reflectance values.

Colour should be able to handle all of the above points, and deliver great
looking plots as well!

~~~
kelvin0
Most the terms you used to explain this go wwwaaayy over my head, but I
understand there are many concepts missing in my mind. What is good reading
for this? Basically I'm working with industrial cameras and trying to compare
the color of an item in an image for verification against stored item
attributes (color, shape...)

~~~
foolrush
The reading for most of this stuff is ridiculously dense, as well as being
more reference.

You sound like a perfect candidate to dig into Colour. There are a great many
extremely knowledgeable people around that project that can help.

Mark Fairchild's Color Appearance Models is probably about the most canonical
tome one can recommend, with the caveat above.

To do what you are seeking, you would need an accurate profile of your camera
in question, as well as likely a spectrophotometer for the objects in
question. It is a pretty tricky field.

I would encourage you to contact the Colour Science Twitter feed to get in on
the Slack channel for help and guidance.

See you there!

------
bpicolo
This is cool. Something I can't imagine having a use for personally, but
clearly something that a lot of research has gone into that fulfills a
specific niche particularly well, and python is definitely the right place for
it.

Hope your road to stable goes well.

