title: What is difference of reduce image size using resize and transform in picasso?
body: <p>I'm using <a href="http://square.github.io/picasso/" rel="nofollow">picasso</a> library for load images. I find two ways for reduct images size. What is difference of reduce image size using resize</p>
  
  <pre><code>Picasso  
  .with(context)
  .load(imageurl)
  .resize(200, 100)
  .onlyScaleDown() // the image will only be resized if it's bigger than 200x100 pixels.
  .into(imageViewResizeScaleDown);
  </code></pre>
  
  <p>and using transform method like this one</p>
  
  <pre><code>public class BitmapTransform implements Transformation {
  
  int maxWidth;
  int maxHeight;
  
  public BitmapTransform(int maxWidth, int maxHeight) {
      this.maxWidth = maxWidth;
      this.maxHeight = maxHeight;
  }
  
  @Override
  public Bitmap transform(Bitmap source) {
      int targetWidth, targetHeight;
      double aspectRatio;
  
      if (source.getWidth() &gt; source.getHeight()) {
          targetWidth = maxWidth;
          aspectRatio = (double) source.getHeight() / (double) source.getWidth();
          targetHeight = (int) (targetWidth * aspectRatio);
      } else {
          targetHeight = maxHeight;
          aspectRatio = (double) source.getWidth() / (double) source.getHeight();
          targetWidth = (int) (targetHeight * aspectRatio);
      }
  
      Bitmap result = Bitmap.createScaledBitmap(source, targetWidth, targetHeight, false);
      if (result != source) {
          source.recycle();
      }
      return result;
  }
  
  @Override
  public String key() {
      return maxWidth + "x" + maxHeight;
  }
  </code></pre>
  
  <p>};</p>
  
  <pre><code>Picasso.with(context).load(imageurl)
                      .transform(new BitmapTransform (200, 100))
                      .into(imageViewResizeScaleDown);
  </code></pre>
  
  <p>Tanks for your help</p>