Is there a way to set image quality for .webp images in python? For instance, saving a webp image with 70% quality.
Asked
Active
Viewed 1,139 times
2 Answers
3
You can do this with the Pillow module (but it doesn't come with Python by default, use pip install pillow
)
from PIL import Image # import the PIL.Image module
img = Image.open("image.webp") # open your image
img.save("image2.webp", quality=70) # save the image with the given quality

Tonechas
- 13,398
- 16
- 46
- 80

rémi couturier
- 425
- 3
- 11