View Full Version : Need some help with filters
mit_mis
22nd March 2004, 19:48
I've got Gekiganger III, and it's in poor quality... So I want to resize it, and improve quality. Can you please help me, and tell which filters I need to use, and how the script must look. Now it's in resolution 320x240, and looks...............bad:( I'm not too good in encoding, so please help me...
Here are some images:
http://mit_mis.w.interia.pl/geki1.pnghttp://mit_mis.w.interia.pl/geki2.png
http://mit_mis.w.interia.pl/geki3.pnghttp://mit_mis.w.interia.pl/geki4.png
SoonUDie
22nd March 2004, 20:59
What's your source? VCD? XviD/DivX?
mit_mis
23rd March 2004, 07:53
Stats form GSpot:
4CC: MP42
Name: S-Mpeg 4 version 2
Bitrate: 403kb/s
SoonUDie
23rd March 2004, 10:31
Well, you can try this script. Paste this into a text editor and save as "pickaname.avsi", and move the .avsi into your Avisynth/Plugins directory:
LoadPlugin("ChromaShift.dll")
LoadPlugin("warpsharp.dll")
function Soon_SharpSizeLQ(clip "a", int "warp", int "shift")
{
warp = default(warp, 120)
shift = default(shift, 0)
x = a.width()
y = a.height()
a = a.LancZos4Resize(x*2, y*2)
lum = a.WarpSharp(warp).Sharpen(0.5).ConvertToYUY2().TemporalSoften(2,3,4,15,2).SpatialSoften(4,4,8)
lum = mergeLuma(lum, lum.ColorYUV(autogain=true), 0.4).ConvertToYV12()
chr = a.ChromaShift(l=shift)
return mergeChroma(lum, chr)
}
In your case, you could call it using:
Soon_SharpSizeLQ(last, 180, -4)
Note that you will need ChromaShift.dll and WarpSharp.dll.
Result:
http://students.oxy.edu/tcoldwell/forum_uploads/newGeki2.jpg
Your milage may vary.
mit_mis
23rd March 2004, 10:38
ok, thanks, but when I'll resize it, will it be in good quality?
SoonUDie
23rd March 2004, 10:53
Originally posted by mit_mis
ok, thanks, but when I'll resize it, will it be in good quality? You'll have to decide for yourself.
It's not perfect. Here's an example where it creates some "mosiacing" (but I think it still looks better than the lanczosResized original):
http://students.oxy.edu/tcoldwell/forum_uploads/newGeki1.jpg
http://students.oxy.edu/tcoldwell/forum_uploads/newGeki1b.jpg
mit_mis
23rd March 2004, 10:56
what about bicubicresize?? and how did you applied this script to the image?
SoonUDie
23rd March 2004, 11:04
Originally posted by mit_mis
what about bicubicresize?? and how did you applied this script to the image? Bicubic resize is a little blurrier than the bottom pic above.
Your entire script would look like this:
DirectShowSource("blah.avi")
Soon_SharpSizeLQ(last, 180, -4)
That's it.
mit_mis
23rd March 2004, 11:08
but, how did u applied it to the image??
Manao
23rd March 2004, 11:13
To remove the ringing around the edges, add something like that after the function of SoonUDie: masklow = source.msmooth(threshold=5,mask=true,highq = true)
maskhigh = source.msmooth(threshold=10,mask=true,highq = true)
mask = hysteresymask(maskhigh,masklow,Y=3,u=1,v=1)
filtered = source.deen("a2d",3,8,15)
return source.maskedmerge(filtered,mask,y=3,u=1,v=1)or if you think it's too slow, mask = source.msmooth(threshold=10,mask=true,highq = true)
filtered = source.deen("a2d",3,8,15)
return source.maskedmerge(filtered,mask,y=3,u=1,v=1)
mit_mis
23rd March 2004, 11:17
speed doesn't matter, but how will the script look now?
Manao
23rd March 2004, 11:38
LoadPlugin("ChromaShift.dll")
LoadPlugin("warpsharp.dll")
LoadPlugin("MaskTools.dll")
LoadPlugin("Msmooth.dll")
LoadPlugin(Deen.dll")
function Soon_SharpSizeLQ(clip "a", int "warp", int "shift")
{
warp = default(warp, 120)
shift = default(shift, 0)
x = a.width()
y = a.height()
a = a.LancZos4Resize(x*2, y*2)
lum = a.WarpSharp(warp).Sharpen(0.5).ConvertToYUY2().
\ TemporalSoften(2,3,4,15,2).SpatialSoften(4,4,8)
lum = mergeLuma(lum, lum.ColorYUV(autogain=true), 0.4).ConvertToYV12()
chr = a.ChromaShift(l=shift)
return mergeChroma(lum, chr)
}
function DeRinging(clip "source", int "thlow", int "thhigh", int "thluma", int "radius")
{
thlow = default(thlow,5)
thhigh = default(thhigh,10)
thluma = default(thluma,8)
radius = default(radius,3)
masklow = source.msmooth(threshold=thlow,mask=true,highq = true)
maskhigh = source.msmooth(threshold=thhigh,mask=true,highq = true)
mask = hysteresymask(maskhigh,masklow,Y=3,u=1,v=1)
filtered = source.deen("a2d",radius,thluma,15)
return source.maskedmerge(filtered,mask,y=3,u=1,v=1)
}And after using Soon's function, you add DeRinging(last,5,10,8,3)
Now, for the use of the parameters :
- reducing thlow will increase the area on which the deringing is applied ( by making it thicker and longer )
- reducing thhigh also increase that area, but by adding new edges to be reringed
- radius will increase the strength of the deringing
- thluma also
If you want to see the area being deringed, instead of returning source.maskedmerge[...], return mask.
SoonUDie
23rd March 2004, 11:52
Manao, your function seems to work very well at smoothing gradiants. I'll be sure to keep this one ;)
Manao
23rd March 2004, 12:01
SoonUDie : strange : it is designed to work only around the edges, so gradients should not be smoothed. Have a look at the mask to see if it is correct. For large-scale ringing, try to increase the thluma and the radius.
mit_mis
23rd March 2004, 12:04
what do you think, about using filters like conv3d or 2dcleaner?? will they improve the quality?
SoonUDie
23rd March 2004, 12:26
Originally posted by Manao
SoonUDie : strange : it is designed to work only around the edges, so gradients should not be smoothed. Have a look at the mask to see if it is correct. For large-scale ringing, try to increase the thluma and the radius. You're right, I was being weird. The gradiant smoothing I got was from setting thlow=1. Anything above one works only on "real" edges. However, I like the smoothing with thlow=1, so I'll keep in that mind for later ;)
But like I said earlier, is there really enough of an improvement with deringing in this case to justify the speed hit?
mit_mis
23rd March 2004, 12:55
I've got an error:
Script Error: there's no function named hysteresymask.
What's wrong?
Manao
23rd March 2004, 13:11
You need the latest version of the masktools :
http://forum.doom9.org/showthread.php?s=&threadid=67232
mit_mis
23rd March 2004, 13:20
It's not a good idea to use SoonUDie script, cause it looks like painted!! any other ideas??
lamer_de
23rd March 2004, 14:32
It's not a good idea to use SoonUDie script, cause it looks like painted!! any other ideas??
Go find a better source!
Honestly, what do you expect from a 320x240 noisy vhs cap video blown up to double resolution? If your source is crap, your final result will most likely be crap aswell. Filters can help you to achieve a more pleasing result, but they can't suprpass such strong limitations in the source.
CU,
lamer_de
mit_mis
23rd March 2004, 15:05
I can't find a better source:( I even can't find a dvd with it:(
SoonUDie
23rd March 2004, 16:50
Originally posted by mit_mis
It's not a good idea to use SoonUDie script, cause it looks like painted!! any other ideas?? Like lamer_de said, there's not a lot you can do with such a nasty clip. The "painted" look is something you'll have to live with if you want a denoised, sharpened picture.
If you want something a little less painted but a lot more noisy, change
SpatialSoften(4,4,8) to SpatialSoften(3,1,6), and use a "warp" parameter between 60-100.
mit_mis
23rd March 2004, 17:34
ok, I've written something like this:
LoadPlugin("D:\Nowy folder\MaskTools-v1.4.6\Sources\MaskTools149.dll")
LoadPlugin("D:\Nowy folder\MaskTools-v1.4.6\Sources\warpsharp.dll")
LoadPlugin("awarpsharp.dll")
LoadPlugin("D:\Nowy folder\temporalcleaner_25_dll\temporalcleaner.dll")
LoadPlugin("Convolution3d.dll")
LoadPlugin("D:\Nowy folder\MaskTools-v1.4.6\Sources\awarpsharp.dll")
LoadPlugin("_2DCleanYUY2_for_25.dll")
AviSource("C:\sysreset\download\Gekiganger_III.avi")
Import("skrypty.avs")
Import("D:\Nowy folder\MaskTools-v1.4.6\Sources\mfToon-v0.52.avs")
ConvertToYV12()
TemporalCleaner (ythresh=5, cthresh=10)
mfToon()
DeRinging(last,5,10,8,3)
ConvertToYUY2()
lanczosResize(512,384)
Convolution3d(preset="animeLQ")
_2DCleanYUY2(0,6,2,2,0,4,4)
ConvertToYV12()
aWarpSharp(16.0, 2, 0.5, 1)
is this good?? however it's working... but... maybe it can be better
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.