import os from aspose.imaging import Image from aspose.imaging.imageoptions import * # You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-Python-Net/blob/master/Examples/data/Templates.zip # After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder # get path of the input data templates_folder = os.environ["DATA_PATH"] if "DATA_PATH" in os.environ else "data" # get output path output_folder = os.environ["OUT_PATH"] if "OUT_PATH" in os.environ else "out" # Load the tga file in an instance of Image with Image.load(os.path.join(templates_folder, "template.tga")) as image: export_options = WmfOptions() export_options.compress = True # Save tga to wmz image.save(os.path.join(output_folder, "tga-to-wmz-output.wmz"), export_options)