Search code examples
mathcolorscolor-spacecielablab-color-space

How to reduce chroma of CIELAB color?


Given a CIELAB color (L* A* B* values), how can the chroma (saturation) be reduced?

Chroma can be calculated as follows:

Cab= sqrt(a²+b*²)

Let's say the output is 72. How do I transform variables a and b to force chroma to be eg. 43?


Solution

  • Short answer: to reverse polar coordinates back to cartesian space, you need to use the HUE correlate as well. Otherwise you won't know the direction the vector is in.

    More Complete Answer:

    To convert ab to hue:

        hueab = 180 * atan2( a , b ) / pi();
    

    Then to convert hue and chroma back to L*a*b*, then:

        a = Cab * cos((hueab * PI()) / 180);
        b = Cab * sin((hueab * PI()) / 180);
    

    Saturation

    You mention saturation. Chroma is not saturation.

    • Saturation is the colorfulness relative to that color's own lightness.
    • Chroma is the colorfulness relative to a separate reference white.

    CIELAB does not do saturation, though other color models like CIELUV and CIECAM02 do.

    CIELUV has the same L* as LAB. But LUV is based on the 1976 UCS chromaticity diagram which uses uʹvʹ coordinates, and which is a simple projection of the 1931 chromaticity diagram. LUV multiples the uʹvʹ each by 13L*, to make them u*v*.

    You create hue and chroma the same way as LAB, but with LUV you can create a useful saturation correlate, which is not really possible in LAB.

    To create saturation from chromau*v*:

        Suv = Cuv / Lstar;
    

    Trivial, and to get saturation back to chroma, obviously:

        Cuv = Suv * Lstar;
    

    Other Models

    CIELAB and CIELUV both came out in 1976 (about the same time as the first Star Wars). Today we have much more accurate models like CIECAM02, CAM16, Jzazbz, ZCAM, etc. I encourage your to take a look at some of them.

    Also, you might be interested in this CIELUV implementation, HSLUV which has some benefits including indication of the gamut limits while choosing colors.

    https://www.hsluv.org