code: public static BufferedImage createThumbnailFast(BufferedImage image,
                                                      int newWidth, int newHeight) {
          if (newWidth >= image.getWidth() ||
              newHeight >= image.getHeight()) {
              throw new IllegalArgumentException("newWidth and newHeight cannot" +
                                                 " be greater than the image" +
                                                 " dimensions");
          } else if (newWidth <= 0 || newHeight <= 0) {
              throw new IllegalArgumentException("newWidth and newHeight must" +
                                                 " be greater than 0");
          }
  
          BufferedImage temp = createCompatibleImage(image, newWidth, newHeight);
          Graphics2D g2 = temp.createGraphics();
          
          try {
              g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                      RenderingHints.VALUE_INTERPOLATION_BILINEAR);
              g2.drawImage(image, 0, 0, temp.getWidth(), temp.getHeight(), null);
          } finally {
              g2.dispose();
          }
  
          return temp;
      }
docs: <p>Returns a thumbnail of a source image.</p>
  <p>This method favors speed over quality. When the new size is less than
  half the longest dimension of the source image,
  {@link #createThumbnail(BufferedImage, int)} or
  {@link #createThumbnail(BufferedImage, int, int)} should be used instead
  to ensure the quality of the result without sacrificing too much
  performance.</p>
  
  @see #createThumbnailFast(java.awt.image.BufferedImage, int)
  @see #createThumbnail(java.awt.image.BufferedImage, int)
  @see #createThumbnail(java.awt.image.BufferedImage, int, int)
  @param image the source image
  @param newWidth the width of the thumbnail
  @param newHeight the height of the thumbnail
  @return a new compatible <code>BufferedImage</code> containing a
  thumbnail of <code>image</code>
  @throws IllegalArgumentException if <code>newWidth</code> is larger than
  the width of <code>image</code> or if <code>newHeight</code> is larger
  than the height of <code>image</code> or if one of the dimensions
  is &lt;= 0