docs: public static BufferedImage rotateImage(BufferedImage image, double angle) {
          double theta = Math.toRadians(angle);
          double sin = Math.abs(Math.sin(theta));
          double cos = Math.abs(Math.cos(theta));
          int w = image.getWidth();
          int h = image.getHeight();
          int newW = (int) Math.floor(w * cos + h * sin);
          int newH = (int) Math.floor(h * cos + w * sin);
  
          BufferedImage tmp = new BufferedImage(newW, newH, image.getType());
          Graphics2D g2d = tmp.createGraphics();
          g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                  RenderingHints.VALUE_INTERPOLATION_BICUBIC);
          g2d.translate((newW - w) / 2, (newH - h) / 2);
          g2d.rotate(theta, w / 2, h / 2);
          g2d.drawImage(image, 0, 0, null);
          g2d.dispose();
          return tmp;
      }