JuliaAttic / Color.jl

Basic color manipulation utilities.
Other
47 stars 21 forks source link

Use correct vector space definitions #64

Closed jiahao closed 9 years ago

jiahao commented 9 years ago

cc @rennis250 @timholy

timholy commented 9 years ago

Images defines arithmetic on all AbstractRGBs, and I'm pretty sure it's going to stay that way. But for this package, this might indeed be the best thing to do. CC also @dcjones.

We also need to put some effort into increasing the efficiency of conversions. See discussion (not implementation) in #48.

rennis250 commented 9 years ago

Cool! LMS is also a linear vector space, so it is safe to define these operations for it, too, unless we want to keep XYZ as a common intermediary for these sorts of operations.

rennis250 commented 9 years ago

EDIT: Ignore what was in this box here. I need sleep. Will hopefully have clearer thoughts after that...

m-lohmann commented 9 years ago

CIECAM02 is not an “LMS system”, but a color appearance space, as you already mentioned in your post. The LMS space can be linearly transformed to XYZ and vice versa, there are no nonlinearities involved.

CIECAM02 uses the linear CMCCAT2000 transform, but then several nonlinear factors, like the involvement of viewing conditions, adaptation and a nonlinear post-adaptation response compression are involved, too.

On 29.09.2014 21:37, Robert J. Ennis wrote:

Oh wait, ignore that. I see that the intention is to implement the CIECAM02 colour appearance model as the LMS system. As far as I can tell, it is only partially implemented? If that is the case, then, once fully implemented, that LMS model is not linear.

— Reply to this email directly or view it on GitHub https://github.com/JuliaLang/Color.jl/pull/64#issuecomment-57216174.

rennis250 commented 9 years ago

Ah, okay, I didn't know the name of the sole transform, only the full model. Thanks for the info!

I suppose this can be merged now?

jiahao commented 9 years ago

I've added some tests. It looks like the Lab and LMS ColorValues behave like a linear vector space too (up to floating-point roundoff); does that look right?

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.18%) when pulling ed449b44f32df1da4e36c94c3a1948aef5d8dfda on cjh/vectorspace into dcfc38f5bf4de8d81f7b02f72aab2364d5fa61dd on master.

rennis250 commented 9 years ago

Lab is also non-linear. It basically applies a cube root transform to each of the X, Y, and Z values. But, yes, LMS is a linear vector space.