magpack.io.white_to_alpha#

white_to_alpha(image_path, output_path, tolerance=1)#

Converts white or bright pixels of a png image to transparent.

Parameters:
image_pathstr

Path to image to convert.

output_pathstr

Path to output image.

tolerancefloat (optional)

Tolerance for transparency. With 0 tolerance only strictly white pixels become transparent.