Log in

View Full Version : experimental fxToon replacement: mfToon


mf
28th April 2003, 19:27
After much research in Paint Shop Pro and VirtualDub, I am happy to annouce an experimental rudimentary version of mfToon!

What's it do: It darkens lines in anime! ^_^
What's the catch: It SLIGHTLY darkens non-lines.
What's the speed: 10fps @ 640x480 on an Athlon XP 2000+
Where can I get it: HERE!

orig = AVISource("in.avi")
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(orig, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)
maskedsharp = Mask(sharp2, greymask)
final = Layer(origrgb, maskedsharp, "add", 255)
return final

Yes this is a mess, yes this could probably be done much better. No I don't care. This is just experimental and rudimentary, so don't complain :). I'll get this done better soon. If you want even more quality (and even less speed), try this:
orig = AVISource("in.avi").Convolution3D(preset="AnimeLQ")
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(orig, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)
maskedsharp = Mask(sharp2, greymask)
semifinal = Layer(origrgb, maskedsharp, "add", 255).ConvertToYUY2().ConvertToYV12(). \
BicubicResize(1920, 1440, 0, 0.75) \
.XSharpen(255, 255).BilinearResize(640, 480).WarpSharp(15, 5)
final = orig.MergeLuma(semifinal)
return final
You'll need the PROPER (not the one on the avisynth beta page) WarpSharp.dll. You can get it here (http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/).

I'll keep you updated on progress :).

Edit: Here's a screenshot (left processed, right original): http://mf.onthanet.com/linedarkening/practice-1.png

Oh and btw, when it's finished it should look something like this:
http://mf.onthanet.com/linedarkening/theory-4.png
http://mf.onthanet.com/linedarkening/theory-4_original.png
(I cooked this up in PSP + Vdub)

Edit 2: mods: DON'T edit scripts without verifying if your wrappers actually work. Edited so they work.

digitize
28th April 2003, 20:10
/me bows down to mf..... im not worthy :p
great job mf, you have discovered the holy grail of anime encoding for avs ;) ... im going off to test it now.

sungey
28th April 2003, 20:35
good job there ... even though it darkens the video abit .. the quality is still much better .... :P

EDIT : this filter-chain amplify noise as well ... use with care ... :)

Guest
28th April 2003, 21:57
Originally posted by mf
Edit 2: mods: DON'T edit scripts without verifying if your wrappers actually work. Edited so they work. Please DON'T post long code lines that cause the page to get too wide. Then the mod won't have to intervene. Thank you.

mf
28th April 2003, 21:59
Originally posted by neuron2
Please DON'T post long code lines that cause the page to get too wide. Then the mod won't have to intervene. Thank you.
When I'm busy trying things out, I tend to forget cosmetic things like that. Sorry. (I'm running 1280x960 res, so I don't notice)
My point was that keeping a script functional is more important than wether it fits on the page or not.

WyldeF1r3
29th April 2003, 14:53
I don't know what you did to the theory picture (not the original) as far as filtering, but it looks as if the lines have been thined, and don't look any darker, also, due to their being thinned, the jagged edges on those lines are more pronounced, as if you had used warpsharp on it. However the practice.png looks well done. I'll be sure to test this when I get home.

mf
29th April 2003, 15:02
Originally posted by WyldeF1r3
I don't know what you did to the theory picture (not the original) as far as filtering, but it looks as if the lines have been thined, and don't look any darker, also, due to their being thinned, the jagged edges on those lines are more pronounced, as if you had used warpsharp on it. However the practice.png looks well done. I'll be sure to test this when I get home.
Bingo. I warpsharped it as far as it would still look good when played fullscreen. And don't get me wrong, I warp sharped supersampled.

WyldeF1r3
29th April 2003, 15:31
pardon me for going off topic for just a moment, but since you brought it up, supersampling, I've only ever heard of it being used to offset an odd effect of xsharpen, is there merit in supersampling, and where can I find out more about it and its merit for certain filters/types of filters (anywhere besides the holy "search" button).

