Hey! I’ve actually done this before using PIL and img2pdf. It’s pretty straightforward once you get the hang of it. Here’s a quick snippet:
```python
from PIL import Image
import img2pdf
with open("output.pdf", "wb") as f:
img = Image.open("image.webp").convert("RGB")
f.write(img2pdf.convert(img.filename))
```
This should work for single images. For batch conversion, just loop through your webp files. Hope this helps!
```python
from PIL import Image
import img2pdf
with open("output.pdf", "wb") as f:
img = Image.open("image.webp").convert("RGB")
f.write(img2pdf.convert(img.filename))
```
This should work for single images. For batch conversion, just loop through your webp files. Hope this helps!
