Jump to content

  • Log In with Google      Sign In   
  • Create Account


HSL with smoother transitions?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Lode   Members   -  Reputation: 962

Like
0Likes
Like

Posted 12 April 2014 - 04:41 PM

Hello,

 

It's extremely hard to explain with words, so I hope the image says it all:

 

iUtRd8v.png

 

The standard HSL color model looks like the image on the left.

 

Depending on which angle from your screen you look at it (im my case it's always visbile but more when looking from the bottom), you can clearly see that there is a horizontal line in the middle of the image. It's in fact just a difference in how it transitions, but the human eye/brain somehow makes a "line" of it. In addition, there are 3 such vertical lines, between the red and green, between the green and blue, and in the purple zone.

 

The red markings in the centermost image contain where those ugly lines are.

 

And the rightmost image shows a plot of a mathematical function (guess which) made with that very HSL color model. And there it is, the ugly line is visible there as well.

 

I'd like to make better looking plots. It should still be a HSL-like color model: still black at the bottom, white at the top (HSV is not white at the top), and all hues in the center. But smoothed in some way that no such obvious lines are visible.

 

I now use the standard HSL to RGB conversion function I already tried, after HSL to RGB, to set Y to the lightness with RGB->YUV->RGB conversion, but that looks even uglier, yellow becomes olive.

 

Does anyone know:

 

If there's a trick to make HSL color better for such mathematical plotting purpose?

 

What the phenomenon with the "lines" is called?

 

Another more suitable color model?

Thanks!



Sponsor:

#2 Promit   Moderators   -  Reputation: 6091

Like
1Likes
Like

Posted 12 April 2014 - 05:27 PM

I did some research on this a while back. I'm just going to link-dump on you, hopefully you can piece it together.

http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/

http://hclcolor.com/

https://github.com/gka/chroma.js/issues/3

http://hclwizard.org/why-hcl/

Further reading on HCL in particular and perceptually uniform color spaces in general should provide some guidance



#3 Lode   Members   -  Reputation: 962

Like
0Likes
Like

Posted 12 April 2014 - 05:51 PM

Thanks! HCL is not bad at all smile.png

I really like how smooth everything looks. The colors themselves are a bit too pink though, I just have to do some tweaking with mostly choosing the right chroma parameter I guess...

 

WCK9pO0.png

 

Edit: Well, in retrospect, I think HCL makes colors too bland... No real red sad.png I guess I need to find something that remains closer to the original HSL, in that it uses all possible things a computer monitor can do at the cost of accuracy, but at least doesn't have the visible bands that HSL has.


Edited by Lode, 12 April 2014 - 06:32 PM.


#4 Anthony Serrano   Members   -  Reputation: 1099

Like
0Likes
Like

Posted 12 April 2014 - 08:13 PM

Those lines are actually a manifestation of the fact that the RGB color space is a cube - the lines correspond to the edges and vertices of the RGB color cube. The appearance of the lines is further amplified by the device's gamma curve - this is why those lines are much more noticeable along brightness gradients than along hue gradients.

Gamma correction can help, but it really mostly helps brightness gradients, and causes some hue shifting for hues that are not primaries (pure blue, red, and green) or secondaries (pure yellow, cyan, and purple). The lines in hue gradients can be fixed by using a color space with curved boundaries in RGB space (like HCL), but as you've noticed, that comes at the cost of losing highly saturated primaries and secondaries




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS