mosaicImages with transparent background problem

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
RayR
Posts: 1
Joined: 2013-10-17T06:18:58-07:00
Authentication code: 6789

mosaicImages with transparent background problem

Post by RayR »

Hi,

I am having problem to create a flatten image with transparent background when using either flattenImages or mosaicImages function.

Code: Select all

std::list<Magick::Image> images;
images.push_back("image1.png");
images.push_back("image2.png");

Magick::Image resultImage;
mosaicImages(&resultImage, images.begin(), images.end());

resultImage.write("test_result.png");
note: image1 is not fully contained image2, so the resultImage should have some transparent pixels.

my problem is whenever I use mosaicImages(), all i get is the flatten image with white background. I also tried use

Code: Select all

resultImage.backgroundColor(Magick::Color(0,0,0,0));
mosaicImages(&resultImage, images.begin(), images.end());
but i still get the white background.

Is there any way i can set the background color?

Thanks advance for help
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: mosaicImages with transparent background problem

Post by dlemstra »

You should change the background color of your first image.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply