-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
What did you do?
I use Pillow to convert images on my web site on-demand to .webp format. It works great! Except for one of two images on this page: https://nedbatchelder.com/text/cardcube.html The first image is strangely pixellated. The second looks perfect.
What did you expect to happen?
The webp conversion should produce the same pixels as the original .png files.
What actually happened?
Unfortunate graininess.
What are your OS, Python and Pillow versions?
- OS: MacOS
- Python: 3.9.17
- Pillow: 10.0.0
I tried converting the two .png files into a variety of formats. The .gif and .bmp look identical to the .png. The .webp shows the results I see on my site:
from pathlib import Path
from PIL import Image
for n in [1, 2]:
for fmt in ["WEBP", "GIF", "BMP"]:
inpath = Path(f"cardcube_step{n}.png")
outpath = inpath.with_suffix("." + fmt.lower())
im = Image.open(inpath)
im.save(outpath, fmt, lossless=True, quality=80, method=6)Here are the two .png files:
Here are the .webp files I get:

