[gst-devel] alpha composition -- results faded

Bert Douglas bertd at tplogic.com
Sat Aug 28 11:34:39 CEST 2010


Hi All,

I am using videomixer to compose four images.
0 -- background large, all black, alpha=0.0
1,2,3 -- foreground, small, alpha=0.5


Images 2 and three are partially overlapping.

The problem is that portions of image 2 and 3 that do not overlap are too
dark.
They look faded.

Since the contribution of the background is zero, I would expect the
brightness of forground images to be unchanged from original image.

I wonder if there is some problem having to do with conventions regarding
pre-multiplied alpha.
Maybe I need to use special plugin to convert back to non-alpha colorspace.

My pipeline follows.
Any help greatly appreciated.

Thanks much,
Bert Douglas

      videomixer name=mix
         sink_0::zorder=0  sink_0::xpos=+000 sink_0::ypos=+000
         sink_1::zorder=1  sink_1::xpos=+250 sink_1::ypos=-100
         sink_2::zorder=2  sink_2::xpos=+100 sink_2::ypos=+200
         sink_3::zorder=3  sink_3::xpos=+400 sink_3::ypos=+200
   !  ffmpegcolorspace
   !  xvimagesink name=sink force-aspect-ratio=1

      videotestsrc name=src0 pattern="black"
   !  video/x-raw-rgb, framerate=1/10, width=1000, height=1000
   !  videobox name=box0 alpha=0.0
   !  mix.sink_0

      videotestsrc name=src1 pattern="smpte"
   !  video/x-raw-rgb, framerate=10/1, width=400, height=300
   !  videobox name=box1 bottom=-200 right=-200 border-alpha=0.0 alpha=0.5
   !  circle name=cir1 angle=0.0 height=200
   !  mix.sink_1

      videotestsrc name=src2 pattern="checkers-8"
   !  video/x-raw-rgb, framerate=10/1, width=400, height=300
   !  videobox name=box2 bottom=-200 right=-200 border-alpha=0.0 alpha=0.5
   !  circle name=cir2 angle=120.0 height=200
   !  mix.sink_2

      videotestsrc name=src3 pattern="snow"
   !  video/x-raw-rgb, framerate=10/1, width=400, height=300
   !  videobox name=box3 bottom=-200 right=-200 border-alpha=0.0 alpha=0.5
   !  circle name=cir3 angle=-120.0 height=200
   !  mix.sink_3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100828/e1f6bb67/attachment.htm>


More information about the gstreamer-devel mailing list