Log in

View Full Version : One color effect with avisynth?


CkJ
30th June 2015, 14:57
Anyone knows how to made a video with one color effect by avisynth. Like as this Sony Vegas TUT: https://www.youtube.com/watch?v=tlSvz0amsiI
Thanks a lot :p

johnmeyer
30th June 2015, 17:48
Why not do it in your NLE? I see no advantage to doing it in AVISynth, and you won't have all the interactive feedback that you get when doing it in Vegas (or similar NLE).

I use the Secondary Color Corrector in Vegas all the time (which is the tool used to achieve this effect), and you really need to tweak a lot of parameters to achieve what you want, and get the result shown in that tutorial. In particular, you need to get the range of hues, the saturation range, and the luma range just right in order to isolate the color, and have it appear natural from frame-to-frame, and not fade in and out around the edges as the object which contains that color moves around the screen.

In addition, it often become necessary to add a "garbage mask" to eliminate any spurious colors from popping up on certain frames, and doing that in AVISynth is extremely difficult, whereas keyframing a garbage mask in Vegas is trivially easy.

But, if you really want to do it in AVISynth, you can certainly create a chroma mask, but I think you'll be disappointed with the quality of the result.

creaothceann
30th June 2015, 17:50
You could use ColorKeyMask (it's at the bottom of this (http://avisynth.nl/index.php/Layer) page).

Reel.Deel
30th June 2015, 18:58
Try tcolormask (https://github.com/tp7/tcolormask).

poisondeathray
30th June 2015, 19:01
or tweak, or maskhs using sat=0 with start and end hue .

but I agree with John - much easier and more effective in a NLE

CkJ
1st July 2015, 10:14
Yep, chroma mask with start hue and end hue is not accurate.
Original
http://8.t.imgbox.com/60g4h5Cc.jpg (http://imgbox.com/60g4h5Cc)
Mask for red
http://3.t.imgbox.com/wEKEdss2.jpg (http://imgbox.com/wEKEdss2)
Result
http://7.t.imgbox.com/V18nBbpp.jpg (http://imgbox.com/V18nBbpp)

johnmeyer
1st July 2015, 16:33
Yep, chroma mask with start hue and end hue is not accurate.Yes. This is exactly what I was talking about when I recommended doing this in your NLE. As you can see, even in anime, the colors are quite different in the shadows than in the highlights. Very often these differences are not only luma changes, but also changes in hue and saturation. In addition, you may not want to track the very subtle color in the ears. If you used your editing program, you could protect those with a garbage mask.

These things are pretty easy to tune in an NLE which not only provides instantaneous feedback as you change the settings with slider controls, but you can also keyframe those changes as the object moves in and out of various lighting situations.

If you really want to get into it, there are a few motion tracking programs that can absolutely nail something like this. I think an older version one of the better commercial programs is now available for free. I have it on my main editing computer but haven't yet used it and don't remember its name. If you are interested, I can look it up and post a link.

Wilbert
1st July 2015, 18:58
Although i certainly agree with your critism of colormaskkeying in AviSynth (especially in case of clips), you can get much better results for the anime example above by smoothing the chroma first when creating the mask:

http://4.t.imgbox.com/ug0DD1lF.jpg (http://imgbox.com/ug0DD1lF)


LoadPlugin("D:\AviSynth\Plugins\Kuwahara\Release\Kuwahara.dll")
c = Imagesource("D:\AviSynth\red.png", start=0, end=0)
c4 = c.Kuwahara(8,true,1,true,2,70).Subtitle("window=4,generalized=true,q=1,smooth_chroma=true,edge=2,threshold=70", size=10)
v = c4.converttoyv24()
v = v.MaskHS(startHue=98, endHue=113).Invert()
maskclip = v.converttorgb24()
overlay(c, c.greyscale, opacity=1, mask=maskclip)


Yes i smoothed the luma too, but you get the idea.

CkJ
2nd July 2015, 15:20
@johnmeyer I have never used any NLE. Thanks anyway.
@Wilbert I see. Thanks for the idea.

johnmeyer
2nd July 2015, 16:20
@johnmeyer I have never used any NLE.Well, if you value your time, or if you care about the quality of your work, I suggest that you reconsider that decision. A good editing program can save you tons of time, open up all sorts of creative possibilities, and make you a star.

There are many excellent choices available for very little money, with some of them available for free (e.g., you can get older versions of all of Adobe's applications for free, from Adobe, including Premiere).

AVISynth is a great tool, but like any tool, it does some things well, some things poorly, and some things not at all.