View Full Version : Improving "Washed-out" B&W Video
Danette
30th January 2019, 03:30
I'm looking for filters that will help bring out the blacks and the whites in a B&W video better, much in the way that white balance filters can improve colors. For example; when I look at the current video, the RGB readings for the whites are in the 220 area and the blacks are in the 15 area. If I were to be able to get the whites into the 240 area and the blacks near zero, it would be a dramatic improvement. Adjusting contrast and/or brightness is not the answer. Any suggestions?
StainlessS
30th January 2019, 04:16
Plenty to choose from here, maybe start with the first one on the list, AutoAdjust.
http://avisynth.nl/index.php/External_filters#Levels_and_Chroma
EDIT: Also, the 2nd one on the list might work ok(maybe with defaults):- https://forum.doom9.org/showthread.php?p=1757661#post1757661
Follow it with GreyScale().
AviSource("D:\g.avi") # some video clip
GreyScale()
ORG=Last
AutoAdjust() # with whatever args
GreyScale()
return StackVertical(ORG,Last)
#Import("AutoContrast.avsi")
AviSource("D:\g.avi") # some video clip
GreyScale()
ORG=Last
##########
SAMPLES = 256 # Default 40. Might wanna try higher sample count (say 256), still only take a few seconds for clip scan.
STRENGTH = 1.0 # Default 0.75. ~ 0.75 -> 1.0 : try 1.0
IGNORE = 0.05 # Default 0.0. Maybe 0.0 -> 0.4
GAMMA = 1.0 # Default 1.0
SHOW = True
##########
AutoContrast(Strength=STRENGTH,Ignore=IGNORE,Gamma=GAMMA,Show=SHOW)
GreyScale()
Return StackVertical(ORG,Last)
AutoAdjust, adjusts levels after testing at every frame, AutoContrast, scans SAMPLES frames from clip (spread across complete clip) and then make single Levels ajustment for entire clip.
Still plenty more plugs to try in the list.
Danette
30th January 2019, 16:43
Plenty to choose from here, maybe start with the first one on the list, AutoAdjust.
http://avisynth.nl/index.php/External_filters#Levels_and_Chroma
EDIT: Also, the 2nd one on the list might work ok(maybe with defaults):- https://forum.doom9.org/showthread.php?p=1757661#post1757661
Follow it with GreyScale().
AviSource("D:\g.avi") # some video clip
GreyScale()
ORG=Last
AutoAdjust() # with whatever args
GreyScale()
return StackVertical(ORG,Last)
#Import("AutoContrast.avsi")
AviSource("D:\g.avi") # some video clip
GreyScale()
ORG=Last
##########
SAMPLES = 256 # Default 40. Might wanna try higher sample count (say 256), still only take a few seconds for clip scan.
STRENGTH = 1.0 # Default 0.75. ~ 0.75 -> 1.0 : try 1.0
IGNORE = 0.05 # Default 0.0. Maybe 0.0 -> 0.4
GAMMA = 1.0 # Default 1.0
SHOW = True
##########
AutoContrast(Strength=STRENGTH,Ignore=IGNORE,Gamma=GAMMA,Show=SHOW)
GreyScale()
Return StackVertical(ORG,Last)
AutoAdjust, adjusts levels after testing at every frame, AutoContrast, scans SAMPLES frames from clip (spread across complete clip) and then make single Levels ajustment for entire clip.
Still plenty more plugs to try in the list.
Thanks for the in-depth reply! I tried them all (had tried Greyscale initially), but they haven't moved the dial on the blacks and whites. There is already good balance in contrast in the video, e.g.; Levels and Tweak did not offer improvement.
StainlessS
30th January 2019, 17:10
Greyscale only makes sure that there is no color in your B/W clip, it does nothing else.
RGB readings for the whites are in the 220 area and the blacks are in the 15 area
There is already good balance in contrast in the video
A little contradictory. [above implies RGB, so should be ~ 0 -> 255]
they haven't moved the dial on the blacks and whites
hard to believe.
Post you script for AutoLevels, and also for AutoContrast.
What colorspace is it ?
What are you measuring levels with ?
Post a 20 second clip with movement (un-encoded source). [suggest mediafire file host].
Danette
31st January 2019, 02:28
Greyscale only makes sure that there is no color in your B/W clip, it does nothing else.
OK, that explains its’ having no effect. Then there is no point in using Greyscale as the source is definitely pure B&W.
A little contradictory. [above implies RGB, so should be ~ 0 -> 255]
This pertains to my comment: “There is already good balance in contrast in the video.” However, from my viewpoint, it isn’t a contrast/brightness issue. As you will see in the attached two files, the “Good” file has blacks and whites that really ‘pop’ without any change (to my eye) in contrast or brightness vs. the “Bad” video.
hard to believe. Post you script for AutoLevels, and also for AutoContrast.
Script is below. Played with all the different variables, but saw no changes.
Code:Import("C:\Program Files (x86)\AviSynth+\plugins\AutoContrast.avsi")
BAD_CONT = -100 # To make bad contrast clip.
BADCHROMA = True # Make BAD chroma
TEST_RGB = False # Conv clips to RGB32
STRENGTH=1.0
IGNORE=0.0
SPLITSCREEN=True
Show=True
ORG = DirectShowSource("C:\Users\Main\Desktop\Videos\Bad.mkv")
# Good contrast clip.
BAD = ORG.ColorYUV(cont_y=BAD_CONT,cont_u=(BADCHROMA||TEST_RGB)?BAD_CONT:0,cont_v=(BADCHROMA||TEST_RGB)?BAD_CONT:0) # Make Bad
ORG=(TEST_RGB) ? ORG.ConvertToRGB32 : ORG
BAD=(TEST_RGB) ? BAD.ConvertToRGB32 : BAD
FIX = BAD.AutoContrast(Chroma=BADCHROMA,Strength=STRENGTH,Ignore=IGNORE,debug=True,SplitScreen=SPLITSCREEN,Show=SHOW) # fix it
BLK = ORG.BlankClip
#Stackvertical(StackHorizontal(ORG.Subtitle("ORG"),BAD.Subtitle("BAD")),StackHorizontal(FIX.Subtitle(SPLITSCREEN?"HALFFIX":"FIX"),BLK.Subtitle("DUMMY")))
#ORG
Clip1=DirectShowSource("C:\Users\Main\Desktop\Videos\Bad.mkv")
StackHorizontal(ORG,Clip1)
Code:DirectShowSource("C:\Users\Main\Desktop\Videos\Bad.mkv")
ORG=Last
#AutoAdjust() # with whatever args
AutoAdjust(auto_gain=false, dark_limit=1.50, bright_limit=1.50, gamma_limit=1.25, gain_mode=0, chroma_process=100, auto_balance=false, chroma_limit=1.00, balance_str=0.75, change_status="", high_quality=true, high_bitdepth=false, input_tv=true, output_tv=true, debug_view=false)
#return StackHorizontal(ORG,Last)
Clip1=DirectShowSource("C:\Users\Main\Desktop\Videos\Bad.mkv")
StackHorizontal(ORG,Clip1)
What colorspace is it ?
Source is YUV, as you will see in the files.
What are you measuring levels with ?
I have a photo editor (PhotoImpact). Moving the cursor where desired reveals the RGB values.
Post a 20 second clip with movement (un-encoded source). [suggest mediafire file host].
Posted. https://www.mediafire.com/folder/899xv9qdkv3di/
NOTE: two files, one named “Bad”, the other named “Good.” The “Bad” file is the one to be improved. The “Good” file shows what the ideal is. You will see the stark difference in blacks and whites.
manono
31st January 2019, 04:17
Then there is no point in using Greyscale as the source is definitely pure B&W.
Except it's not and it should be greyscaled although I do that in Tweak.
However, from my viewpoint, it isn’t a contrast/brightness issue. As you will see in the attached two files, the “Good” file has blacks and whites that really ‘pop’ without any change (to my eye) in contrast or brightness vs. the “Bad” video.
There's absolutely nothing wrong with the 'bad' one, except for the contrast needing lowering a bit.
In the 'good' one you managed to crush the blacks a bit and make the whites worse . The 'good' one wasn't IVTC'd as it should have been and whatever possessed you to convert it to 16:9 with black pillar bars? In doing so you lose resolution and the only conceivable reason for doing that is if it's to be joined with some real 16:9 content.
You shouldn't be just eyeballing these things. I don't know how or why you converted it to RGB just for having a look, but it wasn't necessary. AviSynth has the tools to examine it while in its original YV12.
Danette
31st January 2019, 05:59
Except it's not and it should be greyscaled although I do that in Tweak.
If it's not B&W and it's not color, what is it? What does the greyscale do for B&W?
There's absolutely nothing wrong with the 'bad' one, except for the contrast needing lowering a bit.
In the 'good' one you managed to crush the blacks a bit and make the whites worse . The 'good' one wasn't IVTC'd as it should have been and whatever possessed you to convert it to 16:9 with black pillar bars? In doing so you lose resolution and the only conceivable reason for doing that is if it's to be joined with some real 16:9 content.
You shouldn't be just eyeballing these things. I don't know how or why you converted it to RGB just for having a look, but it wasn't necessary. AviSynth has the tools to examine it while in its original YV12.
I disagree: lowering contrast also dims the entire image. This was not done in the "Good" video. Incidentally, I didn't do anything to either file. These are files from two different studios, which is why they are different aspect ratios, have pillar bars, are IVTC'd and have different appearance. To my eye, the "Good" video is not crushed ...it is superior to the "Bad" video. Neither are in YV12 source, originally. They are taken directly from DVD's.
Nor did I convert these to RGB. I copy an image from the video, place it into the photo editor, and the photo editor analyzes any spot I choose in the image and reports the RGB values for that pinpoint. For example; the whites from the "Good" video check in at greater than 240, yet the "Bad" check in at less that 225, which is noticeable. Same type of variance on the blacks: the "Good" has black values of 1, the "Bad" are near 15.
Incidentally, I agree that the "Bad" file is not truly bad, it's just not as vibrant as the "Good" file. However, the "Good" video has been smoothed too much, for my taste, making people appear more like wax. So, my desire is to achieve the same vibrancy of the blacks and whites in the "Good" video, but retain the grain detail of the "Bad" video.
poisondeathray
31st January 2019, 06:37
If it's not B&W and it's not color, what is it? What does the greyscale do for B&W?
B&W with color moire patterns . Look at the vest . Not only is it distracting for the viewer, it costs bits so it negatively impacts compression
Neither are in YV12 source, originally. They are taken directly from DVD's.
DVD-video will be YV12
This will give you something close to the "Good.m2v" in terms of levels
mpeg2source()
tfm().tdecimate()
greyscale()
smoothlevels(10,1.05,255,0,255,chroma=0)
manono
31st January 2019, 08:09
I disagree: lowering contrast also dims the entire image.
Well, the brightness might need raising a little bit to compensate because changing the contrast also affects the brightness, but to a much lesser degree.
This was not done in the "Good" video.
The 'good' video isn't good. It's worse than your 'bad' video. Okay, you didn't create the 'good' one yourself. But it shouldn't be taken as an example of how the movie should look. Now, it's your video and you can make it look however you like, but how you want it to look is often very different from how it should look. At least the 'good' one was properly greyscaled. Neither was IVTC'd.
To my eye, the "Good" video is not crushed ...it is superior to the "Bad" video.
How many times do I have to mention that you can't eyeball these things? And it's much inferior to the 'bad' one, based on luma values alone. In the picture below is a frame from the 'good' video. The red dots are illegal black values (below 16), the green dots are illegal white values (above 235). They're not horrible and it can be easily fixed. But they're worse than the luma values of the 'bad' video. I used this script:
TFM().TDecimate()
ColorYUV(Analyze=True).Limiter(Show="Luma")
Danette
31st January 2019, 17:44
Well, I want to thank you all for trying to help. I was able to move the shading around with the various filters you all offered, but doing so always resulted in a trade-off between brightness and contrast, although increasing the gamma slightly, as suggested, did come closest.
I realize that the "Good" video does not conform to technical specifications deemed to be correct but, to my eye (eyeballing), it offers significantly better vividness as compared to the technically correct "Bad" file. Beauty is in the eye of the beholder and that supersedes numerically assigned qualifiers.
However, I will be using the "Bad" version, as the over-smoothing of grain in the "Good" version is too much. I will also use Greyscale, following your good explanations for doing so.
hello_hello
8th February 2019, 15:23
I'm big on using Greyscale() for B&W sources myself, and it'll fix the rainbowing, but...
tinting was common (https://en.wikipedia.org/wiki/Film_tinting#Tinting_in_later_years) in the B&W days. If you're enthusiastic you could emulate any tinting, assuming it's correct and consistent, but I prefer B&W myself unless it's a source with a well known tint, and even then I prefer B&W.
You could tint with RGBAdjust.
GreyScale()
ConvertToRGB()
RGBAdjust(0.99,1.03,1.01)
ConvertToYV12()
My 2 cents worth.... the "bad" sample looks perfectly fine to me. The "good" sample is too dark. Maybe you should adjust your monitor rather than the video? ;)
thescrapyard
10th February 2019, 09:25
Not as comprehensive as the other posts, but if you want the absolute best results go with their suggestions
I use this for a quick improvement on B&W sources
greyscale()
autoadjust(auto_gain=true,auto_balance=true)
Nothing too fancy and has improved, to me, poor washed out sources that are very dark
For noise basic noise reduction and slight sharpening that help as well
removedirtmc(125,false)
lsfmod()
or for heavier grain this helps me
deen(mode="a3d",rad=1,thrY=1,thrUV=1)
These are just general suggestions that work for me
A lot of help on here is from people who do this for fun or as part of their day to day work so know a lot more than me and will tell you that to get the best each source should be treated differently
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.