class_docstr: An image.
  
  `Images can be created directly from PNG/JPG/GIF `bytes`, `PIL.Image`s,
  or Matplotlib figures. Note that the image data is embedded in the card,
  so no external files are required to show the image.
  
  Example: Create an `Image` from bytes:
  ```
  current.card.append(
      Image(
          requests.get("https://www.gif-vif.com/hacker-cat.gif").content,
          "Image From Bytes"
      )
  )
  ```
  
  Example: Create an `Image` from a Matplotlib figure
  ```
  import pandas as pd
  import numpy as np
  current.card.append(
      Image.from_matplotlib(
          pandas.DataFrame(
              np.random.randint(0, 100, size=(15, 4)),
              columns=list("ABCD"),
          ).plot()
      )
  )
  ```
  
  Example: Create an `Image` from a [PIL](https://pillow.readthedocs.io/) Image
  ```
  from PIL import Image as PILImage
  current.card.append(
      Image.from_pil_image(
          PILImage.fromarray(np.random.randn(1024, 768), "RGB"),
          "From PIL Image"
      )
  )
  ```
  
  Parameters
  ----------
  src : bytes
      The image data in `bytes`.
  label : str
      Optional label for the image.
class_docstr_tok: ["An","image",".","`","Images","can","be","created","directly","from","PNG\/JPG\/GIF","`","bytes","`",",","`","PIL.Image","`","s",",","or","Matplotlib","figures",".","Note","that","the","image","data","is","embedded","in","the","card",",","so","no","external","files","are","required","to","show","the","image",".","Example",":","Create","an","`","Image","`","from","bytes",":","``","`","current.card.append","(","Image","(","requests.get","(","``","https",":","\/\/www.gif-vif.com\/hacker-cat.gif","''",")",".content",",","``","Image","From","Bytes","''",")",")","``","`","Example",":","Create","an","`","Image","`","from","a","Matplotlib","figure","``","`","import","pandas","as","pd","import","numpy","as","np","current.card.append","(","Image.from_matplotlib","(","pandas.DataFrame","(","np.random.randint","(","0",",","100",",","size=","(","15",",","4",")",")",",","columns=list","(","``","ABCD","''",")",",",")",".plot","(",")",")",")","``","`","Example",":","Create","an","`","Image","`","from","a","[","PIL","]","(","https",":","\/\/pillow.readthedocs.io\/",")","Image","``","`","from","PIL","import","Image","as","PILImage","current.card.append","(","Image.from_pil_image","(","PILImage.fromarray","(","np.random.randn","(","1024",",","768",")",",","``","RGB","''",")",",","``","From","PIL","Image","''",")",")","``","`","Parameters","--","--","--","--","--","src",":","bytes","The","image","data","in","`","bytes","`",".","label",":","str","Optional","label","for","the","image","."]
code: def _update_image(self, img_obj, label=None):
      task_to_dict = TaskToDict()
      parsed_image, err_comp = None, None
  
      # First set image for bytes/string type
      if task_to_dict.object_type(img_obj) in ["bytes", "str"]:
          self._set_image_src(img_obj, label=label)
          return
  
      if task_to_dict.object_type(img_obj).startswith("PIL"):
          parsed_image, err_comp = self._parse_pil_image(img_obj)
      elif (
          _full_classname(img_obj)
          == self._MATPLOTLIB_FIGURE_MODULE_PATH
      ):
          parsed_image, err_comp = self._parse_matplotlib(img_obj)
      else:
          parsed_image, err_comp = None, ErrorComponent(
              self.render_fail_headline(
                  "Invalid Type. Object %s is not supported. Supported types: %s"
                  % (
                      type(img_obj),
                      ", ".join(
                          [
                              "str",
                              "bytes",
                              self._PIL_IMAGE_MODULE_PATH,
                              self._MATPLOTLIB_FIGURE_MODULE_PATH,
                          ]
                      ),
                  )
              ),
              "",
          )
  
      if parsed_image is not None:
          self._set_image_src(parsed_image, label=label)
      else:
          self._set_image_src(None, label=label)
          self._error_comp = err_comp
  
imports: from typing import Any, List, Optional, Union
  from .basic import LogComponent, ErrorComponent, ArtifactsComponent, TableComponent, ImageComponent, SectionComponent, MarkdownComponent
  from .card import MetaflowCardComponent
  from .convert_to_native_type import TaskToDict, _full_classname
  from .renderer_tools import render_safely
  import uuid
label_desc: Use image node_id 6 for calling the Image obj's underlying member method code with example usage: obj._update_image(img_obj, label) without return types