img: Utilities for working with images, using pillow

Functions

asImage(obj)

Returns obj if already a pillow Image or reads it from disk if given a path

cropToBoundingBox(inputpath[, outpath, margin])

Crop an image to its content, trimming any empty space

hasTransparency(img)

Returns True if this image has an alpha channel

htmlImgBase64(imgpath[, width, maxwidth, ...])

Read an image and return the data as base64 within an img html tag

imgSize(path)

returns (width, height)

pngRemoveTransparency(pngfile[, outfile, ...])

Remove transparency from a png file

readImageAsBase64(imgpath[, outformat, ...])

Read an image and output its base64 representation

removeTransparency(im[, background])

Remove transparency (alpha channel) from a PIL image