code: def __init__(
      self,
      tile_definition,
      output_location,
      tile_format="PNG",
      post_render_func=None,
  ):
      self.tile_def = tile_definition
      self.output_location = output_location
      self.tile_format = tile_format
      self.post_render_func = post_render_func
  
      # TODO: add all the formats supported by PIL
      if self.tile_format not in ("PNG", "JPG"):
          raise ValueError("Invalid output format")
  
imports: from __future__ import annotations
  from io import BytesIO
  import math
  import os
  import dask
  import dask.bag
  import numpy
  from PIL.Image import fromarray
label_desc: Use image node_id 1 to create a new TileRenderer object  with example: obj = TileRenderer(tile_definition, output_location, tile_format, post_render_func)