// undefined color, seems to be all black in practice static BufferedImage newBufferedImage(int w, int h) { ret new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); } static BufferedImage newBufferedImage(int w, int h, RGB rgb) { ret newBufferedImage(w, h, toColor(rgb)); } static BufferedImage newBufferedImage(int w, int h, Color color) { BufferedImage img = newBufferedImage(w, h); Graphics2D g = img.createGraphics(); g.setColor(or(color, Color.white)); g.fillRect(0, 0, w, h); ret img; } ifclass Pt static BufferedImage newBufferedImage(Pt p, Color color) { ret newBufferedImage(p.x, p.y, color); } endif