I have this simple white noise generator:
public static void main(String[] args) throws Exception {
int width = 100;
int height = 100;
BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = bufferedImage.createGraphics();
for(int i = 0;i<width;i++) {
for(int j = 0;j<=height;j++) {
float noise = (float) Math.random();
Color pixel = new Color(noise, noise, noise);
g2d.setColor(pixel);
g2d.drawLine(i,j,i,j);
}
}
g2d.dispose();
RenderedImage rendImage = bufferedImage;
File file = new File("C:\\Users\\User\\Desktop\\noise.png");
ImageIO.write(rendImage, "png", file);
}
The output is what should be, just that it has some smoothing applied and the individuals pixels are not crisply defined.
noise.png (15.23 KB)