POV-Ray : Newsgroups : povray.binaries.images : Gamma issues again Server Time
15 May 2024 08:47:58 EDT (-0400)
  Gamma issues again (Message 11 to 20 of 21)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: Kenneth
Subject: Re: Gamma issues again
Date: 30 Dec 2015 08:40:01
Message: <web.5683ddac61c3ffe833c457550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 28.12.2015 um 04:14 schrieb Kenneth:

>
> Later however, I found the time to revisit the issue, and found that
> good results /can/ be obtained; the key is to split up the colour
> information into brightness (i.e. the weighted sum of the colour
> channels) and chroma (i.e. the relative balance between the colour
> channels), interpolate the brightness non-linearly and the chroma
> linearly, and then re-combine the two properties into the new result colour.
>

It took me awhile to absorb your explanation (which is excellent, as always.)
Although the subject of gamma in POV-Ray isn't new to me, this new (subtle?)
topic of chromaticity/brightness certainly is. I have to admit that I never
noticed any 'flaws' in color/brightness gradations in my scenes (having 'worked
around' any odd-looking surprises, at least to my own satisfaction.) But your
explanation of the underlying problems-- and your new tools to solve them-- are
real 'eye-openers', if you'll pardon the pun.  ;-) I'm happily amazed that you
(and Warp) continued to think about this topic.

Thanks for your hard work!


Post a reply to this message

From: Thomas de Groot
Subject: Re: Gamma issues again
Date: 31 Dec 2015 02:48:53
Message: <5684dde5$1@news.povray.org>
Of course! I should have known; I put them at the end of the block which 
makes no sense. Thanks!

-- 
Thomas


Post a reply to this message

From: scott
Subject: Re: Gamma issues again
Date: 4 Jan 2016 05:06:57
Message: <568a4441$1@news.povray.org>
> Later however, I found the time to revisit the issue, and found that
> good results /can/ be obtained; the key is to split up the colour
> information into brightness (i.e. the weighted sum of the colour
> channels) and chroma (i.e. the relative balance between the colour
> channels), interpolate the brightness non-linearly and the chroma
> linearly, and then re-combine the two properties into the new result colour.

Never realised that this had been implemented - great work!

What chroma values are you using?

Have you heard of MacAdam ellipses?

https://en.wikipedia.org/wiki/MacAdam_ellipse

My idea is that if you convert your chroma values to a colour space with 
almost equal-sized MacAdam's ellipses, you can then just do a linear 
interpolation in that colour space, and you should get "perfect" hue 
blends for any colours.


Post a reply to this message

From: clipka
Subject: Re: Gamma issues again
Date: 4 Jan 2016 07:35:00
Message: <web.568a650b61c3ffe8ad6fa18f0@news.povray.org>
scott <sco### [at] scottcom> wrote:
> > Later however, I found the time to revisit the issue, and found that
> > good results /can/ be obtained; the key is to split up the colour
> > information into brightness (i.e. the weighted sum of the colour
> > channels) and chroma (i.e. the relative balance between the colour
> > channels), interpolate the brightness non-linearly and the chroma
> > linearly, and then re-combine the two properties into the new result colour.
>
> Never realised that this had been implemented - great work!
>
> What chroma values are you using?

Actually I'm just using the RGB values, normalized to identical brightness, so
it's a particular slice of RGB space if you will. Not sure what official chroma
format that corresponds to.

While this means that I'm doing the interpolation on three values instead of two
(which might seem like doing extra work), on the other hand it avoids the
computations required to convert from RGB to chroma and back, so I guess it
might even be faster this way -- and I think it's more straightforward and
easier to understand, at least for people who don't wrap their head around
colour spaces on a daily basis.

It also has the benefit of being easily adaptable to a spectral colour model,
which I tend to keep in the back of my head when working on POV-Ray's internal
colour maths.


> Have you heard of MacAdam ellipses?
>
> https://en.wikipedia.org/wiki/MacAdam_ellipse
>
> My idea is that if you convert your chroma values to a colour space with
> almost equal-sized MacAdam's ellipses, you can then just do a linear
> interpolation in that colour space, and you should get "perfect" hue
> blends for any colours.

That might be a neat addition, but at present I don't think it's really
necessary. There's plenty of stuff ranking higher on the agenda right now.

Feel free to do some research on this topic though -- while I don't have much
time to invest into this matter, I'm still interested in it.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Gamma issues again
Date: 4 Jan 2016 11:05:30
Message: <web.568a970f61c3ffe8566b73360@news.povray.org>
scott <sco### [at] scottcom> wrote:
> Have you heard of MacAdam ellipses?
>
> https://en.wikipedia.org/wiki/MacAdam_ellipse
>
> My idea is that if you convert your chroma values to a colour space with
> almost equal-sized MacAdam's ellipses, you can then just do a linear
> interpolation in that colour space, and you should get "perfect" hue
> blends for any colours.

Sounds very interesting.  I've been wondering about a perceptually linear color
space, though none that I have seen looks linear to my own eyes--not Munsell,
not CIELAB.  (I am hearing of CIELUV for the first time, though.)

However, it strikes me as overkill for a ray tracer, so I agree with Clipka that
it should be low priority.


Post a reply to this message

From: clipka
Subject: Re: Gamma issues again
Date: 4 Jan 2016 11:30:39
Message: <web.568a9d6d61c3ffe8ad6fa18f0@news.povray.org>
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> scott <sco### [at] scottcom> wrote:
> > Have you heard of MacAdam ellipses?
> >
> > https://en.wikipedia.org/wiki/MacAdam_ellipse
> >
> > My idea is that if you convert your chroma values to a colour space with
> > almost equal-sized MacAdam's ellipses, you can then just do a linear
> > interpolation in that colour space, and you should get "perfect" hue
> > blends for any colours.
>
> Sounds very interesting.  I've been wondering about a perceptually linear color
> space, though none that I have seen looks linear to my own eyes--not Munsell,
> not CIELAB.  (I am hearing of CIELUV for the first time, though.)

There is no such thing as a perceptually linear color space. None that can be
represented in cartesian space at any rate.


Post a reply to this message

From: scott
Subject: Re: Gamma issues again
Date: 4 Jan 2016 11:30:55
Message: <568a9e3f$1@news.povray.org>
>> My idea is that if you convert your chroma values to a colour space with
>> almost equal-sized MacAdam's ellipses, you can then just do a linear
>> interpolation in that colour space, and you should get "perfect" hue
>> blends for any colours.
>
> Sounds very interesting.  I've been wondering about a perceptually linear color
> space, though none that I have seen looks linear to my own eyes--not Munsell,
> not CIELAB.  (I am hearing of CIELUV for the first time, though.)

There is Yu'v' or Yu*v* which is an improved (more perceptually linear) 
version of Yuv. FWIW that colour space is commonly used in the 
specification of colour coordinates of LCDs. For those it is important 

applied to red, green, blue or white.

> However, it strikes me as overkill for a ray tracer, so I agree with Clipka that
> it should be low priority.

Indeed, especially as you often just manually add in some additional 
control points to get the effect you want. Adding full GPU support is 
far more pressing :-)


