code: private static ImageBuffer extract(SpriteTiled level, int number)
      {
          final ColorRgba transparency = level.getSurface().getTransparentColor();
          final ImageBuffer tile = Graphics.createImageBuffer(level.getTileWidth(), level.getTileHeight(), transparency);
          final Graphic g = tile.createGraphic();
          level.setTile(number);
          level.render(g);
          g.dispose();
  
          final ImageBuffer copy = Graphics.getImageBuffer(tile);
          tile.dispose();
          return copy;
      }
docs: Extract the tile from level.
  
  @param level The level image reference.
  @param number The tile number on level.
  @return The extracted tile image from level.