from PIL import Image img = Image.open("otp-icon.png") img.save("otp-icon.ico")