PIL usage¶ resize¶ pip install Pillow from PIL import Image img_file = 'input.png' img = Image.open(img_file) (width, height) = (img.width // 2, img.height // 2) img_resized = img.resize((width, height)) img_resized.save('output.png', quality=100)