title: Run GraphicsMagick compare command using im4java + gm4java
body: <p>I am trying to do a GraphicsMagick compare using im4java and gm4java. The GraphicsMagick command I'm using is like this:</p>
  
  <pre><code>gm compare -maximum-error 0 -metric MAE -highlight-style xor -hilight-color red -file C:/output/diffFile.pdf C:/input/file1.pdf C:/input/file2.pdf
  </code></pre>
  
  <p>I'm trying to translate that into Java. I know that im4java was originally built for ImageMagick and their commands may differ. Is it possible to run the above compare using im4java plus gm4java?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>SimpleGMService service = new SimpleGMService();
  service.setGMPath("C:/path/to/graphicsMagick/gm.exe");
  
  try
  {
      GMConnection connection = service.getConnection();
      try {
          GMBatchCommand command = new GMBatchCommand(service, "compare");
          // create the operation, add images and operators/options
          IMOperation op = new IMOperation();
          op.metric("MAE");
          op.addRawArgs("-file C:/output/diffFile.pdf");
          op.addImage();
          op.addImage();
  
          ArrayListOutputConsumer output = new ArrayListOutputConsumer();
          command.setOutputConsumer(output);
  
          //debug
          command.createScript("C:/output/myscript.bat",op);
  
          command.run(op, "C:/input/file1.pdf", "C:/input/file2.pdf");
  
  ....
  </code></pre>
  
  <p>The above gives me the error:</p>
  
  <pre><code>org.im4java.core.CommandException: compare: Unrecognized option (-file C:/output/diffFile.pdf)
  </code></pre>