[BufferedImage.getGraphics()](<https://docs.oracle.com/javase/8/docs/api/java/awt/image/BufferedImage.html#getGraphics-->)
always returns [Graphics2D](<https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html>)
.
Using a [VolatileImage](<https://docs.oracle.com/javase/8/docs/api/java/awt/image/VolatileImage.html>)
may significantly improve the speed of drawing operations, but also has its drawbacks: its contents may be lost at any moment and they may have to be redrawn from scratch.