Avisynth AddLogo

From wiki.selur.net
Jump to navigation Jump to search

AddLogo overlays a logo image on the video, with fades, opacity and several blend modes.

Filtering → Avisynth → Other → Logo

AddLogo controls in Hybrid
AddLogo controls in Hybrid

What it does

AddLogo puts a PNG with transparency, an image sequence or an animated GIF on the picture for a range of frames. The logo can fade in and out, can be made partly transparent, and is blended with one of four modes: Over (normal overlay), Screen, Multiply or Watermark. An optional blur helps the logo blend in, and matte carving cuts it along its alpha edges.

Typical uses:

  • Add a channel logo or watermark in a corner of the picture.
  • Show a logo only for the first minutes of a clip with Logo range and fades.

Nothing is added while the logo path is empty. The filter is applied as the last of the picture filters before the output.

Settings

Control Parameter Range Hybrid default Meaning
Logo path first argument – empty Path of the logo file. For an image sequence use a pattern with a frame number such as %d.
Animated gif anim_gif on/off off Read the file as an animated GIF. Only written for files ending in .gif.
Blend mode mode Screen, Multiply, Over, Watermark Over How the logo is blended with the picture.
Logo range start / end 0–20736000 0 / 0 First and last frame of the logo. 0 / 0 means the whole clip.
Position offset x / y 0–32768 0 / 0 Distance from the top-left corner (limited to the output size).
Fade I / O frames 25 / 25 Length of the fade in and the fade out.
Opacity Opac 0–1 1 Opacity of the logo.
Intensity Wstr 0–5 1.2 Intensity of the Watermark mode: above 1.0 brighter, below 1.0 darker. No effect in the other modes.
Blur blur −1–1 0 Blur applied to the logo after the blending preparation.
Matte carving matte on/off off Cut the logo along its alpha matte.
Chroma Chr on/off off Only for Screen and Multiply: process the chroma of the logo too.

Example

Default settings with a logo file, on a 10-bit YUV 4:2:0 source. Hybrid converts to 8 bit and back:

# adding logo
# Converting from 10 to 8bit for Logo
ConvertBits(8)
Logo("C:\logos\logo.png",x=0,I=25,O=25,mode="Over")
# Converting from 8 to 10bit for encoder
ConvertBits(10)

How Hybrid calls it

  • The Logo script is loaded together with masktools2 and the AviSynth+ ImageSeq plugin; Hybrid supplies the image-reading helper functions the script needs.
  • x, I and O are always written; other values only when they differ from the defaults. Wstr is written only in Watermark mode and Chr only in Screen and Multiply mode.
  • The script only accepts 8-bit YV12. Hybrid converts other input to 8 bit YV12 and back to the original bit depth afterwards.
  • AddLogo also offers the common options and can be added to the filter queue several times.

Background

  • "Logo 10.1" by Dogway (2012), published on the doom10 forum (topic 2181). It uses masktools2 (mt_merge, mt_lutxy) and alpha masks.
  • The script checks that the frame range lies inside the clip.
  • The VapourSynth version is Vapoursynth AddLogo; it is a different implementation.

Sources