betty.image module

Manipulate images.

betty.image.image_file_path_format(image_file_path: Path) str[source]

Get the PIL image format for an image’s file path.

betty.image.is_supported_media_type(media_type: MediaType) bool[source]

Test if a media type is supported by the image API.

betty.image.resize_cover(original_image: Image, resize_size: tuple[int, None] | tuple[None, int] | tuple[int, int], *, focus: tuple[int, int, int, int] | None = None) Image[source]

Resize an image to cover an area.

Parameters:

focus – An area within the image of which as much as possible should be part of the resized image.