Magick++ Image::composite() - does not composes iteratively.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Bunkai
Posts: 22
Joined: 2007-01-15T07:37:59-07:00

Magick++ Image::composite() - does not composes iteratively.

Post by Bunkai »

I need to compose one large file with transparency (matte layer) consisting from hundreds of small pictures. I noticed that after creating a loop structure for this, i did not get composed image. Therefore I did an expermient trying to compose two pictures, one by one, into large file. I notices, that Image::Compose() function inserts always only first image, and the subsequent ones never get composed, but, ont he second insertion, compose function even erases the content of the imageOutputSpriteFile. This occurs only if imageOutputSpritesFile->matte() is true. If it is false, then everything works, however, then, i can not compose images with transparency. Is it a bug, or is an errror in my code? The code is below:

Magick::Image *imageOutputSpritesFile = new Magick::Image;
Magick::Geometry imageOutputSize(480, 200);
imageOutputSpritesFile->size(imageOutputSize);
imageOutputSpritesFile->matte(true);

Magick::Image *imageSprite = new Magick::Image;
imageSprite->read("MainLeftFire0033.png");

imageOutputSpritesFile->composite(*imageSprite, 0, 0);
imageOutputSpritesFile->write("compostition1.png");

imageOutputSpritesFile->composite(*imageSprite, 35, 0);
imageOutputSpritesFile->write("composition2.png");
Post Reply