I am trying to create a 1920x1080 colored image with Java, but for some reason I can't change the color. All I get is black, whatever values I place in color RGB. Here is the code:
BufferedImage background = new BufferedImage(1920,1080,BufferedImage.TYPE_INT_ARGB);
Graphics2D g = background.createGraphics();
g.setPaint ( new Color ( 100, 100, 250 ) );
g.fillRect ( 0, 0, background.getWidth(), background.getHeight() );
g.dispose();
try {
ImageIO.write(background, "jpg", new File("output.jpg"));
} catch (IOException ex) {
ex.printStackTrace();
}
What am I doing wrong?