g2d.setColor(Color.RED);
g2d.setFont(new Font("sans-serif", Font.PLAIN, 36));
g2d.drawString("Hello world!", 140, 140);
g2d.setColor(Color.RED.darker());
g2d.setFont(new Font("serif", Font.PLAIN, 36));
g2d.drawString("Hello world!", 140, 180);
//Cleanup
g2d.finish();
} finally {
IOUtils.closeQuietly(out);