euporie.core.convert.formats.pil

Contain functions which convert data to PIL format.

Functions

have_modules(*modules)

Verify a list of python modules are importable.

png_to_pil_py(data[, cols, rows, fg, bg, ...])

Convert PNG to a pillow image using PIL.

register(from_, to[, filter_, weight])

Add a converter to the centralized format conversion system.

set_background(image[, bg_color])

Remove the alpha channel from an image and set the background colour.

async euporie.core.convert.formats.pil.png_to_pil_py(data: bytes, cols: int | None = None, rows: int | None = None, fg: str | None = None, bg: str | None = None, path: Path | None = None, initial_format: str = '') PilImage

Convert PNG to a pillow image using PIL.

euporie.core.convert.formats.pil.set_background(image: PilImage, bg_color: str | None = None) PilImage

Remove the alpha channel from an image and set the background colour.