Package com.mortennobel.imagescaling

Examples of com.mortennobel.imagescaling.ResampleOp.filter()


     * @param sizeNeed
     * @return
     */
    public static BufferedImage getResizedImage(BufferedImage original, Rectangle sizeNeed) {
        ResampleOp resampleOp = new ResampleOp(sizeNeed.width, sizeNeed.height);
        BufferedImage image = resampleOp.filter(original, null);
        return image;
    }

    /**
     * Returns the image appropriate to display the card in the picture panel
View Full Code Here


//                                      System.out.println("Dest (w,h): " + destWidth + ", " + destHeight);
          ResampleOp resampleOp = new ResampleOp(destWidth, destHeight);

          // resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Soft);
          BufferedImage resampled = resampleOp.filter(source, null);
          BufferedImage result    = null;

          if (crop) {

            int offsetX = Math.abs(maxWidth - destWidth) / 2;
View Full Code Here

    ResampleOp resampleOp = new ResampleOp(size, (size * image.getHeight())
        / image.getWidth());
    resampleOp.setFilter(ResampleFilters.getLanczos3Filter());
    resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
    image = resampleOp.filter(image, null);

    ImageIO.write(image, getExtension(f.getName()), destFile);
  }

  private static int getRequiredSize(String originalSize, String resFolder,
View Full Code Here

    {
        BufferedImage crop = ((BufferedImage) originalImage).getSubimage(x, y, cropSize, cropSize);

        ResampleOp resampleOp = new ResampleOp(scaleSize, scaleSize);
        resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
        return resampleOp.filter(crop, null);
    }
}
View Full Code Here

                scaleX = (scaleY * originalImage.getWidth(null)) / originalImage.getHeight(null);
            }

            ResampleOp resampleOp = new ResampleOp(scaleX, scaleY);
            resampleOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
            BufferedImage scaledImage = resampleOp.filter(originalImage, null);

            imageWriter.write(scaledImage, "o" + avatarId);

            // Generate two thumbnails of the file
            Integer x = 0;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.