code: def image_resource_dataUrl(filename):
      ext = os.path.splitext(filename)[1][1:]
      if ext in ["svg", "xml"]:
          ext = "svg+xml"
  
      # acceptable image MIME types:
      # https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#image_types
      if ext not in [
          "apng",
          "avif",
          "gif",
          "jpeg",
          "png",
          "svg+xml",
          "webp",
      ]:
          return None
  
      media_type = f"image/{ext}"
  
      with open(image_resource(filename), "rb") as img:
          b64_string = base64.b64encode(img.read())
  
      data_url = (
          f"data:{media_type};base64,{b64_string.decode('utf-8')}"
      )
  
      return data_url
  
file_path: CellProfiler/src/frontend/cellprofiler/gui/help/content.py
imports: import os
  import os.path
  import re
  import base64
  import pkg_resources
  import cellprofiler
label_desc: Use image node_id 3 for calling a global function with example usage: image_resource_dataUrl(filename) and returns: data_url, None