Thread: Toon-v0.8x
View Single Post
Old 11th July 2007, 10:56   #16  |  Link
MOmonster
Registered User
 
Join Date: May 2005
Location: Germany
Posts: 495
If toon is still not fast enough, what about this:
Code:
###############
## Toon v0.82 edit ##
###############

# function created by mf
#	support by Soulhunter ;-)
# 	ported to masktools v2 and optimized by Didee (0.82)
# 	added parameters and smaller changes by MOmonster (0.82 edited)

# toon v0.8 is the newest light-weight build of mf´s nice line darken function mf_toon
#
# needed filters:
#	- MaskTools v2
#	- AWarpSharp
#
# parameters:
#	str	- strength of the line darken				1.0
#	l_thr	- lower threshold for the linemask			2
#	u_thr	- upper threshold for the linemask			12
#	wdepth	- warping depth (awarpsharp readme)			32
#	wlevel	- warping level (awarpsharp readme)			2	(1 is faster)
#	fast	- gives better speed with only a little
#		  difference to the default output			false


function toon(input, float "str", int "l_thr", int "u_thr", int "wdepth", int "wlevel", bool "fast")
{
sstr	= string(default(str,1.0))
lthr	= string(128+default(l_thr,2))
uthr	= string(128+default(u_thr,12))
ludiff	= string(default(u_thr,12)-default(l_thr,2))
wdepth	= default(wdepth,32)
wlevel	= default(wlevel,2)
fast	= default(fast,false)

input.mt_expand().mt_inpand().mt_makediff(input)
mt_logic(last,last.aWarpsharp(depth=wdepth,blurlevel=wlevel,cm=0), "min")
fast==true ? mt_lut("x "+lthr+" <= 128 x "+uthr+" >= x "+uthr+" x - 128 * x x "+lthr+" - * + "+ludiff+" / ? 128 - "+sstr+" * 128 + ?") :
mt_lutxy(last,last.mt_expand(),"y "+lthr+" <= 128 y "+uthr+" >= x "+uthr+" y - 128 * x y "+lthr+" - * + "+ludiff+" / ? 128 - "+sstr+" * 128 + ?")

return mt_makediff(input,last,U=2,V=2)
}
With fast=true one filtering step is removed. And if you now set wlevel=1 you come into speed levels from FastLineDarken.

As foxyshadis said, they are parameters of my edit, but of course the edit works the same way as the original (that has no parameters), there are no other filter-calls than in Didee's version.
MOmonster is offline   Reply With Quote