Translate these cmdline into Magick++
Posted: 2013-11-08T20:10:13-07:00
Code: Select all
convert ( -page +0+0 -label "a" 1.jpg -background none -mosaic -set colorspace RGB ) ( -page +0+0 -label "b" 2.png -background none -mosaic -set colorspace RGB ) ( -clone 0--1 -background none -mosaic ) -alpha On -reverse "out.psd"
I have tried to translate it into Magick++ like this:
Code: Select all
images.push_back(Image("0.png"));
images.push_back(Image("1.png"));
images.push_back(Image("2.png"));
images.push_back(Image("3.png"));
for (auto i = images.begin(); i < images.end(); i++)
{
i->label(i->fileName());
i->magick("PSD");
i->backgroundColor("none");
i->colorspaceType(RGBColorspace);
i->alphaChannel(ActivateAlphaChannel);
i->opacity(100);
i->mergeLayers(FlattenLayer);
}
Geometry geo(images.at(2).page());
geo.xOff(100), geo.yOff(200);
images.at(2).page(geo);
writeImages(images.begin(), images.end(), "out.psd", true);
Sometimes If I input a big size of images there will be a error that the ps doesn't support this file.
How can I make it correctly?