src/main/java/com/xceptance/neodymium/visual/ai/util/Helper.java
/***
     * Transform Image to BufferedImage with new height and width for scaling. Also change the ImageType to needed type.
     * 
     * @param img
     *            Image
     * @param imageType
     *            int value of the target ImageType
     * @param height
     *            height of the new BufferedImage
     * @param width
     *            width of the new bufferedImage
     * @return resizeBi Resized BufferedImage
     */
Transform Image to BufferedImage with new height and width for scaling. Also change the ImageType to needed type.


Transform Image to BufferedImage with new height and width for scaling . Also change the ImageType to needed type .
public static BufferedImage imageToBufferedImageScaled(Image img, int imageType, int height, int width)
    {
        BufferedImage resizedBi = new BufferedImage(width, height, imageType);
        Graphics2D g2 = resizedBi.createGraphics();
        g2.drawImage(img, 0, 0, width, height, null);
        g2.dispose();
        return resizedBi;
    }
public static BufferedImage imageToBufferedImageScaled ( Image img , int imageType , int height , int width ) { BufferedImage resizedBi = new BufferedImage ( width , height , imageType ) ; Graphics2D g2 = resizedBi . createGraphics ( ) ; g2 . drawImage ( img , 0 , 0 , width , height , null ) ; g2 . dispose ( ) ; return resizedBi ; }
Transform Image to BufferedImage with new height and width for scaling.
Transform Image to BufferedImage with new height and width for scaling .