Adding/Subtracting Two Images
Posted: 2015-09-25T05:23:34-07:00
Hi all,
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:
I am assuming this no longer works due to newer versions being released since it was last worked on, but I want to know what I need to do now to have the same effect. Any ideas? Thanks so much!
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);
}
}