Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unexpected results while copying transparent image over another image.

I have a transparent PNG image (shown below)... image description

and another image (shown below) image description

I want to copy the resize the first image and place it over the second image, and I tried doing so using the resize() and copyTo() functions. But the result was not what I expected or wanted...

image description

How do I get rid of that green color in the background?

Unexpected results while copying transparent image over another image.

I have a transparent PNG image (shown below)... image description

and another image (shown below) image description

I want to copy the resize the first image and place it over the second image, and I tried doing so using the resize() and copyTo() functions. But the result was not what I expected or wanted...

image description

How do I get rid of that green color in the background?

EDIT - So, I did further research and found that this is probably because I am using a three channel image and I need to use a four channel image.

Unexpected results while copying transparent image over another image.

I have a transparent PNG image (shown below)... image description

and another image (shown below) image description

I want to copy the resize the first image and place it over the second image, and I tried doing so using the resize() and copyTo() functions. But the result was not what I expected or wanted...

image description

How do I get rid of that green color in the background?

EDIT - So, I did further research and found that this is probably because I am using a three channel image and I need to use a four channel image.image. So how do I convert a 3-channel image to a 4-channel image?