I have simple code that converts an image from .jpg to .ico.
from PIL import Image image = "image.jpg" im = Image.open(image) im.save("favico