View Full Version : New anime filter: mfToon
Ok, so some of you might have heard of this by reading the AVISynth development forum, however not all of you do, so I'm posting here, now that I reckon I won't be doing much about it anymore.
I have mfToon v0.32 ready, and I think it's good enough for normal usage now. You can follow development from v0.1 onward here (http://forum.doom9.org/showthread.php?s=&threadid=52066).
The script (it's a function, not a real filter dll) can be found here (http://mf.onthanet.com/linedarkening/mfToon-v0.32.avs).
What does it do: in default operation, it performs line darkening, Xsharpening, and warp sharpening. Sharpening is slow, and because of that I've made it optional.
Because of colorspace conversions, most of the operations are done on luma only. Warp sharpening can be done either on luma only or on luma and chroma (chroma linked to luma). Input requires to be YV12, this is not checked, it's probably safe to use other colorspaces but the output will always be YV12. I'm not responsible for what happens if you use something other than YV12 :D.
Usage and parameters:
Import("mfToon-v0.32.avs")
AVISource/MPEG2Source/WhateverSource("file")
mfToon()
Normal parameters:
type param - description - range - default
int strength - line darkening strength - 0-255 - 255
bool sharpen - sharpening - on/off - true
bool cwarp - chroma warp - on/off - true
float wdepth - warping depth - ?-? - 16.0
int wblur - warping blur level - ?-? - 2
float wthresh - warping threshold - 0.0-1.0 - 0.5
int ssw - supersample factor horizontally - 0-inf - 4
int ssh - supersample factor vertically - 0-inf - 4
Advanced parameters, you're not likely to be tweaking these:
type param - description - range - default
int xstren - xsharpening strength - 0-255 - 255
int xthresh - xsharpening threshold - 0-255 - 255
float ublur - unsharp mask blur level - 0.0-1.58 - 1.58
int ustren - unsharp mask strength - 0-255
int urange - unsharp mask range - 0-255 - 115
float uboost - unsharp mask boost - 0.0-10.0 - 1.0
int dstren - detail strength - 0-255 - 255
int drange - detail range - 0-255 - 64
float dboost - detail boost - 0.0-10.0 - 10.0
int dlimit - detail limiter - 0-255 - 30
Explanation of advanced parameters: mfToon uses masks, and these parameters influence them. Strength means opacity of the effect, range means the value compression, boost means an opaque/transparency boost, where a value below 1.0 is negative, and limiter means the final range compression.
Yeah, these are quite some parameters, but I love configurability :D.
Initially I wanted to hide the drawbacks, and let you figure them out (they're hardly noticable), but nahh :devil:.
Drawbacks: Sometimes a strange "dark edge" effect on seemingly low-detail surfaces, and a VERY slight darkening along non-line edges (this is the effect you get from sharpeners ala MSharpen and aSharp, so you probably won't notice it).
Dependencies are:
Special(!) Warp Sharp package (http://mf.onthanet.com/linedarkening/WarpSharp.dll)
MaskTools (http://kurosu.inforezo.org/avs/MaskTools.zip)
aWarpSharp (http://ziquash.chez.tiscali.fr/aWarpSharp%20beta%201.zip)
Thanks go to:
Anonymous author of the new WarpSharp package (http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/)
neuron2 (for the original XSharpen) (http://shelob.mordor.net/dgraft/)
Kurosu (http://kurosu.inforezo.org/avs/)
Marc FD (http://ziquash.chez.tiscali.fr)
The whole forum and its users :) (http://forum.doom9.org)
Have fun!
PS: Just for fun, here's a nice challenge. I just noticed I accidentally made one obsolete parameter. See if you can spot it ;).
digitize
14th May 2003, 13:12
For all of those who have not tried this filter.... well you're missing out ^^. It is directed towards anime... not sure how and if it'd really work with live action stuff. Anyway, it is able to darken lines and sharpen the picture very well. The one drawback atm is the speed, but speed isn't of the largest concern, quality is, and that's where this filter does well. Well done mf :p
jarthel
14th May 2003, 14:20
another drawback: slow even on my overclocked system :( but quality is good. :)
zeus163
15th May 2003, 07:27
(OK, I just re-read some of the txt files and it appears that I need to install 2.51). I'll try that tomorrow and get back to you.
Does this work with 2.08? I'm trying to use it and it errors out every time I pull it into CCE. It doesn't say an error, just a picture with an exclamation error. I just tried to open the script in VDub and it states there is a script error: There is no function named Edge Mask.I took all the downloadable files from this page and just can't seem to get them set up right. I must be doing something wrong. My sample script is below.
Import("C:\Program Files\AviSynth2\plugins\mfToon-v0.32.avs")
AVISource("F:\anime\naruto episodes\naruto test.avi")
mfToon()
BicubicResize(704,440)
AddBorders(8,20,8,20)
ResampleAudio(44100)
I can't wait to try this. It looks cool. Especially since I've been converting Naruto fansubs to DVD!
digitize
15th May 2003, 11:51
@zeus
You need to load all the dll's that you downloaded:
awarpsharp
warpsharp
MaskTools
Load all of those into the avs, and it should work.
dvd2svcd
15th May 2003, 13:39
Here's a funny thing. If you put the 3 above plugins into the Avisynth 2.51 Plugin folder, dvd2svcd fails when using the native VFW routines of Windows (used by preview and frameselection). I haven't gone into depth with the issue, but if anybody cares I can investigate further.
Wilbert
15th May 2003, 14:10
Here's a funny thing. If you put the 3 above plugins into the Avisynth 2.51 Plugin folder, dvd2svcd fails when using the native VFW routines of Windows (used by preview and frameselection). I haven't gone into depth with the issue, but if anybody cares I can investigate further.
Problem is already known (and described in both AviSynth faq's). The problem is warpsharp.dll, and the solution is to put it _not_ in the AviSynth plugindir, but somewhere else.
dvd2svcd
15th May 2003, 14:11
Sorry, my bad. Note to self "use the freaking search button"
However, I find it funny that mf apparently doesn't need to load warpsharp manually. (if you look in the mfToon function it isn't loaded anywhere and therefore mf should get the same problem when previewing an avs in MediaPlayer 6.4)
Originally posted by dvd2svcd
Sorry, my bad. Note to self "use the freaking search button"
However, I find it funny that mf apparently doesn't need to load warpsharp manually. (if you look in the mfToon function it isn't loaded anywhere and therefore mf should get the same problem when previewing an avs in MediaPlayer 6.4)
Actually, I load them before I do Import() :D.
Defiler
15th May 2003, 16:00
I didn't need to explicitly load any plugins to make this work. Thanks for the script.
I'm encoding a 90 minute anime to one CD right now. I'll reply with my results if they are interesting. I'm also using the latest XviD features, like Trellis, etc.. so it will be a while. Heh.
So, nobody spotted the obsolete parameter yet? ;)
Sorrow
15th May 2003, 18:08
I'll take a shot... is the obsolete parm
int urange - unsharp mask range - 0-255 - 115
hehe wild guess here. ;)
Defiler
15th May 2003, 18:13
That's my guess as well.
Originally posted by Sorrow
int urange - unsharp mask range - 0-255 - 115
Nope :).
Defiler
15th May 2003, 19:36
I give up. I just read through the script like 10 times, and every defined parameter seems like it is used in a function that actually passes data to one of the three clips that is used for the final output. 18 "independent" parameters, 18 are defined, 18 are documented.
Can we get a hint? :)
zeus163
15th May 2003, 20:01
I loaded all the plug-in's into my script and that did not solve the problem. Although the error it reported was something like screen size not accepted. I'm at work so don't remember what it says. I think I have to install avisynth 2.51, but whenever I do that I seem to have problems modifying my working scripts for fielddeinterlace (i think it's something to do with mpeg2dec that I'm trying to use). When I get home, I'll try this again and upgrade to 2.51 and see if I can get it to work.
Defiler
15th May 2003, 20:11
zeus: You did read this, right?
Input required to be YV12, this is not checked, it's probably safe to use other colorspaces but the output will always be YV12. I'm not responsible for what happens if you use something other than YV12
Mr_Khyron
15th May 2003, 20:14
zeus163: Try the new MPEG2Dec3 v1.04 (http://forum.doom9.org/showthread.php?s=&threadid=53164) and AviSynth 2.5.1 RC 3.1 (http://cultact-server.novi.dk/kpo/avisynth/avs_cvs.html)
Dreassica
15th May 2003, 20:37
detail limiter - 0-255 - 30
maybe? :P
Originally posted by Defiler
I give up. I just read through the script like 10 times, and every defined parameter seems like it is used in a function that actually passes data to one of the three clips that is used for the final output. 18 "independent" parameters, 18 are defined, 18 are documented.
Can we get a hint? :)
Well actually, there are two parameters that do the same, and you can use either one of them and get the same effect :).
Originally posted by Dreassica
detail limiter - 0-255 - 30
maybe? :P
Nope :).
Defiler
15th May 2003, 20:50
Are they dboost and dstren? They seem to do essentially the same thing, one right after the other.
WyldeF1r3
15th May 2003, 21:07
I personally don't like the thinning of the lines in my anime so i try to minimize all the warping settings as much as possible, but this is definately a useful "filter".
I'm not much of a programmer, and I honest don't feel like testing to see if my guesses on redundancy are correct, but to me it seems like
detail range and detail limiter are somewhat redundant, despite having a different range of perameter values. But also wondering, will cwarp work if you omit cwarp2 (does it default to 0/1 thus enable it's typing to be redundant, perhaps making that your "obsolete")
cwarp = Default(cwarp, true) # chroma warp on/off
cwarp2 = cwarp ? 1 : 0
aWarpSharp(cm=cwarp2
you also don't ask cwarp2 to be identified in mftoon() only cwarp, yet i don't see cwarp anywhere, only cwarp2
Originally posted by Defiler
Are they dboost and dstren? They seem to do essentially the same thing, one right after the other.
You're getting close, but no.
Originally posted by WyldeF1r3
I personally don't like the thinning of the lines in my anime so i try to minimize all the warping settings as much as possible, but this is definately a useful "filter".
I'm not much of a programmer, and I honest don't feel like testing to see if my guesses on redundancy are correct, but to me it seems like
detail range and detail limiter are somewhat redundant, despite having a different range of perameter values. But also wondering, will cwarp work if you omit cwarp2 (does it default to 0/1 thus enable it's typing to be redundant, perhaps making that your "obsolete")
cwarp = Default(cwarp, true) # chroma warp on/off
cwarp2 = cwarp ? 1 : 0
aWarpSharp(cm=cwarp2
you also don't ask cwarp2 to be identified in mftoon() only cwarp, yet i don't see cwarp anywhere, only cwarp2
About the thinning: line darkening thickens the lines. Warping just puts them back at their original thickness.
And about the cwarp: nope :). cwarp is boolean, and the line you pasted converts the boolean into int. I did this because I originally didn't know there were 3 values for aWarpSharp's "cm" :o. But I left it in there cause cm=2 will usually be more crappy than cm=1 anyway.
MasterYoshidino
16th May 2003, 16:24
The thing that is unacceptable in this filter is the overall darkening of the picture, as MPEG4 tends to overcompress dark colors that are still noticeable.
It also would not be a useable one since the only accurate way to use a contrast filter is before deinterlace/decomb. Since this filter will interpolate lines, there is no way to use it there, so it is not a useable filter :rolleyes:
You can do all the sharpening you want, but as soon as I saw the bicubic resize in the script = interpolation = tough to decomb
Originally posted by MasterYoshidino
The thing that is unacceptable in this filter is the overall darkening of the picture, as MPEG4 tends to overcompress dark colors that are still noticeable.
It also would not be a useable one since the only accurate way to use a contrast filter is before deinterlace/decomb. Since this filter will interpolate lines, there is no way to use it there, so it is not a useable filter :rolleyes:
You can do all the sharpening you want, but as soon as I saw the bicubic resize in the script = interpolation = tough to decomb
Maybe you should do some more research.
A) It doesn't darken the whole picture anymore. That was fixed in v0.30.
B) What you say only applies to lumi-masking.
C) You can simply turn off the interpolated sharpening, just do sharpen=false.
D) You should never use these kind of filters on interlaced material, except if it has support for it.
Kurosu
16th May 2003, 17:42
1) People tend to overlook your strength at hiding this obsolete parameter while looking for it, isn't it ? :D
2) Levels(0, 1, 255, 255, 0) = Invert(Y=3,U=2,V=2) from my filters's package, AFAIK. But it might be slower...
3) There could be smarter edge detectors than "sobel", especially if they only detect dark lines. But that's would be of little help anyway.
Originally posted by Kurosu
1) People tend to overlook your strength at hiding this obsolete parameter while looking for it, isn't it ? :D
Even at the last moment, seconds before uploading it to my webspace, I had to look twice to notice it, and it had been there all that time :D.
2) Levels(0, 1, 255, 255, 0) = Invert(Y=3,U=2,V=2) from my filters's package, AFAIK. But it might be slower...
3) There could be smarter edge detectors than "sobel", especially if they only detect dark lines. But that's would be of little help anyway.
Invert says it only runs on YV12, and I found sobel to work the best for me.
Kurosu
16th May 2003, 18:14
Invert says it only runs on YV12
Nevermind, then; I didn't check the colorspace.
MasterYoshidino
18th May 2003, 07:05
:) looks allrite with the newer versions. (did not look around lol)
but I could always do a chain SmartSmooth to emphasize edges. ;)
SmoothHiQ(5,8,16,256,6).SmoothHiQ(5,8,16,256,6).SmoothHiQ(3,8,16,256,4).SmoothHiQ(3,8,16,256,4)
lol, makes them ****** PinkPineapple DVD's look nice and focused
:p
Originally posted by MasterYoshidino
:) looks allrite with the newer versions. (did not look around lol)
but I could always do a chain SmartSmooth to emphasize edges. ;)
SmoothHiQ(5,8,16,256,6).SmoothHiQ(5,8,16,256,6).SmoothHiQ(3,8,16,256,4).SmoothHiQ(3,8,16,256,4)
lol, makes them ****** PinkPineapple DVD's look nice and focused
:p
Nice, however clearly beside the point. mfToon darkens lines. SSHiQ doesn't.
BoNz1
23rd May 2003, 20:30
Just a quick question for you mf or actually maybe not so quick. Ok, so I have been trying to modify mftoon to work for a dvdrip but I can only seem to get it to work one way. Here is my script:
LoadPlugin("C:\Video\Avisynth Plugins\MPEG2Dec3.dll")
LoadPlugin("C:\Video\Avisynth Plugins\Decomb.dll")
Import("C:\Video\Avisynth Plugins\mfToon-v0.32.avs")
MPEG2Source("C:\DVD\VIDEO_TS\DVD.d2v",idct=5,cpu=2)
Telecide(post=false).Decimate(5).FieldDeinterlace(full=false)
crop(12,2,704,476)
mfToon(sharpen=false,cwarp=false,ssw=3,ssh=3)
BicubicResize(640,480,0,0.5)
But, if I do it this way this means that I am resizing three times, first to supersample it and then to resize again to do mergeluma() and then again after mfToon(), I can get mfToon to work like this if I eliminate mergeluma() but I would like use it and also only resize it twice. Is there any way that you can think of to do this? I have been trying for quite a while now and I can't seem to figure it out. I don't think there will be any loss in quality by resizing three times like this but definitely it will slow it down. I guess, the real problem is that the frame size for mergeluma() must be the same so if I change orig.width and orig.height to 640 and 480 respectively everywhere obviously it doesn't work, I guess I could also resize to 640x480 before the first mergeluma() but then I still have to resize three times. Maybe you or someone else can think of a way around this since I can't seem to. :)
EDIT: Don't bother actually, I made my own script and stole some of the routines you used in mfToon, seems just as good since the source is fairly clean plus it is a lot faster ;)
zeus163
24th May 2003, 03:45
Cool. Now that I have Avisynth 2.5.1 working on my machine, I want to play around with this. I created a script that CCE accepted, but when I hit decode it thinks about it for about 5 seconds and then it thinks it's done. Of course, nothing has been produced except a small file that doesn't amount to anything.
I noticed that somebody had shown some screen shots of Naruto. I wonder if the original source files were .avi files (fansubbed divx files). Does mftoon work with these type of files?
I'm sure the answer is right in front of me and I'm missing something.
thanks.
YAY! Feedback! ^__^
Bonzi: You have sharpen=false set, so the resizing routines are left alone. mfToon isn't resizing with sharpen=false set. So ssw and ssh have no influence either. And warping isn't done either, so cwarp is ignored too, in this mode.
Zeus: I don't know for sure, but I think CCE only eats YUY2. Try putting ConvertToYUY2() at the end of your script.
zeus163
24th May 2003, 16:30
@mf
adding the convert worked like a charm. I never had to do that with 2.0.8 and CCE. I just modified my 2.0.8 (simple .avi script) and had to add the convert to get that to work it. So, that must be it!
thanks.
digitize
24th May 2003, 17:58
@zeus163
You never had to do that with 2.08 b/c 2.08 works in yuy2 color space, 2.5 is in yv12.
zeus163
24th May 2003, 18:02
Ahh....Thanks. I appreciate you letting me know that.
I encoded a 1 minute segment and it took about 25 minutes (just did a CBR) and will burn it to a DVD+RW and check it out later on the TV to see if I like the results. If they are promising, then I don't mind the extra time involved.
Thanks for all your answers and help! I appreciate it.
I appreciate you guys' feedback too. Thanks everyone.
digitize
25th May 2003, 04:55
@zeus163 No problem.
@mf Thanks for the filter ^^.
Originally posted by digitize
@mf Thanks for the filter ^^.
Yeahyeah I know, you want that new version huh :p.
crusty
27th May 2003, 19:34
Import("mfToon-v0.32.avs")
AVISource/MPEG2Source/WhateverSource("file")
mfToon()
I like the 'WhateverSource' part....can we have a function like that in avisynth please?:D :D :D
onisama
13th June 2003, 20:46
When I try to run this script I get an avisynth open failure message. It says awarpsharp is not an avisynth 1.0 plugin, I am using avisynth 2.07.
Here is my script:
LoadPlugin("C:\Program Files\DVD2SVCD\Avisynth2 Plugins\awarpsharp\aWarpSharp.dll")
LoadPlugin("C:\Program Files\DVD2SVCD\Avisynth2 Plugins\masktools\MaskTools.dll")
LoadPlugin("C:\Program Files\DVD2SVCD\Avisynth2 Plugins\WarpSharp.dll")
Import("C:\DOCUME~1\BadAss\Desktop\dvdtemp\BATTLE~1\ep7\RESAMP~1.AVS")
Import("mfToon-v0.32.avs")
LoadPlugin("C:\PROGRA~1\DVD2SVCD\AVISYN~1\Mpeg2dec\MPEG2D~1.DLL")
UnalignedSplice(mpeg2source("C:\Documents and Settings\BadAss\Desktop\dvdtemp\Battle Athletes\ep7\New Folder\d2v\intro.D2V"),mpeg2source("C:\Documents and Settings\BadAss\Desktop\dvdtemp\Battle Athletes\ep7\New Folder\d2v\ep7.D2V"),mpeg2source("C:\Documents and Settings\BadAss\Desktop\dvdtemp\Battle Athletes\ep7\New Folder\d2v\ending.D2V"),mpeg2source("C:\Documents and Settings\BadAss\Desktop\dvdtemp\Battle Athletes\ep7\New Folder\d2v\preview.D2V"))
LoadPlugin("C:\Program Files\DVD2SVCD\InverseTelecine\Donald Graft\Decomb.dll")
Telecide(guide=1,gthresh=50,chroma=true,threshold=30)
Decimate(cycle=5)
mfToon()
BicubicResize(480,480,0.0,0.6)
ResampleAudio(44100)
lamer_de
14th June 2003, 09:27
aWarpSharp - a WarpSharpenning filter for Avisynth 2.5 - beta 1
Update to avisynth 2.5.x and it will work.
CU,
lamer_de
Originally posted by onisama
LoadPlugin("C:\Program Files\DVD2SVCD\InverseTelecine\Donald Graft\Decomb.dll")Eeks! And there I was thinking I was typing much with my LoadPlugin("D:\Video\AVISynth\AVISynth\Filter.dll") lines - you sort them to category and author! ~__~
I found a problem.
The difference in the ascript is just mftoon()
Note, the screenshot is cropped.
Original (http://web.ics.purdue.edu/~yaok/ori.PNG)
MfToon (http://web.ics.purdue.edu/~yaok/mftoon.PNG)
Kurosu
18th June 2003, 08:26
Play a bit with the thresholds, or rather, clean your source *first* with a spatial denoiser (deen, convolution3D and mipsmooth come to mind), in order not to sharpen/filter the compression noise. I see as first purpose for mftoon to sharpen edges that are already sharp. Furthermore, if you don't see it when it's played at (was: in) realtime speed, then it's not there (unless you want to squeeze some more compressibility).
Note: it may be a filter bug (not really in mftoon), but still, I think the result would more representative if you applied the much needed spatial smoother.
1) This source doesn't need mfToon. The lines are dark enough. If you want to sharpen anyway, try this:
ssxshref = last
ssxshref.LanczosResize(ssxshref.width*4, ssxshref.height*4)
XSharpen(255, 255)
LanczosResize(ssxshref.width, ssxshref.height)
aWarpSharp()
2) Kurosu is right. The artifacts you are seeing are a known issue on noisy sources.
I have a new version.. I actually wanted to make a "proper" version, but as I'm leaving for holidays tomorrow (and don't have time to script avisynth in the mean time[then why the hell do I have time to post on doom9]), I can't create that version. Instead, I have a intermediate version for all you experienced anime encoders that are breaking their heads over the "emboss artifact" of mfToon v0.3x :D.
Get it at mf's AVS dumpster (http://nabeshin.ddo.jp/avisynth/) :D. As you can see there's also some other crap in there, so leech at your pleasure.
Now why is this an intermediate version? Cause it's locked at 640x480 (or 768x576), unless you use your l33t AVS scripting skills on it and adapt it for another res (don't forget to update ssw and ssh if you do!). I was getting errors when making it dynamic, (and there was an important encode deadline I had to keep :D) so I just left it at this.
When I get back I hope to create a better version.
Happy summer everyone! :)
Duncan_07
6th August 2003, 13:22
Hi all.
I tried mfToon v0.32, but it crash my system during te first pass.
"Out of system ressource".
I haven't try others version of mftoons because the resolution of the video is not 640x480.
Someone have tips on that ?
Thinks.
Jedd
15th August 2003, 05:34
Hi,
I was playing around with mfToon and I have to say it works great when it comes to edging:
source (http://webpages.charter.net/jedd/ORIG.png)
no mfToon (Dean, TemporalCleaner): (http://webpages.charter.net/jedd/NO_MF.png)
mfToon (Dean, TemporalCleaner) (http://webpages.charter.net/jedd/MF.png)
As you can see without mfToon original source and compressed one look almost identical (~1000kbps here). After mfToon get involved picture became much more alive and warm, BUT - check all those blocks on background and artifacts around bed edges. :scared:
Now, I wonder, is it possible to use mfToon and keep blocks and artifacts at normal level?
:stupid:
P.S. I was using 0.32, 0.4 complains "Unrecognized Exception! line 106"( BlankClip(greymask, color=$FFFFFF) ??) even with avisynth-that-works-with-mftoon.dll renamed and put into system32.
mf
15th August 2003, 10:45
Originally posted by Jedd
P.S. I was using 0.32, 0.4 complains "Unrecognized Exception! line 106"( BlankClip(greymask, color=$FFFFFF) ??) even with avisynth-that-works-with-mftoon.dll renamed and put into system32.
Please make sure the input mfToon is getting is YV12, and your script is fault-free, and try removing Temporalcleaner. I have found that whenever I get an unrecognized exception with a release mfToon (that means not a new version I'm still working on), it is one of those. For some evil reason, mfToon often conflicts with filters like Convolution3D. I've been thinking of getting an avisynth dev to look into that, since mfToon is 100% scripted, so any scripting errors should come out as parse errors, and the rest of the faults can only be caused by avisynth itself, its filters, or your environment (I've had cases where something would work on one system and the same script would give some error on another).
Hope this helps, and thanks for using mfToon :).
Jedd
15th August 2003, 16:30
mf
I found the problem, I had a crop to 698. When I have changed it to 696 I managed to load 0.4 (doesnt really explain why 0.32 works fine with 698)
And I have to say .4 looks like a great improvement over .32
Check this out:
mfToon.32 + Deen().TC() (http://webpages.charter.net/jedd/f2_mf_32_dt.avi)
mfToon.4 + Deen().TC() (http://webpages.charter.net/jedd/f2_mf_4_dt.avi)
But Deen().TC() is a must here to get rid of blocks and warps.
Plain mfToon.4 (http://webpages.charter.net/jedd/f2_mf_4.avi)
Right now my script is as simple as this:
LoadPlugin("C:\Media\Plugins\warpsharp.dll")
LoadPlugin("C:\Media\Plugins\aWarpSharp.dll")
LoadPlugin("C:\Media\Plugins\MaskTools.dll")
LoadPlugin("C:\Media\Plugins\deen.dll")
LoadPlugin("C:\Media\Plugins\TemporalCleaner.dll")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("decomb.dll")
Import("C:\Media\mfToon-v0.4.avs")
mpeg2source("C:\Media\DVD\slt_a.d2v")
Telecide(guide=1).Decimate(5)
crop(12,0,696,480)
mfToon()
Deen("a2d",5,5,10).TemporalCleaner(4,6)
What else can be done here? Maybe some dup()? And I can't really decide - should I resize 696x480 to 640x480 or not...
mf
15th August 2003, 17:53
Originally posted by Jedd
What else can be done here? Maybe some dup()? And I can't really decide - should I resize 696x480 to 640x480 or not...
Your source seems pretty clean, try raising deen's temporal influence with steps of 10 at a time until you're satisfied. That should also remove the need for temporalcleaner (it has a tendency to ghost, so I would disrecommend it). Avoid Dup at all costs.
Jedd
19th August 2003, 01:03
Originally posted by mf
Your source seems pretty clean, try raising deen's temporal influence with steps of 10 at a time until you're satisfied. That should also remove the need for temporalcleaner (it has a tendency to ghost, so I would disrecommend it).
You mean like Deen("a2d",7,5,10,10), Deen("a2d",7,5,10,20), Deen("a2d",7,5,10,30) etc.? Don't really see any difference between 10 and 50. :confused:
I have tried almost all combinations, but the only way to reduce blockiness is to use TemporalCleaner.
mf
19th August 2003, 10:30
Originally posted by Jedd
You mean like Deen("a2d",7,5,10,10), Deen("a2d",7,5,10,20), Deen("a2d",7,5,10,30) etc.? Don't really see any difference between 10 and 50. :confused:
I have tried almost all combinations, but the only way to reduce blockiness is to use TemporalCleaner.
Err, a2d doesn't have temporal influence. Try a3d.
killerhis
19th August 2003, 17:07
yo mf.... I really like these new versions of mftoon (0.4 and 0.4-768) but I still get some artifacts on all my encodes.... The collors looks like to be darken and then light again and changing all the time. When I remove mftoon the artifacts disapere. If I use version 0.32 I also lose the artifacts.. but it ain't that good as the new versions.
Here I got a previeuw.. compare them and look especally at the monitor.. you'll see that the collor changes a bit from dark to light and again.
So anyone know how to fix it or mf... when will the new version be done :D
http://home.hccnet.nl/h.chourak/clip(original).avi
http://home.hccnet.nl/h.chourak/clip(remasterd).avi
killingspree
20th August 2003, 10:38
hi @ll
since i just had a bit of a hard time to find masktools, here's a new link to kurosu's download page:
http://kurosu.inforezo.org/avs/MaskTools/index.html
furthermore i've asked kurosu if it's ok for him to put masktools on warpenterprises filter collection and since he has given his ok, i'm going to PM warpenterprises now and ask him to upload the piece so hopefully you can soon find all filters there :)
steVe
mf
20th August 2003, 11:33
@killerhis
The only source of your problem that I can see, is the anime being analogue which always has some annoying fluctuations.. It might be mfToon enhancing them. Some further denoising might fix it. And about the new version: I'm off-schedule with anime encoding and I really need to catch up with some other things, so I'm a bit busy right now.
killerhis
20th August 2003, 12:31
@mf
I've been jusing the values: mftoon(sharpen=false).awarpsharp(cm=1)
I get the same result on clean sources, like blue submarine, but I'll try the heavier denoising.. and it's to bad to hear new mftoon is delayed for a while
:mad:
/[edit] heavy denoising, not much effect: VegueDenoiser(threshold=32,method=1,nsteps=7,chroma=true)
Kurosu
20th August 2003, 12:45
Originally posted by killingspree
hi @ll
since i just had a bit of a hard time to find masktools, here's a new link to kurosu's download page:
http://kurosu.inforezo.org/avs/MaskTools/index.html
That's the page that was not adapted in a long time. MaskTools is one of the filter for which I've pretty much dropped support, and only update for my own purpose.
An actual link would be http://kurosu.inforezo.org/avs/MaskTools/MaskTools1.4.zip
killingspree
20th August 2003, 12:55
thanks for the info
hmm i guess i must have gotten the oldest version possible :) -0.1
no wonder mftoon then is soooo slow... it took me 12 hours to do the first pass of a 40 min anime :D
steVe
mf
20th August 2003, 13:16
Originally posted by killerhis
/[edit] heavy denoising, not much effect: VegueDenoiser(threshold=32,method=1,nsteps=7,chroma=true)
Isn't VagueDenoiser 2D ? Luma fluctuations are temporal, so you need at least a 3D denoiser.
Jedd
20th August 2003, 14:55
Originally posted by killerhis
The collors looks like to be darken and then light again and changing all the time. When I remove mftoon the artifacts disapere. If I use version 0.32 I also lose the artifacts..
killerhis,
I had absolutely the same problem after using mfToon 0.4. So I made 40 frames span and started to apply Deen() filter with all kind of parameters. After making about two dozen clips I opened em up in the VirtualDub and sorted out all with too much blocks, warps and blinks.
Deen("a3d",3,10,12,20) have worked best for me.
The only downside - expect another 12 hours of encoding. :sly:
Kurosu
20th August 2003, 14:55
Originally posted by killingspree
no wonder mftoon then is soooo slow... it took me 12 hours to do the first pass of a 40 min anime :D
The filter is really slow, particularly because of upsampled operations. Then there is various colorspaces conversions and the like. MaskTools1.4 has a rewritten mfToon version that avoid most of them. AFAIK, it was around 3 times faster without upsampling, but was outputting images a bit different. Anyway, the purpose wasn't to produce a faster mfToon, but rather to show how it could be rewritten for a close result.
killingspree
20th August 2003, 21:23
first of allm, the result of the last 24 hours of encoding are simply amazing... the quality is simply soo much better :)
anyway, as i was still using masktools 0.1 i decided to try again with masktools 1.4 from the zip file kurosu linked to just above.
unfortunately, when loading exactly the same script into vdubmod as before i get the following error:
Script error: invalid arguments to function "EdgeMask"
(h:\folder\mftoon-0.4.avs,line 91)
(h:\folder\main.avs, line 13)
here's the original script which worked with 0.1 but didn't work with 1.4! i guess it could use some major tweaking too :)
btw, i'm dealing with a relative clean PAL source which is already encoded at a fairly low bitrate though. the vobs just span 1.3 Gigs. my encoding bitrate is fairly high too as i do not have anything else to put on the cd. so i'm going for 2410 kbps and a 192 kbit mp3 soundtrack...
Loadplugin("c:\programme\avisynth 2.5\plugins\awarpsharp.dll")
loadplugin("h:\f102\video_ts\warpsharp.dll")
Loadplugin("c:\programme\avisynth 2.5\plugins\masktools.dll")
import("h:\f102\video_ts\mftoon-v0.4.avs")
mpeg2source("H:\F102\VIDEO_TS\main.d2v")
FieldDeinterlace(blend=false)
crop(14,8,694,568)
BicubicResize(608,464,0,0.5)
MfToon()
Deen("a2d",5,5,10)
TemporalCleaner(4,6)
BicubicResize(608,464,0,0.5)
thanks for any help
steVe
Kurosu
20th August 2003, 23:53
NoOoOo, don't force me to look for a bug / compare old and new syntaxes >.<
Besides, webhost is done *sigh*
mf
21st August 2003, 11:08
Originally posted by Kurosu
NoOoOo, don't force me to look for a bug / compare old and new syntaxes >.<
Using fixed params pays off? :D
Kurosu
21st August 2003, 22:00
Originally posted by mf
Using fixed params pays off? :D
It would but EdgeMask has changed too much. It should now read:
orig.EdgeMask(thY1=0, thY2=255, type="sobel")
(maybe add U=-128, V=-128, but chroma shouldN'T matter) [EDIT]
instead of:
orig.EdgeMask(0, "sobel")
1) EdgeMask(th1=[0..255],th2=[0..255],string):
Component is either Y, U or V; derivative is the result of the convolution
by the differential kernel. MMX code is only used with MOD8 width (might
not be necessary).
- string: which differential convolution to use:
. "line" will try to spot darker thin (1 pixel-wide) lines in the
picture (it has an incorporated anti-noise floor which makes it ignore
any variation lower than 3)
. "roberts" will apply a pseudo-Roberts 2x2 kernel:
2 -1
-1 0
. "sobel" will apply a pseudo-Sobel 3x3 kernel:
0 -1 0
-1 0 1
0 1 0
. "hq" uses a Laplacian kernel:
-1 -1 -1
-1 8 -1
-1 -1 -1
. "special" uses this kernel:
. "cartoon" uses the pseudo-Sobel kernel but only keeps components with
lower value than their neighbours (i.e. negative values of the
derivative)
- th1: threshold under which component value is set to 0
- th2: threshold under which component value is set to the derivative
value, and over which it's set to 255
(notice how it was edited in a hurry and almost left out as is)
mf
22nd August 2003, 11:34
The cartoon mode is interesting, from what I read of it it only catches two-sided edges (lines)?
Kurosu
22nd August 2003, 12:54
Well, in a cartoon/anime line, there are 2 edges; consider this line of pixels:
... 167 167 167 34 34 34 167 167 167...
a basic derivative line is (kernel -1 2 -1):
... ? 0 33 -33 0 -33 33 0 ? ...
2 edges are therefore seen.
The cartoon mode simply returns:
... ? 0 0 33 0 33 0 0 ? ...
and now the edges are located on the pixels that are the "darker" (only valid in luma plane, you can produce other masks on other plane with other derivative types). It therefore produces less "false" positives regarding the lines in a cartoon image. But it can have its drawback, and the fact that you Inflate() the edgemask should mean you aren't looking for that effect.
Another possibility could be to only mark as edges pixels that are dark (not darker, like 224 compared to 240, which are both bright), but it would mainly produce artifacts due to thresholding (that's why I introduced 2 thresholds to allow direct manipulation without tweaking with levels()).
One last point: there are now 2 means to increase/decrease areas. I don't remember which is which, but:
- one takes the maximum/minimum value in the 3x3 neighbourhood
- another calculates the average (center pixel not included) of such neighboorhoud, and replace it when it's higher/lower than the original value
Most of them would benefit a lot from iSSE optimizations (over simple MMX as of now) but they weren't worth the developping time needed for my sole purpose.
mf
22nd August 2003, 16:09
Originally posted by Kurosu
The cartoon mode simply returns:
... ? 0 0 33 0 33 0 0 ? ...
and now the edges are located on the pixels that are the "darker" (only valid in luma plane, you can produce other masks on other plane with other derivative types). It therefore produces less "false" positives regarding the lines in a cartoon image. But it can have its drawback, and the fact that you Inflate() the edgemask should mean you aren't looking for that effect.
I inflate because the edgemask I get is very dim and small values are 1) easily lost and 2) will not give very much effect when applying the actual line darkening effect. mfToon is "safe" in the sense that applying it to a greater area than only the line itself will not be seen. So with my inflated and amplified mask, I'm sure that all lines will get caught and get a good line darkening effect (slight lines deserve just as much darkening as thick lines). The only trouble is that EdgeMask also catches "single" edges, like the edge of cel shading (a line has edges on both sides of it, shading has only a single edge). That is the only real drawback it has (and it darkens black-outlined OP credits, but that's barely noticable and perfectly within its function specification. It darkens black lines :D).
alucard83
24th August 2003, 01:28
Damn, I need aWarpsharp but the link is broken I believe and it links me to some dating(?) site. Is there anywhere else that hosts it?
MajinMarc
3rd September 2003, 01:10
Error in script?
I recently tried using the params for mftoon in my script. it was always unable to load the preview if I used params and if I tried to encode vdubmod's status window never popped up and my computer lagged horribly. I was wondering if maybe this is a result of my using params that are too high, or did I make an error in my script.
SetWorkingDir("C:\Documents and Settings\Marc\My Documents\My Downloads\Encoder\filters")
LoadPlugin("Warpsharp.dll")
LoadPlugin("awarpsharp.dll")
LoadPlugin("MaskTools.dll")
AVIsource("C:\PICCOLO_JR_SAGA2_DISC2\VIDEO_TS\english2.avi")
Import("mfToon-v0.32.avs")
mfToon(strength=100,wdepth=25.0,wblur=10,wthresh=0.7,ssw=25,ssh=25)
Thank you for your time.
pcsoul
3rd September 2003, 03:37
it is so slooooooooooooooow...
2 fps @ P IV 2.4C + Asus 865PE + DDR 400 (Dual Channel) With mfToon 0.32
cry...
who can help me?
alucard83
3rd September 2003, 04:50
k, I loaded my script into Vdub and I immediately got an error:
AviSynth open failure:
Script Error: there is no function named "EdgeMask"
(G:\mfToon-0.32.avs, line 75)
(G:\Rurouni Kenshin(DVD1)\ep5.avs, line 23)
It seems it cannot recognize the function in the mfToon script itself
Here's my script
SetWorkingDir("C:\PROGRA~1\GORDIA~1\")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("decomb.dll")
LoadPlugin("UnDot.dll")
LoadPlugin("WarpSharp.dll")
LoadPlugin("Convolution3DYV12.dll")
LoadPlugin("SmoothDeinterlacer.dll")
LoadPlugin("UnFilter.dll")
Import("G:\mfToon-v0.32.avs")
mpeg2source("G:\Rurouni Kenshin(DVD1)\ep4.d2v")
#IVTC
Telecide(guide=1,gthresh=50,chroma=true,threshold=30)
Decimate(cycle=5)
#DEINTERLACE
ConvertToYUY2().SmoothDeinterlace()
#FILTERS
mfToon()
Convolution3d("AnimeLQ").Temporalsoften(4,4,8,mode=2,scenechange=8)
UnFilter(0,0)
UnDot()
Can someone tell me what I'm doing wrong? I've tried to open it in vdub v1.5.4 as well as the latest version of vdubmod and I get the same error
I'm fairly new to AviSynth so plz bear with me:)
pcsoul
3rd September 2003, 04:55
Originally posted by alucard83
k, I loaded my script into Vdub and I immediately got an error:
AviSynth open failure:
Script Error: there is no function named "EdgeMask"
(G:\mfToon-0.32.avs, line 75)
(G:\Rurouni Kenshin(DVD1)\ep5.avs, line 23)
It seems it cannot recognize the function in the mfToon script itself
Here's my script
SetWorkingDir("C:\PROGRA~1\GORDIA~1\")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("decomb.dll")
LoadPlugin("UnDot.dll")
LoadPlugin("WarpSharp.dll")
LoadPlugin("Convolution3DYV12.dll")
LoadPlugin("SmoothDeinterlacer.dll")
LoadPlugin("UnFilter.dll")
Import("G:\mfToon-v0.32.avs")
mpeg2source("G:\Rurouni Kenshin(DVD1)\ep4.d2v")
#IVTC
Telecide(guide=1,gthresh=50,chroma=true,threshold=30)
Decimate(cycle=5)
#DEINTERLACE
ConvertToYUY2().SmoothDeinterlace()
#FILTERS
mfToon()
Convolution3d("AnimeLQ").Temporalsoften(4,4,8,mode=2,scenechange=8)
UnFilter(0,0)
UnDot()
Can someone tell me what I'm doing wrong? I've tried to open it in vdub v1.5.4 as well as the latest version of vdubmod and I get the same error
I'm fairly new to AviSynth so plz bear with me:)
try to edit mfToon-0.32.avs,find orig.EdgeMask(0, 255, "sobel"),use orig.EdgeMask(thY1=0, thY2=255, type="sobel")
mf
3rd September 2003, 11:33
I'll put up a new AVS dumpster with all necessary filters soon. Hang on.
alucard83
3rd September 2003, 19:18
Thnx pcsoul I'll try that
Update*: It's a no go:( :mad:
pcsoul
4th September 2003, 01:40
Originally posted by mf
I'll put up a new AVS dumpster with all necessary filters soon. Hang on.
good news!!!
mf
10th September 2003, 09:59
Originally posted by mf
I'll put up a new AVS dumpster with all necessary filters soon. Hang on.
And here it is (http://mf.creations.nl/avs/). Cheers! :)
alucard83
10th September 2003, 13:26
Schwanky!
mf
11th September 2003, 21:22
OMG, I am such a 馬鹿!! (baka)
I was defining "width" twice, instead of defining "width", and "height", once. So that's why it wasn't working. Trivial, trivial, trivial. mfToon v0.41 (http://mf.creations.nl/avs/functions/mfToon-v0.41.avs) is out, and it finally supports target width and height properly. Thanks to superdump for motivating me to look at it again, so I could finally find the flaw. Anyway, have fun. :)
lamer_de
14th September 2003, 16:05
Hi all.
I adapted the script kurosu provided with his MaskTools to mfToon 0.4.1. It runs around 10% faster on my system and with my usual scripts. I don't see any difference to the original mfToon 0.4.1 besides the speed increase, but kurosu stated that there's up to 5% difference in the edgde mask, so use at your own risk ;)
EDIT:
hmm, somewhere I f*cked it up, but nobody complained, so I guess nobody usedit anyway :P
CU,
lamer_de
NightMare
16th September 2003, 19:59
hey mf
i found mfToon-v0.42.avs at your site
whats new in that
mf
16th September 2003, 20:05
Sorry lamer_de, I haven't switched to the latest MaskTools yet, BUT I do have a new version, with some lame new features.
Here they are:
Horizontal/vertical sharpening: If you need less sharpening in either the horizontal or vertical direction, you can use these two parameters. Minimal value is 1 (meaning 100% sharpening), maximum is the same as you set your ssw/ssh to, so if you set it to 4 while ssw/ssh is 4, you will have 0% sharpening (example: mfToon(hsharp=1, vsharp=4) will sharpen only horizontally).
Show: Darkened lines are emphasized in purple, or any other color you choose with scolor.
Debug: Show some lame text, and optionally show any of the processing stages (example: mfToon(debug=true, dclip="sharp2") will show the unsharp masked image).
It's here (http://mf.creations.nl/avs/functions/mfToon-v0.42.avs).
Edit:
Originally posted by NightMare
hey mf
i found mfToon-v0.42.avs at your site
whats new in that
Damn you're too fast, I was busy with updating :p.
Chainmax
21st September 2003, 19:44
Is there any chance that mfToon becomes an actual DLL-based filter? Maybe you could grab the source of all the filters it uses and (with the permission of the original filter authors, of course) implement all the individual things you use from those filters in a single DLL. That would probably make it easier to upgrade/update mfToon, right?
Not that I'm complanining, though. mfToon is perfect right now, I'd just prefer to handle a DLL rather than a script.
OBcecado
22nd September 2003, 01:10
Hi, just to warn that awarpsharp's link (http://ziquash.chez.tiscali.fr/aWarpSharp%20beta%201.zip) is broken.
All the best.
Zarxrax
22nd September 2003, 05:06
I just tried mfToon, but it crashes vdubmod whenever I load the avs file using it! :confused:
I'm only interested in seeing the line darkening...
mf
22nd September 2003, 11:22
Originally posted by Chainmax
Is there any chance that mfToon becomes an actual DLL-based filter? Maybe you could grab the source of all the filters it uses and (with the permission of the original filter authors, of course) implement all the individual things you use from those filters in a single DLL. That would probably make it easier to upgrade/update mfToon, right?
Not that I'm complanining, though. mfToon is perfect right now, I'd just prefer to handle a DLL rather than a script.
I would, if I could code...
Originally posted by Zarxrax
I just tried mfToon, but it crashes vdubmod whenever I load the avs file using it! :confused:
I'm only interested in seeing the line darkening...
See this thread (http://forum.doom9.org/showthread.php?s=&threadid=61689). The problem seems to come from mfToon's complexity, and maybe accumulating bugs or something. Afaik my script is errorfree, so the problem has to lie in AVISynth.
Chainmax
22nd September 2003, 17:36
Originally posted by mf:
quote:
--------------------------------------------------------------------------------
Originally posted by Chainmax
Is there any chance that mfToon becomes an actual DLL-based filter? Maybe you could grab the source of all the filters it uses and (with the permission of the original filter authors, of course) implement all the individual things you use from those filters in a single DLL. That would probably make it easier to upgrade/update mfToon, right?
Not that I'm complanining, though. mfToon is perfect right now, I'd just prefer to handle a DLL rather than a script.
--------------------------------------------------------------------------------
I would, if I could code...
Maybe you could ask some of the other pros here to help you. You could always make new releases as avs scripts and let other people make DLLs out of them.
mf
22nd September 2003, 18:08
Originally posted by Chainmax
Maybe you could ask some of the other pros here to help you. You could always make new releases as avs scripts and let other people make DLLs out of them.
Coding bitches are hard to find. Nobody has responded to my call for a coder for the best media player ever, either (it's in my sig).
qwerpoi
22nd September 2003, 18:18
Actually, I don't see what's the problem in keeping it a function. Functions can autoload just as easily as dlls, just keep a text file in your plugins directory called "functions.avsi" and paste any number of functions in there (just be sure none of your functions have any syntax errors :) ). Unless there is some kind of significant speed increase to talk about when converting a function into a dll, I think functions are more appropriate for things like mftoon which exclusively uses existing filters.
mf
22nd September 2003, 19:39
1: There is significant speed to be gained if everything was in YV12.
2: Parsing mfToon causes great instability to AVISynth
3: There might be some nice things optimizable.
Zarxrax
23rd September 2003, 22:01
mf: I believe I may have found some insight on the crashing of mftoon. Ever since I installed the warpsharp.dll that mftoon requires, avisynth has been acting EXTREMELY unstable in all areas. Just removing this filter from my plugins folder, avisynth is back to normal and functioning great. What is this warpsharp.dll used for in mftoon? Is it possible to use some other filter in place of it, or not use it at all?
stickboy
23rd September 2003, 23:13
Which version of warpsharp.dll are you using? Where did you get it from?
Zarxrax
24th September 2003, 01:58
I downloaded the one at the beginning of this thread.
qwerpoi
24th September 2003, 04:53
Unless I'm mistaken, this is a known problem (see the sticky YV12 faq in this forum, question 15) with warpsharp.dll. If you want to use it without crashing, all you have to do is put the dll somewhere other than your autoloading plugins directory and load it manually. Warpsharp.dll is necessary for the XSharpen() function (I believe mftoon uses awarpsharp() to do any warp sharpening).
Zarxrax
24th September 2003, 05:51
Ah I see, mftoon actually works now ^_^
mf
24th September 2003, 11:37
Originally posted by Zarxrax
mf: I believe I may have found some insight on the crashing of mftoon. Ever since I installed the warpsharp.dll that mftoon requires, avisynth has been acting EXTREMELY unstable in all areas. Just removing this filter from my plugins folder, avisynth is back to normal and functioning great. What is this warpsharp.dll used for in mftoon? Is it possible to use some other filter in place of it, or not use it at all?
There are two versions of warpsharp. Both contain XSharpen() and WarpSharp() functions. One used to be available from the AVS 2.5 alpha download page, and the other one from the beginning of this thread. The problem with the one from the AVS 2.5 alpha page, is that it causes jagged edges on full strength (http://forum.doom9.org/showthread.php?s=&threadid=46612&highlight=xsharpen). The one I use doesn't. Oh and btw, I never autoload plugins.
Chainmax
24th September 2003, 17:32
Originally posted by mf:
Coding bitches are hard to find.
They'll surely be if you call them like that :sly:. Plus, it's not like they'd have to code everything from scratch, but rather sew code bits together. I'd guess the workload would be lower that way.
mf
24th September 2003, 18:56
Originally posted by Chainmax
They'll surely be if you call them like that :sly:. Plus, it's not like they'd have to code everything from scratch, but rather sew code bits together. I'd guess the workload would be lower that way.
It's just a joke to call them like that ;). It's usually very fun for both sides to develop something with me (at least that's what they told me :D). I actually miss developing with a coder :(. But the pain of finding someone willing demotivated me so I don't usually go looking for them anymore.
Chainmax
25th September 2003, 00:34
Oh well, never mind. mfToon is awesome anyway, so I'll get my head out of my ass and learn how to use it.
Chainmax
25th September 2003, 22:24
A couple of questions:
1) If the video needs denoising, are the C3D calls in mfToon good enough or should I use something extra?
2) Does it perform better before or after IVTC/Deinterlace filters?
mf
26th September 2003, 11:33
Originally posted by Chainmax
A couple of questions:
1) If the video needs denoising, are the C3D calls in mfToon good enough or should I use something extra?
2) Does it perform better before or after IVTC/Deinterlace filters?
1) C3D? Where? I don't see it anywhere.
2) After.
Chainmax
26th September 2003, 20:06
from the 8th post in the second page of the other mfToon thread:
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
(emphasis mine).
One more question: since mfToon works better after IVTC/Deinterlace filters, I assume it works better after filters like Dust and GuavaComb too?
digitize
27th September 2003, 15:34
well one would not want to amplify noise now would they ;) (i.e. cleaning the source is reccomended before using mftoon).
mf
27th September 2003, 17:42
Originally posted by Chainmax
from the 8th post in the second page of the other mfToon thread:
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
(emphasis mine).
One more question: since mfToon works better after IVTC/Deinterlace filters, I assume it works better after filters like Dust and GuavaComb too?
That's an old version I no longer support. Why would you even ask a question about something that I removed in later versions?
Chainmax
28th September 2003, 19:42
That was removed? Sorry, my bad :o.
clima
30th September 2003, 13:47
I have tried to use this filter but I can't succeed to make it work :/
[code]
with mfToon-v0.42.avs and the 3 dlls provided on mf's website
Avisynth open failure:
Evaluate: Unrecognized exception!
(C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.42.avs, line 115) <--- line 115 : .XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
(I:\DVD\anime.avs, line 135) <--- line 135 : mfToon()
with mfToon-v0.32.avs and the 3 dlls provided on mf's website
Avisynth open failure:
Evaluate: Unrecognized exception!
(C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.32.avs, line 86) <--- line 115 : .XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
(I:\DVD\anime.avs, line 135) <--- line 135 : mfToon()
[\code]
Here is my "configuration" :
I am using the last avisynth (version 2.52, build: Sep 17 2003) and the last version of MPEG2Dec3.
anime.avs :
[code]
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Warpsharp\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.32.avs")
function replace(clip c, int beg, int end, int by)
{
c.trim(0,beg-1)++loop(c.trim(by,by),end-beg+1,0,0)++c.trim(end+1,0)
}
mpeg2source("I:\DVD\anime.d2v",idct=5)
Telecide(guide=1)
replace(2440,2440,2439)
replace(3045,3046,3047)
replace(3091,3091,3090)
# [...] manuel dup in order to clean scene changes (very bad telecine anime (like in Eva's DVDs...)
Decimate(5,ovr="I:\DVD\anime.dec")
Top=0
Left=8
Right=10
Bottom=0
crop(Left,Top,-Right,-Bottom)
deen("c3d", rad=1)
mfToon()
ColorYUV(levels="TV->PC")
BicubicResize(640,480,0,0.5)
undot()
limiter()
[\code]
I have been playing with avisynth but no way, I can't make it work.
Thanks for the help :)
TNM
30th September 2003, 19:24
Hi, I tried to load mfToon 0.42 but vdm just pop up "invalid arguments to function EdgeMask". Here is the script I use
loadplugin("C:\Program Files\AviSynth 2.5\plugins\mfToon\awarpsharp.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\mfToon\warpsharp.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\mfToon\masktools.dll")
avisource("avi path").killaudio()
undot()
fluxsmooth()
converttoyuy2()
peachsmoother()
textsub("subtitle path")
import("C:\Program Files\AviSynth 2.5\plugins\mfToon\mftoon_042.avs")
mftoon()
Did I do anything wrong? :confused:
EDIT: I'm sorry, this problem has been mentioned in previous pages of this thread...
mf
30th September 2003, 22:01
Originally posted by clima
with mfToon-v0.32.avs and the 3 dlls provided on mf's website
Avisynth open failure:
Evaluate: Unrecognized exception!
(C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.32.avs, line 86) <--- line 115 : .XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
(I:\DVD\anime.avs, line 135) <--- line 135 : mfToon()
Wrong :D. mfToon v0.32 has .BicubicResize(orig.width, orig.height, 0, 0.75) on line 86, and not .XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75) :p. But sorry, the problem is out of my hands. This is AVISynth behaving instably on mfToon. I have problems with it all the time too, and others as well.
Originally posted by TNM
Hi, I tried to load mfToon 0.42 but vdm just pop up "invalid arguments to function EdgeMask".
Too new version of MaskTools :D.
BBQmyNUTZ
7th October 2003, 18:44
@mf: I ran into an issue when trying out your script here (GREAT WORK by the way!).
Using Avisynth 2.5, this script worked fine:
import("D:\Program Files\AviSynth 2.5\plugins\mftoon_032.avs")
mpeg2source("c:\file.d2v")
telecide(order=1,guide=1,post=0)
decimate()
MfToon()
This script crashes Vdub completely, the avi had already been IVTC'd:
import("D:\Program Files\AviSynth 2.5\plugins\mftoon_032.avs")
OpenDMLSource("c:\file.avi")
MfToon()
I'm using the latest AVS 2.5 compatible plugins & the special package linked to in the first message of this thread.
Kai
MajinMarc
12th October 2003, 03:22
I have been doing some serious encoding testing and have found some very interesting things, Deen Rocks in Removing Video Noise, I think personally it is better than Convolution3D. Secondly I have had no Success in Making Mfoon Work with d2v files. Originally The Problem was with Decomb.dll. It would always Cause a Access Violation when used before or after mftoon. Second I fixed that error by Switching over to toms Deinterlacer and that solved the Access Violation problem. Now I seem to Be Having a Problem with it erroring out after 38% of the First Pass. This is my Script, I know it's alot of filters but the source is really bad.
SetWorkingDir("C:\filters\")
LoadPlugin("mpeg2dec3.dll")
LoadPlugin("TomsMoComp.dll")
LoadPlugin("Deen.dll")
LoadPlugin("TemporalCleaner.dll")
LoadPlugin("Msmooth.dll")
LoadPlugin("vsfilter.dll")
Import("mfToon-v0.42.avs")
mpeg2source("C:\Encode\English.d2v")
TomsMoComp(1,5,1)
mftoon()
deen("a3d",4,9,1,9).TemporalCleaner(3,3).Temporalsoften(4,8,8,mode=2,scenechange=10)
MSmooth(strength=8,highq=true)
crop(14,2,694,472)
LanczosResize(640,480)
textsub("C:\Encode\Overlay.ssa")
I did alot of testing and took out each of the filters individually trying to isolate the problem but was unsuccessful, if there is anything anyone can suggest your comments will be greatly appreciated.
mf
12th October 2003, 14:38
Sorry guys. I really don't know. Lately I don't really have that much problems with mfToon. And really, I have no idea how to fix such problems. Afaik, they're AVISynth, and not anything wrong in my filter. It's scripted, so I really can't provide much support for things like this.
NightMare
14th October 2003, 23:15
Originally posted by mf
Sorry guys. I really don't know. Lately I don't really have that much problems with mfToon. And really, I have no idea how to fix such problems. Afaik, they're AVISynth, and not anything wrong in my filter. It's scripted, so I really can't provide much support for things like this.
just a thought
maybe u should change back to Deen
mf
15th October 2003, 16:00
Originally posted by NightMare
just a thought
maybe u should change back to Deen
Change what back to Deen?
NightMare
15th October 2003, 16:13
arnt u using masktools now
back in 0.32 u used deen warpsharp and awarpsharp
in 0.42 masktools warpsharp and awarpsharp
i think masktools is the cause of all the problems
mf
15th October 2003, 19:31
Originally posted by NightMare
arnt u using masktools now
back in 0.32 u used deen warpsharp and awarpsharp
in 0.42 masktools warpsharp and awarpsharp
i think masktools is the cause of all the problems
I use masktools in ALL versions, from 0.1 onwards. :sly:
NightMare
15th October 2003, 20:59
Originally posted by mf
I use masktools in ALL versions, from 0.1 onwards. :sly:
sorry abouy that :p i didnt use the past ver ;)
so u removed deen from the new ver
mf
15th October 2003, 21:56
Originally posted by NightMare
so u removed deen from the new ver
Yah, it was pretty useless.
LB
16th October 2003, 08:14
I love your script. It really does wonders for my anime, but... I am having the same issue someone earlier in this thread had (and am curious if anyone else is having the problem too). After using the mf function, my anime now has a flicker to it. It gets lighter then darker and this repeates. The source is pretty clean. I've also tried this on other shows and get the same effect. Dark, light, dark, like. The best way I can describe it is a strobe-like effect in the distance. Any thoughts on this and ideas on how to fix it?
Malevolent
18th October 2003, 02:43
To OBcecado
...And others with troubles getting aWarpSharp:
Don't use DL managers, and the link works.
On another note, the Masktools link is broken :P
Stil available at the Warpenterprises Avisynth filter collection site.
To mf:
Nice tool, just having some quick testruns with it, since i got me some toons to encode. Keep 'em coming.
mf
18th October 2003, 06:28
Originally posted by Malevolent
To mf:
Nice tool, just having some quick testruns with it, since i got me some toons to encode. Keep 'em coming.
Coming up soon: mfToon v0.5. :)
Velsk
26th October 2003, 03:13
Originally posted by mf
Too new version of MaskTools :D.
I get the same error Script error: there is no function named EdgeMask.
Where do you get the right version of MaskTools? I got mine off of http://mf.creations.nl/avs/ and got the error, then I googled Warpenterprises AviSynth filter collection but they have the same version of the plugin.
mf
26th October 2003, 14:00
Originally posted by Velsk
I get the same error Script error: there is no function named EdgeMask.
Where do you get the right version of MaskTools? I got mine off of http://mf.creations.nl/avs/ and got the error, then I googled Warpenterprises AviSynth filter collection but they have the same version of the plugin.
Hm. Maybe your filter path is wrong and you need to use LoadPlugin.
mf
7th December 2003, 18:12
Status report on mfToon v0.5 development:
The change to YV12 was smooth, but I am totally defeated with the linemask and sharp2. I can choose between haloed proper darkening, or non-haloed weak darkening. Inflate() doesn't do anything even when chained 8 times, and enhancing the lines in the mask just seems an impossible task. Sorry guys, if anyone still wants 0.5, it'll take a while longer.
Manao
7th December 2003, 18:30
Inflate() indeed doesn't work in the latest masktools. But if your are in a binary mode ( i.e. only 0 and 255 values, working on a mask for example ), then the following will do the trick :binary.blur(0.5,0.5).Binarize(1,false,Y=3,U=3,V=3)If you are not with binary values, you can do nothing about it ( except correct the masktools, of course ). I think, if I manage to find some time, that I'll try to correct them after Christmas, because when it comes to complex scripting, there are almost unavoidable.
mf
7th December 2003, 19:09
Originally posted by Manao
If you are not with binary values, you can do nothing about it ( except correct the masktools, of course ). I think, if I manage to find some time, that I'll try to correct them after Christmas, because when it comes to complex scripting, there are almost unavoidable.
Well I don't want binary values (they're evil with masks), so it can't be helped. Of course, it could be easy to compile the old masktools with only the inflate function, and rename it to "Dilate()", so the two won't conflict. If anyone would be willing I'd be very thankful.
mf
9th December 2003, 14:11
New version: mfToon-v0.44 (http://mf.creations.nl/avs/functions/mfToon-v0.44.avs)
This is a preview version for v0.5. This release has bugs, and some filter parameters have stopped working. There should be a speed increase and the flickering bug should have been fixed. Also, hsharp and vsharp have been disabled due to the fact that it caused strange effects. Also, hsharp and vsharp have been disabled.
The version number is because v0.43 was an internal version.
I don't consider this version to be suited for normal use, but please test it to see if the flickering bug is indeed resolved. Thanks.
Chainmax
9th December 2003, 15:09
Is this based off v0.32 or 0.42? I remember reading some posts that mentioned that they experienced flickering with the latter and not with the former...
mf
9th December 2003, 15:19
Originally posted by Chainmax
Is this based off v0.32 or 0.42? I remember reading some posts that mentioned that they experienced flickering with the latter and not with the former...
It's based on 0.45, which in turn is based on 0.43, which in turn is based on 0.42 :D. I'd never go back to 0.32's inferior linemask. Currently 0.45 is a big kludge that doesn't work right. 0.45 should be the bastard child that will grow into 0.5.
Human_USB
12th December 2003, 16:41
Any updates on the new version?
mf
12th December 2003, 16:49
Originally posted by Human_USB
Any updates on the new version?
Been to busy with getting clones on IRC, making SSTMC, and doing real fansubbing :D. But still, I need that Dilate (or Inflate, whatever ya wanna call it ;)) thing to work until anyone's gonna see mfToon-v0.5.
Human_USB
12th December 2003, 18:27
Ahhh.....
Thanks for the update. I hope you do GITS SAC Season 2 :D
clima
21st December 2003, 14:06
@mf : your mailbox is full :rolleyes:
mf
21st December 2003, 16:37
I know. That's you guys' faults :D. /me will clean it in a moment
Edit: Cleaned. You can now spam me with your questions again :p.
mrfil13
21st December 2003, 20:58
Hi, ive got mftoon .44 and using virtualdub, on the first pass the fps is 2-3, is this normal, i have a amd 2200xp. Just wondering if it could be sopmething i have done.
Cheers
Manao
21st December 2003, 21:01
mf : have a look here (http://forum.doom9.org/showthread.php?s=&threadid=67232). Now you have no excuses for not working on mfToon-v0.5 :D
mrfil13 : it's normal : quality has a price...
mf
21st December 2003, 23:28
Manao, I saw, very nice work. I'll release v0.5 tomorrow, but don't take my word for it. I have to clean the script and add YV12Layer, but for the rest it's done afaics.
mf
22nd December 2003, 17:04
And here it is!
http://mf.creations.nl/avs/mftoon-box.png (http://mf.creations.nl/avs/functions/mfToon-v0.5.avs)
Go test it! :)
Dark-Cracker
22nd December 2003, 17:46
naruto rulezzzz :)
what news in this version ? (speed increase ?)
++
mf
22nd December 2003, 17:54
Originally posted by Dark-Cracker
naruto rulezzzz :)
what news in this version ? (speed increase ?)
++
From the script:
####
##
## Allow me to quote MarcFD: Warning! YV12 Inside ^^
## mfToon is now completely YV12. New unsharp mask technique, and an upgrade to MaskTools
## 1.4.2. Flickering bug should be 100% resolved.
##
mrfil13
22nd December 2003, 18:21
Ive just tried tried the new version, but in virtual dub it has a error
invalid arguments to function "edgemask"
line 56
i have avisynth 2.5 and the newest versions of
MaskTools, aWarpSharp and WarpSharp
mf
22nd December 2003, 18:25
Originally posted by mrfil13
Ive just tried tried the new version, but in virtual dub it has a error
invalid arguments to function "edgemask"
line 56
i have avisynth 2.5 and the newest versions of
MaskTools, aWarpSharp and WarpSharp
Get MaskTools v1.4.2 (http://mf.craetions.nl/avs/filters/MaskTools142.dll).
ssjkakaroto
22nd December 2003, 20:34
hey mf you misspelled "creations" on the link you just gave here's the correct one
Mask Tools v1.4.2 (http://mf.creations.nl/avs/filters/MaskTools142.dll)
and thx a lot for the update :)
mf
22nd December 2003, 21:00
Originally posted by ssjkakaroto
hey mf you misspelled "creations" on the link you just gave here's the correct one
Mask Tools v1.4.2 (http://mf.creations.nl/avs/filters/MaskTools142.dll)
and thx a lot for the update :)
Well I type the word "creations" at least thrice a day so I'm surprised this is my first typo at it.
Dali Lama
22nd December 2003, 22:26
@mf
I am getting an unrecognized exception when I run the script on line 112?
I am using the recommended MaskTools, aWarpSharp, etc.
If others are not getting it then its probably my fault?
Thanks,
Dali
mf
22nd December 2003, 22:33
Originally posted by Dali Lama
@mf
I am getting an unrecognized exception when I run the script on line 112?
I am using the recommended MaskTools, aWarpSharp, etc.
If others are not getting it then its probably my fault?
Thanks,
Dali
I really wouldn't know. It works on two different AVIsynth versions, both 2.5.1 alpha and 2.5.3 release.
Dali Lama
22nd December 2003, 23:25
Ok thanks mf. I'll try to figure it out. If not the older version works well for me. If I can fix it I'll post.
Thanks,
Dali
skizm
22nd December 2003, 23:56
The problem I'm having is...
Script error: there is no function named "Unsharpmask"
(mfToon-v0.5.avs, line 83)
:/
I'm using the MaskTools from the link above, I have avisynth 2.5.3, and the newest WarpSharp package from warpenterprises... Hmmm... :\
mf
23rd December 2003, 00:10
Originally posted by skizm
I'm using the MaskTools from the link above, I have avisynth 2.5.3, and the newest WarpSharp package from warpenterprises... Hmmm... :\
There's your problem, wrong WarpSharp. Get this one (http://mf.creations.nl/avs/filters/WarpSharp.dll).
skizm
23rd December 2003, 00:17
Thanks for the help, that solved that problem. But now I'm back to where I started:
Evaluate: Unrecognized exception!
(mfToon-v0.5.avs, line 112)
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
That's the line. I dunno why :\
Duncan_07
23rd December 2003, 01:17
So i test the new version and it'is two time faster (4 img/s :p) on my athlon 2400+ without other filters.
Very good work Mf ^^
I will do some other tests after christmas to see if there is a qualitee improvement. But i think it can't be wost than the 1.4 ;)
MrBunny
23rd December 2003, 09:29
Hey mf, love your work!
I am having the same problems as skizm with the unrecognized exception on line 112. It seems to me to have something to do with the height in the BicubicResize:
semifinal = dark.BicubicResize(ssw2, ssh2, 0, 0.75)
Even if I remove the mergeluma(semifinal) in the final= line, it will cause the exception. The only way I've found to bypass the exception is to replace ssh2 with the original height (though that will cause an avisynth memory access error). I tried it with just mftoon() and mftoon(512,384).
I hope this helps a bit and I look forward to any response.
Thanks again mf,
Mr. B
clima
23rd December 2003, 09:43
Originally posted by skizm
Thanks for the help, that solved that problem. But now I'm back to where I started:
Evaluate: Unrecognized exception!
(mfToon-v0.5.avs, line 112)
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
That's the line. I dunno why :\
I have got the same issue.
I have got AviSynth 2.52, build: Jun 1 2003, I am going to try a newer one. (I know it is supposed to work under avisynth 2.52)
The test script is :
Top=6
Left=4
Right=2
Bottom=10
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.5.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp\WarpSharp.dll")
Mpeg2Source("I:\Animes\test.d2v")
IT()
LanczosResize(640,480)
mfToon()
Edit : Latest avisynth version doesn't change anything.
clima
23rd December 2003, 09:48
Originally posted by MrBunny
[B]The only way I've found to bypass the exception is to replace ssh2 with the original height (though that will cause an avisynth memory access error). I tried it with just mftoon() and mftoon(512,384).
I have changed the "ssh2 = 480" for the previous script and status bar of vdubmod indicates : Avisynth read error: "Avisynth: illegal instruction at 0x03a21be3"
Changing "semifinal = dark.BicubicResize(ssw2, 480, 0, 0.75) \ " and "dstring3 = "Bicubicsized: " + String(ssw2) + "x" + String(480)" leads to the same line 112 error.
mf
23rd December 2003, 14:22
Originally posted by clima
I have changed the "ssh2 = 480" for the previous script and status bar of vdubmod indicates : Avisynth read error: "Avisynth: illegal instruction at 0x03a21be3"
Changing "semifinal = dark.BicubicResize(ssw2, 480, 0, 0.75) \ " and "dstring3 = "Bicubicsized: " + String(ssw2) + "x" + String(480)" leads to the same line 112 error.
Don't even bother. That won't do what you want it to do.
My testing:
AVS 2.5.0 works (http://prdownloads.sourceforge.net/avisynth2/AviSynth_250.exe?download)
AVS 2.5.1 works (http://prdownloads.sourceforge.net/avisynth2/AviSynth_251.exe?download)
AVS 2.5.2 works (http://prdownloads.sourceforge.net/avisynth2/AviSynth_252.exe?download)
AVS 2.5.3 works (http://prdownloads.sourceforge.net/avisynth2/AviSynth_253.exe?download)
I'll try to debug some more.
Chainmax
23rd December 2003, 19:03
I'm going to rip my Simpsons DVDs soon. What do you recommend me for sharpening, SSXSharpen() or mfToon()? I'm running on an Athlon 850Mhz with 160Mb Ram; what speed do you think I should expect when using either? Maybe 1 fps?
mf
23rd December 2003, 19:05
Originally posted by Chainmax
I'm going to rip my Simpsons DVDs soon. What do you recommend me for sharpening, SSXSharpen() or mfToon()? I'm running on an Athlon 850Mhz with 160Mb Ram; what speed do you think I should expect when using either? Maybe 1 fps?
Simpsons has pretty thick lines, so I'd say ssxsh. No need to darken anything from what I've seen.
Chainmax
24th December 2003, 00:25
Cool, thanks :).
Popovk
24th December 2003, 01:57
Originally posted by skizm
Thanks for the help, that solved that problem. But now I'm back to where I started:
Evaluate: Unrecognized exception!
(mfToon-v0.5.avs, line 112)
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
That's the line. I dunno why :\
Having the same error, and it seems to be related to WarpSharp. I mean, as for each script, plugin are not in default avisynth folder and so manually loaded, whatever warpsharp is loaded or not, the error is the same, and vdub/avisynth didn't complain about the missing plugin
Already tried the one from the package in 1st page of the thread and the other in the post a little upper, same results. Strange, as it worked with 0.4x of mftoon
Too late to continue on it, and I won't be able until end of week ... ;)
MrBunny
24th December 2003, 05:33
For those of you like me having trouble, does commenting out the line of that code
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
with or without deleting the \ at the end of the previous line prevent the error from occuring? It doesn't for me :(
Thanks for trying to debug mf, I'll be playing with it a bit more later.
Mr. B
skizm
24th December 2003, 06:14
#semifinala = dark.BicubicResize(ssw2, ssh2, 0, 0.75)
semifinal = dark.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
I changed lines 111 and 112 to be like that. While that won't do what mfToon is made to do, it seems to have gotten the error outside of the mfToon script. VirtualDubMod then gave me an error in MY script on line 33, which was, surprise, a BicubicResize. I commented that out and now I get the memory access error that has already been described here. I have no idea what the problem is ;/
MrBunny
24th December 2003, 08:11
This is what it seems to boil down to for me right now. Having it the way it is already written will give me an the line 112 error. Changing the lines to :
semifinal = dark.BicubicResize(ssw2, theight, 0, 0.75) \
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
final=orig.BicubicResize(twidth, theight, 0, 0.75).MergeLuma(semifinal).aWarpSharp(cm=cwarp2, depth=wdepth, \
blurlevel=wblur, thresh=wthresh)
will get rid of that error, but there will be an avisynth read error when the avs is loaded.
Changing the code to (removing the mergeluma):
semifinal = dark.BicubicResize(ssw2, theight, 0, 0.75) \
.XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75)
final=orig.BicubicResize(twidth, theight, 0, 0.75).aWarpSharp(cm=cwarp2, depth=wdepth, \
blurlevel=wblur, thresh=wthresh)
will allow the script to function (though of course it's not working as it was designed without the mergeluma)
This is all with mftoon() after resize. If I use it before resize then as skizm just said, avisynth will give an exception on the resize line in the main script and if there is no resize before or after, it just gives me an avisynth read error.
I hope this might help the debugging...
Mr B.
mf
24th December 2003, 12:35
The only fixes I can see:
Have the same filter versions as on http://mf.creations.nl/avs/filters/
Don't use plugin autoloading
Don't load more than one version of MaskTools at a time (Autoloading might give problems?)
If that doesn't work I really wouldn't know of any fixes anymore..
mf
24th December 2003, 13:06
Just in news from my lovely debugger Akirasuto, the problem is probably related to MergeLuma. mfToon v0.51 (http://mf.creations.nl/avs/functions/mfToon-v0.51.avs) doesn't use MergeLuma, so I hope this fixes all your problems (except the love-life ones ;)). Merry Christmas/hanukkah/whateveryoucelebrate!
Dali Lama
24th December 2003, 14:13
I hate to be the bearer of bad news, but mftoon v5.1 gives an unrecognized exception on line 115 now.
I hope others have more success. Thanks for helping mf.
edit2: I was wrong. The exception in mftoon v5.1 comes from:
final = dark.BicubicResize(ssw2, ssh2, 0, 0.75).XSharpen(xstren, xthresh).BicubicResize(twidth, theight, 0, 0.75).MergeChroma(semifinal).aWarpSharp(cm=cwarp2, depth=wdepth, blurlevel=wblur, thresh=wthresh)
edit3: when I comment out everything after bicubicresize the script loads but gives an access violation error. If I leave bicubiresize in it won't load. Could it be the resize?
Now, if only I could fix it ;)
-Dali
mf
24th December 2003, 14:55
Originally posted by Dali Lama
edit3: when I comment out everything after bicubicresize the script loads but gives an access violation error. If I leave bicubiresize in it won't load. Could it be the resize?
Now, if only I could fix it ;)
-Dali
And my above fixes (autoload, etc)?
mf
24th December 2003, 15:09
I've just noticed at every scenechange one of the masks comes through to the return clip. Really, something should be fixed in AVISynth, as I really don't see another reason why it would happen.
Didée
24th December 2003, 15:39
Originally posted by mf
I've just noticed at every scenechange one of the masks comes through to the return clip. Really, something should be fixed in AVISynth, as I really don't see another reason why it would happen.
Some time ago, I have seen exactly that when I was trying some mask operations on very big framesizes. The solution was to manually force SetMemoryMax() to high values, like 128 or 160.
I'm not sure if this is really AviSynth's fault, rather than MaskTools' one.
Generally, the SetMemoryMax-trick *sometimes* is able to solve unexplainable errors in scripts that are technically correct. It never hurts to give it a try in complex scripts ;)
- Didée
mf
24th December 2003, 15:59
Well, I've got 1GB of memory so that won't be a problem then :D. I'll do SetMemoryMax(768) and see if that fixes it :p.
MrBunny
24th December 2003, 16:44
Thanks for looking into this mf, but it still isn't working :(
This is my current script:
LoadPlugin("...path...\mpeg2dec3dg.dll")
LoadPlugin("...path...\masktools142.dll")
LoadPlugin("...path...\warpsharp.dll")
LoadPlugin("...path...\awarpsharp.dll")
import("...path...\mfToon-v0.51.avs")
SetMemoryMax(512)
mpeg2source("...path...\2.d2v",cpu=0,ipp=true)
crop(8,2,704,476)
LanczosResize(512,384)
mftoon()
This gives the exception at line 115.
I just redownloaded all 3 .dlls from mf's website too, so it shouldn't be that and there should be no dlls being autoloaded.
Happy Holidays to all
Thanks,
Mr. B
clima
24th December 2003, 23:02
I have got the exception at line 115 too :(
K-Dash
25th December 2003, 12:35
Impressive, thx for the good work. :D
mf
25th December 2003, 15:58
Originally posted by K-Dash
Impressive, thx for the good work. :D
Thanks :).
Now, before I release v0.52 (it's not ready anyway), I want to put up a small poll.
The question is: Do you have a PC faster than me?
Answers are: Yes/No
Please state your processor speed and RAM capacity and speed. You may also guess why I'm asking this :D.
I have an Athlon 2500+ (Barton), with 1GB dual-channel DDR RAM.
This poll is related to something new in mfToon v0.52 :p.
skizm
25th December 2003, 18:18
I've got a Pentium 4 3.2ghz HT with 1GB of PC 3200.
acrespo
26th December 2003, 14:21
Answer: No
Athlon XP 1800, 1Gb RAM.
Chainmax
26th December 2003, 15:23
No.
Athlon T-Bird 850Mhz + 160Mb PC100 RAM (used to be 256Mb PC133).
If you're worried about wether this will be to slow for some of us, what about making it optional?
skizm
26th December 2003, 15:49
Originally posted by Chainmax
If you're worried about wether this will be to slow for some of us, what about making it optional?
Everything is optional anyway ;p
mf
26th December 2003, 15:56
Originally posted by Chainmax
No.
Athlon T-Bird 850Mhz + 160Mb PC100 RAM (used to be 256Mb PC133).
If you're worried about wether this will be to slow for some of us, what about making it optional?
I'm just interested, and of course it's optional. Nobody wanna take guesses at what it is ? :D
clima
26th December 2003, 22:31
PIV 2,6 GHz with 512 MB of DDR Ram
@ mf : Do you have any other idea about what is causing mfToon 0.5 not to work for about half of us ?
Nobody wanna take guesses at what it is ?
Humm, you are willing to slow down under 1 fps for such high config's PCs ? :p
mf
26th December 2003, 23:24
Originally posted by clima
@ mf : Do you have any other idea about what is causing mfToon 0.5 not to work for about half of us ?Sadly, nope :(.
Humm, you are willing to slow down under 1 fps for such high config's PCs ? :p Wrong guess. Try again :D.
Dreassica
27th December 2003, 01:26
Might it be the HQdering u are talking about in teh other thread? ;)
acrespo
27th December 2003, 03:56
mftoon 0.51 is working here, but when I change the strength parameter to anything different than 255 (default value), I receive a error in line 107 ('dark' is not recognized).
mf
27th December 2003, 12:56
Originally posted by acrespo
mftoon 0.51 is working here, but when I change the strength parameter to anything different than 255 (default value), I receive a error in line 107 ('dark' is not recognized).
Yeah. I noticed that too. Kurosu interpreted my script wrong and put it like that in his K-mfToon. When I was looking for things i could steal (:devil:) from his version I simply copywasted that line. Expect a fix in 0.52. And Dreassica: Nope :D.
Popovk
30th December 2003, 13:01
Originally posted by mf
And my above fixes (autoload, etc)?
none of them.
On the other hand, I think I have found why it doesn't work on some computer (thanks to the 3 differents I have at home :D )
Mf, I assume you have an athlon, right ?
CPU type resume of those who have the error :
MrBunny : ?
skizm : Pentium 4 3.2ghz HT with 1GB of PC 3200
Dali Lama : ?
clima : PIV 2,6 GHz with 512 MB of DDR Ram
And myself : P4 3.0Hz with 1Gb ram in dual mode, tested with and without hyperthreading.
Now the final answer from the final test : I did a copy/paste of the directories to my athlon 3ghz, lanched the avs script with mftoons, and it worked like a charm. As none who have an AMD processor did complaign about the error, easy to understand where the error come from.
mf, for purpose testing sake, can you do the same script without using any external plugin ? It may be usable to found where the error is coming from, as separately, the external plugin are working fine (also, if someone could test them to confirm)
mf
30th December 2003, 14:44
Originally posted by Popovk
mf, for purpose testing sake, can you do the same script without using any external plugin ? It may be usable to found where the error is coming from, as separately, the external plugin are working fine (also, if someone could test them to confirm)
Of course I can't. mfToon v0.5 barely uses any internal functions anymore. Used ones are:
Unsharpmask - WarpSharp.dll
Edgemask - MaskTools142.dll
YV12Layer - MaskTools142.dll
Inflate - MaskTools142.dll
MaskedMerge - MaskTools142.dll
XSharpen - WarpSharp.dll
aWarpSharp - aWarpSharp.dll
In that sense, it's easy to put the problem at MaskTools. Earlier mfToons used the old MaskTools, and alot of internal AVS functions (mainly Mask() and Layer()). Now, does MaskTools use any SSE2? If so, it might be interesting to disable it and create a new build.
Also: AllTimeSToneD has a dual P4 and can use mfToon without too many problems (none are really reproducible). That makes it a bit more mysterious.
MrBunny
31st December 2003, 05:41
Nice catch Popovk.
I'm using a P4 2.4c with HT enabled. I might be able to try it on a athlon cpu in the next couple days.
Mr. B
Kurosu
31st December 2003, 15:54
There are some 3DNow opcodes used instead of iSSE around the asm parts (can't remember where). Have Manao or a willingful asm coder check for paddusb instead of paddb, prefetch/prefetchw instead of prefetchnta.
I asked someone to send mf a fixed version of masktools 3 weeks ago, but it seems it wasn't done. bah.
mf
31st December 2003, 16:17
Kurosu! :) Haven't seen you in a while. Indeed, I never got a "fixed" version of MaskTools, other than 142 that Manao compiled. You'll be glad to see that I'm putting your "cartoon" edge detection to use in 0.52. Best wishes for the new year!
Dali Lama
2nd January 2004, 07:44
Originally posted by Popovk
Dali Lama : ?
Dali Lama = P4
I think your're right Popovk, we are all running P4's that are having problems. Hopefully Kuroso has spotted the problem and someone can fix it.
-Dali
Aiorus
3rd January 2004, 23:15
Well, for what it's worth, I tried mftoon v 0.50 on a PIII 700 MHz and it also has the error (Line 112 on 0.50, line 115 on 0.51+), and the same error appeared on a celeron computer. Apparently it's an Intel thingie.
Edit: I forgot to mention, it did work on an Athlon XP 2700
WyldeF1r3
3rd January 2004, 23:21
kurosu coded the latest masktools in amd assembler. i have an intel-fixed version of masktools 1.4.1 if someone knows how i can attatch a file to a post. or you could just wait until kurosu rewrites it now that he seems back from vacation ^_^
mf
4th January 2004, 14:23
Originally posted by WyldeF1r3
kurosu coded the latest masktools in amd assembler. i have an intel-fixed version of masktools 1.4.1 if someone knows how i can attatch a file to a post. or you could just wait until kurosu rewrites it now that he seems back from vacation ^_^
Well that would be useless because Inflate is broken in 141. So unless you have the source too it won't help anyone.
Manao
4th January 2004, 16:56
I updated the MaskTools to v1.4.3, it should work with P4 ( not tested though ). I only removed the prefetch instructions. I corrected some bugs with optimizations ( which means I disabled some optimizations ), and I optimized two filters ( Invert and Binarize, which were very simple to optimize ).
Please report bugs on this thread (http://forum.doom9.org/showthread.php?s=&threadid=67232). You'll find the new version here (http://www.geocities.com/manao47/Filters/masktools-v1.4.3.zip). Copy & paste the link in your adress bar
skizm
4th January 2004, 17:06
The Geocities page doesn't work :\
If you want you can e-mail me the file and I'll post it on my hosting. Let me know if that's the case.
Manao
4th January 2004, 17:45
I forgot the usual disclaimer : copy & paste the link in your adress bar. I edited my previous post.
NightMare
6th January 2004, 00:04
hey mf wazzup
i'v been away for a while and when i come back i see mftoon v0.51
great work mf congrats
sadly i dont have any anime to encode right now but i'm gona try it on naruto and see hope nuthin's wrong ;)
SSJGesus
6th January 2004, 05:14
yep, it works fine on my P4 with the new masktools
pity i only get 1 or 2fps, and divx 5.1.1 running on slowest ontop of that :P
just imagine if i was doing multi-pass :P
Popovk
7th January 2004, 15:51
working fine now, and mf, you're crazy as hell, as usual.
Without mftoon but some plugins instead like msharpen : 26 fps
only mftoon : 4 fps :rolleyes:
mrfil13
8th January 2004, 13:56
im using the .51 mftoon and did a test sample of 1.2min at a filesize of 5mb but the quality was poor, here are my settings and script
oh and im trying to compress cowboy bebop the movie
newest koepi's xvid
2 pass
AS @ 5
h.263
quartpel
GMC
Bvop, max consec bvop 2, qaut ratio 1.5, offset 1, packed bitstream, closed gov
MSP - 6 ultra high
VHQ - 4
Chroma motion
trellis
script
# PLUGINS
LoadPlugin("E:\Rip\GordianKnot\mpeg2dec3.dll")
LoadPlugin("E:\Rip\GordianKnot\undot.dll")
LoadPlugin("E:\Rip\GordianKnot\masktools\MaskTools142.dll")
LoadPlugin("E:\Rip\GordianKnot\aWarpSharp\aWarpSharp.dll")
LoadPlugin("E:\Rip\GordianKnot\WarpSharp.dll")
# SOURCE
mpeg2source("E:\Fast\cowboy009.d2v")
# CROPPING
crop(0,14,718,548)
# RESIZING
lanczosResize(640,336)
#
Import("mfToon.avs")
mfToon()
im trying to get this onto a 700mb cd
mf
8th January 2004, 23:28
Define "poor".
mrfil13
10th January 2004, 00:04
Well has ringing and seems to be overly sharp.
I will try and get a sample up tommorow because my ecplenation is probably not very helpful, plus does cartoon mode help or not.
mrfil13
10th January 2004, 23:23
Heres a link for the download of the test sample i did,
http://renault5archive.donnchadh.co.uk/cow.avi
how could i make this better, to me it looks like the lines are to thick and its overly bright, what settings do i need to change to alter these factors
cheers
lamer_de
12th January 2004, 00:02
Hi mf, could you please fix this annoying "strength" bug? I hardly ever use full strength linedarkening, unless the source I have to work on is blurred as hell or features chroma ghosting etc. So I can put mftoon only to limited use atm :(
mrfil13: The clip doesn't looks "wrong" to me, but I don't know how it's supposed to look :p
You can thin lines using the warpsharp filter. Brighness adjustment can be done via the levels filter. Use the vdub version of the filter to find the correct values, then enter them in your avs script. However, unless you know that you colours/brightness are off, I wouldn't start fiddling around with it.
CU,
lamer_de
mf
12th January 2004, 10:20
Originally posted by lamer_de
Hi mf, could you please fix this annoying "strength" bug? I hardly ever use full strength linedarkening, unless the source I have to work on is blurred as hell or features chroma ghosting etc. So I can put mftoon only to limited use atm :(
You should be able to fix it yourself :D. replace the linemask = line with linemaskpre =, and then add a line linemask = (strength=255) ? linemaskpre : linemaskpre.Levels(0, 1.0, 255, 0, strength), or something like that. Of course you then also have to get rid of that other strength conditional. (I'm not at home atm so I can't really check everything literally) I'll prep mfToon-v0.52 for release later today and I'll incorporate that into it. I just didn't before cause I grew kinda tired of cleaning the script and the other stuff I gotta do before releasing a version of mfToon :rolleyes:.
zettai
12th January 2004, 19:58
Is there no other way of using mftoon without that specific warpsharp.dll? It's phenominally bug-ridden - I recall MarcFD taking just the warpsharp code because one of the other parts of the filter kept causing crashes all the time.
mf
12th January 2004, 20:01
Originally posted by zettai
Is there no other way of using mftoon without that specific warpsharp.dll? It's phenominally bug-ridden - I recall MarcFD taking just the warpsharp code because one of the other parts of the filter kept causing crashes all the time.
If someone could compile a version that only includes these filters:
Unsharpmask()
XSharpen()
FrameCache()
Then I'd be happy enough.
zettai
13th January 2004, 14:58
BTW, the warpsharp.dll pack posted on this site:
http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/
Created Nov '03 184k, is much more stable than the 127k version you have linked to at the start of the thread and doesn't cause any crashing with autoloading so far.
Are you aware of this version? It seems to work fine for me.
mf
13th January 2004, 15:44
Originally posted by zettai
BTW, the warpsharp.dll pack posted on this site:
http://www.geocities.co.jp/SiliconValley-PaloAlto/2382/
Created Nov '03 184k, is much more stable than the 127k version you have linked to at the start of the thread and doesn't cause any crashing with autoloading so far.
Are you aware of this version? It seems to work fine for me.
Looks like it's from the same site as I got the original version I have from. So apparently it's been updated in the meantime.
mrfil13
14th January 2004, 11:23
Was that to use warpsharp before or after mftoon() or is there a way to do the line thinning using mftoon
Also will it be worth just waiting for .52 with the cartoon edge detection.
mf
14th January 2004, 12:04
Originally posted by mrfil13
Also will it be worth just waiting for .52 with the cartoon edge detection.
Only for dark or contrastful anime. The cartoon edge detection (which is multiplied by sobel (or did I use roberts?) because of the weakness of the cartoon edgemask) only (partly) fixes shadow contours (the edges of a shadow fill are detected as a line and get darkened). So if it's never bothered you before I don't think it'll be such a big fix.
Arrakis_Dune
14th January 2004, 17:58
Well, I'm just restarting to backup my Dvd's, so some questions here will be somewhat dumb or lamme.. I've been trying to backup Gits into 2 Cd's, with 2 ogg streams (jap, Eng), and the Dvd is interlanced, so I'm using Toms to deinterlace it.. The bitrate reported by Gknot ia around 1911, with a 704*368 pal Anamorphic aspect.. my question is.. What settings should I use.. I don't know if I'm choosing this right.. Size and audio are what I want, because I need extreme quality.. But I'm not sure about filtering and related issues..
Could all you help the newbie here?? Im using Knot latest build, VdubMod included in Gknot, and Avisynth 2.5 :P
PS: The image back there was really cool.. I liked it.. Ohh, I don't mind speed.. I'm more consourned with the final quality :)
Once again Thank you :) [[[]]]
Arrakis_Dune OUT
PS2:
#
# Created with Gordian Knot
#
# http://gknot.doom9.org
#
# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\undot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\TomsMoComp.dll")
#
# SOURCE
mpeg2source("E:\GHOST_IN_THE_SHELL\VIDEO_TS\New Folder\GITS Main.d2v")
#
# CROPPING
crop(6,16,708,540)
#
# DEINTERLACING (1)
#FieldDeinterlace()
#FieldDeinterlace(blend=false)
TomsMoComp(1,5,1)
#
# RESIZING
LanczosResize(704,368)
#
#
Undot()
mf
14th January 2004, 18:16
And this is related to mfToon in what way?
Arrakis_Dune
14th January 2004, 18:49
Well, I was wondering if I could use your filters to help my backup.. I've read a lot, and they seem to be the ideal ones for the "job".. The only problem Is how to apply them to the rip.. If you could help I would be appreciated :)
[[[]]]
Arrakis_Dune OUT
mf
14th January 2004, 21:26
Well, like it says on the top of the thread.
Import("X:\Path\to\avs_stuff\mfToon-v0.51.avs")
[your filters]
mfToon()
Arrakis_Dune
14th January 2004, 22:30
Thanks.. I was encoding a tinny bit to fast, without any improvementes to the eye.. So I knew something was wrong.. I was missing
mfToon()
Anyway, on Ghost In The Shell, I must say your filters are the greates.. I've seen major improvments in the image quality and in the lines definition.. Once again, thank you :)
Arrakis_Dune OUT
Wilbert
14th January 2004, 22:36
Sorry for the useless interruption. I splitted Arrakis_Dune's post from this thread, because I thought it was totally unrelated.
I guess it was not, since he added it back again.
Sorry for the troubles!
mf
15th January 2004, 11:47
Originally posted by Arrakis_Dune
Anyway, on Ghost In The Shell, I must say your filters are the greates.. I've seen major improvments in the image quality and in the lines definition.. Once again, thank you :)
No problem :).
mf
15th January 2004, 18:18
And here it is once again!
mfToon-v0.52 (http://mf.creations.nl/avs/functions/mfToon-v0.52.avs)
Have fun :).
ZoNtO
16th January 2004, 16:29
Do you have new links to those 3 plugins you need? I can't get the ones in your first post to work at all! Thanks!
mf
16th January 2004, 16:43
http://mf.creations.nl/avs/filters/MaskTools142.dll (this is NOT for P4 users! Get the latest version off the "New masktools version" thread!)
http://mf.creations.nl/avs/filters/WarpSharp.dll (DON'T use plugin autoloading, if you do want to, read up in this thread, there is a new [unsupported] version mentioned that shouldn't have autoload problems)
http://mf.creations.nl/avs/filters/aWarpSharp.dll
ZoNtO
17th January 2004, 09:19
Thank you my friend, I got this and Dering to work because of all your help. Rock on!
ssjkakaroto
19th January 2004, 00:29
edit: nm, i got it working with the latest masktools, but it's strange since i have a p3 so i thought v1.42 would work :p
mf
24th February 2004, 22:15
Sneak peek!
I've been playing around from scratch, and suddenly I got this:
http://mf.creations.nl/avs/newmftoon-sneakpeek.png
I'm aware of the full-frame darkening, that's an issue of MaskedMerge. Don't dare asking for it now, it reflects NinjaMice's quote in my sig all too well. I'll give away two secrets though: 1) it uses CoronaEdgeMask, 2) it's slower than current mfToon. :D
Edit: uploaded screenshot without full-frame darkening.
lamer_de
24th February 2004, 23:30
so, where's the difference in output besides that it darkens the whole image? I can't spot any signigficant differences
(might be Naruto related though, everytime I see a scene from that anime, I feel like throwing up :p ).
EDIT: Ah, k, it's supposed to look the same ^_^ Maybe you should link to your other thread from this thread aswell. Well, as it's even slower, it's cool that you've found another way to create edge masks, but not really usable.
CU,
lamer_de
mf
24th February 2004, 23:45
KEEP LAMER! :devil:
It's not supposed to look the same, there is a difference! Halos are gone (thanks to HQUnfilter), and lines are darkened without creating halos in shadows/dark areas (a known bug of the current mfToon method). This new version only works with coronamask, cause it uses a key aspect of it. So the slow speed really can't be taken away ;). Also, I've thrown in a mix of warp darkening and regular fxToon-type darkening.
killerhis
25th February 2004, 02:42
so where is this new version?
*KillerHIS wants the new mfToon version*
:p
LB
25th February 2004, 03:03
I think this is just one more of mf's evil attempts in slowing down our already slow render speed :devil:
It's called the slowmedown(). Doesn't do anything to the video, but you'll notice a diff in your speed, for sure. :p
lamer_de
25th February 2004, 09:32
KEEP LAMER!
Please stop using such useless statements. While being in Keep may make you loose some braincells, it doesn't mean that everyone in it is a egocentric speed subbing dumbfuck. I am sick of those annoying flames.
It's not supposed to look the same, there is a difference! Halos are gone (thanks to HQUnfilter),
That is hardly a feature of mftoon then ;)
and lines are darkened without creating halos in shadows/dark areas (a known bug of the current mfToon method). This new version only works with coronamask, cause it uses a key aspect of it.
Ah, here's the information. Thanks. However, you will hopefully agree with me that it is next to impossible to detect this feature from 2 screencaps (which don't even feature "shadows/dark areas" [well, maybe the shoulder of that girl]), so I think my question was legit.
CU,
lamer_de
mf
25th February 2004, 12:35
Originally posted by lamer_de
Please stop using such useless statements. While being in Keep may make you loose some braincells, it doesn't mean that everyone in it is a egocentric speed subbing dumbfuck. I am sick of those annoying flames.I thought you also saw the smiley. I just like to poke fun at you guys without really meaning it. Ask DeathWolf :).That is hardly a feature of mftoon then ;)Well, you'd be surprised. I'm actually planning to integrate it into mfToon in a way that makes it much more effective (and slow :devil:).Ah, here's the information. Thanks. However, you will hopefully agree with me that it is next to impossible to detect this feature from 2 screencaps (which don't even feature "shadows/dark areas" [well, maybe the shoulder of that girl]), so I think my question was legit.
Want me to include a screenshot of the old mfToon as well? I can indeed see some usefulness in that :). I'll make a screenshot of HQUnfilter+old mfToon, so you can see the clear haloing issue.
Edit: okay, you win :D. I totally picked the wrong screenshot for showing differences. New comparison!
HQUnfilter:
http://mf.creations.nl/avs/newmftoon-sp-hqunfilter.png
mfToon v0.52:
http://mf.creations.nl/avs/newmftoon-sp-mftoon5.png
mfToon v0.6pre1:
http://mf.creations.nl/avs/newmftoon-sp-mftoon6.png
The "kawaii wan-chan" shows halos around his mouth, and Shikamaru's net-shirt is really ruined.
killerhis
25th February 2004, 13:17
OK mf sorry to tell you this, but I found something on v0.52 that I dont like... maybe its just me or maybe its know, but fix it asap!
Somehow I get fucked top/bottom edges when I use mftoon. I traced the filter that made those artifacts and it was MFtoon for sure! To see what I mean, check this short clip and look at the bottom/top of the clip, you'll see a small line wich looks like a edge of a fucked source, but the source is as clean as it gets ^_^.
NGE f**ked edges by mftoon :) (http://home.hccnet.nl/h.chourak/test(edge).avi)
If noone else has had this problem before, it could be that I have like a wrong version of a filter loaded. Can someone give me then a link with all filters that are 100% correct?
Keep up the good work mf
mf
25th February 2004, 13:22
You're not the first with this problem.
AddPadding-v0.1 (http://mf.creations.nl/avs/functions/AddPadding-v0.1.avs) was made for this purpose. Add padding, apply mfToon, then crop off the padding again.
killerhis
25th February 2004, 13:30
heheh I love your fast reply mf ^_^.. good that we are in the same timezone :)
OK I'll give it a try, I was making a samekind of function as we but I'll use this, hopefully it does what I want it to do
and thankz again mf :)
PS: maybe its usefull to integrate it in your mftoon script and speedoptimize it :)
mf
25th February 2004, 13:42
Originally posted by killerhis
PS: maybe its usefull to integrate it in your mftoon script and speedoptimize it :)
Integrate that ugly piece of script into mfToon? nevAR! I made that in 30 mins *shiver*
dapipa
4th March 2004, 17:42
hi!any progress with mfToon v0.6?i'd just like 2 slow my painfully fast encodes a bit...
:)
I've experimented with some EDI, but nothing more. I haven't had my mind on it much either, lately :).
Edit: Even a heavily modified mfToon v0.6pre1 can't face up to the crappiness of cosprayers, MAN I hate that anime :).
http://mf.creations.nl/avs/cosprayers-still-SUCKS.png
The authorer of that broadcast should be executed without blindfold.
mit_mis
20th March 2004, 10:32
oh, I don't know why, but I'm getting this error:
Error initializing audio stream decompression:
The requested converion is not possible.
and this is my source:
LoadPlugin("MaskTools142.dll")
LoadPlugin("warpsharp.dll")
LoadPlugin("awarpsharp.dll")
LoadPlugin("Convolution3DYV12.dll")
Import("mfToon-v0.52.avs")
AviSource("C:\sysreset\download\Gekiganger_III.avi")
ConvertToYv12()
ConvertAudioTo16bit()
mfToon()
Dreassica
20th March 2004, 10:39
Don't see how thats related to MFtoon in any way.:sly:
mit_mis
20th March 2004, 11:01
cause with older versions this error isn't showing... I don't know what to do:(
[edit]: Sorry, it's working now. I just had to delete some files;P
[edit2]: Not working:/ This is the error:
Evaluate: Unrecognized exception. line 113
and this is line 113:
.aWarpSharp(cm=cwarp2, depth=wdepth, blurlevel=wblur, thresh=wthresh)
Some ideas?
@mit_mis
No idea. Sorry :(.
@all
Just for fun, I made a commented version of mfToon-v0.52. The script is exactly the same, just there's comments in between. I'm looking forward to reading your comments on my comments :D.
####
##
## Commented version, for your reading pleasure. Needless to say, I should've
## been doing more useful things.
##
##
function mfToon(clip orig, int "twidth", int "theight", int "ssw", int "ssh", int "xstren", \
int "xthresh", bool "cwarp", bool "sharpen", int "strength", float "wdepth", int "wblur", \
float "wthresh", int "drange", float "dboost", int "dlimit", bool "debug", bool "doutput", \
string "dclip", bool "show", int "scolor") {
# normal params
strength = Default(strength, 255) # line darkening strength, 0-255
sharpen = Default(sharpen, true) # sharpening on/off
cwarp = Default(cwarp, true) # chroma warp on/off
cwarp2 = cwarp ? 1 : 0
wdepth = Default(wdepth, 16.0) # warping depth, ?-?
wblur = Default(wblur, 1) # warping blur level, ?-?
wthresh = Default(wthresh, 0.5) # warping threshold, 0.0-1.0
ssw = Default(ssw, 4) # supersample factor horizontally, 0-inf
ssh = Default(ssh, 4) # supersample factor vertically, 0-inf
twidth = Default(twidth, orig.width) # target width (useful for cropping), 0-inf
theight = Default(theight, orig.height) # target height (useful for cropping), 0-inf
show = Default(show, false) # show which lines are being darkened
scolor = Default(scolor, $FF00FF) # which color to show lines in
# advanced params
xstren = Default(xstren, 255) # xsharpening strength, 0-255
xthresh = Default(xthresh, 255) # xsharpening threshold, 0-255
## Where have all the params gone?! - They were useless as of 0.5, but I forgot to clean them.
drange = Default(drange, 64) # detail range, 0-255
dboost = Default(dboost, 1.0) # detail boost, 0.1-10.0
dlimit = Default(dlimit, 30) # detail limiter, 0-255
debug = Default(debug, false) # debug mode on/off
doutput = Default(doutput, true) # print debug info on processed image
dclip = Default(dclip, "rclip1") # which stage of the processing to show
ssw2 = twidth * ssw
ssh2 = theight * ssh
sharpen2 = show ? false : sharpen
## Unsharp mask increases contrast of adjacent picture elements (pels).
## It is the main darkening "engine" for mfToon.
##
orig.Unsharpmask(300, 4, 0)
sharp = last
##
## I don't like white halos, and we don't need them. Only black ones will do.
##
MaskedMerge(sharp, orig.GreyScale(), orig)
sharp1 = last
MaskedMerge(sharp1, orig.GreyScale(), orig)
sharp2 = last
## Funny thing. I don't use this anywhere else in the script. =)
greymask = orig.Greyscale().Invert()
## Don't you just love scripting messes like this?
## Don't try to touch this. Old stuff, and I forgot most of what it /exactly/ does.
## I could've rewritten it, but then the parameters and effect would change. It's best
## to leave it.
##
## Build a "cartoon" mask and amplify it so it actually has an effect on the video.
detailmaskpre0 = orig.EdgeMask(3, 255, 255, 255, "cartoon", Y=3, V=1, U=1) \
.Tweak(0.0, 1.0, drange, 1.0).Levels(60, dboost, 255, 0, 255) \
.Levels(0, dboost, dlimit, 255, 0).GreyScale().Inflate().Deflate().Deflate().Deflate()
##
## Build a "roberts" mask with the same amplification (I can feel the FPS drop already).
## Basically, "cartoon" is too weak by itself.
detailmaskpre1 = orig.EdgeMask(3, 255, 255, 255, "roberts", Y=3, V=1, U=1) \
.Tweak(0.0, 1.0, drange, 1.0).Levels(60, dboost, 255, 0, 255) \
.Levels(0, dboost, dlimit, 255, 0).GreyScale().Inflate()
detailmaskpre2 = YV12Layer(detailmaskpre0, detailmaskpre1, "mul", 255, chroma=false, Y=3, V=1, U=1).Blur(1.0)
##
## Add the two edgemasks together.
YV12Layer(detailmaskpre2, detailmaskpre2, "mul", 255, chroma=false, Y=3, V=1, U=1).Levels(0, 1.0, 190, 0,
255)
ConvertToYV12().Invert().Inflate().Invert()
detailmask = last
##
## Modify the edgemask so only the edges that exist on a dark pixel in "orig" are assumed to be
## cartoon lines. Looks like I could've used my "greymask" here, but I haven't.
white = orig.Binarize(Y=-255,U=-128,V=-128)
linemask1 = MaskedMerge(white.ConvertToYV12(), detailmask, orig.Invert().ConvertToYV12()).Invert()
linemask = (strength == 255) ? linemask1 : linemask1.levels(0, 1.0, 255, 0, strength)
## This is for "show lines" mode. Either use the darkening clip "sharp2", or just an identifying color.
color = BlankClip(orig, color=scolor)
sharp3 = show ? color : sharp2
## Overlay sharp3 over original. If show=true, clip will be greyscale with colored lines, otherwise
## chroma is restored from "orig".
dark = MaskedMerge(orig.Greyscale(), sharp3, linemask, Y=3, U=2, V=2)
darkmerged = dark.MergeChroma(orig)
finaldark = show ? dark : darkmerged
## For our added resize functionality.
semifinal=orig.BicubicResize(twidth, theight, 0, 0.75)
## SSXSharpen and WarpSharp. I'd say it's self-explanatory.
final = dark.BicubicResize(ssw2, ssh2, 0, 0.75).XSharpen(xstren, xthresh) \
.BicubicResize(twidth, theight, 0, 0.75).MergeChroma(semifinal) \
.aWarpSharp(cm=cwarp2, depth=wdepth, blurlevel=wblur, thresh=wthresh)
## Output conditionals. For debug mode and stuff.
rclip1 = sharpen2 ? final : finaldark
Eval("dclip1 = doutput ? "+dclip+" : orig")
## Debug text.
dstring1 = "mfToon v0.52 by mf - Debug mode ;p"
dstring2 = "Pointsized: DisabledxDisabled"
dstring3 = "Bicubicsized: " + String(ssw2) + "x" + String(ssh2)
dstring4 = "Outputsize: " + String(twidth) + "x" + String(theight)
dstring5 = "Debug image: " + dclip
clipstring = sharpen2 ? "final" : "finaldark"
dstring6 = "Output image: " + clipstring
## Overlay debug text over video.
dclip2 = dclip1.Subtitle(dstring1).Subtitle(dstring2, y=33).Subtitle(dstring3, y=48) \
.Subtitle(dstring4, y=63).Subtitle(dstring5, y=78).Subtitle(dstring6, y=93)
## But do we really need to debug?
rclip2 = debug ? dclip2 : rclip1
return rclip2
}
## I'm still waiting to be able to run this realtime on my ffdshow. Bah.
function mfToonLite(clip orig, int "twidth", int "theight", int "strength", int "dstren", int \
"drange", float "dboost", int "dlimit", string "mask") {
# S N I P - the code is gone, it'd make my post too long.
}
Didée
21st March 2004, 03:04
Hah, what a script! ;)
As I never touch animee, I never have used mftoon ... and from reading the script, I get headaches. But then, I get them also, when reading some of my own scripts :D
Two things that actualy fell into my eyes:
1. Invert().Inflate().Invert()
Any special reason for this, except for eating more CPU cycles?
Or do you experience this behaves different from a simple "Deflate()"? (Well, I could simply try it, but am too tired for that now.)
2. You are using quite some inflate's & deflate's in the script. Assuming that you apply these to greyscale masks, then these should run faster when you call them with "(Y=3,U=1,V=1)" instead.
Good night
- Didée
1) "old stuff" says it all. Looks like a snippet I never noticed and thus never changed. I think a long time ago in a galaxy far far away there was some kind of problem with deflate. Can't remember exactly what anymore though
2) u=3, v=3 is default for inflate and deflate. Passing the argument is a waste of keyboard cycles :D.
Manao
21st March 2004, 14:53
Just to correct the small typo of mf : default argument are y=3, u=1 and v=1.
The explanation of the invert.inflate.invert must have been that some times ago, deflate was quite buggy :D
Didee : did you tried the last version of the MaskTools, and did the issue with YV12LUT gone ?
Didée
21st March 2004, 18:23
[raping mf's thread]
Manao:
No, didn't check the new version for that issue yet, sorry. Too busy inventing other new ideas ;)
Will report as soon as I checked it.
- Didée
mit_mis
21st March 2004, 18:52
Who'll help me?? I want to use it too... but I can't:( and don't know why ;_;
@mf
when will you relese next version??
Soulhunter
21st March 2004, 19:17
Originally posted by mit_mis
Who'll help me?? I want to use it too... but I can't:( and don't know why ;_; Have you tried to process your source without the audio... :confused:
@mf
Thus commented version is very nice... :D
Remembers me all this dotty-param-files from various computer games !!!
WeaponID = 01
WeaponName = Shotgun # Boom... What a pleasure !!!
SG_A_range = 10 # Distance to introduce funny FX to heads
SG_B_range = 30 # Hey, its no sniper riffle... Got it ???
SG_damage = 25 # Defeat the super-giant-techno-bot with only 150 hits
Maybe you could add some poem or funny storys also ???
Having a small basic version then & a special EX version also... :cool:
Bye
mit_mis
21st March 2004, 19:28
Have you tried to process your source without the audio...
No, but I think, that it'll not help, cause I have problem with the script.
@mf
please help, cause I want to make Gekiganger III, and it's really in poor quality...
malkion
21st March 2004, 19:52
this simple script works for me mit_mis. using all the correct dll's of course.
loadplugin("e:\dll\mpeg2dec3dg.dll")
loadplugin("e:\dll\warpsharp.dll")
loadplugin("e:\dll2\masktools.dll")
loadplugin("e:\dll\awarpsharp.dll")
import("e:\dll2\mftoon-v0.52.avs")
setmemorymax(128)
mpeg2source("e:\eko eko azarak\eko.d2v",idct=5)
crop(8,6,-8,-0,align=true).lanczosresize(640,352)
mftoon()
side note, maybe just processing your audio separately and muxing it in later?
[edit]: try grabbing the awarpsharp off of warp enterprise...
[edit2]: i noticed u're missing setmemorymax(), these scripts like it.
[edit3]: now that's not right. lol. mf already stated which masktools to use earlier in this thread. (the one that works, ofcourse, and this depends if u have a p4 or amd)
mit_mis
21st March 2004, 19:54
maybe something is wrong with my awarpsharp.dll... can someone tell me which one i've got to have??
@mit_mis
Unrecognized exceptions are not my fault! I can't do much about them.
Make sure you have the right filters and avisynth version, and close all programs if the problem persists. That's all I can say to help.
mit_mis
21st March 2004, 20:13
which version of MaskTools I've got to have? cause on your site there's couple of them
142 if you have an Athlon, 149 if you have P4. It's mentioned earlier in the thread, which you would've read if you *really* wanted to solve your problem.
mit_mis
21st March 2004, 20:42
I've read it, but... I don't know why I didn't saw that;P
killerhis
9th April 2004, 14:30
I dont want to be annoying, but where's the new version :).. its taking too long :cool:
[/edit] DAHM, you reply FAST :D
Too busy, not enough motivation.
http://www.mufunyo.net/mftoon-osaka.png
Yuuhi
18th April 2004, 23:20
:D
killerhis
4th May 2004, 11:14
:(
Stop making drawings and get a new version released :P
The old one isn't good enough ? There's little to improve.
killerhis
4th May 2004, 13:28
Like you.... I want always a better version if possible :cool:
qverny
13th May 2004, 19:21
I'm not very good at scripting but I have trouble getting mftoon to work.
I've d/l all necessary filter : Warpsharp, Awarpharp, and Masktools 1.42
But when I load mftoon : Invalid argument to fonction MaskedMerge line 83.
Can you tell where I when wrong?
And I liked to know also if in normal parameter : could I change the number like in strenght,wblr etc...
Thx
Yuri Khan
2nd June 2004, 17:48
I like the script but there’s one problem. If there are many thin lines in the original, after warpsharping they turn into 1..2 pixel lines, creating an annoying shimmering effect. I currently work around it by adding a sharpen=false parameter, but then it loses half the fun :( Any ideas?
You can use SSXsharpen() after mftoon(sharpen=false) to get the fun back.
Yuri Khan
3rd June 2004, 12:31
I’ll need to try that out… I’m looking at mfToon (the part that does the sharpening) and SSXSharpen, they look very similar, except SSXSharpen uses Lanczos resizer and mfToon uses sharp Bicubic, and mfToon also does an aWarpSharp on the result. Something tells me that with the fun will return the grief ;)
Cranking up the supersample factors (ssw, ssh) seems to help, but then it becomes waaay too expensive.
I’ll also make and post clips of some particularly nasty illustrations of the problem.
Yuri Khan
3rd June 2004, 16:38
When I comment out aWarpSharp, the shimmering stops. Thanks AS.
Here are the samples, as promised:
With aWarpSharp (http://www.demakova.net/~yuri/anime/problems/kiki.warpsharp.avi) (2252K)
No aWarpSharp (http://www.demakova.net/~yuri/anime/problems/kiki.nowarpsharp.avi) (2390K)
MasterYoshidino
9th June 2004, 08:26
you have to remember that sharpening anime will amplify both lines AND artifacts that are in the source. AWarpsharp tends to do this.
ChronoCross
1st September 2004, 05:40
Suprisingly I'm very excited about someday having a new mftoon. I figured out where he wanted to use greymask and got a pretty impressive speedup with the same results as the standard mftoon. I wonder if mf is delaying the release of a new mftoon because it's speed is so great we may all just die from his prowess at scripting. ;)
SirCanealot
1st September 2004, 16:34
Is there any alternate links to the script itself and the plugins mentioned in the first post?
I'm looking to try out MFToon a little, but the links are down. Bleh~
Soulhunter
1st September 2004, 18:55
Originally posted by SirCanealot
Is there any alternate links to the script itself and the plugins mentioned in the first post?
I'm looking to try out MFToon a little, but the links are down. Bleh~ Afaik you are a member of mf's forum as well !!!
So, have a look here... (http://mf.onthanet.nl/forum/thread.php?threadid=22&boardid=4&styleid=1&sid=afded35b363879aa8893998736391e02&page=1#1) ;)
Bye
[MA]Debito
6th September 2004, 05:01
VirtualDubMod always crashes when I try to run this script:
MPEG2Source("C:\Documents and Settings\Debito\Desktop\Trigun5\Trigun5.d2v",CPU=6,IDCT=6,IPP=True)
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\Filters\warpsharp.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.44.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\mfrainbow-v0.31.avs")
Telecide(Order=1,Guide=1,blend=true,vthresh=75,gthresh=15)
Decimate(cycle=5)
BicubicResize(576,432)
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.44.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\mfrainbow-v0.31.avs")
Mergechroma(ColorYUV(Levels="TV->PC")).Mergechroma(ColorYUV(Levels="TV->PC")).tweak(sat=1.2,cont=1.2,bri
ght=-15)
mfrainbow()
atc(l=0, c=3, b=12, t=0.6)
Convolution3d(preset="AnimeBQ")
mftoon()
dup(threshold=0.8, copy=true, blend=true, maxcopies=20, debug=false)
TextSub("C:\Documents and Settings\Debito\Desktop\SSA\Trigun04.ssa")
Any clues of what's wrong? I'm running VDubMod 1.5.10.1 2439 and AVIsynth 2.5.5. Thanks for the help.
EDIT: It tells me that there is no function named EdgeMask.
Soulhunter
6th September 2004, 14:21
Originally posted by [MA]Debito
EDIT: It tells me that there is no function named EdgeMask.
Think you missed this line...
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Masktools.dll")
Bye
Mug Funky
6th September 2004, 14:56
also, you appear to be loading the subs from the previous episode :O
subs are best muxed into the stream - better compression and way more flexibility. WMP comes with a subtitle filter these days, but of course it's best to use something like vobsub. if you're planning on using the encode on other machines, just include the required directshow filters and a reg file to install them and all will be well.
[MA]Debito
6th September 2004, 19:27
no and no. First, I have masktools as an autoload, even if i did load it without autoload...still gives me the same problem.
And it doesn't really matter on the subs, as long as the file exists, so that's not it either.
madness
6th September 2004, 21:05
Originally posted by [MA]Debito
VirtualDubMod always crashes when I try to run this script:
MPEG2Source("C:\Documents and Settings\Debito\Desktop\Trigun5\Trigun5.d2v",CPU=6,IDCT=6,IPP=True)
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\Filters\warpsharp.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.44.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\mfrainbow-v0.31.avs")
Telecide(Order=1,Guide=1,blend=true,vthresh=75,gthresh=15)
Decimate(cycle=5)
BicubicResize(576,432)
Import("C:\Program Files\AviSynth 2.5\plugins\mfToon-v0.44.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\mfrainbow-v0.31.avs")
Mergechroma(ColorYUV(Levels="TV->PC")).Mergechroma(ColorYUV(Levels="TV->PC")).tweak(sat=1.2,cont=1.2,bri
ght=-15)
mfrainbow()
atc(l=0, c=3, b=12, t=0.6)
Convolution3d(preset="AnimeBQ")
mftoon()
dup(threshold=0.8, copy=true, blend=true, maxcopies=20, debug=false)
TextSub("C:\Documents and Settings\Debito\Desktop\SSA\Trigun04.ssa")
Any clues of what's wrong? I'm running VDubMod 1.5.10.1 2439 and AVIsynth 2.5.5. Thanks for the help.
EDIT: It tells me that there is no function named EdgeMask.
Importing the two file twice??
Try remove one of them. I thought loading plugin or import once is enough. :sly:
[MA]Debito
7th September 2004, 02:51
says the same thing even with the extra import gone
Edit: Also, I tried using the LoadPlugin() function instead of having MaskTools Autoload and it tells me it's unable to load the plugin MaskTools.dll.
DeepDVD
7th September 2004, 22:49
By the way... mf seems to be kidnapped or something ... somebody should engage an investigator or so finding him and getting him back on scratch :D
ChronoCross
10th September 2004, 06:11
the Version of masktools you are using is incompatible with mftoon. I had the same problem. you have to use the one from earlier in this thread. in fact it's best to use the ones from this thread because they have been tested with mftoon. ;)
[MA]Debito
10th September 2004, 17:24
And which version would this be? Quote or something pweez :)
Edit: Nvm, i found them...Now it tells me there's a problem with MotionMask within mfrainbow.
Soulhunter
10th September 2004, 17:49
Originally posted by DeepDVD
By the way... mf seems to be kidnapped or something ... somebody should engage an investigator or so finding him and getting him back on scratch :D
Not kidnapped, he was banned... :sly:
Fortunately he has his own forum (http://mf.onthanet.nl/forum/) !!!
Bye
ChronoCross
11th September 2004, 00:28
why was he banned?
[MA]Debito
12th September 2004, 06:29
anywho...i solved the problem...i just put in MaskTools 1.4.9 and viola, no more problems! although...13 hours a pass for 24 minute video is a bit much
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.