Skip to main content

batch_process_images

FunctionSource

batch_process_images(
processor: Callable[[ImageSingle], ImageSingle],
folder_path: str | PathLike[str],
out_folder_path: str | PathLike[str] | None = None,
out_file_name_prefix: str | None = None,
out_file_fmt: Literal["png", "jpg", "webp"] = "png",
quality: ImageQuality = ImageQuality.medium,
skip_thumbnails: bool = False,
verbose: bool = False,
)

Run batch processing for a group of images, and save the processed images as Steam screenshots.

Arguments​

Requires​

NameTypeRequired
Description
processorCallable[[ImageSingle], ImageSingle]The processor where the input and output are loaded image and the processed image, respectively.
folder_pathstr | PathLike[str]The path to the folder where the input images are stored. The image files with jpg, jpeg, png, or webp will be loaded.
out_folder_pathstr | PathLike[str] | NoneThe folder where the output images are saved. If not specified, will use <folder_path>/out as this value.
out_file_name_prefixstr | NoneThe prefix prepended to the output image file names. If not specified, will not add name prefix.
out_file_fmtLiteral["png", "jpg", "webp"]The format of the output files. When "png" is used, will use quantization.
qualityImageQualityThe quality of the output images.
skip_thumbnailsboolA flag. If specified, will not save thumbnails.
verboseboolA flag. If specified, will display the processing progress.