src/main/java/com/xceptance/neodymium/visual/ai/util/Helper.java
/***
     * Transform a given image to an BufferedImkage with with exact same width and height as the original.
     * 
     * @param img
     *            Image to transform into BufferedImage.
     * @param imageType
     *            Chosen int value of the target ImageType.
     * @return bi BufferedImage
     */
Transform a given image to an BufferedImkage with with exact same width and height as the original.

@param img
Image to transform into BufferedImage.
@param imageType
Chosen int value of the target ImageType.
Transform a given image to an BufferedImkage with with exact same width and height as the original . @param img Image to transform into BufferedImage . @param imageType Chosen int value of the target ImageType .
public static BufferedImage imageToBufferedImage(Image img, int imageType)
    {
        BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), imageType);
        Graphics2D g2 = bi.createGraphics();
        g2.drawImage(img, null, null);
        g2.dispose();
        return bi;
    }
public static BufferedImage imageToBufferedImage ( Image img , int imageType ) { BufferedImage bi = new BufferedImage ( img . getWidth ( null ) , img . getHeight ( null ) , imageType ) ; Graphics2D g2 = bi . createGraphics ( ) ; g2 . drawImage ( img , null , null ) ; g2 . dispose ( ) ; return bi ; }
Transform a given image to an BufferedImkage with with exact same width and height as the original.
Transform a given image to an BufferedImkage with with exact same width and height as the original .