MfToon

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(Update documentation to latest version (v0.54) - still needs some work!)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
{{FilterCat|External_filters|Restoration_filters|Deblockers}}
+
{{FilterCat4|External_filters|Scripts|Adjustment_filters|Line_darkeners}}
{{Filter
+
{{Filter3
| mf
+
| {{Author/mf}}, {{Author/Manao}}
| 0.54
+
| v0.54
| [http://avisynth.org/mediawiki/upload/d/db/Mftoon.avsi mftoon.avsi]
+
| [[Media:mfToon-v0.54.avsi|mfToon-v0.54.avsi]]
| Linedarkeners
+
| Line darkeners
 
|
 
|
* YV12
+
|6=[http://forum.doom9.org/showthread.php?t=53364 Doom9 Thread]}}
|}}
+
==Description==
 +
In default operation, it performs line darkening, Xsharpening, and warp sharpening. Sharpening is slow, and because of that I've made it optional.
  
I have mfToon v0.52 ready, and I think it's good enough for normal usage now. You can follow development from v0.1 onward [http://forum.doom9.org/showthread.php?s=&threadid=52066 here].
+
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.
 +
<br>
 +
<br>
 +
== 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).
 +
<br>
 +
<br>
 +
== Requirements ==
 +
* AviSynth 2.5.8 or later
 +
* Supported color formats: [[YV12]]
  
Since the code is rather large (and looked bad in wiki preview), I've decided to just link it. You can find it [[mfToon_v052|here]] ([http://mf.creations.nl/avs/functions/mfToon-v0.52.avs original link]). [http://forum.doom9.org/showthread.php?t=116699 discussion].
+
=== Required Plugins ===
 +
Latest version of the following plugins are recommended unless stated otherwise.<br>
 +
*<strike>[[aWarpSharp]]</strike>
 +
*[[aWarpSharp2]] - recommended drop-in replacement for aWarpSharp.
 +
*[[MaskTools2]]
 +
*[[WarpSharp]]
 +
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
=== mfToon2 ===
 +
:{{FuncDef|mfToon2(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")}}
 +
<br>
 +
::{{Par2|orig|clip| }}
 +
:::Input clip.
  
== Required filters ==
+
::{{Par2|twidth|int|width(orig)}}
 +
::{{Par2|theight|int|height(orig)}}
 +
:::Target width and height (useful for cropping), 0-inf. If these parameters are not defined they default to the dimensions of the input clip.
  
* [http://mf.onthanet.com/linedarkening/WarpSharp.dll Special(!) Warp Sharp Package]
+
::{{Par2|ssw|int|4}}
* [http://kurosu.inforezo.org/avs/MaskTools.zip MaskTools]
+
::{{Par2|ssh|int|4}}
* [http://ziquash.chez.tiscali.fr/aWarpSharp%20beta%201.zip aWarpSharp]
+
:::Horizontal/vertical supersampling factor, 0-inf.
  
== What does it do ==
+
::{{Par2|xstren|int|255}}
 +
:::Xsharpening strength, 0-255.
  
In default operation, it performs line darkening, Xsharpening, and warp sharpening. Sharpening is slow, and because of that I've made it optional.
+
::{{Par2|xthresh|int|255}}
 +
:::Xsharpening threshold, 0-255.
  
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.
+
::{{Par2|cwarp|bool|true}}
 +
:::Chroma warp on/off.
  
== Usage and parameters ==
+
::{{Par2|sharpen|bool|true}}
 +
:::Sharpening on/off.
  
[[Import]]("mfToon-v0.32.avs")
+
::{{Par2|strength|int|255}}
[[AviSource]]/MPEG2Source/WhateverSource("file")
+
:::Line darkening strength, 0-255.
mfToon()
+
  
'''Normal parameters'''
+
::{{Par2|wdepth|float|16.0}}
 +
:::Warping depth, 0.0 - 64.0.
  
{| border=1 cellspacing=1 cellpadding=4
+
::{{Par2|wblur|int|1}}
! type
+
:::Warping blur level, 1-4.
! 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'''
+
::{{Par2|wthresh|float|0.5}}
 +
:::Warping threshold, 0.0-1.0.
  
You're not likely to be tweaking these:
+
::{{Par2|drange|int|64}}
 +
:::Detail range, 0-255.
  
{| border=1 cellspacing=1 cellpadding=4
+
::{{Par2|dboost|float|1.0}}
! type
+
:::Detail boost, 0.1-10.0.
! 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.
+
::{{Par2|dlimit|int|30}}
 +
:::Detail limiter, 0-255.
  
== Drawbacks ==
+
::{{Par2|debug|bool|false}}
 +
:::Debug mode; on/off.
  
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).
+
::{{Par2|doutput|bool|true}}
 +
:::Print debug info on processed image, only has an effect when debug=true.
 +
 
 +
::{{Par2|dclip|string|"rclip1"}}
 +
:::which stage of the processing to show, only has an effect when debug=true.
 +
::{{Par2|scolor|int|$FF00FF}}
 +
:::Which color to show lines in, colors are represented in hex values, take a look at the [[color presets]].
 +
<br>
 +
<!--'''Normal parameters:''' <code>strength, sharpen, cwarp, wdepth, wblur, wthresh, ssw, ssh</code>
 +
 
 +
'''Advanced parameters''': <code>xstren, xthresh, ustren, urange, uboost, dstren, drange, dboost, dlimit</code>
 +
 
 +
* Explanation of advanced parameters (You're not likely to be tweaking these): 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.-->
 +
 
 +
 
 +
-----
 +
 
 +
 
 +
=== mfToonLite ===
 +
Lite version of mfToon2, originally intended for realtime playback.
 +
 
 +
:{{FuncDef|mfToonLite (clip orig, int "twidth", int "theight", int "strength", int "dstren", int "drange", float "dboost", int "dlimit", string "mask")}}
 +
<br>
 +
::{{Par2|orig|clip| }}
 +
:::Input clip.
 +
 
 +
::{{Par2|twidth|int|width(orig)}}
 +
::{{Par2|theight|int|height(orig)}}
 +
:::Target width and height (useful for cropping), 0-inf. If these parameters are not defined they default to the dimensions of the input clip.
 +
 
 +
::{{Par2|ssw|int|4}}
 +
::{{Par2|ssh|int|4}}
 +
:::Horizontal/vertical supersampling factor, 0-inf.
 +
 
 +
::{{Par2|strength|int|255}}
 +
:::Line darkening strength, 0-255.
 +
 
 +
::{{Par2|dstren|int|255}}
 +
:::detail strength, 0-255
 +
 
 +
::{{Par2|drange|int|64}}
 +
:::Detail range, 0-255.
 +
 
 +
::{{Par2|dboost|float|1.0}}
 +
:::Detail boost, 0.1-10.0.
 +
 
 +
::{{Par2|dlimit|int|30}}
 +
:::Detail limiter, 0-255.
 +
 
 +
::{{Par2|mask|string|"fastest"}}
 +
:::Quality of the mask, any string other than "fastest" will use the slower mask.
 +
<br>
 +
== Examples ==
 +
[[AviSource]]("Blah.avi")
 +
mfToon2()
 +
<br>
 +
== Changelog ==
 +
Version      Date          Changes<br>
 +
v0.54        2006/01/14    - adapted to MaskTools 2.0 by Manao [http://forum.doom9.org/showpost.php?p=764490&postcount=123]
 +
                            - change function name to mfToon2
 +
v0.52        ????/??/??    - [http://web.archive.org/web/20120110041853/http://mf.creations.nl/avs/functions/mfToon-v0.52.avs mfToon-v0.52.avs]
  
----
+
<br>
Back to [[Shared functions]].
+
==External Links ==
[[Category:Shared_functions]]
+
*[http://forum.doom9.org/showthread.php?t=52066 Doom9 Forum] - initial mfToon development thread.
 +
*[http://forum.doom9.org/showthread.php?t=53364 Doom9 Forum] - mfToon continued development.
 +
*[http://www.aquilinestudios.org/avsfilters/sharpeners.html#mftoonlite Scintilla's Guide] - additional mfToonLite documentation.
 +
<br>
 +
<br>
 +
-----------------------------------------------
 +
'''Back to [[External_filters#Line_Darkening|External Filters]] &larr;'''

Latest revision as of 13:13, 15 June 2015

Abstract
Author mf, Manao
Version v0.54
Download mfToon-v0.54.avsi
Category Line darkeners
License
Discussion Doom9 Thread

Contents

[edit] Description

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.

[edit] 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).

[edit] Requirements

  • AviSynth 2.5.8 or later
  • Supported color formats: YV12

[edit] Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.


[edit] Syntax and Parameters

[edit] mfToon2

mfToon2(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")


clip  orig =
Input clip.
int  twidth = width(orig)
int  theight = height(orig)
Target width and height (useful for cropping), 0-inf. If these parameters are not defined they default to the dimensions of the input clip.
int  ssw = 4
int  ssh = 4
Horizontal/vertical supersampling factor, 0-inf.
int  xstren = 255
Xsharpening strength, 0-255.
int  xthresh = 255
Xsharpening threshold, 0-255.
bool  cwarp = true
Chroma warp on/off.
bool  sharpen = true
Sharpening on/off.
int  strength = 255
Line darkening strength, 0-255.
float  wdepth = 16.0
Warping depth, 0.0 - 64.0.
int  wblur = 1
Warping blur level, 1-4.
float  wthresh = 0.5
Warping threshold, 0.0-1.0.
int  drange = 64
Detail range, 0-255.
float  dboost = 1.0
Detail boost, 0.1-10.0.
int  dlimit = 30
Detail limiter, 0-255.
bool  debug = false
Debug mode; on/off.
bool  doutput = true
Print debug info on processed image, only has an effect when debug=true.
string  dclip = "rclip1"
which stage of the processing to show, only has an effect when debug=true.
int  scolor = $FF00FF
Which color to show lines in, colors are represented in hex values, take a look at the color presets.





[edit] mfToonLite

Lite version of mfToon2, originally intended for realtime playback.

mfToonLite (clip orig, int "twidth", int "theight", int "strength", int "dstren", int "drange", float "dboost", int "dlimit", string "mask")


clip  orig =
Input clip.
int  twidth = width(orig)
int  theight = height(orig)
Target width and height (useful for cropping), 0-inf. If these parameters are not defined they default to the dimensions of the input clip.
int  ssw = 4
int  ssh = 4
Horizontal/vertical supersampling factor, 0-inf.
int  strength = 255
Line darkening strength, 0-255.
int  dstren = 255
detail strength, 0-255
int  drange = 64
Detail range, 0-255.
float  dboost = 1.0
Detail boost, 0.1-10.0.
int  dlimit = 30
Detail limiter, 0-255.
string  mask = "fastest"
Quality of the mask, any string other than "fastest" will use the slower mask.


[edit] Examples

AviSource("Blah.avi")
mfToon2()


[edit] Changelog

Version      Date           Changes
v0.54 2006/01/14 - adapted to MaskTools 2.0 by Manao [1] - change function name to mfToon2 v0.52  ????/??/?? - mfToon-v0.52.avs


[edit] External Links




Back to External Filters

Personal tools