In any case, I've seen your discussions with neuron2 about your unshrap mask experiments and the script you've provided here looks to have some of the same elements. Never having experience with unsharp mask filters either in a photoediting program (PSP, PhotoShop, etc) or vdub's version, would it be possible to explain what an unsharp mask does, perhaps as opposed to a standard sharpener? Or must I go on the quest for the holy readme.txt? It would make my testing job for your script=mftoon if I know what it is I'm looking for besides thicker/darker lines.

mf
29th April 2003, 17:07
The explanation is simple. Unsharp mask makes adjacent dark image elements darker, and light elements lighter. I use a brighness mask to eliminate the lightening effect. That means when a dark image element is next to a lighter one, it will get darkened. This is a very simple way to darken lines. That's the basic concept. Now to refine, I sharpen with supersampled xsharpen. What that does, is I use bicubic interpolation to "make up" curves that aren't there. XSharpen sharpens those so far that they become "jagged edges", or aliased. Downsizing back to the original size will cause the jagged edges to be averaged along the made up curves, causing a sharp anti-alias effect. A side effect of the line darkening, is that it seems to thicken the lines, because blurry lines are wider than sharp ones. So I use Warp Sharp to thin those lines. I overlay the xsharpened image over the warp sharpened image with again a brightness mask, so that only the dark lines will be replaced by the warp sharped thinner lines (I'm still wrestling with that in AVISynth, which seems to be a lot harder to do than in Paint Shop Pro). Warp Sharp has a nasty side effect of causing slight (not as bad as xsharpen) jagging when used with higher strengths (as needed for effective line thinnign), so I supersample 2x2 (meaning 2 times the original size) to compensate for that. Hope this explains everything good enough :).

mf
29th April 2003, 20:42
Ok, I just managed to make something that really looks nice on naruto, but it's such a mess I don't dare post it here :o. And it's badass slow too. I'll hear it if someone really wants it :p.

Dreassica
29th April 2003, 20:46
slow or not, me wants it. :D So do not hesitate to share it .

WyldeF1r3
29th April 2003, 21:01
I'm accustomed to the wonders of the sub 4fps myself, speed's not an issue where a challange is concerned, so if you're to share I'd love to see it. ^_^

Thank you very much for the explanation of the unsharp mask and supersampling you've done, it's made this all much easier for me to understand. I hope I'll be able to contribute something meaningful to its developement through some of my test encodes.

mf
29th April 2003, 21:13
Ok, here goes ~_~ *closes eyes as if he's on a rollercoaster that's climbing up*

For sharp anime (Narue no Sekai, Wolf's Rain, etc)
orig = AVISource("in.avi").Convolution3D(preset="AnimeLQ")
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(orig, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 80, 0, 255)).ConvertToRGB32().MSmooth()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 0.6, 175, 255, 0)
maskedsharp = Mask(sharp2, greymask)
ssxsh = Layer(origrgb, maskedsharp, "add", 255).ConvertToYUY2().ConvertToYV12() \
.BicubicResize(1920, 1440, 0, 0.75).XSharpen(255, 255)
warpsharp = ssxsh.BilinearResize(640, 480).BicubicResize(1280, 1024, 0, 0.75) \
.aWarpSharp(56, 2, 0.5, 0).BicubicResize(1920, 1440, 0, 0.75).ConvertToRGB32()
ssxshrgb = ssxsh.ConvertToRGB32()

darknessmask = ssxshrgb.Greyscale()
detailmask = orig.MSmooth().EdgeMask(0, "sobel").GreyScale() \
.BicubicResize(1920, 1440, 0, 0.75).ConvertToRGB32()
white = BlankClip(darknessmask, color=$FFFFFF)
maskeddarkness = Mask(detailmask, darknessmask)
warpmask = Layer(white, maskeddarkness, "add", 255).Levels(0, 1, 255, 255, 0) \
.Levels(30, 1.0, 60, 0, 255).ConvertToYUY2.ConvertToYV12().Levels(0, 1, 255, 255, 0) \
.Inflate().Levels(0, 1, 255, 255, 0).ConvertToRGB32().GreyScale()

