This source file includes following definitions.
- main
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
if ( argc < 3 )
{
cout << "Usage: " << argv[0] << " background_color file..." << endl;
exit( 1 );
}
InitializeMagick(*argv);
{
Color color;
try {
color = Color(argv[1]);
}
catch ( Exception error_ )
{
cout << error_.what() << endl;
cout.flush();
exit(1);
}
char **arg = &argv[2];
while ( *arg )
{
string fname(*arg);
try {
Image overlay( fname );
Image base( overlay.size(), color );
base.composite( overlay, 0, 0, OverCompositeOp );
base.matte( false );
base.write( fname );
}
catch( Exception &error_ )
{
cout << error_.what() << endl;
}
++arg;
}
}
return 0;
}