Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th January 2015, 17:34   #1  |  Link
Stormborec
Registered User
 
Join Date: Feb 2013
Posts: 158
Gamma vs. saturation

In Levels "manual" stands:

"When processing data in YUV mode, Levels only gamma-corrects the luma information, not the chroma. Gamma correction is really an RGB concept, and I don't know how to do it properly in YUV ..."

If I understand - the only way to maintain saturation during gamma correction is to do it in RGB, otherwise the midtones - where is the biggest change - looses saturation according the gamma curve - if the value of gamma increases ...
Stormborec is offline   Reply With Quote
Old 28th January 2015, 21:14   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,909
Nobody knows how to do it properly in YUV, so I would not expect too many suggestions, as you say, it is a RGB concept.
If however you just want to mod in YUV then see ColorYUV2: http://forum.doom9.org/showthread.ph...ight=coloryuv2
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 28th January 2015, 22:24   #3  |  Link
Stormborec
Registered User
 
Join Date: Feb 2013
Posts: 158
Can coloryuv2 does something like this? :

Code:
y = converttoy8()
u = utoy8()
v = vtoy8()
y_scaled = y.bilinearresize(width(u), height(u))
u_adjusted = mt_lutxy(u,y_scaled,expr="x 128 - 1.10 * 128 + y 16 - 0.06918 * +")
v_adjusted = mt_lutxy(v,y_scaled,expr="x 128 - 1.30 * 128 + y 16 - 0.02525 * -")

ytouv(u_adjusted,v_adjusted,y)

Last edited by Stormborec; 29th January 2015 at 19:56.
Stormborec is offline   Reply With Quote
Old 29th January 2015, 18:37   #4  |  Link
Stormborec
Registered User
 
Join Date: Feb 2013
Posts: 158
Maybe something like: would do the job concerning gamma without saturation shift


Code:
y = converttoy8()
u = utoy8()
v = vtoy8()

y_adjusted = mt_lut("x 16 - 219 / 1 1.2 / ^ 219 * 16 +", chroma="copy")
y_scaled   = y.bilinearresize(width(u),height(u))
u_adjusted = mt_lutxy(u,y_scaled,"x 128 - y 16 - 219 / 1 1.2 / ^ 219 * 16 + y / * 128 +")
v_adjusted = mt_lutxy(v,y_scaled,"x 128 - y 16 - 219 / 1 1.2 / ^ 219 * 16 + y / * 128 +")

ytouv(u_adjusted,v_adjusted,y_adjusted)

NOW IT WORKS, YES, NOW IT WORKS, perhaps ...

There could be: y_scaled = y_adjusted.bilinearresize(width(u),height(u))
but I don't know, if is it correct to chain the luts ...

Or exactly like this:
u_adjusted = mt_lutxy(u,y_scaled,"x 128 - y 16 - 219 / 1 1.2 / ^ 219 * y 16 - / * 128 +")
v_adjusted = mt_lutxy(v,y_scaled,"x 128 - y 16 - 219 / 1 1.2 / ^ 219 * y 16 - / * 128 +")

(excepting the zero division, when black ... maybe diddle it ... y 15 -

Last edited by Stormborec; 29th January 2015 at 20:45.
Stormborec is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.