title: scale image with marvin
body: <p>I am using the <a href="http://marvinproject.sourceforge.net/" rel="nofollow">Marvin Image Processing Framework</a> in Java and I am struggling to scale the image. It's just making a black square, can you see what I have done wrong? The set threshold is working.</p>
  
  <pre><code>package com.example.marvin;
  
  import marvin.image.MarvinImage;
  import marvin.io.MarvinImageIO;
  import marvin.plugin.MarvinImagePlugin;
  import marvin.util.MarvinPluginLoader;
  
  public class Imageprocess {
  
      public static void main (String[] args) {
  
          MarvinImage image = MarvinImageIO
                  .loadImage("/Users/unknown1/Desktop/images.jpeg");
  
          MarvinImagePlugin thresholdplugin = MarvinPluginLoader
                  .loadImagePlugin("org.marvinproject.image.color.thresholding.jar");
  
          MarvinImagePlugin scaleplugin = MarvinPluginLoader
                  .loadImagePlugin("org.marvinproject.image.transform.scale.jar");
  
          thresholdplugin.setAttribute("threshold", 85);
          thresholdplugin.process(image, image);
  
  
          scaleplugin.setAttribute("newWidth", 50);
          scaleplugin.setAttribute("newHeight", 37);
          scaleplugin.process(image, image);
  
          image.update();
  
          MarvinImageIO.saveImage(image, "/Users/unknown1/Desktop/images1.jpeg");
      }
  
  }
  </code></pre>