Color Saturation

Discussion about displays and related hardware including MiSTer filters and video settings.
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Color Saturation

Unread post by SuperBabyHix »

This may be a dumb question, but would it be possible to say, modify some of the gamma filters to be able to adjust saturation?
FoxbatStargazer
Top Contributor
Posts: 994
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Color Saturation

Unread post by FoxbatStargazer »

I thought that's what they already did kind of? Higher gamma curve increases the apparent saturation of colors without risking clipping (although you have to worry about losing shadow/dark detail.)

I'm more wondering why there aren't any lower gamma options, in case you wanted to brighten up a dark VGA monitor for instance...
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

I should have been more clear, I'm looking to de-saturate colors.
FoxbatStargazer
Top Contributor
Posts: 994
Joined: Thu Dec 10, 2020 5:44 pm
Has thanked: 309 times
Been thanked: 228 times

Re: Color Saturation

Unread post by FoxbatStargazer »

SuperBabyHix wrote: Thu Jul 15, 2021 12:03 pm I should have been more clear, I'm looking to de-saturate colors.
We just need some options to decrease gamma then, which really ought to be there anyway!
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

Ok, that makes sense, thanks. I found a utility that lets you make a gamma curve and it spits out a LUT that looks similar to the ones in the Mister repo. (https://www.rumblehouse.com/products/ga ... generator/). When I get some time I'll mess with it and see what I can come up with. I'll post if I get any positive results.

EDIT: This tool looks much easier: https://victornpb.github.io/gamma-table-generator/
MiSTer_Kirk
Posts: 210
Joined: Thu Feb 04, 2021 11:42 pm
Has thanked: 18 times
Been thanked: 46 times

Re: Color Saturation

Unread post by MiSTer_Kirk »

Don't you have saturation adjustment on your display ?
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

MiSTer_Kirk wrote: Thu Jul 15, 2021 6:24 pm Don't you have saturation adjustment on your display ?
Yes, but its implementation is not terribly user friendly. It is not 1, not even 3, but 6 adjustment bars (RGB and CYM). It also doesn't save it per input or color settings profile. For whatever reason it is set for all inputs and profiles.
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

So I had a chance to play with this and it more or less does what I want. I'm trying to achieve the look of the TV I grew up with that had bad, washed out colors. Just for fun really. This sort of gets it, though not entirely as pure red, green, and blue are still quite vivid.

Anyway, I'm attaching what I have done and if anyone has any pointers or questions about what I did please feel free.
Attachments
75.zip
(434 Bytes) Downloaded 109 times
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

I want to preface this by saying I don't profess to understanding anything about this, so please, if I am incorrect in any way please correct me.

That being said, using this site (https://victornpb.github.io/gamma-table-generator/) I compared the results of Gamma 1.1 to the PureGamma 110 that is in the repo and they were exactly the same numerically.

This leads me to believe that this gamma generator is giving pure gamma tables. Therefore I generated .50 to .95 in .5 increments and am attaching it to this post. Any input is fully appreciated.
Attachments
Pure_Gamma 50-95.zip
(4.58 KiB) Downloaded 122 times
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

Well, I said this does more or less what I want, but upon further review it does not. Certainly lower gamma values do seem to wash out the midtones, but I think what I am looking for is a bit different. Like I said, I do not fully understand the math, but it looks like saturation is a function of color and luminosity, so you should be able to reduce the color intensity without raising or lowering the overall brightness. I might be misunderstanding that completely.

That being said, I am not sure if this is actually something that can be adjusted via the gamma curve function.

I am probably way off in my understanding of all of this and I apologize to those that know better.

EDIT: I should also say, I experimented with limiting the max value to something lower than 255. That just seemed to make everything dimmer, which makes sense, but is not what I am trying to do.
robinsonb5
Posts: 129
Joined: Fri Jun 19, 2020 8:54 pm
Has thanked: 13 times
Been thanked: 57 times

Re: Color Saturation

Unread post by robinsonb5 »

SuperBabyHix wrote: Fri Jul 16, 2021 4:29 am Well, I said this does more or less what I want, but upon further review it does not. Certainly lower gamma values do seem to wash out the midtones, but I think what I am looking for is a bit different. Like I said, I do not fully understand the math, but it looks like saturation is a function of color and luminosity, so you should be able to reduce the color intensity without raising or lowering the overall brightness. I might be misunderstanding that completely.
In terms of RGB, saturation can be thought of very broadly as the difference between the highest RGB value and the lowest - so RGB 255,0,0 is very saturated, 192,128,128 is much less saturated and 128,128,128 isn't saturated at all.
A gamma adjustment can reduce the saturation of the second of those three examples, by moving the values closer together, but won't do anything for the first one, since all three RGB values are already at their extremities.

To reduce saturation you'd want to calculate a grey equivalent of the colour under consideration - either a simple average, (R+G+B)/3 or something more complex that gives green more weight - and then interpolate each RGB value between this and their original values. (Technically you should remove any existing gamma encoding first, do the calcs in linear space, then re-apply gamma afterwards, but it would be good enough without going to those lengths.)

The bad news is you can't do that with simple 1-dimensional look-up tables - because each of the RGB values will depend upon all three inputs, not just its own value.
EDIT: I should also say, I experimented with limiting the max value to something lower than 255. That just seemed to make everything dimmer, which makes sense, but is not what I am trying to do.
Yes, that will make it dimmer, and conversely increasing the minimum value will might it brighter - and that's probably going to give you better results. (Old TV sets with a game console hooked up over composite wouldn't have blacks anywhere near as deep as a modern LCD monitor can manage) - try with a minimum value of 20 or 30 - or maybe try reducing the maximum a little at the same time.
User avatar
SuperBabyHix
Posts: 152
Joined: Sun May 24, 2020 8:26 pm
Has thanked: 43 times
Been thanked: 34 times

Re: Color Saturation

Unread post by SuperBabyHix »

robinsonb5 wrote: Fri Jul 16, 2021 7:45 am try with a minimum value of 20 or 30 - or maybe try reducing the maximum a little at the same time.
Thanks so much for all the info. I find this all very fascinating. Are there any good books or websites you suggest one to read if they wanted to learn more?

I tried limiting the range from about 19-248 and yep, that is definitely closer to the look I am going for. Combined with the comopsite blend filter it's really starting to look like a crappy old tv.
robinsonb5
Posts: 129
Joined: Fri Jun 19, 2020 8:54 pm
Has thanked: 13 times
Been thanked: 57 times

Re: Color Saturation

Unread post by robinsonb5 »

SuperBabyHix wrote: Fri Jul 16, 2021 6:29 pm Thanks so much for all the info. I find this all very fascinating. Are there any good books or websites you suggest one to read if they wanted to learn more?
There's a lot of good information - albeit quite dense - here: https://poynton.ca/ColorFAQ.html
I'd probably start with the supplementary document about colour space conversions and go from there. As with so many subjects, it's not deep magic but there's jargon and technical terms which are confusing to start with.
Post Reply