How about converting the image to jpg or png ?
import io
from PIL import Image
import requests
url = 'https://www.gstatic.com/webp/gallery/1.webp'
res = requests.get(url)
content = io.BytesIO(res.content)
try:
with Image.open(content) as img:
img.save("output_image.png", "PNG")
except Exception as e:
print(f"Error converting image: {e}")