BufferedImage buffered = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    protected BufferedImage resize(int w, int h, boolean smooth) {        BufferedImage buffered = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);        Graphics2D g2d = buffered.createGraphics();        g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,             smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :                RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR        );        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,             smooth ? RenderingHints.VALUE_RENDER_QUALITY :                RenderingHints.VALUE_RENDER_SPEED        );        AffineTransform at = AffineTransform.getScaleInstance(            (double) w / width,            (double) h / height        );        g2d.drawImage(image, at, null);        g2d.dispose();        return buffered;    }