maskedssxsh = Mask(ssxshrgb, warpmask)
semifinal = Layer(warpsharp, maskedssxsh, "add", 255).ConvertToYUY2().ConvertToYV12() \
.BilinearResize(640, 480)


final = orig.MergeLuma(semifinal)
return final
@_@

Here's a screenshot:
http://mf.onthanet.com/linedarkening/practice-2.png

And now for blurry anime (Naruto, Naruto, Naruto, etc)
orig = AVISource("in.avi").Convolution3D(preset="AnimeLQ")
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(orig, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp1 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 80, 0, 255))
sharp2 = origyuy.MergeLuma(Layer(sharp1, sharp, "mul", 128) \
.Levels(0, 1.0, 180, 0, 255)).ConvertToRGB32().MSmooth()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 0.6, 175, 255, 0)
maskedsharp = Mask(sharp2, greymask)
ssxsh = Layer(origrgb, maskedsharp, "add", 255).ConvertToYUY2().ConvertToYV12() \
.BicubicResize(1920, 1440, 0, 0.75).XSharpen(255, 255)
warpsharp = ssxsh.BilinearResize(640, 480).BicubicResize(1280, 1024, 0, 0.75) \
.aWarpSharp(56, 2, 0.5, 0).BicubicResize(1920, 1440, 0, 0.75).ConvertToRGB32()
ssxshrgb = ssxsh.ConvertToRGB32()

darknessmask = ssxshrgb.Greyscale()
detailmask = orig.MSmooth().EdgeMask(0, "sobel").GreyScale() \
.BicubicResize(1920, 1440, 0, 0.75).ConvertToRGB32()
white = BlankClip(darknessmask, color=$FFFFFF)
maskeddarkness = Mask(detailmask, darknessmask)
warpmask = Layer(white, maskeddarkness, "add", 255).Levels(0, 1, 255, 255, 0) \
.Levels(30, 1.0, 60, 0, 255).ConvertToYUY2.ConvertToYV12() \
.Levels(0, 1, 255, 255, 0) \
.Inflate().Levels(0, 1, 255, 255, 0).ConvertToRGB32().GreyScale()

maskedssxsh = Mask(ssxshrgb, warpmask)
semifinal = Layer(warpsharp, maskedssxsh, "add", 255).ConvertToYUY2().ConvertToYV12() \
.BilinearResize(640, 480)


final = orig.MergeLuma(semifinal)
return final

Screenshot of this one:
http://mf.onthanet.com/linedarkening/practice-3.png

You need MSmooth (http://shelob.mordor.net/dgraft/msmooth/msmooth200b1.zip), Conv3DYV12 (http://www.hellninjacommando.com/con3d/beta/convolution3dyv12.zip), WarpSharp (http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/), aWarpSharp (http://ziquash.chez.tiscali.fr/aWarpSharp%20beta%201.zip), and MaskTools (http://kurosu.inforezo.org/avs/MaskTools.zip).

Because of my bad scripting I will now set up a disclaimer.
By replying to this post you agree that you will not criticize my HORRIBLE script unless you have a good suggestion on how to do it better. I know this is crappy and slow, that's why it's experimental. I'm just afraid of breaking it when I optimize it for speed ~_~.

Happy 1fps encoding! -_-;;
Oh yeah, and a note to supreme post-edit-master neuron, I will edit my post and add wrappers in a sec.
Edit: Edited them :>.

Dreassica
29th April 2003, 21:52
the scirpt isnt working for me. I keep on getting Invalid arguments to Convolution3d, even though it should work (no typos). Also Xsharpen isnt recognised either. I do have all filters needed in my autoload folder including latest warpsharp package.

ps The awarpsharp link leads to the asharp.dll.

Kep up the good work! ^^

mf
29th April 2003, 22:04
Originally posted by Dreassica
the scirpt isnt working for me. I keep on getting Invalid arguments to Convolution3d, even though it should work (no typos). Also Xsharpen isnt recognised either. I do have all filters needed in my autoload folder including latest warpsharp package.

ps The awarpsharp link leads to the asharp.dll.

Kep up the good work! ^^
I always load everything manually. Just to be sure ;). The warpsharp you need is different though (as I said at the top of the thread), so you should make sure you have the same version as me. It includes a proper XSharpen. I updated the link, and thanks for the compliment :)! Also note that I edited my post and added screenshots. So if it's still not working you can see the effect anyway ;).

