betty.image module - Betty 0.4.0a3 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.image module

Manipulate images.

betty.image.resize_cover(original_image: PIL.Image.Image, cover_size: tuple[int, None] | tuple[None, int] | tuple[int, int]) → PIL.Image.Image

  Resize an image to cover an area.

  Parameters:

    - original_image (`PIL.Image.Image`)

    - cover_size (`tuple`[`int`, `None`] | `tuple`[`None`, `int`] | `tuple`[`int`, `int`])

  Return type:

    `PIL.Image.Image`

betty.image.resize_crop(original_image: PIL.Image.Image, crop_size: tuple[int, int]) → PIL.Image.Image

  Resize an image by cropping it.

  Parameters:

    - original_image (`PIL.Image.Image`)

    - crop_size (`tuple`[`int`, `int`])

  Return type:

    `PIL.Image.Image`