Compress selected supported images to JPG while reducing JPEG quality toward the requested approximate target size.
imgCompressor(targetSizeMB=1, source=None)targetSizeMBType: int or float, default 1
Approximate target size per output image in megabytes. Must be greater than zero.
sourceType: path, iterable of paths, or None
Optional image input. If omitted, all supported images in the current folder are discovered.
A list of `Path` objects for compressed JPG files, or `None` when no images are found.
imgCompressor()imgCompressor(2)imgCompressor(source=imgWatermark("PREETAM"))The target is approximate. The function lowers JPEG quality in steps and stops at the first result at or below the target, or at quality 15 if the target cannot be reached before the lower bound.
When source is omitted, Toolvix discovers matching files in the current working folder. When source is supplied, only the supplied files are processed. This makes nested pipelines deterministic.