Utils

ez_pil.utils.load_image(link, raw=False)

Load image from link.

Parameters:
  • link (str) – Image link

  • raw (bool) – if you want the raw image without any conversion

Return type:

Image | GifImageFile

async ez_pil.utils.load_image_async(link, session=None, raw=False, *, fallback_image='https://cdn.discordapp.com/embed/avatars/0.png')

Load image from link (async).

Parameters:
  • link (str) – Image from the provided link (if any)

  • session (ClientSession | None) – ClientSession for making requests, defaults to None

  • raw (bool) – if you want the raw image without any conversion

  • fallback_image (str | None) – Return a fallback image if the provided link is invalid. Defaults to a Discord avatar.

Return type:

Image | GifImageFile

async ez_pil.utils.run_in_executor(func, **kwargs)

Run function in executor.

Parameters:

func (Callable) – Function to run