>>733
手抜きですが。

import java.awt.*;
import java.awt.image.*;
import java.io.*;

public class T53_733 {
public static void main(String[] args) throws IOException {
// 描画
BufferedImage image = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB);
Graphics g = image.getGraphics();
for(int i=0; i<50; i++) {
int x1 = (int)(Math.random()*640);
int y1 = (int)(Math.random()*480);
int x2 = (int)(Math.random()*640);
int y2 = (int)(Math.random()*480);
g.setColor(new Color((int)(Math.random()*0xFFFFFF)));
g.drawLine(x1, y1, x2, y2);
}
// 保存
javax.imageio.ImageIO.write(image, "png", new File("output.png"));
}
}