code: public CanvasImage toImage(Align align, int fillColor) {
      float pad = pad();
      CanvasImage image = graphics().createImage(bounds.width()+2*pad, bounds.height()+2*pad);
      image.canvas().setFillColor(fillColor);
      fill(image.canvas(), align, pad, pad);
      return image;
    }
docs: Creates a canvas image large enough to accommodate this text block and renders the lines into
  it. The image will include padding around the edge to ensure that antialiasing has a bit of
  extra space to do its work.