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 30th August 2014, 13:06   #1  |  Link
killerteengohan
Registered User
 
Join Date: Feb 2013
Posts: 68
Raising saturation without the colors messing up?

I have a source that the colors look very dull or washed out. I was going to increase it slightly by using Tweak(sat=1.05)

I noticed when using this though that on all the blacks or dark colors you can see green spots and or rainbow like colors showing up and moving around on the source. It seems to add a green tint to blacks. When I turn the tweak back off, the colors go back to normal.

This does this even if I raise the saturation even the smallest bit like tweak(sat=1.01) and its very visible and annoying.

Using a derainbow filter doesn't help at all. Is there an alternative method for increasing saturation using avisynth?



Heres screenshots of the issue I'm talking about. This scene isnt as washed out or dull as the other scenes I want to use tweak for but it shows what I'm talking about if you look at the black or darker colors like their shirt.


NO SATURATION INCREASE




WITH TWEAK SAT=1.04




NO SATURATION INCREASE




WITH TWEAK SAT=1.04


Last edited by killerteengohan; 30th August 2014 at 13:17.
killerteengohan is offline   Reply With Quote
Old 30th August 2014, 16:06   #2  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
I have a script that allows you to Tweak (or anything else) the midrange tones only, leaving highlights and lowlights alone:
Code:
## Last = YUV

## DEMO - FRAME STEP ONLY
return Interleave(
\   Subtitle("org"),
\   Tweak(sat=1.5) /* exaggerated for testing */
\     .Subtitle("Tweak"),
\   MergeLMH(C_mid=Tweak(sat=1.7)) /* same apparent sat (+/-) */
\     .Subtitle("MergeLMH"),
\   Subtitle("org")
\ ).Loop(3).Histogram("color2")

#######################################
### merge Lo, Mid, Hi clips based on clip "C" luma
### requires MaskTools v2
##
## @ xover_x   - aproximate 50% luma blend between ranges 
##                  default 102 (40%), 191 (75%)
## @ showmasks - if true, show original + 3 masks in quad split
##
function MergeLMH(clip C, clip "C_lo", clip "C_mid", clip "C_hi",
\           float "xover_lomid", float "xover_midhi",
\           bool "showmasks")
{
    xlo   = Min(Max(  0, Default(xover_lomid, 102)), 127) * 3.0 / 256
    xhi   = Min(Max(128, Default(xover_midhi, 191)), 255) * 3.0 / 256
    showmasks = Default(showmasks, false)

    ## (mt_lutxyz too slow; use mt_lut x3)

    mask_lo  = C.mt_lut(
    \   yexpr="x -0.01 * "+String(xlo)+" + 256 * ",
    \   u=-128, v=-128)
    
    mask_hi  = C.mt_lut(
    \   yexpr="1 x -0.01 * "+String(xhi)+" + - 256 * ",
    \   u=-128, v=-128)
    
    mask_mid = mt_lutxy(mask_lo, mask_hi, 
    \   "x  y + -1 * 256 + ", 
    \   u=-128, v=-128)

    R = C
    R = (!IsClip(C_lo))  ? R : R.Overlay(C_lo,  mask=mask_lo)
    R = (!IsClip(C_mid)) ? R : R.Overlay(C_mid, mask=mask_mid)
    R = (!IsClip(C_hi))  ? R : R.Overlay(C_hi,  mask=mask_hi)
    
    return (showmasks==false) ? R
    \  : StackVertical(
    \       StackHorizontal(C, mask_lo),
    \       StackHorizontal(mask_mid, mask_hi)
    \    ).BilinearResize(C.Width, C.height)
    \     .Subtitle("Low",    align=9)
    \     .Subtitle("\nMid",  align=4, lsp=0)
    \     .Subtitle("\nHigh", align=6, lsp=0)
}
raffriff42 is offline   Reply With Quote
Old 31st August 2014, 04:14   #3  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
If you look carefully - you'll see that color issue is present in the source. You just amplify it by rising saturation. Don't know how to fight it, but I would try tempo-spatial denoising (3D DFTTest with motion compensation) and then ordered dithering before applying saturation tweak.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 31st August 2014, 08:43   #4  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Using Tweak(param…, dither=true) may help to fix this kind of artefact.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 31st August 2014, 15:44   #5  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 354
If neuron2 was here, he would've ask about how did you obtain your source.
bxyhxyh is offline   Reply With Quote
Old 31st August 2014, 16:07   #6  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by bxyhxyh View Post
If neuron2 was here, he would've ask about how did you obtain your source.
he's gone, you don't gotta be mean
feisty2 is offline   Reply With Quote
Old 31st August 2014, 18:28   #7  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by feisty2 View Post
he's gone, you don't gotta be mean
LOL. Neuron2 is gone?! My, I really *have* been off this world for a spell!
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 31st August 2014, 18:31   #8  |  Link
asarian
Registered User
 
Join Date: May 2005
Posts: 1,462
Quote:
Originally Posted by Mystery Keeper View Post
If you look carefully - you'll see that color issue is present in the source. You just amplify it by rising saturation. Don't know how to fight it, but I would try tempo-spatial denoising (3D DFTTest with motion compensation) and then ordered dithering before applying saturation tweak.
Agree with this, actually. You can clearly see it's already present in the source. I dunno, maybe a wee hue-shift on the blacks would work?
__________________
Gorgeous, delicious, deculture!
asarian is offline   Reply With Quote
Old 1st September 2014, 01:59   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by asarian View Post
LOL. Neuron2 is gone?! My, I really *have* been off this world for a spell!
neuron2 just left the forum lately all the sudden, nobody knows why he left, the Guest user used to be neuron2
feisty2 is offline   Reply With Quote
Old 1st September 2014, 12:41   #10  |  Link
killerteengohan
Registered User
 
Join Date: Feb 2013
Posts: 68
I havent seen neuron2 in a while
killerteengohan is offline   Reply With Quote
Old 2nd September 2014, 04:50   #11  |  Link
killerteengohan
Registered User
 
Join Date: Feb 2013
Posts: 68
okay well the solution to my problem was use a filter called smoothtweak(saturation=1.04) or to use ColorYUV(cont_u=10, cont_v=10)

it did exactly what I wanted and the greens I was seeing didn't change or become more visible. I went with the smoothtweak.
killerteengohan is offline   Reply With Quote
Reply

Tags
color, rainbow, saturation, tweak

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 11:07.


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