Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So you already got the mask for foreground,


  • Create alpha channel with above mask.
  • Split the original image in to three single channel.
  • Create the final result by merging three single channel and alpha(BGRA order).

See similar thread with example code here.