static BufferedImage convertImage(BufferedImage image){
switch (image.getType()) {
case BufferedImage.TYPE_INT_ARGB_PRE:
    return image;
case BufferedImage.TYPE_4BYTE_ABGR:
  image.coerceData(true);
return image;
}
BufferedImage convertedImage=new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB_PRE);
Graphics2D g=convertedImage.createGraphics();
g.setColor(new java.awt.Color(0f,0f,0f,0f));
g.fillRect(0,0,image.getWidth(),image.getHeight());
g.drawImage(image,0,0,null);
g.dispose();
return convertedImage;
}

static BufferedImage convertImage ( BufferedImage image ) { switch ( image . getType ( ) ) { case BufferedImage . TYPE_INT_ARGB_PRE : return image ; case BufferedImage . TYPE_4BYTE_ABGR : image . coerceData ( true ) ; return image ; } BufferedImage convertedImage = new BufferedImage ( image . getWidth ( ) , image . getHeight ( ) , BufferedImage . TYPE_INT_ARGB_PRE ) ; Graphics2D g = convertedImage . createGraphics ( ) ; g . setColor ( new java . awt . Color ( 0f , 0f , 0f , 0f ) ) ; g . fillRect ( 0 , 0 , image . getWidth ( ) , image . getHeight ( ) ) ; g . drawImage ( image , 0 , 0 , null ) ; g . dispose ( ) ; return convertedImage ; }
converts the given image into a format for quick upload to the gpu .