Dreassica
29th April 2003, 22:29
Originally posted by mf
I always load everything manually. Just to be sure ;). The warpsharp you need is different though (as I said at the top of the thread), so you should make sure you have the same version as me. It includes a proper XSharpen. I updated the link, and thanks for the compliment :)! Also note that I edited my post and added screenshots. So if it's still not working you can see the effect anyway ;).

i downloaded that warpsharp package from the link u gave, so that cant be it.

WyldeF1r3
29th April 2003, 22:46
I've run several tests now (I forgot how much fun it was to spend 30 minutes encoding a minute and a half of footage XD hehe) and the results are very encouraging. The lines show a noticable darkness though some elements look to be a little jagged. There is definately room for tweaking and, admitadly, speed optimization, but an altogether excellent work mf, thanks for the trouble, I'm sure this'll keep my nose in the encodes for another few weeks with tests :)

jarthel
30th April 2003, 06:21
Can these be used in .d2v files? The samples uses .avi.

Thanks

Jayel

mf
30th April 2003, 10:23
Originally posted by jarthel
Can these be used in .d2v files? The samples uses .avi.

Thanks

Jayel
Of course it can, but you'll have to modify it yourself. Because it's experimental, it'll only do AVI at 640x480 unless you modify it.

jarthel
30th April 2003, 12:00
It shouldn't be a problem them. I always use 640x480 as my output resolution.

I'll try it overnight. Thanks

Jayel

jarthel
1st May 2003, 07:52
I tried the script (slower one) with Eva. It looks good I think. It made it sharper and brighter.

Jayel

mf
6th May 2003, 19:32
Ok, here is mfToon v0.3!

orig = AVISource("in.avi")
origsmooth = orig.Deen("a3d",4,5,1,50)
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(origsmooth, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)

detailmask = origsmooth.EdgeMask(0, "sobel").Tweak(0.0, 1.0, 64, 1.0) \
.Levels(60, 10.0, 255, 0, 255).Levels(0, 10.0, 30, 255, 0).GreyScale().ConvertToRGB32()
maskeddetail = Mask(detailmask, greymask)
white = BlankClip(greymask, color=$FFFFFF)
linemask = Layer(white, maskeddetail, "add", 255).Levels(0, 1, 255, 255, 0)

maskedsharp = Mask(sharp2, linemask)
dark = Layer(origrgb, maskedsharp, "add", 255)
darkyv12 = dark.ConvertToYV12()

final = darkyv12.BicubicResize(2560, 1920, 0, 0.75).XSharpen(255, 255) \
.BicubicResize(640, 480, 0, 0.75).aWarpSharp().Convolution3D(preset="AnimeLQ")
return final


You now additionally need Deen (http://ziquash.chez.tiscali.fr/Deen%20beta%202.zip).

Since this version has a lot less issues, being no more noticable overall darkening, and a speed gain over v0.2, I now declare this version usable. It's now really not just line darkening anymore, it's more like sharpening with built-in line darkness adjustment ;). I REALLY like how it looks on HQ raws.

