I have tried to output the sum of pixels in a shell variable, as in
> set sum = `gmic -v -1 A.pbm B.pbm --echo_stdout[0] ‘{is}’ --echo_stdout[1] ‘{is}’`
so $sum now contains two entries each the sum of pixel values in A.pbm and B.pbm. My difficulty has been on how to stop displaying the images on the screen? What should I issue to prevent displaying them? I am sure it is something simple but I just couldn’t find out how to do it.
That’s because when there is an argument with a space provided on the command line, it is automatically double-quoted by G’MIC, so that when it is a filename, it can be loaded as expected without having the filename split into several G’MIC items.
And then, as G’MIC variables are not substituted inside double-quotes, it explains the behavior you get.
In your case, I would suggest something shorter, like: