static BufferedImage drawableToImage(int w, int h, G2Drawable drawable) { var img = whiteImage(w, h); drawable?.drawOn(img); ret img; }