static BufferedImage transparentBufferedImage(int w, int h) { BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Graphics2D g = getGraphics2D(img); g.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR)); g.fillRect(0, 0, w, h); ret img; }