PDA

View Full Version : Correct Usage of ImageSource to keep alpha information


SirHando
2nd March 2005, 23:25
Hi All,

I am using ImageSource to open a series of png files and import them as an AVI into a custom conversion program. I want to retain the alpha channel information in the png files after passing through AviSynth. My current scrip is like this...

ImageSource("file%04d.png", 1, 100 )
ConvertToRGB32()

However, the avi generate from this has the alpha channel set to 0xff, not the original values from the png file.

Is it possible to retain the alpha values from the png?

Any help much appreciated.

Thanks,

Hando

Wilbert
2nd March 2005, 23:50
ImageSource doesn't support alpha (because the used devil lib doesn't).

Use ImageMagick plugin: http://forum.doom9.org/showthread.php?s=&threadid=90131

SirHando
3rd March 2005, 00:21
Thanks for that.

The link for immaread620.rar is not working. Do you know of anywhere else I might be able to find this?

TIA

Wilbert
3rd March 2005, 00:31
The link works for me. I will upload it tomorrow ...

Septimus
16th April 2005, 15:37
For Avisynth 2.5.5

I could never get the overlay trick to work with .png files, but with RGB32 .bmp + 1 alpha channel produced in photoshop its quite easy.

After removing some features from a DVD menu, I used the following script to overlay an bitmap which removes the options and allows the rest of the animated menu to show through.

I think the DEvil libraries are not used by default anymore (for .bmp not .png). It's an option (use_devil)

# PLUGINS
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")

# SOURCE
clip1 = mpeg2source("D:\01_Menu.d2v").converttorgb32()
clip1Frames = Framecount(clip1)
clip2 = ImageSource("D:\overlay.bmp", end=clip1Frames)

# OUTPUT
return Layer(clip1, clip2)