Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
29th December 2017, 18:28 | #1 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,345
|
premultiply (alpha channel) for avisynth ?
Is there an avisynth equivalent of premultiply ? I can find an unpremultiply plugin
Background: certain programs might not have the ability to interpret certain types of alpha channel or premultiply on the fly - in those cases you can apply the filter externally eg . ffmpeg has it https://ffmpeg.org/ffmpeg-filters.html#premultiply eg. vapoursynth has it http://www.vapoursynth.com/doc/funct...emultiply.html Both work in my tests |
29th December 2017, 20:14 | #3 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,345
|
Quote:
Thanks David. I tried some layer() combos, op="mul" , etc..., no luck and my google and avisynth kung fu isn't that great . I think I'm missing something simple Perhaps a test example - Here is simple animation exported from aviutl (lagarith, RGBA, 3.2MB) http://www.mediafire.com/file/9pjqh8...9sq/aviutl.avi Programs like vdub, avspmod , a handful of others may interpret the alpha channel incorrectly, as a result you get "ratty", aliased edges. There are no other export options for the alpha in aviutl On import, other programs like AE can interpret with premultipled black, or ffmpeg or vapoursynth can apply the premultiply so it can be interpreted correctly and look correct eg. ffmpeg premultiply Code:
ffmpeg -i aviutl.avi -vf premultiply=inplace=1 -an -c:v png ffmpeg_premultiply_png.mov Code:
import vapoursynth as vs core = vs.get_core() video = core.avisource.AVISource(r'F:\aviutl.avi', alpha=True) p = core.std.PreMultiply(video[0], video[1]) p.set_output() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|