Here are some screenshots:
http://mf.onthanet.com/linedarkening/practice-4.png
http://mf.onthanet.com/linedarkening/practice-5.png

Please test this version too :).

digitize
7th May 2003, 21:25
/me again bows down to mf ^^. This filter greatly enhances the video, although somewhat slow... but again this is only version .3, so speed will come in time. Thank you again mf.

jarthel
8th May 2003, 04:42
will test tonight. I really hate the darkening effect with 0.2. Video losses alot of detail. :(

Jayel

WyldeF1r3
8th May 2003, 08:00
the overall darkening effect can easily be compensated for by adding Donal Graft's Tweak Plugin into avisynth, or using his hue/saturation/intensity filter in virtualdub. Both of those have worked well for me in offsetting the effects, as well as revamping the colors after so many colorpsace conversions.

jarthel
8th May 2003, 09:09
5+hours/pass on a 25 minute video :( and that's running on the system in my sig :(

gamr
8th May 2003, 10:19
now, a usable speed script :devil:


origsmooth = orig.Deen("a3d",4,5,1,50)
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(origsmooth, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255).Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)

detailmask = origsmooth.EdgeMask(0, "sobel").Tweak(0.0, 1.0, 64, 1.0).Levels(60, 10.0, 255, 0, 255) \
.Levels(0, 10.0, 30, 255, 0).GreyScale().ConvertToRGB32()
maskeddetail = Mask(detailmask, greymask)
white = BlankClip(greymask, color=$FFFFFF)
linemask = Layer(white, maskeddetail, "add", 255).Levels(0, 1, 255, 255, 0)

maskedsharp = Mask(sharp2, linemask)
dark = Layer(origrgb, maskedsharp, "add", 255)
darkyv12 = dark.ConvertToYV12()

final = darkyv12.BicubicResize(orig.Width*3, orig.height*3, 0, 0.75).XSharpen(127, 255) \
.BicubicResize(orig.width, orig.height, 0, 0.75).aWarpSharp()

mask alternative


mask = orig.deen("a2d",2,200,250).deen("a2d",2,200,250)


higher than radius 2 on a2d gives artifacts, not sure which is faster.

made it suit my sources as well as made the side dynamic. the problem was mostly that white text with black outlines (credits on dvds) got screwed over bigtime, xsharpen at 127,255 fixes that for me. the results from this to the other version seem to be the same or very close to it.

results arent exactly the same but close enough for my usage.

a question tho, should orig be cleaned already? ie. edeen+atc

mf
8th May 2003, 12:02
Originally posted by WyldeF1r3
the overall darkening effect can easily be compensated for by adding Donal Graft's Tweak Plugin into avisynth, or using his hue/saturation/intensity filter in virtualdub. Both of those have worked well for me in offsetting the effects, as well as revamping the colors after so many colorpsace conversions.
The colors don't need revamping, cause I don't touch them. As you can see I copy the exact chroma from the original at the end. So your last sentence doesn't make sense.
Edit: Oh, I see I forgot to do that in this version. I'll call it a "bugfix" :D See bottom of this post for the "bugfixed" version :p.

Originally posted by gamr
now, a usable speed script :devil:
Well actually there's still some things done stupid in v0.3, but that's not really fixed the way you do it :). I like how you made it dynamic, I've had troubles with that, but changing the supersample to 3x3 really degrades quality. Fine detail will get messed up. I'll make something better this afternoon.

Edit: could you please mark your changes? My script is cryptic enough for users as it is.

Bugfixed v0.3:
orig = AVISource("in.avi")
origsmooth = orig.Deen("a3d",4,5,1,50)
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(origsmooth, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255) \
.Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)

