code: protected BufferedImage stampTileImage (Object stamp, BufferedImage ftimg, int width,
          int height)
      {
          // create the target image if necessary
          if (ftimg == null) {
              ftimg = _imgr.createImage(width, height, Transparency.BITMASK);
          }
          Graphics2D gfx = (Graphics2D)ftimg.getGraphics();
          try {
              if (stamp instanceof Tile) {
                  ((Tile)stamp).paint(gfx, 0, 0);
              } else {
                  gfx.drawImage((BufferedImage)stamp, 0, 0, null);
              }
          } finally {
              gfx.dispose();
          }
          return ftimg;
      }
docs: Helper function for {@link #getTileImage}.