Log in

View Full Version : How to do these tasks


MysteryX
21st April 2017, 20:09
I still am not familiar with most plugins, and would like to know which plugin to look for to do the following tasks.

To divide all pixel values in half, is there a better way than

Levels(0, 1, 255, 0, 128, coring=false) ?


Currently, ConditionalFilter doesn't work with MT. Is there an alternative to this that will work with MT?

ConditionalFilter(EM, BlankClip(EM, color=color_white), Sc, "AverageLuma()", ">", string(SkipOver))


And finally, I've seen this around some lines of code which I never saw before. What does [* *] do? [** abc *] also seemed to be used as a comment.

[*.ColorYUV(cont_y=_f2c(2.0)) *]


Thanks

raffriff42
21st April 2017, 20:43
>To divide all pixel values in half...
I don't know if there's a difference between Levels, ColorYUV/RGBAdjust, or mt_lut("x 2 / "), except that Levels has optional dithering.

>Is there an alternative to this that will work with MT?
Don't know, sorry

>What does [* *] do?
It's like /* */ but multiple levels can be nested.
http://avisynth.nl/index.php/Grammar#Comments /* this is a
block comment
[* this is
a nested comment
[* and another one *]
*]
*/I commented out an experimental 2x contrast adjustment and forgot to delete it. BTW, here is _f2c:#######################################
### scale "normal" float arguments to
### ColorYUV's "gain_x", "gamma_x" & "cont_x" (AVS*)
##
function _f2c(float f) {
return Round((f - 1.0) * 256.0)
}
...and that (AVS*) in the description is my cryptic code for it works with AVS and AVS+, including high bit depth (you don't have to scale "256.0" to the current bit depth - unlike Levels BTW)

MysteryX
21st April 2017, 21:10
I think what happens is that MMask sets the Luma and leaves other planes with random data -- and the background dirt is what confused me.