Tstickers Index / Tstickers / Convert
Auto-generated documentation for tstickers.convert module.
Represents different conversion libraries such as pyrlottie, and rlottie-python.
class Backend(IntEnum): ...
Convert animated stickers, over a number of threads, at a given framerate, scale and to a set of formats.
swd
Path - The sticker working directory (e.g., downloads/packName).threads
int - Number of threads for ProcessPoolExecutor (default: number of logical processors).fps
int - framerate of the converted sticker, affecting optimization and quality (default: 20)scale
float - Scale factor for up/downscaling images, affecting optimization and quality (default: 1). :param set[str]|None formats: Set of formats to convert telegram tgs stickers to (default: {"gif", "webp", "apng"})
Type: int Number of stickers successfully converted.
def convertAnimated(
swd: Path,
threads: int = multiprocessing.cpu_count(),
fps: int = 20,
scale: float = 1,
backend: Backend = Backend.UNDEFINED,
formats: set[str] | None = None,
) -> int: ...
Convert animated stickers with (Base/Backend.UNDEFINED).
def convertAnimatedFunc(
_swd: Path, _threads: int, _fps: int, _scale: float, _formats: set[str] | None
) -> int: ...
Convert static stickers to specified formats.
swd
Path - The sticker working directory (e.g., downloads/packName).threads
int - Number of threads for ProcessPoolExecutor (default: number of logical processors). :param set[str]|None formats: Set of formats to convert telegram webp stickers to (default: {"gif", "png", "webp", "apng"})
Type: int Number of stickers successfully converted.
def convertStatic(
swd: Path, threads: int = 4, formats: set[str] | None = None
) -> int: ...
Convert a webp file to specified formats.
input_file
Path - path to the input image/ sticker :param set[str] formats: set of formats
Type: Path path of the original image/sticker file
def convertWithPIL(input_file: Path, formats: set[str]) -> Path: ...