complex_colormap icon indicating copy to clipboard operation
complex_colormap copied to clipboard

Not perceptually uniform?

Open endolith opened this issue 7 years ago • 5 comments

Instead of JCh, it looks like this should be constructed in CAM02-UCS space (expressed in cylindrical coordinates) which has a different lightness curve and chroma(/colorfulness?) curve.

https://github.com/matplotlib/matplotlib/issues/6033#issuecomment-412318447 and https://github.com/matplotlib/matplotlib/issues/6033#issuecomment-412367529

("the new uniform colour spaces based on CIECAM02 by Luo et al. (CAM02-UCS, CAM02-SCD and CAM02-LCD)", so CIECAM02 itself is not a uniform color space)

and even after fixing that, it might still not be technically correct to call it "perceptually uniform", but I think "perceptually uniform in lightness and hue" would be correct.

endolith avatar Aug 12 '18 20:08 endolith

@njsmith Is it correct to say that colorspacious.cspace_converter("sRGB1", "CAM02-UCS") returns J′a′b′ triples, and that when I convert them to cylindrical coordinates they become J′M′h?

Mʹ = np.sqrt(aʹ**2 + bʹ**2)
h = np.degrees(np.arctan2(bʹ, aʹ))

aʹ = Mʹ * np.cos(np.radians(h))
bʹ = Mʹ * np.sin(np.radians(h))

Kruse 2018:

kruse 2018 quote

Masaoka 2013:

masaoka 2013

So then my colormap will be linear J′ ("lightness") vs linear h ("hue"), while maximizing M′ ("colorfulness") (in various ways).

endolith avatar Aug 16 '18 23:08 endolith

Is it correct to say that colorspacious.cspace_converter("sRGB1", "CAM02-UCS") returns J′a′b′ triples, and that when I convert them to cylindrical coordinates they become J′M′h?

Yes. The J′a′b′ and J′M′h terminology isn't quite standard, but I know what you mean and what you mean is correct :-).

njsmith avatar Aug 17 '18 00:08 njsmith

@njsmith Is there a more standard terminology?

endolith avatar Aug 17 '18 00:08 endolith

Not really :-/. The Luo et al paper uses more cumbersome terminology where J′ refers to an intermediate value instead of the final result, just to make everyone's life difficult. What colorspacious call J′ matches what Luo et al call "J′ / K_L". (Though for CAM02-UCS specifically, K_L is 1, so these are the same again...)

I would ignore all this and just use J′, but since you were asking about the terminology specifically I wanted to give you a heads up that others could possibly get confused.

njsmith avatar Aug 17 '18 00:08 njsmith

@njsmith Ok, thanks,

endolith avatar Aug 17 '18 00:08 endolith