I'm new to ImageMagick as I have just started working on an image analysis project. I've working with some existing, but old, code for working with these images. I'm trying to understand how to add and subtract images as a test run with the code. Before, it looked like this:
Code: Select all
if (chosen_arithmetic == ADD)
{
int status = execl("/usr/local/bin/combine", "combine", "-compose", "add", "temp_in1.pgm", "temp_in2.pgm", "temp_out.pgm", (char*)NULL);
if(status == -1) //error executing
{
printf("Error executing.\n");
exit(1);
}
}
else if (chosen_arithmetic == SUBTRACT)
{
int status = execl("/usr/local/bin/combine", "combine", "-compose", "subtract", "temp_in1.pgm", "temp_in2.pgm", "temp_out.pgm", (char*)NULL);
if(status == -1) //error executing
{
printf("Error executing.\n");
exit(1);
}
}