detailmask = origsmooth.EdgeMask(0, "sobel").Tweak(0.0, 1.0, 64, 1.0) \
.Levels(60, 10.0, 255, 0, 255).Levels(0, 10.0, 30, 255, 0).GreyScale().ConvertToRGB32()
maskeddetail = Mask(detailmask, greymask)
white = BlankClip(greymask, color=$FFFFFF)
linemask = Layer(white, maskeddetail, "add", 255).Levels(0, 1, 255, 255, 0)

maskedsharp = Mask(sharp2, linemask)
dark = Layer(origrgb, maskedsharp, "add", 255)
darkyv12 = dark.ConvertToYV12()

semifinal = darkyv12.BicubicResize(2560, 1920, 0, 0.75).XSharpen(255, 255) \
.BicubicResize(640, 480, 0, 0.75).aWarpSharp().Convolution3D(preset="AnimeLQ")
final = orig.MergeLuma(semifinal)
return final

gamr
8th May 2003, 13:57
you are certainly right about the bug (forgetting mergeluma)

you are also awarpsharping chroma as well at the moment, cm=0 is what you want to add, should give slight performance boost.

here it is with mergeluma included


origsmooth = orig.Deen("a3d",4,5,1,50)
mask = orig.Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58)
sharp = Subtract(origsmooth, mask).ConvertToYUY2()
origyuy = orig.ConvertToYUY2()
sharp2 = origyuy.MergeLuma(Layer(origyuy, sharp, "mul", 255).Levels(0, 1.0, 115, 0, 255)).ConvertToRGB32()
origrgb = origyuy.ConvertToRGB32()
greymask = origrgb.Greyscale().Levels(0, 1, 255, 255, 0)

detailmask = origsmooth.EdgeMask(0, "sobel").Tweak(0.0, 1.0, 64, 1.0).Levels(60, 10.0, 255, 0, 255) \
.Levels(0, 10.0, 30, 255, 0).GreyScale().ConvertToRGB32()
maskeddetail = Mask(detailmask, greymask)
white = BlankClip(greymask, color=$FFFFFF)
linemask = Layer(white, maskeddetail, "add", 255).Levels(0, 1, 255, 255, 0)

maskedsharp = Mask(sharp2, linemask)
dark = Layer(origrgb, maskedsharp, "add", 255)
darkyv12 = dark.ConvertToYV12()

semifinal = darkyv12.BicubicResize(orig.Width*3, orig.height*3, 0, 0.75).XSharpen(127, 255) \
.BicubicResize(orig.width, orig.height, 0, 0.75).aWarpSharp(cm=0)
final = orig.MergeLuma(semifinal)


as for 3x supersampling, your right, i did lower that, the reason for it tho is im also lowering xsharpen to 127 so as i dont get artifacts that it introduces when its at 128 or higher. if you dont understand what im seeing here ill screenshot it for you. if you want 4x supersampling just change it to orig.blah*4, simple enough

maybe i should get off my backside and update the code and make some variables but meh, maybe tomorow, a supersample factor variable would be useful

ok, just to list off all the changes, here they are

supersampling at 3x resolution instead of 4x (faster and also because we arent sharpening as much, very similar results tho)
xsharpen lowered to 127 instead of 255
dynamic frame size
no c3d at the end of the script (i use other filters personally, c3d just isnt tweakable enough for me)

if i missed anything here please let me know

mf
8th May 2003, 14:58
Originally posted by gamr
if i missed anything here please let me know
Yeah. Make your scripts fit on the page or neuron will get angry :p.

Btw: I really didn't want to make everything dynamic yet until things really work like I intend them to. In the end I'll just attach a .avs file which ppl will be able to invoke and then use mfToon(args). Then it won't have that much preset filtering included either. And I also wanted to make script functions earlier, but I got all kinds of problems. Blah.

