Q:

how to create a transparent mask instead of white color using opencv

I'm using the following code to create mask with the white color. But when I extract it, I want it to be transparent. How can I do it?
 mask = cv2.ellipse(mask, center=(cX, cY), axes=(axesX, axesY), angle=0, startAngle=0, endAngle=360,
                       color=(255, 255, 255), thickness=-1)

inside = np.bitwise_and(image, mask)
outside = np.bitwise_and(image, ~mask)

http://answers.opencv.org/question/25523/extract-an-ellipse-form-from-an-image-instead-of-drawing-it-inside/

A:

I've fixed it by using the following code for Tranparency+Mask
Using PIL to make all white pixels transparent?

