cropToBoundingBox¶
- emlib.img.cropToBoundingBox(inputpath, outpath='', margin=0)[source]¶
Crop an image to its content, trimming any empty space
- Parameters:
inputpath (
str) – the path of the input imageoutpath (
str) – the path of the output. If not given the original image is modifiedmargin (
int|tuple[int,int,int,int]) – a margin in pixels. Can also be a tuple (x0, y0, x1, y1)
- Return type:
None