title: Compare two images using imagemagic-im4java and show differences with original image
body: <p>I am trying to compare two jpg images using im4java and showing difference between them.
  i have successfully done that but the output of difference image contrast is decreased. but i need to show the differences on output image with original contrast.
  I need to get result as diff without changing the contrast</p>
  <pre><code>public static void compareImageswithdifferenceimage (String expected, String actual, String difference) throws Exception {
          try {
              String Ipath=&quot;jars\\ImageMagick-7.0.10-Q16-HDRI&quot;;
              ProcessStarter.setGlobalSearchPath(Ipath);
              CompareCmd compare = new CompareCmd();
              //compare.setErrorConsumer(StandardStream.STDERR);
              IMOperation compareoperation = new IMOperation();
              //compareoperation.addRawArgs(&quot;compare&quot;);
              compareoperation.addImage(expected);
              compareoperation.addImage(actual);
              
              compareoperation.fuzz(1.0);
              //compareoperation.channel(&quot;red&quot;);
              compareoperation.metric(&quot;AE&quot;);
              compareoperation.transparentColor(&quot;Black&quot;);
             // compareoperation.fill(&quot;rgba(255, 215, 0, 0.1&quot;);
              //compareoperation.opaque(&quot;red&quot;);
             compareoperation.addImage(difference);
              try {
                  System.out.println (&quot;*******Comparison has Started********&quot;);
                  compare.run(compareoperation);
                  System.out.println (&quot;*******Comparison has Finished*******&quot;);
                  }
                  catch (Exception e) {
                       System.out.println (&quot;##### Comparison has Failed #######&quot;);
                       e.printStackTrace();
                  }
              }
              catch(Exception exc) {
                  System.out.println(&quot;Exception while executing compareImageswithdifferenceimage function&quot;);
                  exc.printStackTrace();
      
          }
      }
  </code></pre>
  <p>Note : I am unable to post images here</p>