Here you can find the source of toBufferedImage(Image img)
public static BufferedImage toBufferedImage(Image img)
//package com.java2s; //License from project: LGPL import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; public class Main { public static BufferedImage toBufferedImage(Image img) { ImageIcon ii = new ImageIcon(img); img = ii.getImage();//from w ww . ja v a 2 s . co m BufferedImage bi = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB); Graphics2D g = bi.createGraphics(); g.drawImage(img, 0, 0, null); g.dispose(); return bi; } }