All I want to do is decrease my video's saturation to 75% and increase its gamma to 150%. I'm terrible with .avs stuff though, here is my naive attempt:
Then I throw this .avs on virtualdub and get this error: "The script's return was not a video clip, (Is the undefined value)."AVISource("castle.avi")
saturation = 0.75
gamma = 1.5
What am I doing wrong?
+ Reply to Thread
Results 1 to 10 of 10
-
-
Code:
Tweak(sat=0.75) ColorYUV(gamma_y=128)
Code:ColorYUV(gamma_y=128, cont_u=-64, cont_v=-64)
Last edited by jagabo; 30th Oct 2017 at 06:59.
-
Levels supports RGB. You can adjust the gamma like this.
Levels(0, 1.5, 255, 0, 255, Coring=false)
RGBAdjust would probably do the equivalent of adjusting the saturation
RGBAdjust(0.75, 0.75, 0.75)
Thinking about it, RGBAdjust should be able to do both. Something like this, I think.
RGBAdjust(R=0.75, G=0.75, B=0.75, RG=1.5, GG=1.5, BG=1.5) -
To decrease saturation you need to convert to YUV (and then back again if you want to stay in RGB)
Code:ConvertToYV24 Levels(0, 1.5, 255, 0, 255, coring=false) Tweak(sat=0.75) ConvertToRGB24
Last edited by raffriff42; 1st Nov 2017 at 16:34.
-
That darkens the picture and is very different from a 0.75 saturation adjustment. Try this script:
Code:function RGBSat(clip c, float val) { RGBAdjust(c, r=val, g=val, b=val) Subtitle("RGBAdjust(rgb="+String(val)+")") } function YUVSat(clip c, float val) { Tweak(c, sat=val) Subtitle("Tweak(sat="+String(val)+")") } src = ColorBars().Crop(0,0,640,80).Trim(0,100).RGBAdjust(r=2.0, g=2.0, b=2.0, rb=-100, gb=-100, bb=-100) rgb = Animate(0,100, "RGBSat", src,1.0, src,0.0) yuv = Animate(0,100, "YUVSat", src.ConvertToYV24(),1.0, src.ConvertToYV24(),0.0).ConvertToRGB() StackVertical(src, rgb, yuv)
At sat=0 your RGBAdjust(rgb=0) will result in black for all source colors. Tweak(sat=0) will result in different greys for different source colors.
RGB gamma is also different from YUV gamma.Last edited by jagabo; 30th Oct 2017 at 10:21.
-
Since nobody has a smaple of that video, everyone's just guessing anyway. How de we know gamma and saturation are the problems?
Note that tweak() and Levels() have coring = true by default. Why use "coring=false" for Levels() and not use it for Tweak()?- My sister Ann's brother -
I've never noticed a problem with Tweak() because I think it just clips the levels on output, but Levels() can result in a visibly different output at times.
http://avisynth.nl/index.php/Levels
output = ( (input - input_low) / (input_high - input_low) )(1 / gamma) * (output_high - output_low) + output_low
When coring=true, input luma is clamped to the range 16-235 and the chroma to 16-240;
This clamped input is scaled from 16-235 to 0-255,
The conversion takes place according to the transfer function above, and then
Output is scaled back to 16-235.
When coring=false, the conversion takes place according to the transfer function, without any scaling.
So if I do this:
Levels(0, 1.0, 255, 16, 235) isn't everything below 16 & above 235 clipped to 16-235, before it's converted to 16-235? It seems a bit odd to me. -
Yes. You can see it here:
On the left is a greyscale ramp from Y=0 to Y=255. In the middle is the result of Levels(0, 1.0, 255, 16, 235) (coring=true is the default). You can see that the values below 16 and above 235 were crushed before the levels change. On the right is the result of Levels(0, 1.0, 255, 16, 235, coring=false). You can see that the crushing did not occur. -
I'm sorry for not replying to this sooner, but I solved my problem with this filter.
I realized changing the saturation isn't really necessary, so I just set the Global gamma to -50 and left the rest as it is.
Similar Threads
-
How to change the gamma of a video with virtualdub?
By synnchan in forum Newbie / General discussionsReplies: 4Last Post: 18th May 2017, 09:24 -
Gamma for Avisynth?
By Aludin in forum Newbie / General discussionsReplies: 1Last Post: 2nd Mar 2017, 19:41 -
how to change gamma in avisynth?
By marcorocchini in forum Newbie / General discussionsReplies: 21Last Post: 7th Oct 2014, 03:16 -
How can i Use VDub Script[.vcf] into Avisynth Script[.avs] ( Megui )
By Maskoff in forum EditingReplies: 1Last Post: 25th Jun 2013, 15:30 -
Avisynth script for this TV captured video
By Anonymous847344 in forum Video ConversionReplies: 10Last Post: 23rd Jun 2013, 14:02