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 27th September 2017, 23:21   #1  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 57
Restorating color in VHS cartoon

Hi there,

After doing many arbitrary brightness/color adjustments in the past, I started worrying about if I am doing well or not in this sphere. I've read a little about RGB balancing, histograms and these stuff, but it's also true that automatic balancers work mostly well with film and not cartoon.

I'm interested in learning what the thumb rules for color adjustment are, if there are any, because I would like to see satisfactory colors on my source while being certain I did not make them over-saturated in the attempt, and the same with levels and losing details in dark areas, though this is easier to prevent.

The source I'm working on right now looks somewhat like this in average:



Colors and brightness look weared, yet the edge ringing (I'm not sure this is the right name) produces very bright or dark halos in some places (which reveal 'black' areas of the cartoon are pretty grey-ish).

A tool I've been using pretty often, rather than the internal levels and tweak functions, is VDub's Gradation Curves Filter by Alexander Nagiller. Applying this filter in RGB mode gives good darkening results in my opinion, because the picture doesn't just look darker (like most of my attempts at doing this with the levels function) but less weared. The other way around, applying it in CYMK mode is what I used to boost the colors, and it also makes the picture darker. In order not to be arbitrary, I only boost C, Y and M in the same proportion and with just one point (you can check the vdscript VDub (FilterMod version) Processing Settings file I enclosed and uploaded to the MEGA link below).

For instance, I could suggest something like this:



But I would like to hear your suggestions.

I've exported a series of video samples, which feature diverse situations in the cartoon, though you don't have to download them all.

https://mega.nz/#F!8lVwnTCb!Qhu5hmSagaoCDCWq5C84sQ

What I can tell you about the source video is that I applied aWarpSharp in the chroma plane and desaturated over-saturated colors with FixChromaBleedingMod. I didn't apply any further brightness/saturation adjustments.

Thanks!
Attachments Pending Approval
File Type: zip levels5dark12color10.zip

Last edited by magiblot; 27th September 2017 at 23:25.
magiblot is offline   Reply With Quote
Old 27th September 2017, 23:48   #2  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 231
If you intend to do a lot of cleanup work on VHS source, why are you capturing to a lossy codec?
LemMotlow is offline   Reply With Quote
Old 28th September 2017, 07:14   #3  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 57
The capture was done in Lagarith YUY2. The samples I shared are already processed; since I wanted to discuss color I didn't find it comfortable to share big lossless videos.
magiblot is offline   Reply With Quote
Old 28th September 2017, 10:00   #4  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 231
I'm afraid few (if any) takers have the time or patience to correct your processing, much less help clean up an original. You don't need lengthy samples to illustrate problems. Once analog capture defects are lossy encoded many properties of the original are corrupt or missing -- the samples can only look worse with all the meddling required. That's what "lossy" means. Get it?

Last edited by LemMotlow; 28th September 2017 at 10:07.
LemMotlow is offline   Reply With Quote
Old 28th September 2017, 11:23   #5  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 695
Try this script i made:

Quote:
SetMemoryMax(4096)
SetMTMode(3,4)
LWLibavVideoSource(source="M:\05-montage\mario-cartoon-sample1.mkv")
SetMTMode(3,4)
ylevels(0,0.750,255,16,255)
tweak(sat=1.4,coring=false)
ConverttoRGB32(matrix="rec601",interlaced=false)
SetMTMode(3,2)
LoadVirtualDubPlugin("C:\Program Files (x86)\virtualdubmod1.5\plugins\Camcorder_Color_Denoise_sse2.vdf", "CCD", 0)
CCD(10,0) # 0 to 100
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\gradation1.46b.vdf", "gcurves", 0)
gcurves(2,"00000101020203030404050506060707080809090a0a0b0b0c0c0d0d0e0f0f1010111212131414151616171819191a1b1c1c1d1e1f20212223232425262728292a2c2d2e2f30313234353637393a3b3d3e3f414243454648494a4c4d4f505253555658595b5c5e5f616264656668696b6c6e6f717273757678797a7c7d7e80818284858687888a8b8c8d8e8f9091939495969798999a9b9c9d9e9fa0a1a2a3a3a4a5a6a7a8a9aaabacadadaeafb0b1b2b3b4b4b5b6b7b8b9babbbbbcbdbebfc0c1c2c3c4c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9d9dadbdcdddedfe0e1e2e3e4e5e6e7e8eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff","15222220502020202000045307f81bebfffff0000ffff0000ffff0000ffff0000ffff")
Converttoyv12(matrix="rec601",interlaced=false)


c=last
#even fields
# Motion compensation on frames -2...+2
even = c.SelectEven()
super_even=even.MSuper()
vf2 = super_even.MAnalyse (isb=false, delta=2, overlap=4)
vf1 = super_even.MAnalyse (isb=false, delta=1, overlap=4)
vb1 = super_even.MAnalyse (isb=true, delta=1, overlap=4)
vb2 = super_even.MAnalyse (isb=true, delta=2, overlap=4)
cf2 = MCompensate (even, super_even, vf2, thSAD=400)
cf1 = MCompensate (even, super_even, vf1, thSAD=400)
cb1 = MCompensate (even, super_even, vb1, thSAD=400)
cb2 = MCompensate (even, super_even, vb2, thSAD=400)
# dfttest on motion-compensated clip
Interleave (cf2, cf1, even, cb1, cb2)
SetMTMode(3,4)
RemoveSpotsMC()
SetMTMode(4)
dfttest (sigma=4, sigma2=4, tbsize=5, lsb=false) #
SelectEvery (5, 2)
# Gradient smoothing
presmooth = last
#SmoothGrad (radius=20, thr=0.15) #
#SmoothGrad (radius=12, thr=0.25, ref=presmooth)#
# Back to 8 bits, ordered dithering
#DitherPost () #
filtered_even=last
#odd fields
# Motion compensation on frames -2...+2
odd = c.SelectOdd()
super_odd=odd.MSuper()
vf2 = super_odd.MAnalyse (isb=false, delta=2, overlap=4)
vf1 = super_odd.MAnalyse (isb=false, delta=1, overlap=4)
vb1 = super_odd.MAnalyse (isb=true, delta=1, overlap=4)
vb2 = super_odd.MAnalyse (isb=true, delta=2, overlap=4)
cf2 = MCompensate (odd, super_odd, vf2, thSAD=400)
cf1 = MCompensate (odd, super_odd, vf1, thSAD=400)
cb1 = MCompensate (odd, super_odd, vb1, thSAD=400)
cb2 = MCompensate (odd, super_odd, vb2, thSAD=400)
# dfttest on motion-compensated clip
Interleave (cf2, cf1, odd, cb1, cb2)
SetMTMode(3,4)
RemoveSpotsMC()
SetMTMode(4)
dfttest (sigma=4, sigma2=4, tbsize=5, lsb=false) #
SelectEvery (5, 2)
# Gradient smoothing
presmooth = last
#SmoothGrad (radius=20, thr=0.15)
#SmoothGrad (radius=12, thr=0.25, ref=presmooth)#
# Back to 8 bits, ordered dithering
#DitherPost ()#
filtered_odd=last
Interleave(filtered_even, filtered_odd)

DeHalo_alpha_mt()
Toon(strength=0.4) # A simple but effective line darkener
FastLineDarken()
aWarpSharp(depth=6,blurlevel=4,thresh=0.2,cm=1)

Last edited by Mounir; 28th September 2017 at 11:26.
Mounir is offline   Reply With Quote
Old 28th September 2017, 21:13   #6  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 57
Quote:
Originally Posted by LemMotlow View Post
I'm afraid few (if any) takers have the time or patience to correct your processing, much less help clean up an original. You don't need lengthy samples to illustrate problems. Once analog capture defects are lossy encoded many properties of the original are corrupt or missing -- the samples can only look worse with all the meddling required. That's what "lossy" means. Get it?
I understand what you mean. But the actual source video is so difficult I thought I would do you a favor by fading away your intentions of debating the processing . In fact, you already gave it a try in this thread.

My point was to solve the color issue, and to focus on other processing in another occasion (that's why the video samples are a bit improvised). Even so, I can admit my error and for this reason I've added lossless samples to the MEGA link: one from the unprocessed video (IVTCed only) and another processed by me (like the previous lossy samples), if it helps. At this point, I guess I should just take the chance and make a more general discussion about the processing my source needs (though I think it's already too late to change the thread title, which in addition has a stupid spelling mistake).

What could I say about the processing? I'll try to share my script later (it's too messy right not), but some of the things I did, in case someone wants to look deeper into the issue, were:

* UnDot
* Denoising at half horizontal resolution (resizing gets rid of the vertical interference, so it's the best moment to denoise as well).
* Edges need antialiasing, but in order to prevent flickering it's convenient to apply antialiasing before denoising. To prevent widespread quality degradation I applied naa3mod with an edge mask before resizing the video to half resolution.
* Harmless halo reduction with LGhost(1,5,20,3,4,-50).
* In addition, I verified by checking the U and V channels separately that ChromaShift(U=-2,V=-4) are the best parameters for shifting chroma back to its place.

I tried not to denoise very strongly because I like to see a bit of grain and detail (in the background art). But well, I'm aware this part is to be improved and I'm open to suggestions.

Quote:
Originally Posted by Mounir View Post
Try this script i made:
Thanks. I need more time for comparing the denoising power and the color/brightness adjusment of your script with my previous attempts. I'm also waiting for a bug in AviSynth+'s LoadVirtualDubPlugin to be fixed, but I guess I could move to 2.6 in the meanwhile to run your script in the way you intended it to be. Still, I loaded your Gradation Curves preset into VirtualDub and saw it seems a pretty good decision.

I did check the dehalohing part of your script, though (which is something I was looking forward to implement in my script). It's good but it also generates a lot of aliasing . I've also had some random artifacting at the right edge of the picture, which I don't know why it was caused, but I guess it doesn't damage any actual details in the frame.

Watch the 'denoisedAndDehaloed.mkv' file in the 'Testing' folder in the MEGA link. It's specially noticeable in the plane scene. I also used the AviSynth denoising part of your script for this video (sorry for not sharing scripts! I'll try to add them later).



I tried applying naa3mod with an edge mask and reducing FastLikeDarken's thinning parameter. I haven't tried with other antialiasers yet, but it looks like there remains a bit of artifacting. You can see it in 'grainyWithAntialiasedDehaloing.mkv', in the same folder than before.


(I added a 10:11 SAR flag in this video but not in the others, excuse me for being so random >.<)

The lossless samples I uploaded feature the same segment that these two test videos.

And when I have more time I'll try some of real.finder's functions like VHSHaloremover and edgesidebleed.

Cheers.

Last edited by magiblot; 28th September 2017 at 21:19.
magiblot is offline   Reply With Quote
Reply

Tags
color, gradation curves

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 14:57.


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