Log in

View Full Version : Overlaying a background image


tacman1123
18th May 2008, 16:58
I'm trying to create a mask for a name/title caption in a documentary style clip -- that is, someone talking, then their name and title fades in. It looks pretty good right now with SubtitleEx(), but I'd like to add a semi-transparent gray background so that the letters stand out.

Obviously, I'll use Overlay(), but I'm not sure how to create the image I want to use as an overlay.

bg=(something)

and then something like

Overlay(bg, x=50, y=20, mode="subtract", opacity=0.25)

I'm hoping this is a common enough request that someone can just point me to some code (if Amazon sold an Avisynth Cookbook, I'd already have ordered it!).

Thanks! After many months of playing around with video software, I'm finally using Avisynth and am blown away at how good it is.

Tac

thetoof
19th May 2008, 00:50
Try Aegisub and then load your .ass with textsub()

What you want is very basic typesetting that is easy to do in the program I mentionned.

tacman1123
19th May 2008, 13:54
Looks like a LOT of work to install Aegisub, it's not just a simple AviSynth plugin. At the moment, here's my best attempt:

a=AVISource(...)
fontsize=2
bg=blankclip(length=10, width=round(a.width/2), height=40, color=$0FF000).Greyscale()
Overlay(a, bg, x=a.width-bg.width, y=a.height-(bg.height+fontsize), opacity=0.2)

Then I use SubitleEx() to add the captions. It's working ok, but I'm sure there's a better way (like figuring out the right color!)

Tac

thetoof
19th May 2008, 15:35
It's a program like any other.... run the exe and your done. After that, load your video in Aegisub, time and typeset your stuff, save as .ass and load that file with textsub() in avs.

Or, use nother method.... It's just that I'm used to work with that program and I saw that it can do amazing things.

gzarkadas
19th May 2008, 22:43
...I'm sure there's a better way (like figuring out the right color!)...

You can use one of the gray color constants at the call to BlankClip and avoid the Greyscale call: color_gray10, ...20, ..., ...90.

You could also try mode="Chroma", with opacity=1.0 (or close to 1, say 0.8 or 0.9).