Create Journals
Update Journals

Journals
Find Users
Random

Read
Search
Create New

Communities
Latest News
How to Use

Support
Privacy
T.O.S.

Legal
Username:
Password:

ClaudiusMaximus (claudiusmaximus) wrote,
@ 2008-01-30 13:39:00
Previous Entry  Add to memories!  Add to Topic Directory  Tell a Friend!  Next Entry

    An obscure colour space for friendly saturation adjustment

    I stumbled across Susan Roberta Curtis' 1982 MSc thesis: Saturation and Luminance Control in Color Image Processing. This defines an LC1C2 colour space with some interesting properties that make it more useful than either RGB or YUV.

    RGB is a pain at the best of times, but YUV isn't much better. The problem with YUV is that the "constant saturation curve" is not a circle, but a skew ellipse, which makes setting absolute saturation very tricky. This is generally shown best on a vector scope:

    Vectorscope

    The constant saturation curves in the LC1C2 colour space seems to be more circular than in YUV, I haven't measured it yet but the results are pleasing. Here's a fragment of GLSL code that sets the saturation of an RGB colour:

       // inputs
       vec3 in;
       float saturation;
       // outputs
       vec3 out;
       // conversion matrices
       mat3 rgb2lcc = mat3(
          0.299,  0.621,  0.080,
          0.498, -0.442, -0.056,
         -0.162, -0.336,  0.498
       );
      mat3 lcc2rgb = mat3(
          1.0,  1.407,  0.0,
          1.0, -0.677, -0.236,
          1.0,  0.0,    1.848
       );
       // saturation bashing
       vec3 lcc1 = in * rgb2lcc;
       float l  = lcc1.x;
       float c1 = lcc1.y;
       float c2 = lcc1.z;
       float sat = saturation/sqrt(c1*c1+c2*c2);
       vec3 lcc2 = vec3(l, sat*c1, sat*c2);
       vec3 out = lcc2 * lcc2rgb;

    Next step is to investigate LC1C2 more scientifically.



(Read comments)

Post a comment in response:

From:
 
Username:  Password: 
Subject:
No HTML allowed in subject
 Don't auto-format:
Message:
Enter the security code below.


Notice! This user has turned on the option that logs your IP address when posting.

Allowed HTML: <a> <abbr> <acronym> <address> <area> <b> <bdo> <big> <blockquote> <br> <caption> <center> <cite> <code> <col> <colgroup> <dd> <dd> <del> <dfn> <div> <dl> <dt> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <ins> <kbd> <li> <li> <map> <marquee> <ol> <p> <pre> <q> <s> <samp> <small> <span> <strike> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <tt> <u> <ul> <var> <xmp>
© 2002-2008. Blurty Journal. All rights reserved.