Log in

View Full Version : How to make a color-friendly grayscale?


FredThompson
28th June 2003, 10:14
I have some DV of analog source which alternates from color to greyscale and back a few times.

I'd really like to completely remove the chroma noise in the B&W sections.

Manually cutting these segments, filtering, and reassembling is acceptable if it's the only way.

The problem is I haven't figured out how to make a proper greyscale. The VirtualDub and AviSynth built-in filters yield clips which VirtualDub will refuse to append to color segments, claiming the formats are incompatible.

How can chroma be effectively removed yet the clip still "play friendly" with color clips?

Also, is there a way to do this conditionally within a script such that multiple sections would be converted to greyscale within the same stream, based on frame number?

Wilbert
28th June 2003, 12:35
The problem is I haven't figured out how to make a proper greyscale. The VirtualDub and AviSynth built-in filters yield clips which VirtualDub will refuse to append to color segments, claiming the formats are incompatible.
Use greyscale and append them in AviSynth. I assume that the color segments and greyscale segments are from the same clip?

Also, is there a way to do this conditionally within a script such that multiple sections would be converted to greyscale within the same stream, based on frame number?
Don't know. Have you tried ApplyRange: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/avisynth2/avisynth/docs/filters/animate.html?rev=1.7

FredThompson
28th June 2003, 16:39
Ah, insight ;)

Another approach I thought of last night is to force the chroma range to very low, say 1-10, and let it get removed by Limiter(). Don't know how to re-scale it but this should be more append-friendly.

FredThompson
29th June 2003, 06:13
Darn it, I'm doing something incorrectly. This is being rejected with the claim the arguments for ApplyRange are invalid:

ApplyRange(1416,1801,"GreyScale")

Why is this happening?

Guest
29th June 2003, 14:13
Ha ha. Gotcha! Tweak strikes again.

Greyscale takes no arguments, so it can't be animated. Use this:

ApplyRange(0,10,"Tweak",0.0,0.0,0.0,1.0)

stickboy
29th June 2003, 20:42
Originally posted by neuron2
Greyscale takes no arguments, so it can't be animated.You can work around this by creating your own user-defined function to act as a wrapper.
function GreyscaleWrapper(clip c, string unused)
{
return c.Greyscale()
}

ApplyRange(1416, 1801, "GreyscaleWrapper", "")

Or, a more general version:

function NoArgFunctionWrapper(clip c, string f)
{
c
return Eval(filter + "()")
}

ApplyRange(1416, 1801, "NoArgFunctionWrapper", "Greyscale")

Wilbert
29th June 2003, 20:47
good one :)