Log in

View Full Version : "elegant" line darkening for progressive B&W


FredThompson
19th December 2005, 03:20
I've been using this for cleaning progressive B&W vintage films:

ConverttoYV12()
LRemoveDust_YV12(17,2)
Soothe(LimitedSharpen(ss_x=1.0,ss_y=1.0,Smode=4),last,24)
FastLineDarken(strength=8, luma_cap=191, threshold=4, thinning=0)

It seems to work quite well. The FastLineDarken call is really a kludge, though. Something needed to be done after the LRemoveDust call because the darker lines were a little too light. FastLineDarken creates good results during playback but the result on a frame is really small portions of the dark areas which are pushed to black.

I'm looking for a way to darken the lines without this clipping behavior which is useful for animation but not so good for film.

I've never used masks with AviSynth but suspect that might be part of a solution. Essentially, the darker pixels of the original stream would replace those of the filtered frame. Maybe the two are combined through a weighted average so there is a little cleaning but with less loss of darkness. I suppose the threshold which specifies which pixels get treated this way should also be adjustable.

Has anyone written such a filter? Would someone show me how to create such a masking?

Didée
19th December 2005, 09:06
Have to search a little ... could be I have a LUT for that ;)

Do I get you right the issue just being that FastLineDarken pushes some detail too much into the darks? (Screenshot, please ...)

FredThompson
19th December 2005, 09:19
Yes, that is correct. Give me a day or so to find some B&W vintage film source. I'm not working on any right now. The post came from a discussion about cleanup advice for vintage film.

Didée
19th December 2005, 16:36
Most simple approach: Limit FastLineDarken so that it doesn't add more than LRemoveDust had taken away.

ConverttoYV12()
LRemoveDust_YV12(17,2)
Soothe(LimitedSharpen(ss_x=1.0,ss_y=1.0,Smode=4),last,24)
beforeFLD = last
FastLineDarken(strength=8, luma_cap=191, threshold=4, thinning=0)
afterFLD = last
yv12lutxy(beforeFLD,afterFLD,"x 2 + y < x 2 + x 2 - y > x 2 - y ? ?",U=2,V=2) It would be more elegant with LimitChange from SSETools instead of YV12Lutxy ... but in LimitChange, I tend to always swap the clip arguments, somehow. :o


Other possibilities:

- Don't use FastLineDarken, but just LS with e.g. "undershoot=4" (perhaps also up the strength a notch or two, perhaps plus soft=60~90)

- put the diff of FastLineDarken (or of the whole processing) through a multiplying LUT that saturates towards Y=16 and Y=235 ... similar to Overlay(hardlight), just not done in the Photoshop way that lets everything shoot beyond bounds (a stupid way, if you ask me).

The latter is what I had in mind in above post ... it offers some nice possibilities, but let's try the easy things first.
Thinking about it, the multiplying thingy would justify an own thread...