pyguymer3.media.images2webp

pyguymer3.media.images2webp(imgs, webp, /, *, exif=None, fps=25.0, lossless=False, method=6, minimize_size=True, mode='RGB', quality=100, screenHeight=-1, screenWidth=-1)[source]

Convert a sequence of images to a WEBP animation.

This function makes a WEBP animation from either a list of PIL Images or a list of file paths. The user is able to set the framerate.

Parameters:
  • imgs (list of PIL.Image.Image or list of str) – the list of input PIL Images or list of paths to the input images

  • webp (str) – the path to the output WEBP

  • exif (dict, optional) – a dictionary of EXIF data to save in the output WEBP (default None)

  • fps (float, optional) – the framerate, default 25.0

  • lossless (bool, optional) – save a lossless WEBP (default False)

  • method (int, optional) – the method to use when saving the WEBP (default 6)

  • minimize_size (bool, optional) – minimize the output size (default True)

  • mode (str, optional) – the mode of the outout WEBP (default “RGB”)

  • quality (int, optional) – the quality of the output WEBP (default 100)

  • screenHeight (int, optional) – the height of the screen to downscale the input images to fit within, currently only implemented if “imgs” is a list of str (default -1; integers less than 100 imply no downscaling)

  • screenWidth (int, optional) – the width of the screen to downscale the input images to fit within, currently only implemented if “imgs” is a list of str (default -1; integers less than 100 imply no downscaling)

Notes

Copyright 2017 Thomas Guymer [1]

References