public static BufferedImage Conversion(Image img, int wid, int ht, int type)
{
BufferedImage bi = new BufferedImage(wid,ht,type);
Graphics2D g2d = bi.createGraphics();
g2d.drawImage(img,0,0,wid,ht,null);
return bi;
}
I hope this can help