Kamui-Dash
9th May 2003, 06:15
That warpsharp link is dead, so I was using warpsharp_2003_0121 and got an error saying "EdgeMask" cannot be found. I also tried searching on the forum but nothing showed and then I went to avisynth page to check our with search button. Still nothing :( Could u plz tell me where I can find this warpsharp with "EdgeMask" or any other place to get it. Thx ^^

Wilbert
9th May 2003, 08:34
I guess he used this plugin: http://forum.doom9.org/showthread.php?s=&threadid=49892.

Kamui-Dash
9th May 2003, 10:23
Oh thx, I just realize that I have a Mask Tools zip :D

mf
9th May 2003, 12:04
Read all my posts in this thread from top to bottom and you'll find all the plugins you need. I'll check on the broken link.

mf
9th May 2003, 14:17
And here is mfToon v0.31! Finally it behaves as a filter ;).

http://mf.onthanet.com/linedarkening/mfToon-v0.31.avs

It works like this:

Import("mfToon-v0.31.avs")

AVISource("NARUTO.14.avi")
mfToon()
Parameters are:
boolean sharpen - sharpening on/off - default true - turning this off increases speed at the cost of quality
boolean cwarp - chroma warping on/off - default true - same as above
integer ssw - supersample factor horizontally - default 4 - lowering this increases speed at the cost of quality, raising this is useless (most of the time)
integer ssh - supersample factor vertically - default 4 - same as above
integer xstren - sharpening strength - default 255 - changing this may improve appearance on some sources
integer xthresh - sharpening threshold - default 255 - same as above

Have fun, and thanks for all the support! :)

mf
14th May 2003, 13:01
Just for the record, I have now released v0.32 in the AVISynth Usage Forum (http://forum.doom9.org/showthread.php?s=&threadid=53364). Development will be here, releases and info will be there. Thanks for reading! :)

t3ch
13th September 2003, 21:06
Import("mfToon-v0.31.avs")
AVISource("NARUTO.14.avi")
mfToon()
cout<<"why doesn't this compile ahhh";
writeln("hrmmm");

Nice filter though, good work :cool:

mf
14th September 2003, 10:11
Originally posted by t3ch
cout<<"why doesn't this compile ahhh";
writeln("hrmmm");Nice filter though, good work :cool:
wtf?

MsticAzn
5th October 2003, 16:24
Import("C:\mfToon-v0.42.avs")

AVISource("C:\File.avi")
mfToon()


this was the setup for the .avs file, but when i load it into vdub, the program just closes, is there something else that i am missing?:confused:

clima
6th October 2003, 12:34
Try with a resolution of 640x480.

mf
5th November 2003, 22:08
Question to devels: I am getting more and more cases of the wrong clip being returned by my scripted function, on a seemingly random basis. A few days ago I had the linemask clip come through for 1 frame somewhere in the middle of an anime episode. I think this is also for some obscure reason the cause of these "dark flickering" people seem to be getting. I haven't gotten it yet though, strangely enough.

Chainmax
12th November 2003, 01:03
Would it be possible that you updated mfToon so that it accepts the latest masktools version? It's kind of a drag having to switch DLLs when using rainbow killer nd/or mfToon...

mf
12th November 2003, 13:11
Originally posted by Chainmax
Would it be possible that you updated mfToon so that it accepts the latest masktools version? It's kind of a drag having to switch DLLs when using rainbow killer nd/or mfToon...
I've been wanting to do this for version 0.5. But I haven't gotten to it so far.

Chainmax
13th November 2003, 20:30
Hopefully you can do it sometime. Keep up the good work :).

LB
17th November 2003, 20:46
Originally posted by mf
Question to devels: I am getting more and more cases of the wrong clip being returned by my scripted function, on a seemingly random basis. A few days ago I had the linemask clip come through for 1 frame somewhere in the middle of an anime episode. I think this is also for some obscure reason the cause of these "dark flickering" people seem to be getting. I haven't gotten it yet though, strangely enough.

Hey MF, you prob already know this, but I'll just mention it anyway. I've been using v.32 instead of your current versions because I found that it doesn't produce any flickering effect as I experienced with all the later versions. So if you are looking into that issue, you might want to look back at 32.