Generating scaled images from BufferedImages in Java