I’d like to add some others from this table, or even a custom option. Even after seeing this table, it still surprises me to get a rich color from “A” when fully desaturating a color. It’s just odd, even though it totally makes sense (the white point is the “grey/white/black” point).
I’m trying to implement channel-locked color pickers but having a really annoying problem gamut mapping the color back to within-gamut. Say I take a blue color and convert that to CIECAM JCh with python-colorspacious:
from colorspacious import cspace_convert
cspace_convert((0,0,1), “sRGB1”, “JCh”)
array([ 21.074306 , 90.51466637, 257.9160105 ])
then I change the hue and convert that back to sRGB:
cspace_convert((21.074306 , 90.51466637, 0), “JCh”, “sRGB1”)
array([ 0.57352534, -0.3367575 , 0.26130328])
Now I have a negative value and want to perform gamut mapping to get back to sRGB. LittleCMS should do this but I can’t seem to find any way to use it from within python. PIL Image/ PIL ImageCMS doesn’t seem to support floating points for more than one channel. So, not sure how I can do CM with an Image object without 3 channels… dohh
im=PIL.Image.new(“F”, (1,1), color=(0.5, 0.5, 0.5))
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib/python2.7/dist-packages/PIL/Image.py”, line 2063, in new
return Image()._new(core.fill(mode, size, color))
TypeError: a float is required