import os
from PIL import Image
# Open the PNG image
im = Image.open(‘input.png’)
# Save the image as WebP
im.save(‘output.webp’, ‘webp’)
import os
from PIL import Image
# Open the PNG image
im = Image.open(‘input.png’)
# Save the image as WebP
im.save(‘output.webp’, ‘webp’)