if (image instanceof BufferedImage)
return (BufferedImage) image;
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
// BufferedImage bufferedImage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
BufferedImage bufferedImage = gc.createCompatibleImage(100, 80, transparency);
Graphics g = bufferedImage.createGraphics();
g.drawImage(image, 0, 0, null);
g.dispose();