Translate these cmdline into Magick++

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yujincheng08
Posts: 3
Joined: 2013-11-07T07:59:41-07:00
Authentication code: 6789

Translate these cmdline into Magick++

Post by yujincheng08 »

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"
This is my comdline.
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);
But it dosen't work as I excepted, for it dosen't come out with transparent missing the first page.
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?
Post Reply