Post a reply to this message

From: Mike Horvath
Subject: Re: Gamma issues again
Date: 5 Jan 2016 23:39:39
Message: <568c9a8b$1@news.povray.org>
On 1/4/2016 11:27 AM, clipka wrote:
> There is no such thing as a perceptually linear color space. None that can be
> represented in cartesian space at any rate.
>
>

I've never really understood the big deal about perceptually uniform 
color spaces. Compare to sound compression. There it makes sense. You 
save disk space. But the color spaces try to muck things up. Whereas in 
music a F remains an F and a C remains a C.


Mike


Post a reply to this message

From: scott
Subject: Re: Gamma issues again
Date: 6 Jan 2016 04:49:49
Message: <568ce33d$1@news.povray.org>
>> There is no such thing as a perceptually linear color space. None that
>> can be
>> represented in cartesian space at any rate.
>
> I've never really understood the big deal about perceptually uniform
> color spaces. Compare to sound compression. There it makes sense. You
> save disk space. But the color spaces try to muck things up. Whereas in
> music a F remains an F and a C remains a C.

It doesn't have anything to do with compression to save disk space. And 
when converting between colour spaces the colour remains physically the 
same, just like 1 inch is the same as 25.4 mm, two different ways to 
conceptually describe the same physical thing.

The idea of using a perceptually linear colour space is that then the 
"distance" between two colours looks the same "difference" to a human no 
matter what colours are used. This is not the case with sRGB, for 
example the difference between (0,0,0) and (0,128,0) looks much "bigger" 
than between (0,128,0) and (0,128,128), even though the distance is 128 
in both cases. So using a distance in sRGB space would be quite useless.

In fact, there's a metric called "delta-E" which is used extensively in 
many indsutries where colour is important (clothing, painting, make-up, 
plastics, food, printing etc) that is exactly the "distance" between two 
colours. However it is calculated in a (near) perceptually linear colour 
space, and scaled so that a delta-E of 1.0 is "just visible" by most 
humans. It is then a very useful number indeed.


Post a reply to this message

From: clipka
Subject: Re: Gamma issues again
Date: 6 Jan 2016 06:18:29
Message: <568cf805$1@news.povray.org>
Am 06.01.2016 um 10:49 schrieb scott:

> In fact, there's a metric called "delta-E" which is used extensively in
> many indsutries where colour is important (clothing, painting, make-up,
> plastics, food, printing etc) that is exactly the "distance" between two
> colours. However it is calculated in a (near) perceptually linear colour
> space, and scaled so that a delta-E of 1.0 is "just visible" by most
> humans. It is then a very useful number indeed.

Actually that colour space is nowhere near perceptually linear --
perceptually equidistant might be a more fitting description.

If you take two arbitrary colours in that colour space, and try to
interpolate them, you'll usually get a nasty surprise.

It's a bit akin to map projections, where a projection that lets you
easily judge areas will be useless to find the shortest route between
two points, let alone identify the point smack halfway between them.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.