Page MenuHome

VSE renders with alpha transparent PNG image incorrectly
Closed, ResolvedPublic

Description

System Information
Windows 10 Pro x64, GeForce GTX 1060 6GB

Blender Version
Broken: 2.79-7b397cd (RC2), 2.79 RC1
Worked: 2.78c

Short description of error
VSE renders incorrectly between a Scene strip and an Image strip which has a PNG file saved by Gimp with "Save background color" and "Save color values from transparent pixels" options.

Exact steps for others to reproduce the error

  1. In VSE, insert a scene strip in channel 1
  2. Insert an image strip in channel 2 and specify an image file that I mentioned above.
  3. Set "Alpha Over" blend option of the image strip.
  4. (Optional)Enable "Use Backdrop" option of VSE header.
  5. Render with [F12]. You can see VSE doesn't render translucency of the image.

Or, You can download the attached file and test the blend file in it.

Thanks,

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Aug 30 2017, 7:53 PM

The problems comes from render result having a float buffer of pixels, while PNG reading generates a byte buffer.

@Sergey Sharybin (sergey) iirc, you did the optimization of freeing byte pixel of a strip's result when it has float values? Not sure how to fix this, something like that sort of does the trick, though color space seems to be wrong, probably not the right fix:

diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 3a04bd79360..5b1f50a8027 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3688,6 +3688,17 @@ static ImBuf *seq_render_strip_stack_apply_effect(const SeqRenderData *context,
        float facf = seq->blend_opacity / 100.0f;
        int swap_input = seq_must_swap_input_in_blend_mode(seq);
 
+       printf("%p, %p  ||  %p, %p\n", ibuf1->rect, ibuf2->rect, ibuf1->rect_float, ibuf2->rect_float);
+
+       if (ibuf1->rect_float != NULL && ibuf2->rect_float == NULL) {
+               IMB_float_from_rect(ibuf2);
+               imb_freerectImBuf(ibuf2);
+       }
+       else if (ibuf2->rect_float != NULL && ibuf1->rect_float == NULL) {
+               IMB_float_from_rect(ibuf1);
+               imb_freerectImBuf(ibuf1);
+       }
+
        if (swap_input) {
                if (sh.multithreaded)
                        out = seq_render_effect_execute_threaded(&sh, context, seq, cfra, facf, facf, ibuf2, ibuf1, NULL);