@Nullable
    BufferedImage createImage(@NotNull Graphics2D g, Paint paint, double height) {
      double period = getPeriod(height);
      int width = (int)period << (paint instanceof Color ? 8 : 1);
      if (width <= 0 || height <= 0) return null;

      BufferedImage image = ImageUtil.createImage(g, width, height, BufferedImage.TYPE_INT_ARGB, RoundingMode.FLOOR);
      paintImage(image.createGraphics(), paint, width, height, period);
      return image;
    }
@Nullable
    BufferedImage createImage(@NotNull Graphics2D g, Paint paint, double height)